Skip to content

The firmware that runs on both motor controllers to drive the wheels.

License

Notifications You must be signed in to change notification settings

bobbycar-graz/bobbycar-controller-firmware

Repository files navigation

bobbycar-controller-firmware

#dependencies
sudo pacman -Sy --noconfirm \
    arm-none-eabi-binutils \
    arm-none-eabi-gcc \
    arm-none-eabi-gdb \
    arm-none-eabi-newlib \
    cmake \
    make \
    openocd \
    stlink

git clone --recursive git@github.com:bobbycar-graz/bobbycar-controller-firmware.git
cd bobbycar-controller-firmware/
cmake -DCMAKE_BUILD_TYPE=Release .
make unlock0 # needed only once per board
make flash-motortest
make flash-feedc0de-front
make flash-feedc0de-back
make flash-greyhash

Hardware

otter

The original Hardware supports two 4-pin cables that originally were connected to the two sensor boards. They break out GND, 12/15V and USART2&3 of the Hoverboard mainboard. Both USART2 & 3 can be used for UART and I2C, PA2&3 can be used as 12bit ADCs.

The reverse-engineered schematics of the mainboard can be found here: http://vocke.tv/lib/exe/fetch.php?media=20150722_hoverboard_sch.pdf

Flashing

To build the firmware, just type "make flash". Right to the STM32, there is a debugging header with GND, 3V3, SWDIO and SWCLK. Connect GND, SWDIO and SWCLK to your SWD programmer, like the ST-Link found on many STM devboards.

Do not power the mainboard from the 3.3V of your programmer! This has already killed multiple mainboards.

Make sure you hold the powerbutton or connect a jumper to the power button pins while flashing the firmware, as the STM might release the power latch and switches itself off during flashing. Battery > 36V have to be connected while flashing.

To flash the STM32, use the ST-Flash utility (https://github.com/texane/stlink).

If you never flashed your mainboard before, the STM is probably locked. To unlock the flash, use the following OpenOCD command:

make unlock0

If that does not work:

make unlock1
make unlock2

Troubleshooting

First, check that power is connected and voltage is >36V while flashing. If the board draws more than 100mA in idle, it's probably broken.

If the motors do something, but don't rotate smooth and quietly, try to use an alternative phase mapping. Usually, color-correct mapping (blue to blue, green to green, yellow to yellow) works fine. However, some hoverboards have a different layout then others, and this might be the reason your motor isn't spinning.


Acknowledgements

Last but not least, I would like to acknowledge and thank the following people:

for the very useful discussions, code snippets, and good suggestions to make this work possbile.

About

The firmware that runs on both motor controllers to drive the wheels.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •