Re: Debugging NRF51822 (OpenOCD + GDB)

Chettimada, Vinayak Kariappa

Hi Scott,

On 25 Aug 2017, at 05:23, Chettimada, Vinayak Kariappa <> wrote:

On 24 Aug 2017, at 17:21, Scott Nelson <> wrote:

OK, I finally was able to catch the fault while I had a serial console connected and here’s what I saw:

***** HARD FAULT *****
Executing thread ID (thread): 0x20001908
Faulting instruction address: 0xbc76
Nice! May I ask if there where any preceding console messages? usually, the assert condition is printed along with the function name.
If I where to force an assert (break the design), this is how I would get (for samples/bluetooth/peripheral on my local repo):

[bt] [INF] show_dev_info: Identity: da:d7:35:42:55:80 (random)
[2017-08-25 05:28:18.771] [bt] [INF] show_dev_info: HCI: version 5.0 (0x09) revision 0x0000, manufacturer 0xffff
[2017-08-25 05:28:18.779] [bt] [INF] show_dev_info: LMP: version 5.0 (0x09) subver 0xffff
[2017-08-25 05:28:18.785] [bt] [WRN] bt_pub_key_gen: ECC HCI commands not available
[2017-08-25 05:28:18.797] [bt] [WRN] irk_init: Using temporary IRK
[2017-08-25 05:28:18.802] Bluetooth initialized
[2017-08-25 05:28:18.806] Advertising successfully started
[2017-08-25 05:28:18.913] [bt] [ERR] radio_event_adv_prepare: assert: '!_radio.ticker_id_prepare' failed
[2017-08-25 05:28:18.920] ***** HARD FAULT *****
[2017-08-25 05:28:18.922] Executing thread ID (thread): 0x200021a4
[2017-08-25 05:28:18.926] Faulting instruction address: 0xf7be
[2017-08-25 05:28:18.930] Fatal fault in ISR! Spinning...


arm-none-eabi-addr2line -afie samples/bluetooth/peripheral/outdir/nrf51_pca10028/zephyr.elf 0xf7be

and the line in the source file:

5542 void radio_event_adv_prepare(u32_t ticks_at_expire, u32_t remainder,
5543 u16_t lazy, void *context)
5544 {
5545 ARG_UNUSED(lazy);
5546 ARG_UNUSED(context);
5550 LL_ASSERT(!_radio.ticker_id_prepare);
5551 _radio.ticker_id_prepare = RADIO_TICKER_ID_ADV;

The faulting instruction address corresponds to the next program counter, hence the line number given is next line in c source code.

Could you please give details on how I can reproduce the hardfault, I do not have a ble_nano (16 KB RAM nRF51), but pca10028 boards should have a similar nRF51 (32 KB RAM).

Hmmmm…. I see Kconfig.defconfig.nrf51822_QFAA has:
15 config ISR_STACK_SIZE
16 default 640

Could you please use 1024 bytes, and give a try, if your observation is related to insufficient ISR call stack? (pong sample of the micro:bit uses 1024, maybe for a reason!).


Zephyr-users mailing list

Join to automatically receive all group messages.