Description:
I'm having an issue with my nRF52811 custom board where the device won't start BLE advertising after programming, but it works after cycling through GDB monitor resets multiple times.
Hardware:
- nRF52811_xxAA on custom board
- J-Link OB-nRF5340 debugger
- External power supply
Software:
- BLE DFU application (SoftDevice + Application + Bootloader)
- SoftDevice: S112 (version: please specify)
- SDK: please specify version
- IDE: SEGGER Embedded Studio
- Toolchain: arm-none-eabi-gcc
Problem:
The device does NOT start advertising after:
- Programming via
nrfjprog --program merged.hex --reset - Flashing through nRF Connect Programmer app
- Power cycling the custom board
- Running
nrfjprog --reset
The device DOES work after:
- Starting J-Link GDB Server:
JLinkGDBServer -device nRF52811_xxAA -if SWD -speed 4000 - Connecting with GDB:
target extended-remote localhost:2331 - Running
monitor reset+continuecombo 2-3 times - Once advertising starts through this method, it continues to work even after disconnecting the debugger
- But stops working again after power cycle
Errors Encountered:
Sometimes I get:
warning: ARM M in lockup state, stack unwinding terminated. ``` Other times: ``` (gdb) continue Continuing. Program received signal SIGTRAP, Trace/breakpoint trap. 0x20006000 in ?? () (gdb) backtrace #0 0x20006000 in ?? () #1 0x2000032e in __reserved_ram_start__ () Backtrace stopped: previous frame identical to this frame (corrupt stack?) ``` When this happens, I need to: 1. Run `nrfjprog --recover` 2. Reflash the image 3. Try the GDB reset combo again
Questions:
- Why does the device only start properly after multiple GDB
monitor resetcycles? - The crash at
0x20006000(RAM address) suggests the PC is jumping to invalid memory - is this a memory layout issue? - Could this be related to SoftDevice initialization timing?
- Is there a difference between
nrfjprog --resetand J-Link'smonitor resetthat could explain this behavior? - Should I add delays after SoftDevice initialization or clock startup?
What I've Tried:
- Different reset methods
- Reflashing multiple times
- Using
--recoverbefore programming
Any insights would be greatly appreciated!
if i try nordic bliky ble , i can use ide , or cli commands to run it on it , it works
but even if i try base nordic_buttonless dfu code with modification in both bootloader and it to change lf_src 0 (i don't have low freq external crystal) and accuracy and citv to match to RC config , i get the same issue