In the case of a bricked ESC/Controller/Control Board, STLinking can save the master control board from needing to be replaced in some instances.

This is often the only way to save a board that has been bricked when the wrong firmware was flashed or an update failed.

This guide shows how to STLink the Controller/Master Controlboard/ESC for the following scooters:

Retail Specific

Rental Specific

Accessing the Debug Pins

Template:Ninebot ESX Accessing Internals

Disassembling the ESC

The internal battery unplugs fairly easily but the BMS connector may need needle-nose pliers to remove the connector.

3 longer hex screws hold the heat sink in place.

 

2 shorter hex screws hold the charging port in place.

 

2 shorter hex screws hold the external battery port in place.

 

Once all screws have been removed, you can pull the ESC to remove it port end first.

 
The ESC being removed from the housing/heatsink.
 
The ESC removed from the housing/heatsink.

Download Software

Download STM32 STLink Utility from the ST website.

Scroll down and click "Get Software" and enter your email to receive a download link.

Install it and open it.

Flashing

Connect the STLink to the Master Control Board

Connect pins to 5v/VCC, GND, SWDIO, and SWCLK as shown below.

 
The pins and where they should be connected.

You can solder to these for a better connection or hold DuPont connectors as shown in the image.

 
Using dupont cables to connect to the STM32.

Here I did a poor solder job but it still works.

STM32 STLink Utility

Download the 1.3.9 full dump .bin from ScooterHacking.

You can only flash full dump files or the ESC will not function.

Always check that you are downloading files from trusted sources(aka ScooterHacking) to avoid flashing malicious firmware.

Open STM32 STLink Utility and attempt to connect to the esc with the button shown below.

 
Click the button shown here to attempt to connect.

You should be warned that readout protection is enabled if it is connected successfully.

 
The warning will be fixed in the next steps.

Next, press CTRL + B to open the chip settings.

Select "Disabled" under "Read out protection".

 
The warning will be fixed in the next steps.

Next, click the open icon on the far right as shown.

 
Click to open the file.

Select the esc_fulldump139.bin file you downloaded earlier.

 
Click to open the esc_fulldump139.bin file you downloaded earlier.

Click Target->Program & Verify or press CTRL + P.

 
Open the programming menu.

Confirm one last time that the file you are flashing is the full dump and then press "Start".

 
Match the settings and confirm the file before pressing start.

The program will now program the chip with the full dump.

Once it finishes check the console to make sure it was successful.

 
Completely finished and successful programming.