Skip to content

AM32 Development Setup

This tutorial works for Windows, Linux, and MacOS

Build AM32 Bootloader from source

  • Download vscode and install extension, cortex-debug, makefile-tools(optical)

  • Install make if you don't have it, skip this if you want to use make from download sdk(only windows so far)

  • For vscode makefile-tools user Vimdrones STLinkV3 Probe am32 esc wiring diagram

  • Download bootloader repo and install toolchain

    git clone https://github.com/am32-firmware/AM32-bootloader.git
    cd AM32-bootloader
    make arm_sdk_install
    

    make command fail

    if you haven't setup you env path, you might not able to run make directly
    use full path instead, ie.
    shell & 'C:\Program Files (x86)\GnuWin32\bin\make.exe' arm_sdk_install for windows in powershell
    /usr/bin/make arm_sdk_install for linux/mac

  • Build Target

    make AM32_L431_BOOTLOADER_PA2
    
    output
    building bootloader for L431 with pin PA2
    Compiling obj/AM32_L431_BOOTLOADER_PA2_V12.elf
    Memory region         Used Size  Region Size  %age Used
               FLASH:        3156 B         4 KB     77.05%
                 RAM:        2120 B         4 KB     51.76%
    Generating obj/AM32_L431_BOOTLOADER_PA2_V12.hex
    

    how to know the target name?

    the target name pattern is AM32_{MCU}BOOTLOADER{INPUT_SIGNAL_PIN}, reference to the pinout of Vimdrones ESC Development Board, we can know that the MCU is L431 and input signal pin is PA2, to list all targets use make targets

using ls obj command we can see the building output files

AM32_L431_BOOTLOADER_PA2_V12.bin AM32_L431_BOOTLOADER_PA2_V12.elf debug.elf
AM32_L431_BOOTLOADER_PA2_V12.d   AM32_L431_BOOTLOADER_PA2_V12.hex openocd.cfg

  • Flash Target and Debug

    • Open vscode and open the repo folder
    • Wring the Vimdrones ESC Development Board and Vimdrones Stlinkv3 Probe (any stlink should also works), connect stlink with USB and power up the ESC Development Board with proper voltage, ie. 16.8V Vimdrones STLinkV3 Probe am32 esc wiring diagram
    • open bootloader/main.c in vscode, set a test breakpoint and start the debug session vscode set breakpoint and start debug session
    • vscode cotrex-debug overview am32 vscode debugging overview
    • now you can try to modify the code run make AM32_L431_BOOTLOADER_PA2 again and using load command in gdb shell session to upload your bootloader program and reload debug sission
    • enjoy!
  • AM32 bootloader usage

    • after you upload the proper bootloader to the ESC board, you can not spin your motor yet, next step you need to flash the main AM32 firmware, but now you can try and test the bootloader function
    • now you can using a betaflight flight controller as a passthrough, to connect the ESC board with config software, detail please visit AM32 Getting Started or AM32 offical page https://am32.ca

AM32 Main Firmware Build from source

TODO