cancel
Showing results for 
Search instead for 
Did you mean: 

target halted due to breakpoint

Takayoshi Ishii
Associate III
Posted on June 22, 2017 at 02:37

Hello, I'm a new with STM32.

I have Nucloe-N053R8, Win8.1, SystemWorkbench.

I made a short program and it seems that I could send the program to the Nucloe-board, but it doesn't work. I can see the console said 'target halted due to breakpoint'. But there is no breakpoint.

Nucleo-board have LED as LD2, connected PA5. My program wants to blink it. I just did click the 'RUN' button on the Systemworkbench.

I have no idea whether my program is incorrect or if the operation of Workbench is incorrect.

---my program----

#include 'stm32l0xx.h'

#include 'stm32l0xx_nucleo.h'

#include 'stm32l0xx_hal_gpio.h'

int main(void)

{

HAL_Init();

GPIO_InitTypeDef pin_PA5;

pin_PA5.Mode = GPIO_MODE_OUTPUT_PP;

pin_PA5.Pin = GPIO_PIN_5;

HAL_GPIO_Init(GPIOA, &pin_PA5);

HAL_GPIO_WritePin(GPIOA, GPIO_PIN_5, GPIO_PIN_SET);

for(;;){

double i=0;

while(1){

i = i +1;

if(i>100000){

break;

}

}

HAL_GPIO_TogglePin(GPIOA,GPIO_PIN_5);

}

}

---the console result---

Open On-Chip Debugger 0.10.0-dev-00278-ga53935e-dirty (2017-05-09-09:25)

Licensed under GNU GPL v2

For bug reports, read

https://community.st.com/external-link.jspa?url=http%3A%2F%2Fopenocd.org%2Fdoc%2Fdoxygen%2Fbugs.html

srst_only separate srst_nogate srst_open_drain connect_assert_srst

Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD

adapter speed: 480 kHz

adapter_nsrst_delay: 100

Info : clock speed 480 kHz

Error: libusb_open() failed with LIBUSB_ERROR_NOT_SUPPORTED

Info : STLINK v2 JTAG v28 API v2 M v18 VID 0x0483 PID 0x374B

Info : using stlink api v2

Info : Target voltage: 3.261782

Info : STM32L053R8Tx.cpu: hardware has 4 breakpoints, 2 watchpoints

STM32L053R8Tx.cpu: target state: halted

target halted due to debug-request, current mode: Thread

xPSR: 0xf1000000 pc: 0x08001190 msp: 0x20002000

STM32L0: Enabling HSI16

** Programming Started **

auto erase enabled

Info : Device: STM32L0xx (Cat. 3)

Info : STM32L flash size is 64kb, base address is 0x8000000

STM32L053R8Tx.cpu: target state: halted

target halted due to breakpoint, current mode: Thread

xPSR: 0x61000000 pc: 0x2000000e msp: 0x20002000

STM32L053R8Tx.cpu: target state: halted

target halted due to breakpoint, current mode: Thread

xPSR: 0x61000000 pc: 0x2000000e msp: 0x20002000

wrote 8192 bytes from file Debug/Nucleo-L053R8_disc4.elf in 1.288458s (6.209 KiB/s)

** Programming Finished **

** Verify Started **

STM32L053R8Tx.cpu: target state: halted

target halted due to breakpoint, current mode: Thread

xPSR: 0x61000000 pc: 0x2000002e msp: 0x20002000

STM32L053R8Tx.cpu: target state: halted

target halted due to breakpoint, current mode: Thread

xPSR: 0x61000000 pc: 0x2000002e msp: 0x20002000

verified 6136 bytes in 0.098492s (60.839 KiB/s)

** Verified OK **

** Resetting Target **

shutdown command invoked
4 REPLIES 4
Takayoshi Ishii
Associate III
Posted on June 22, 2017 at 02:41

ST-Link speed is 480KHz anyway.

AvaTar
Lead
Posted on June 22, 2017 at 09:13

STM32L053R8Tx.cpu: target state: halted

target halted due to breakpoint, current mode: Thread

xPSR: 0x61000000

pc: 0x2000002e

msp: 0x20002000

To me, it looks like you execute your application from RAM. That would not work without a debugger.

I don't know the SystemWorkbench IDE, though.

Posted on June 26, 2017 at 17:10

Thank you for the reply.

I spent four days for the problem, but I couldn't solve it.

There is no memory settings on the Ac6 at all.

Posted on June 26, 2017 at 17:25

Consider using professional tools if your time is valuable. Keil and ST provide free licensing for Cortex-M0 parts.

Is there an issue here with using floating point? You use a double, is that really necessary?

Make sure you enable floating point libraries, these may be rather large.

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