Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

crash in ble_template_app (from nRF5 SDK 15.0.0)


I've installed the ble_template_app on the nrf52832DK and the nrf52840PDK and the Adafruit nrf52 Feather (almost the same as the nrf52832DK). I've modified the configuration enough to have Segger RTT logging enabled, but no changes to main.

I'm seeing the application run for a while (30 seconds to a handful of minutes) and then an "app: Fatal error" log message comes across the console . At that point, there's no interaction with the device available (I'm using the LightBlue Explorer too). Hit the reset button - starts over as I'd expect and then the same thing will happen.

The boards will crash whether or not I connect to them. I don't see any particular pattern of crashing a consistent time after a connect or disconnect event (which I see in the logs).

The stacktrace of the crash (captured in GDB) also seems odd to me:

#0 app_error_fault_handler (id=id@entry=16385, pc=pc@entry=0, info=info@entry=536935940)
at /Users/zoo/Programming/nordic/SDK/nRF5_SDK_15.0.0_a53641a/components/libraries/util/app_error_weak.c:56
#1 0x000273f0 in app_error_handler_bare (error_code= )
at /Users/zoo/Programming/nordic/SDK/nRF5_SDK_15.0.0_a53641a/components/libraries/util/app_error.c:73
#2 0x0002d69e in ble_advertising_start (p_advertising=0x20002d78 ,
advertising_mode= )
at /Users/zoo/Programming/nordic/SDK/nRF5_SDK_15.0.0_a53641a/components/ble/ble_advertising/ble_advertising.c:663
#3 0x0002d8b2 in on_terminated (p_ble_evt= , p_ble_evt= ,
p_advertising=0x20002d78 )
at /Users/zoo/Programming/nordic/SDK/nRF5_SDK_15.0.0_a53641a/components/ble/ble_advertising/ble_advertising.c:146
#4 ble_advertising_on_ble_evt (p_ble_evt= , p_context=0x20002d78 )
at /Users/zoo/Programming/nordic/SDK/nRF5_SDK_15.0.0_a53641a/components/ble/ble_advertising/ble_advertising.c:687
#5 0x00031ad6 in nrf_sdh_ble_evts_poll (p_context= )
at /Users/zoo/Programming/nordic/SDK/nRF5_SDK_15.0.0_a53641a/components/softdevice/common/nrf_sdh_ble.c:307
#6 0x00031a82 in nrf_sdh_evts_poll ()
at /Users/zoo/Programming/nordic/SDK/nRF5_SDK_15.0.0_a53641a/components/softdevice/common/nrf_sdh.c:386
#7 SWI2_EGU2_IRQHandler ()
at /Users/zoo/Programming/nordic/SDK/nRF5_SDK_15.0.0_a53641a/components/softdevice/common/nrf_sdh.c:395
#8 0xffffffe8 in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

How does the app_error_handler get called from this code (file nRF5_SDK_15.0.0_a53641a/components/ble/ble_advertising/ble_advertising.c)

661 if (p_advertising->evt_handler != NULL)
662 {
663 p_advertising->evt_handler(p_advertising->adv_evt);
664 }

Related