Skip to content

Flashing

mean00 edited this page Apr 29, 2022 · 12 revisions

/!\ If you have a clone with a CH32F103, use the CH32 flash setup /!\

Introduction

There are 2 executables to flash through SWD / Serial:

  • The bootloader
  • The main App

The bootloader is also able to do DFU update IF you have the usb setup.

Flashing with blackmagic

You'll have to replace /dev/XXXX by the port the blackmagic is connected to

First step is to erase the whole flash and remove rdp.

For that one it may be better to NOT power the DSO as usual and just connect GND+SWDIO/SWDCLK+VCC to the blackmagic (the MCU will be powered by the MCU)

arm-none-eabi-gdb -ex "target extended-remote /dev/XXXXX" -ex "monitor swdp_scan" -ex "attach 1" -ex "mon option erase"

Power cycle.

Now you can power it anyway you want

Flash the bootloader code

arm-none-eabi-gdb -ex "target extended-remote /dev/XXXXX" -ex "monitor swdp_scan" -ex "attach 1" -ex "load bootloader.elf" -ex "compare-sections" -ex "set confirm off" -ex "file bootloader.elf"

arm-none-eabi-gdb -ex "target extended-remote /dev/XXXXX" -ex "monitor swdp_scan" -ex "attach 1" -ex "load Dso150.elf" -ex "compare-sections" -ex "set confirm off" -ex "file Dso150.elf"

Reboot, you should see the splash screen

Flashing with stlink v2

Download the stlink utilities ( as of now https://github.com/stlink-org/stlink/releases/tag/v1.6.1 ) Take the stlink-1.6.1-x86_64-w64-mingw32.zip version if you are running a recent windows (64 bits).

Fetch the 2 binaries for you (probably stm32f1 bootloader and app) then :

st-flash write bootloader.bin 0x8000000

st-flash write dso.bin 0x8002000

Reverting to vanilla/stock formware (STLink v2)

Download firmware from jyetech and unzip it

Power the board through SWD, or power it on normally without 3.3v on the SWD interface, not both!

st-flash --format ihex write 113-15001-064.hex

(replace the xxxx.hex by the correct name)

You shouldnt have issue with serial number as we dont modify the e2prom, but i'm not 100% sure

Clone this wiki locally