Loading...
 
Skip to main content

System Workbench for STM32


Unable to debug/program NUCLEO-F303K8

Hello,

I was planning on having some fun with my NUCLEO-F303K8 board today but before I got that far I stumbled upon some problems. I am using System Workbench 1.13.1 on Windows 10 (x64).

When I try to debug my application I get the following error message (at 93%):

Error in final launch sequence
Failed to execute MI command:
load D:\\Daniel\\SystemWorkbench\\workspace\\MLX90614\\Debug\\MLX90614.elf

Error message from debugger back end:
Error erasing flash with vFlashErase packet
Error erasing flash with vFlashErase packet

When I check the openocd console I see the following:

Error: timed out while waiting for target halted
TARGET: stm32f3x.cpu - Not halted
in procedure 'reset'
in procedure 'ocd_bouncer'

I get that error three times, then at the end:

Error: Target not halted
Error: failed erasing sectors 0 to 1
Error: flash_erase returned -304

There seems to be a similar problem in this thread but I did not get it to work with the proposed solutions. Anyone have any other suggestions?

Another strange problem I have is that I tried to program my board using ST-LINK utility but it doesn't detect it, so I cannot connect to it. All it says is "cannot connect to target" and suggests I go to settings and choose "connect under reset", but I see no such option.

I know I must have managed to program the board a couple of month ago when I bought it because the demo application that was on it is no longer running when I connect the usb cord. I have updated the firmware a couple of times but it has always succeeded.

So I can connect in order to upgrade the ST-LINK firmware but not to do anything else it seems.

BR
Daniel

  1. This is an my board with a single STM32F103C8Tx chip.
  2. Generated by System Workbench for STM32


source find interface/stlink-v2.cfg

set WORKAREASIZE 0x5000
transport select "hla_swd"

set CHIPNAME STM32F103C8Tx

source find target/stm32f1x_stlink.cfg

  1. use hardware reset, connect under reset

reset_config none


Thanks for the reply.

This is what my config-file looks like:

  1. This is an ST NUCLEO-F303K8 board with a single STM32F303K8Tx chip.
  2. by ST


source find interface/stlink-v2-1.cfg

set WORKAREASIZE 0x3000

source find target/stm32f3x_stlink.cfg

  1. use hardware reset, connect under reset

reset_config srst_only srst_nogate

I tried to change the last line to "reset_config none" but the error doesn't go away.

What does it mean when it says "use hardware reset, connect under reset". Do I need to do something with the reset button on the board? I tried pressing it before/keeping it pressed while attempting to start a debug session but I still get the same error no matter what I do.

I also noticed this warning in the console:
Warn : STM32 flash size failed, probe inaccurate - assuming 64k flash

Any ideas what could be causing it?


I managed to find the cause of the problem and I am embarrassed to say I had by mistake placed the jumper that was included with the board between GND and NRST instead of GND and PA12. I am now able to debug my application. Hopefully I will not do this mistake again now after wasting a day on this. 😊