Project start: November 2017

Hoverboard Firmware Hack - How to




Compiling and flashing the hacked firmware for the hoverboard-circuitboards isn't obvious. So for me to remember what I have been doing and also maybe for those who want to try this too I wrote this short instruction which will describe what I did and what worked for me. Not saying its the only or even right way.
Also I'm not the creator of this hacked firmware and therefore I am not able to help with in-depth problems. Please also keep in mind that there is a probability that your board can be destroyed.

The current version of the Firmware can be found here: github.com/NiklasFauth/hoverboard-firmware-hack
I'm assuming your using Linux, more specifically some kind of Ubuntu based Linux.
The programmer I am going to be using is a cheap ST-Link V2.

Compiling the firmware

In order to compile, gcc-arm is needed.
Your can get get it either by downloading the newest version ( developer.arm.com/open-source/gnu-toolchain/gnu-rm/downloads ) and extracting the directory "gcc-arm-none-eabi-..." or the easy way:

sudo apt-get install gcc-arm-none-eabi

After that you need to clone the firmware from Github:

git clone https://github.com/NiklasFauth/hoverboard-firmware-hack.git

.. or downloading and extracting yourself.
After that change to that directory and compile:

cd hoverboard-firmware-hack

make

If the file build/hover.bin exists compiling worked without problems.
Now you should make your own adjustments to the settings. This is mainly done by (un-)commenting things like control method in the Inc/config.h.
For example commenting out #define CONTROL_NUNCUCK: //#define CONTROL_NUNCUCK
and uncommenting the desired method like control speed and direction via potentiometer or a hallsensor: #define CONTROL_ADC
(Sometimes the endpoints have to be calculated and entered in the src/main.c file. Just search for #ifdef CONTROL_ADC.

Save and compile again:

make clean

make

STM32 Toolchain

sudo apt-get install openocd libusb-1.0-0-dev cmake build-essential

git clone https://github.com/texane/stlink

cd stlink

make release

mkdir build

cd build

cmake -DCMAKE_BUILD_TYPE=Debug ..

make

cd Release

sudo make install

sudo ldconfig

Connecting the hoverboard:

Unlocking the STM

On a fresh board the STM is locked an has to be unlocked in order to be able to write to it.

Flashing the firmware

Testing

The board can now be powered up by pressing the power button. -> Funny beeping sounds.
Try increasing the throttle slowly. You can do this with only one motor connected.
I would recommend to use a bench power supply set to 40V and a current limit of 0.5A. If you're using a power supply decrease the throttle slowly, currents from recuperation can kill your powersupply.
If the motor doesn't turn even if a significant amount of current flows or the motor stutters you should first test all possible motor-controller wire configurations.

Good luck!