Crawler AM32 single ESC Flashing Tutorial - AlkaMotors/AM32-MultiRotor-ESC-firmware GitHub Wiki
Updated: August/24/2021
These instruction are designed with a single esc for RC crawlers in mind, but the steps are basically the same for quadcopter use. For a 4in1 ESC you will need to connect and program each of the 4 ESC's individually.
Step 1: Gather your supplies
- You’re going to need a compatible ESC ( I am using am Airbot Wraith32 )
- ST-link v2 programmer with jumper wires
- soldering Iron with a small tip
- wires
- Battery plug
- non acid flux
- computer ( I use Windows 10, but it can be done on Linux as well, possibly on a Mac to but I am not sure )
Optional supplies
- a magnifying glass, or a good zoom app for your phone camera, I use open camera (for android) because it doesn’t fall asleep.
- Dupont Crimpers and Plugs Alternativly you can cut one of these off an old servo or something.
Step 2: Soldering
We need some tiny wire, I use stranded silicone 26awg wire.
Solder wires 26g to:
SWD ( SWDIO ),
SWC ( SWCLK )
An alternative to soldering to the tiny SWD and SWC pads is to make a harness and use pogo pins like this POGO Pin demo
PWM,
+ ( POS, main positive power in for ESC ) and
- ( GND, main negative power in for ESC ).
Also Solder larger Battery wires (14g to 18g) to:
+ ( POS, main positive power in for ESC ) and
- ( GND, main negative power in for ESC ).
and attach a battery plug.
Attach a motor wire to each of the 3 motor terminals on the opposite side and add plugs as well.
Your esc should look something like this ( I have also installed an optional 2 pin JST RCY plug for a direct power servo )
Note how the ST-link in this picture has the terminals in a different order, Make sure you use the proper order for your device.
Step 3: Download and install Software
STM32CubeProgrammer We need this to disable write protection on the Option bytes, and to load the firmware.
You may see images of the older version of this software STM32 ST-LINK utility Either software will work about the same, mostly the difference is the user interface.
I think you need to register or something to download the software, but it's free, no credit card, just an annoyance.
Step 4: Download the Firmware
There are 3 pieces of firmware to upload to the ESC
- The bootloader: Use the List of Supported Hardware To determine Which bootloader is right for your esc. Download the appropriate bootloader for your esc. Bootloader Downloads and Newer Experimental Bootloader Downloads
- The Firmware: Download the appropriate firmware for your ESC Firmware Downloads
- The eeprom: which stores your settings The eeprom binary is located here
Alternatively if you are using a wraith32 esc for a RC crawler you can download a full firmware file from Voodoobrew's google drive, these file end with _FULL ( i.e. WRAITH32_CRAWLER_FULL.bin ) and they include all 3 of the previous files.
Step 5: Connect ST-programmer
Relatively straight forward, make sure you have your wires in the right locations.
3 wires connect the ESC to the ST-Link
SWD (SWDIO),
SWC (SWCLK) and
- (GND).
2 wires connect the battery to the ESC
+ (POS, 5.0v) and
- (GND).
Plug the USB on the ST-Link into the Computer
Step 6: STM32CubeProgrammer
With your ESC and ST-Link connected, open STM32CubeProgrammer and click the green connect button in the upper right corner.
Erasing the BLHeli32 firmware from the ESC
- (This is a point of no return! There will be no way to re-upload BLHeli32 back to the esc once erased)
-
Click on OB (Option bytes)
-
Select “Read Out Protection” and Set to AA ( AKA level 0 )
-
Select “Write Protection” and check all the empty boxes, scroll through, get them all and click apply.
-
Now do a full chip memory erase
-
Select Erasing & Programming from the left
-
Browse for the firmware you just downloaded
-
Set the start address to 0x08000000 if it isn’t already
- Bootloaders and _FULL.bins are uploaded to 0x08000000
- Target firmware and _PART.bins are uploaded to 0x08001000
- EEPROM binary for f051 or f031 chips are uploaded to 0x08007C00
- Tip: It is safer and easier to upload the Firmware Target with the configuration tool with an Arduino or Flight controller, then upload default EEPROM settings by clicking "Send Default Settings"
- Note: the esc will not work without uploading EEPROM settings
- Note: The _FULL.bin files contain the Bootloader, EEPROM and Target files.
-
Check the Skip flash erase before programming box if it isn’t already ( You dont want to erase your previous uploads if you are loading the files Individually )
-
Check the verify programming box if it isn’t already ( optional )
-
Click Start Programming to upload the file.
Repeat the above steps for each file, uploading it the the appropriate destination address in part 7.
Alternatively you can continue on to the Configuration tool and upload the latest Firmware and Change settings.
Directions for Connecting to the configuration tool can be found Here.
Step x: Testing
At this point you should have a functional ESC. The settings can be adjusted later using this Tutorial for an Arduino PC Link. You should be able to connect a motor and power it on to hear startup beeps and arming tones if you also connected a receiver.
Step xx: Unsoldering
We will no longer need the
SWD (SWDIO) and
SWC (SWCLK) Wires
So you can now remove them.
This esc was not designed to power a servo, so only run the ground and PWM to your receiver. You can use a tiny BEC like This one to power the receiver ( or a larger one like this Castle BEC if you also want to power a servo ).
Connect all this to your RC car
At this point you can try your hand at building your own firmware https://youtu.be/Gtim9Y21_lc
That’s about it…