0
\$\begingroup\$

I have flashed a dfu bootloader from https://github.com/davidgfnet/stm32-dfu-bootloader onto a fresh stm32f103c8t6 and it was working fine. After I uploaded my binary with dfu-util the device would no longer show up in usb dmesg so it seems like the bootloader was erased, although the program (a simple blinker) always ran for a few seconds after powerup and then stopped.

The problem is that from now on if I connect the device via stlink it reports a correct size of sram but 0 bytes of flash. I tried flashing with st-flash --flash=64k write ... but it didn't work. Only other thing that comes to mind is to do some kind of a reset so I tried st-flash --flash=64k erase, it looked like it worked but the device still reports 0 bytes flash memory.

What could be the cause of this? Did the bootloader remove some stm firmware required for flashing the chip? How come only flash size is reported as 0 but not sram? Is there a way to reflash the required firmware or is it bricked? I'm lucky to have bought two but still I'd like to rescue the first one if possible.

\$\endgroup\$
9
  • \$\begingroup\$ You can't remove ST firmware. What is the state of readout protection? \$\endgroup\$
    – Justme
    Commented Nov 29, 2020 at 23:10
  • \$\begingroup\$ That part does not have a dfu bootloader, the application supported a bootloader, once you overwrote it with yours it was game over. Now you need to use uart or swd or other, but not usb... \$\endgroup\$
    – old_timer
    Commented Nov 30, 2020 at 2:16
  • \$\begingroup\$ @old_timer the asker is explicitly describing results from a tool which uses SWD and only SWD \$\endgroup\$ Commented Nov 30, 2020 at 2:30
  • \$\begingroup\$ @ChrisStratton "so it seems like the bootloader was erased" sounds like a question, the answer is yes the dfu bootloader is an application not part of the st firmware \$\endgroup\$
    – old_timer
    Commented Nov 30, 2020 at 2:33
  • \$\begingroup\$ Again the asker is explicitly describing attempts to communicate via SWD, not a bootloader. \$\endgroup\$ Commented Nov 30, 2020 at 2:34

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.