-
Notifications
You must be signed in to change notification settings - Fork 5
How to use PinFinder firmware
The pinfinder tool will help you configure all the settings changeable in the firmware and automatically detect the pins, or manually set the pins. All without needing to know how to code, use keil, or compile your own firmware.
Using the pinfinder tool is easy, flash the correct pinfinder for your board. The tool will detect the uart pins you want to use. Connect your serial device to the uart pins, and connect with your favorite serial communicator. Once connected you will work through the menu to detect the pins and make adjustments to the settings. Save your settings and flash the main firmware.
- Board you want to program
- A constant current power supply, set to 24V1A, or the power supply that came with your balance board.
- A SWD programmer, DAPlink is suggested, cheap stlink v2 would also work
- USB to TTL uart adapter, if you dont have one a esp32 dev board can be used
- PC with serial terminal software, it is suggested to use putty or online version Online Serial Terminal
- Please make sure you know the model of your mcu, it should be stamped/printed on the boards mcu. Failure to use the firmware/pinfinder designed for your mcu will likely brick your board. If you are not sure about your board, please check the database of all known boards, or ask for help.
- In order to flash your mcu, you will need to find the SWD debug header on your board. Luckily this is the only hardware reverse engineer you need to do, and it is often quite easy. The SWD debug header is often located near the top left of the micro controller, with 4 or 5 holes, marked as GND, 3V3, DIO, CLK, & RST (RST is not on all boards).
If the pins are connected together, it is for an RF remote and is not the programming headers.
![swd](https://private-user-images.githubusercontent.com/142502122/318266232-f4295f36-0f23-4a45-a721-873a13c8ea8a.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjU5ODc3MjksIm5iZiI6MTcyNTk4NzQyOSwicGF0aCI6Ii8xNDI1MDIxMjIvMzE4MjY2MjMyLWY0Mjk1ZjM2LTBmMjMtNGE0NS1hNzIxLTg3M2ExM2M4ZWE4YS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwOTEwJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDkxMFQxNjU3MDlaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0yODE2NzQxMWVlMzBjYTFhYzdlN2I2ZTI5MjgxMDQ1Yjk3ZWRlNTUxNzU1MDgxY2NhOWI3MTk1ZWFkOWYzYzc4JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.1jxuVWaUXdhfWXBxgXZ5Jvb6kWVEUVLCCHiSlhqeByY)
- You will need to find a serial port to use the pinfinder terminal, it is suggested to use the masterslave connector on the board, the pinout is sometimes marked on the back of the board. You will need to connect to Tx Rx & GND make sure you do not connect the masterslave positive pin to your usb to ttl adapter! It is likely 12 or 15 Volts and will kill your PC/TTL UART adapter
- Please refer to installation guide in the readme
- If this is your first time installing this firmware, please do a full chip erase to unlock the chip and make sure the eeprom is clean, then install the latest pre-compiled firmware provided here or compile your self here
- After the firmware is flashed, immediately disconnect the power to the board, or choose to not run code after flash, because the first boot is very important.
- Before powering on the board connect all the accessories in the hoverboard back to your main board, the bluetooth module is not used so you can remove it for additional serial port, the masterslave connector should be left empty for now, DON'T CONNECT THE BATTERY connect the battery wire to a constant current power supply (24 Volts 1 Amp), or the balance board power supply. Using the battery may damage the mosfet on the board and brick your board.
*Power Button Detection: Turn on the power supply, press the balance board power button and release it immediately (if its a master), all led(s) on the board will light up, wait for about 5 seconds the led(s) will turn off one by one until the entire board powers off(power supply will read no current draw).
*UART/Serial pin Detection: Press the power button again to turn the board back on and release it, all the led(s) will start to flicker quickly, it is waiting to set the serial port you want to use, just use a piece of wire to short the Tx and Rx together for about 1 second, after the detection is successful the led(s) will stay on for 1 second then go off, now you can release the short between the serial wires.
- Connect the Tx, Rx, and GND to your usb ttl adapter, open the serial terminal software and connect at baud 19200 8N1, you will see the dots being printed by the hoverboard, now press enter to enter the main menu
Press 1 at main menu to detect everything, just follow the serial terminal guide, you should be able to use the board with main firmware already with default configuration.
Once detection is complete, press 8 at main menu to try out motor rotation, if it works and no error in autodetect it will likely work with main firmware.
If you want to change the parameters like battery voltage, current, slaveID, ETC or if the autodetect is unable to detect your pinout, you can use command line to set them manually. Press 7 at main menu to enter command line interface. There is a help option in the UI to guide you through manual configuration.
After all configuration is set with the pinfinder, power the board off and flash the main firmware, be sure to select erase sector only do not erase chip. If all goes well you can connect to the UART/Serial pins with esp32. If all led(s) flash slowly the config is either accidentally erased or was not saved correctly in pinfinder, please start over again.