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
  • most likely, yes, that would cause a hardfault (because of timing, as far as I got). Since I am on nRF51, there is no monitor mode debug on that kernel ;-(, and it is sort of pain in the ass, when you have to start debugging over and over again to get to finally find the bug. It gets even more complicated with segger, when it just gets out of debugging after a while (you have may be 10-20 second - and I have no idea to explain such strange behavior)

Reply
  • most likely, yes, that would cause a hardfault (because of timing, as far as I got). Since I am on nRF51, there is no monitor mode debug on that kernel ;-(, and it is sort of pain in the ass, when you have to start debugging over and over again to get to finally find the bug. It gets even more complicated with segger, when it just gets out of debugging after a while (you have may be 10-20 second - and I have no idea to explain such strange behavior)

Children
No Data
Related