After watching this talk at GPN18 from Niklas Fauth and Jan Henrik I decided to make my own “moving object”. The video and the accompanying github page explains how to flash a cheap E-Board aka Hoverboards, that are self-balancing scooters like “Segways”. In particular, I intended to make a transport platform for another project of mine in analogy to what the call “transOtter”, controlled by a Gametrak.
List of materials
- Hoverboard (not working, no charging cable etc.) for 40€ from ebay-Kleinanzeigen
- Gametrak-controller (there are 2 3D-controllers/device) for 3€ from ebay-Kleinanzeigen
- Motherboard from ebay for 10-15€
- st-link V2 to flash the motherboard for 3€ on ebay
- new battery pack with 36V - I went for a e-bike replacement offer with charger and internal balancer for 150€ (10 Ah)
- other stuff you don’t necessarily need: LED-display with I2C support, logic analyzer etc.
I decided to work on my old Windows 10 PC for this. I followed the instructions on the github page with the following additions and modifications.
- Download st-link drivers from [st]http://www.st.com/content/st_com/en/products/development-tools/software-development-tools/stm32-software-development-tools/stm32-utilities/stsw-link009.html) - registration necessary.
- Unlocking with openocd did not work but could be done with the st-GUI. Thanks to a hint explained: texane/stlink on github due to write protection.
- Install xpack and arm-eabi
- modifying the makefile first with the correct arm-none-eabi worked after several iterations, this is what eventually worked:
PREFIX = "C:/Users/chris/AppData/Roaming/xPacks/@gnu-mcu-eclipse/arm-none-eabi-gcc/7.2.1-1.1.5/.content/bin/arm-none-eabi-"
- Modify the config file (see below for more details) I had to install cygwin and choco to get the “make” command on windows. Run makefile from the cygwin terminal.
- Clone stlink or simply using the binaries provided there, you may go and execute (I have to erase before flashing every time):
\stlink-1.3.0-win64\bin st-flash erase st-flash --reset write C:/Users/chris/Documents/GitHub/hoverboard-firmware-hack/build/hover.bin 0x8000000
- Thats it, see a first test run in the video on the right side
Config-file modifications for GameTrak controller
You can read in the deprecated hoverboard-board-hack repository more on the GameTrak controller:
This firmware allows you to connect the sensor unit of a GameTrak PS2 controller to the ADC channels PA2 & 3. Use the potentiometers for x and z as voltage dividers (3V3 VREF) and connect them to PA2 & PA3. Also a great template for your own projects that require USART & ADC readout of some type of analog sensor (like a joystick). Same protection features as PPM. I2C LCD support to show data like battery gauge is WIP.
I’ll update more as soon I finished welding the frame. I decided to construct the frame from aluminum and put it together with rivots. On top of the aluminium board I rivoted half of a beer crate in order to have a standard size, be able to to stack multiple things and to protect the battery.
Video of first test walk:My first application