cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F405 unable to flash, damaged flash?

NRich.1
Associate II

Hello,

Yesterday I was working on a device that uses the STM32F405RG chip, functionally it's a Vedder ESC, when the computer no longer recognized that I had the USB plugged in to the board. After a bit of troubleshooting I thought I should reflash the bootloader and install the firmware again to see if that would fix it, so I plugged in an ST-link via SWD and tried to use ST-link Utility to flash the bootloader onto it. I was only able to connect via Hot Plug mode in the connect settings. This is when I kept getting an Internal Command Error and in Option Bytes menu it said that the Read Out Protection was level 1; however, I had never set the read out protection. It's possible that I killed the chip with ESD but I was using a ESD mat to mitigate this possibility. Reading into other ways to reset the board, people and the manual mentioned setting BOOT0 to HIGH; however, that pin is tied to ground on this board. I tried using STM32cudeIDLE to reprogram the board with no luck; STM32cube was unable to determine flash size (like with ST-link), the core could not be halted (ST-link also mentioned this), and returned flash_erase returned -304.

With all that's been said, is the chip dead and the best option is to replace it? I'll attach a picture showing the Options bytes menu for this board, which will show the read protection as level 1, and another picture of an identical board's Option Bytes which is working.

Any advice is greatly appreciated.

Thanks,

Nic

3 REPLIES 3

Can you connect up the NRST pin along with SWDIO/SWCLK, then "Connect Under Reset" might work properly?

The connection process takes some time, and code on the device can interfere with the debug pins, or power down the logic.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
NRich.1
Associate II

I'm using the SWD pins connected to an external Nucleo debugger, I should have mentioned that, so those pins are already connected. When I try, ST-link returns:

09:56:52 : Can not connect to target!

         If you're trying to connect to an STM32W1xx device, please select Normal or HotPlug mode from Target->Settings menu.

         If you're trying to connect to a low frequency application , please select a lower SWD Frequency mode from Target->Settings menu.

09:57:35 : Core is held in reset

It fails pretty fast; a couple of seconds. In Connect Settings, it'll fail to auto-detect the STM board in use if I select connect Under Reset as well.

Oops, I'm new to the forum so I accidentally replied to the post instead of your comment. I should mention, in addition to my comment below, that hot plug mode can auto detect the STM chip in use.