# Hoverboard Schmoverboard

May 22nd 2018
STM32/Embedded

A couple years ago I bought me a broken “hoverboard”. I had seen the insides of them an notices that they were definitely run on brushless hub motors. All I would need to make use of them were some electronic speed controllers (ESC) and something to command them.

It’s been a year in our new house and, while organizing and unpacking, I stumbled upon it again. So since it had been a while I thought it would be a good idea to see if anyone had done anything cool with them yet. To my delight, it looked like someone had written an entire firmware for most generic versions of these. Of course I knew what I had to do.

Soldering a little female header on there was quick and easy and then I had access to serial connection and GPIO14 which is free.

### The GPIO

The button pin is GPIO 00. This is perfect because it lets us boot the esp into bootloader mode. The relay is connected to GPIO 13, and the LED is connected to GPIO 12

Folks, I’m going to tell you right now, mistakes were made. It took me FOREVER to figure out why my FTDI basic just wasn’t connecting to this thing. I broke out the multimeter, I made sure my voltages were correct, I reinstalled it to the outlet to see if it still powered on. swapped Tx and Rx. Nothing!… All I have to say now is, make sure you are connecting ground to ground and not “DTR GRN” to ground. GRN looks a lot like GND at first glance. I did however ensure my FTDI was in 3.3V mode. Make sure you do too!

###### CC BY 2.0 made available by Sparkfun Electronics.

GPIO | Use | Status
--- | --- | ---
GPIO 00 | Pushbutton, bootloader mode | In use
GPIO 01 | TX Pin | Available with care
GPIO 03 | RX Pin | Available with care
GPIO 04 | NC on esp8266 chip | Can be used with a little finesse.
GPIO 05 | “” | “”
GPIO 12 | Relay | In use
GPIO 13 | LED | In use
GPIO 14 | Broken out | Free for use

`st-flash --reset write ../hover.bin 0x8000000` FAIL!

PaulFertser On the OpenOCD irc channel

    1
    2
    3
    4
    5
    Dongle 	Blue Pill
    GND 	G
    5V or 3V3 	5V or 3.3
    TXD 	A10
    RXD 	A9

    1
    2
    3
    4
    5
    Probe 	Target
    GND 	GND
    B14 	SWDIO
    A5 	SWCLK
    POWER 	3.3

    1
    2
    3
    4
    5
    cd blackmagic
    make -j PROBE_HOST=stlink
    cp src/blackmagic_dfu.bin ./
    truncate --size=8192 blackmagic_dfu.bin
    cat blackmagic_dfu.bin src/blackmagic.bin > blackmagic_full.bin

    1
    2
    3
    4
    arm-none-eabi-gdb -ex "target extended-remote /dev/cu.usbmodemB5DD97E1"
    monitor swdp_scan
    attach 1
    load hover.elf

John Warren

Just a place to make stuff