Skip to content

Flashing and upgrading Firmware

Jim Morris edited this page Oct 22, 2023 · 1 revision

Flash modes

There are three use modes for flashing firmware.

  1. User upgrades
  2. Developer loading
  3. Brick recovery

Currently available methods.

User upgrades

  1. With network use the upgrade command
  2. copy flashme.bin to sdcard and reboot, can use ftp, ymodem or USB serial download to get the file there (or sneaker net)

Developer loading

  1. Use fast download over USB serial download-dl.py
  2. Use JLink and gdb or jlinkflash
  3. Use STLink and STM32CubeProgrammer/bin/STM32_Programmer_CLI
  4. Use dfu-util -D binfile (needs the DFUflasher in qspi or high flash memory and needs to be enabled in config.ini)

Brick recovery

  1. Use jlink or stlink (not good for end users)
  2. use the BOOT0 mode (press the BOOT0 button and reset)
  • flash the .dfu file using either dfu-util -d 0483:df11 -D smoothiev2_Devebox/smoothiev2.dfu or python3 tools/pydfu.py -u smoothiev2_Devebox/smoothiev2.dfu
  • flash the .bin using STM32CubeProgrammer STM32_Programmer_CLI -c port=usb1 -w smoothiev2_Devebox/smoothiev2.bin 0x08000000

Issues

  1. I would like to avoid a dedicated boot loader as V1 has as they are hard to upgrade, having the flashloader builtin means it gets upgraded as needed.
  2. What is needed to use pydfu.py on Windows

Potential solutions

  1. download the relevant stm32 cube programmer for your host from http://smoothieware.org/_media/bin

    en.stm32cubeprg-win64_v2-7-0.zip en.stm32cubeprg-lin_v2-7-0.zip en.stm32cubeprg-mac_v2-7-0.zip en.stm32cubeprg-win32_v2-7-0.zip

    Install it then run STM32_Programmer_CLI -c port=usb1 -w smoothiev2.bin 0x08000000

Clone this wiki locally