Hi!
Program enters infinite loop in `sd_ble_gap_adv_start`.
Setup:
I've seen https://devzone.nordicsemi.com/f/nordic-q-a/11818/sd_ble_gap_adv_start-hangs-after-disconnect, doesn't help.
Using:
* SDK v14.2.0
* S132 v5.1.0
* nRF52810 QFAAB0
using fix: https://devzone.nordicsemi.com/f/nordic-q-a/34784/conflicting-types-for-_putchar
There are changes in the BSP, as this is a custom board.
Removed all NUS service stuff, added DIS service (NUS takes too much space to enable decent debugging)
Parameters going into
SVCALL(SD_BLE_GAP_ADV_START, uint32_t, sd_ble_gap_adv_start(ble_gap_adv_params_t const *p_adv_params, uint8_t conn_cfg_tag));
according to debugger:
conn_cfg_tag = 0x01; p_adv_params = { type = 0x00 (BLE_GAP_ADV_TYPE_ADV_IND), p_peer_addr = 0x00000000, fp = 0x00 (BLE_GAP_ADV_FP_ANY), interval = 0x0040, timeout = 0x0005, channel_mask = {0x00, 0x00, 0x00) };
Problem:
On the Supervisor Call, the SD enters an infinite loop at address 0x0000B6E4 - 0x0000B6EA:
Reg state before 0x0000B6E4: r0: 0x4000d000 - Base address of the Random Number Generator r1: 0x00000000 Disassembly: 0000B6E4 F8D01100 ldr.w r1, [r0, #0x100] 0000B6E8 2900 cmp r1, #0 0000B6EA D0FB beq 0x0000B6E4
Advertising uses the RNG for it's jitter generation. Is there something I need to do to enable the RNG? In which case, shouldn't the SD be doing it itself?
(Bloody rich text editor, what's wrong with MarkDown?)
EDIT:
@ 0xB66E the EVENTS_VALRDY is cleared.
@ 0xB674 the VALRDY interrupt is enabled.
-- branch, @ 0xB720 0x2000 is stored into 0xE000E280) (?)
@ 0xB67E the TASKS_START is triggered. Memory view doesn't show that happening, but that's a write-only register.
@ 0xB686 0x2000 is stored into 0xe000e100 (?)
ret to 0x012CA4...
And the CONFIG register shows bias correction as ENABLED, if that matters.