STLink Ninebot ESX ESC

From Joey's Wiki
Jump to navigation Jump to search

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

Removing the Pole

Remove the 4x Security Torx T25 screws or Hex Screws that hold the handlebar in place on the pole.

The handlebar screws in place.

Remove the 4x Security Torx T30 screws or Hex screws that hold the pole to the base.

The front pole screws in place.
The rear pole screws in place.

Accessing the Internals

If you have an external battery, two screws hold the battery on the bracket.

These are either security hex or regular hex.

The two screws holding the external battery on the bracket.

This will expose 3 more screws.

Take care removing these screws as they strip very easily.

The 3 easily-strippable screws.

The bracket may be slightly stuck but once these 3 screws are out it can be removed.

If you do not have a bracket then you will have three screws holding the battery in place within the pole.

The 3 screws that hold the internal battery in place within the pole.

You will also have a charging port cover to remove.

Remove the top cover to reveal two screws holding the cover on.

The port cover removed.

Finally, one more screw holds the ESC in place on the pole.

The final screw holding the ESC in place within the pole.

Next comes arguably the most annoying part of the disassembly, removing the waterproofing grommets.

On the top and the bottom is two grommets that are twisted in place.

Press down hard with a large flathead screwdriver and twist counter-clockwise until the slots line up with the metal ridge within the pole.

Keep the grommets attached if you can.
The parts of the grommet.

In some cases, pushing the rubber inner part through the plastic retainer ring will make it easier to remove.

Attempt to keep the wires pushed through the rubber part.

Once both are separated the whole mechanism slides easily out of the pole unless the pole has been damaged or bent.

The battery/esc internals. Here the ESC is highlighted but you want to separate it from the battery.

A plastic holder clips the battery and ESC together.

Separate the ESC from the battery and carefully unplug the 4-pin data cable and the power cable.

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.

NinebotESXESCHeatsinkScrews.jpg

2 shorter hex screws hold the charging port in place.

NinebotESXESCChargingPortScrews.jpg

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

NinebotESXESCExternalBatteryPortScrews.jpg

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.

Reassembly

Start by placing the plastic battery-ESC clip into the battery.

The clip placed securely onto the battery.

Thread the dashboard cable through the power cable on the battery.

The dashboard cable threaded through the battery cable.

Plug in the 4-pin data line.

The data cable firmly plugged in.

Plug in the power cable.

The power cable plugged in.

Feed the loose dashboard cable until it is mostly tight.

Clip the ESC to the battery.

The esc clipped to the battery.

Press firmly to reinstall the dashboard cable into the channel, pulling the dashboard cable tight.

The dashboard cable installed in the battery channel.

Slide the battery and ESC into the pole.

The assembly should slide upward into the pole.

Align the charging port and insert the small screw.

The assembly should fit perfectly with the charging port lining up.

If using an external battery, use Loctite/thread lock on the 3 holes.

Blue loctite/threadlock insures that the battery is secure and helps prevent error 42.

Take care reinstalling the 3 bracket screws as they strip very easily.

The 3 easily-strippable screws.

If you do not have a bracket then you will have three screws holding the battery in place within the pole.

The 3 screws that hold the internal battery in place within the pole.

You will also have a charging port cover to reinstall.

Install the two screws and the cover.

The port cover removed.

If you have an external battery, two screws hold the battery on the bracket.

These are either security hex or regular hex.

The two screws holding the external battery on the bracket.

Plug in the dashboard cable to the dashboard in the handlebar.

Test that the scooter still functions before continuing with assembly.

Reinstall the 4x Security Torx T25 screws or Hex Screws that hold the handlebar in place on the pole.

The handlebar screws in place.

Reinstall the 4x Security Torx T30 screws or Hex screws that hold the pole to the base.

The front pole screws in place.
The rear pole screws in place.

Check that the scooter is sturdy and nothing is loose.