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 }

Parents
  • Hello David,

    I need a little more information from you:

    Have you tested with other unmodified examples like "ble_app_uart"?

    Could you include your code? 

    What have you added to the template project?

    Have you tried debugging your code?

    If you have a BLE connection between the devices, a sniffer log would be helpful to see what is going on over the air.

  • I have seen unusual issues with other programs (of my own).   This is the only demo program I've tried using so far.   I'll try ble_app_uart tomorrow.   

    I've put my application into github at github.com/.../nrf-test-app.git

    The changes I made were:

       set SDK_ROOT accordingly (points to an unmodified 15.0.0 directory)

       set NRF_LOG_BACKEND_RTT_ENABLED to 1

       setup the Makefiles to use a variable for NRFJPROG (since I have several boards attached at once, I set --snr XYZ appropriately).   

    That's it.   NO changes to the code of the program.   

    I have done some debugging (see the original report, which includes the call trace of the crash).   I don't understand how a call to p_advertising->evt_handler() ends up in the app_error_handler (since the stack trace doesn't show anything from within the evt_handler function).   

    I have no sniffer log available at this time.

Reply
  • I have seen unusual issues with other programs (of my own).   This is the only demo program I've tried using so far.   I'll try ble_app_uart tomorrow.   

    I've put my application into github at github.com/.../nrf-test-app.git

    The changes I made were:

       set SDK_ROOT accordingly (points to an unmodified 15.0.0 directory)

       set NRF_LOG_BACKEND_RTT_ENABLED to 1

       setup the Makefiles to use a variable for NRFJPROG (since I have several boards attached at once, I set --snr XYZ appropriately).   

    That's it.   NO changes to the code of the program.   

    I have done some debugging (see the original report, which includes the call trace of the crash).   I don't understand how a call to p_advertising->evt_handler() ends up in the app_error_handler (since the stack trace doesn't show anything from within the evt_handler function).   

    I have no sniffer log available at this time.

Children
No Data
Related