Hi all,
I am looking for some help on where to identify a problem that cropped up recently. I'm relatively new to the softdevice concept, though it seems straightforward and we've done a few different small projects that use it successfully, but I may be doing something wrong.
Setup: Win7, Keil 5.14, nRF51822 custom board, Segger J-link. SoftDevice S110 V 7.1
Background: Using the BLE UART sample as our starting point, we adapted the sample such that we can connect and send small UART messages over the BLE link. When all said and done, that working code (in Keil) debugs just fine, runs just fine on or off the debugger and has the following stats:
code=31264, RO-data=808, RW-data=312, ZI-data = 7816.
We added a file and increased a few array sizes, and now we have the new stats:
code=32284, RO-data=820, RW-data=356, ZI-data = 8060.
No issues compiling, building or downloading. Except that it no longer runs.
When run under the debugger, we see that the processor runs thru part of arm_startup_nrf51.s, then gets to "SystemInit" function in the file system_nrf51.c. At this point, it encounters (disassembly) PUSH (r4,lr) which starts a small chain of assembly instructions that gets to:
0x00014F6E 9806 LDR ro,[sp,#0x18]
which, when executed, jumps immediately to :
0xFFFFFFFE 0000 MOVS r0,r0.
This then goes to 0x00000000 and steps up to 0x000000C0 B51f PUSH {r0-r4,lr}, which then makes it jump back to 0xFFFFFFFE. And repeat.
I've triple checked the settings on both projects (one was a straight build off the other, so there weren't any project setting changes really) and they match in the memory map setup, etc. as far as I can tell. The only thing I can guess at is that there is some kind of memory overwrite. But the code hasn't even gotten to the start of main.c, this is all startup file activity.
Does anyone have any hints as to where to look? Or did I miss something obvious?