This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

How is it possible that my app doesn't start unless I start a debug?

I am playing with example app from this tutorial devzone.nordicsemi.com/.../ I can see the app only when I start debugging. If I just power up my custom board, it doesn't show the app in my smartphone. What do I explain such behavior? (Probably, some settings in Segger, but I can't understand, which exactly).

UPD. Could it be so that it's working in debug mode because of delays, introduced by debugger? And the absense of these delays renders in a non-working application during normal run? UPD2. I soldered on an LED to pin10 (UART config and init is commented out in my code, at least in main.c), and during debug mode my characeristic shows up simultaneousy with me LED on pin 10 (which is actually not expected). I traced it down to ble_advertising.c, line 373,

m_evt_handler(m_adv_evt);

where m_adv_evt is BLE_ADV_EVT_FAST. but I can't find, what is inside that call, and my LED seems to turn on after this line.

Parents
  • Yes, I am trying to debug the board with jlink. My whole board is powered from jlink. When I connect the board and upload the firmware, it says 'nothing done, firmware matches' (if I haven't erased it before that). But I can't see anything, unless i start debugging. BTW, see update.

    No, pin 10 LED only is on after I start debugging. Tracking down this weird behaviour I found out that even during debug sessions my applications get to hardfault (0x6B0). But I can't figure out, what was the stack and from which line it gets there. Thinking of recording a screencast... Anyway, even with this strange behavior I managed to control my led as I needed, but then the app dies again. This was the case when I added that code to a working ble_beacon project I played with before that. Now I decided to follow the latest segger tutorial, importing it from scratch. Still I got to hardfault in debug mode, still I can't see app after the normal startup. The board keeps restarting. See the video

    https://youtu.be/GL3GwJUwPx8 https://youtu.be/gBA1JsnluH0 and this one with some more info on stack https://youtu.be/7aOtWxhuqk0

Reply
  • Yes, I am trying to debug the board with jlink. My whole board is powered from jlink. When I connect the board and upload the firmware, it says 'nothing done, firmware matches' (if I haven't erased it before that). But I can't see anything, unless i start debugging. BTW, see update.

    No, pin 10 LED only is on after I start debugging. Tracking down this weird behaviour I found out that even during debug sessions my applications get to hardfault (0x6B0). But I can't figure out, what was the stack and from which line it gets there. Thinking of recording a screencast... Anyway, even with this strange behavior I managed to control my led as I needed, but then the app dies again. This was the case when I added that code to a working ble_beacon project I played with before that. Now I decided to follow the latest segger tutorial, importing it from scratch. Still I got to hardfault in debug mode, still I can't see app after the normal startup. The board keeps restarting. See the video

    https://youtu.be/GL3GwJUwPx8 https://youtu.be/gBA1JsnluH0 and this one with some more info on stack https://youtu.be/7aOtWxhuqk0

Children
No Data
Related