Flash AM32
AM32 Firmware
Original project : https://github.com/AlkaMotors/AM32-MultiRotor-ESC-firmware
Gipsa Fork :
https://github.com/gipsa-lab-uav/AM32-MultiRotor-ESC-firmware
https://github.com/gipsa-lab-uav/AM32_Arterytek
Tested hardware
Model | mcu | Bootloader | Target |
---|---|---|---|
hglrc Trex | STM32F051 | PA2 | HGLRC35 |
hglrc Zeus 4in1 | STMF051 | PA2 | HGLRC35 |
mamba F40 4in1 | AT32F421 | PB4 | |
aikon single | AT32F421 | PB4 | AIKON_SINGLE |
tekkon 32 mini | AT32F415 | ?!? | Tekko32 f415 |
Flash Artery MCU with OpenOCD
OpenOCD Artery fork in:
https://github.com/ArteryTek/openocd/releases
Take following file : “tool-openocd-at32-0.1100.220911.tar.gz”
- download AT32 IDE at following link : https://www.arterychip.com/file/download/1740
- install (for example) in ~/apps/AT32IDE/OpenOCD by following this link https://www.arterychip.com/en/news/220930_eng.jsp
- As root create and edit the file /etc/udev/rules.d/90_stlink.rules with
SUBSYSTEMS==“usb”, ATTRS{idVendor}==“0483”, MODE:=“0666”
-
Change location to the installation folder of the OpenOCD (~/apps/AT32IDE/OpenOCD in previous example at line 2)
-
add this script at32_utils.tcl to the “scripts” directory of the downloaded software
-
Connect the esc to the stlink programmer and the power supply to the esc as follows :
PHOTOOOOOO
-
Run openocd :
./bin/openocd -s scripts -f ./interface/stlink.cfg -f ./target/at32f4**xx.cfg -f ./at32_utils.tcl
with ** adjusted to the MCU you are using (15 or 21)
-
in another terminal run telnet :
telnet localhost 4444
You can install it with
sudo apt install telnet
-
in telnet : first disable write protection (if necessary) :
reset halt
at32f4**_disable_write_protection
with ** adjusted to the MCU you are using (15 or 21)
You may have to do it 2 times (the first time it is displaying an issue, but it is fake)
-
download in ~/AM32_ESC/bootloaders the following “bootloader” file : https://am32.ca/downloads
F4**_PB4_BOOTLOADER_V2.hex
with ** adjusted to the MCU you are using (15 or 21) 9. flash the bootloader in the telnet console:
flash write_image erase unlock /path_to_AT32F421_AM32_Bootloader/Objects/AM32_F415_BOOTLOADER_PB4_V4.hex
reset halt
Flash Custom AM32 into the ESC with esc-unlocker
{width=298 height=167}
Download the bin from release :
https://github.com/am32-firmware/AM32-unlocker
https://github.com/am32-firmware/AM32-unlocker/releases
cd ~/src/esc-unlocker
./esc_unlicker_linux>
ST Link and ESC Tekko32 Mini Holybro :
Select file F415_PB4_BOOTLOADER_V4.hex
Flash Custom AM32 into the ESC
- Download following custom am32 firmware from here : AM32_TEKKO32_F415.hex
- Go to following link : https://am32.ca/configurator IN CHROME
- Plug in the kakute with BETA-FLIGHT, with the usb-c cable to the computer and the battery to the ESC
- click port select and select your device
- push the connect button
- push read button
- push flash firmware button
- tick “ignore current mcu layout”, select all 4 ESC and push the Flash local file button. Select “AM32_TEKKO32_F4**.hex
with ** adjusted to the MCU you are using (15 or 21)
Configure custom AM32
-
Clone the following git repo : https://github.com/gipsa-lab-uav/esc-configurator
-
Open a terminal
-
Change location to the uncompressed file
-
install yarn following this tutorial : https://github.com/gipsa-lab-uav/esc-configurator
-
Enter following command into the terminal
yarn start
-
Chrome should open, click the connect button
-
read settings, you should see 4 ESC
-
Push “restore the default settings” button
-
Tune the gains as you wish