2017-06-21 05:37 PM
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 v2For bug reports, readhttps://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_srstInfo : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWDadapter speed: 480 kHzadapter_nsrst_delay: 100Info : clock speed 480 kHzError: libusb_open() failed with LIBUSB_ERROR_NOT_SUPPORTEDInfo : STLINK v2 JTAG v28 API v2 M v18 VID 0x0483 PID 0x374BInfo : using stlink api v2Info : Target voltage: 3.261782Info : STM32L053R8Tx.cpu: hardware has 4 breakpoints, 2 watchpointsSTM32L053R8Tx.cpu: target state: haltedtarget halted due to debug-request, current mode: Thread xPSR: 0xf1000000 pc: 0x08001190 msp: 0x20002000STM32L0: Enabling HSI16** Programming Started **auto erase enabledInfo : Device: STM32L0xx (Cat. 3)Info : STM32L flash size is 64kb, base address is 0x8000000STM32L053R8Tx.cpu: target state: haltedtarget halted due to breakpoint, current mode: Thread xPSR: 0x61000000 pc: 0x2000000e msp: 0x20002000STM32L053R8Tx.cpu: target state: haltedtarget halted due to breakpoint, current mode: Thread xPSR: 0x61000000 pc: 0x2000000e msp: 0x20002000wrote 8192 bytes from file Debug/Nucleo-L053R8_disc4.elf in 1.288458s (6.209 KiB/s)** Programming Finished **** Verify Started **STM32L053R8Tx.cpu: target state: haltedtarget halted due to breakpoint, current mode: Thread xPSR: 0x61000000 pc: 0x2000002e msp: 0x20002000STM32L053R8Tx.cpu: target state: haltedtarget halted due to breakpoint, current mode: Thread xPSR: 0x61000000 pc: 0x2000002e msp: 0x20002000verified 6136 bytes in 0.098492s (60.839 KiB/s)** Verified OK **** Resetting Target **shutdown command invoked2017-06-21 05:41 PM
ST-Link speed is 480KHz anyway.
2017-06-22 12:13 AM
STM32L053R8Tx.cpu: target state: halted
target halted due to breakpoint, current mode: Thread xPSR: 0x61000000pc: 0x2000002e
msp: 0x20002000To 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.
2017-06-26 10:10 AM
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.
2017-06-26 10:25 AM
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.