cancel
Showing results for 
Search instead for 
Did you mean: 

Failing to flash a standalone board using stlink v2-1 on Nucleo

DMolo
Senior

Hi!

I have been making soem firmware for a small device, and so far have been developing it on a Nucleo... all has gone relatively well so far...

I'm now trying to get it running on a standalone chip so that I can put it on a custom board. But all is not as easy as it seems it should be...

Nucleo is the F303RE. Chip is STM32F303CB (48 pin LQFP), soldered on a breakout board.

I've wired it as in the attached picture, and the STLINK is up to date (just updated) but when I flash from Eclipse/st4workbench it reads the correct MCU code (I think, device id = 0x10036422) but then returns:

Error: timed out while waiting for target halted
TARGET: STM32F303CBTx.cpu - Not halted
in procedure 'reset' 
in procedure 'ocd_bouncer'
 
 
 
Info : device id = 0x10036422
Warn : STM32 flash size failed, probe inaccurate - assuming 256k flash
Info : flash size = 256kbytes
Info : Stlink adapter speed set to 950 kHz
adapter speed: 950 kHz
Error: timed out while waiting for target halted
TARGET: STM32F303CBTx.cpu - Not halted
in procedure 'reset' 
in procedure 'ocd_bouncer'
 
 
 
Error: Target not halted
Error: failed erasing sectors 0 to 1
Error: flash_erase returned -304

The firmware I am currently flashing is just a fairly blank CubeMX default program, with the SW debug enabled, and one GPIO and the MCO master clock enabled...0690X000008AUf7QAG.jpg

Any idea what I am getting wrong? I presume since it reads the device ID (reads a different device ID if I replace the nucleo jumpers) I have not bricked the chip and my soldering passes some level of quality...

Have not removed any solder bridges or 0 ohm resistors on the nucleo. Is this a problem? Should I clip SB12 NRST (not using the SWO presently)?

Thanks

David

1 REPLY 1
DMolo
Senior

Ok, so I unsoldered the SB12 and it worked fine. Didn't think I needed to, thanks to advice from a few other websites. The official documentation said:

Note: SB12 NRST (target STM32 RESET) must be OFF if CN4 pin 5 is used in the external application.

Thought I wasn't using pin5 (connected in photo through previous desperation and thinking why would it matter if the debugger is pulling the reset on two mcus rather than one...) and since I had changed in the debug config file:

set CONNECT_UNDER_RESET "1" to "0"

But it turns out that for some reason unknown to me, eclipse/GCC/whatever is resetting it to 1 every time I recompile...

Would be nice if there was another jumper on CN4 for this!

I guess that when I am turning off the f303RE by removing the IDD jumper the whole MCU is low and it keeps the reset line constantly pulled low or something?