Finally, I managed to compile ble_beacon in segger. However, here's what I can not understand.
Using either Segger -> Target -> Download File or RKNRFGO I managed to upload the ready-made hex from that example to nrf chip, and I can see it on my smartphone. Then I upload the freshly built firmware (with a bit altered UUID - to see which version of firmware is flashed) - segger reports that the new fimware has been flashed successfully, but I can not see anything on the smartphone (I attached the log below). But when I do
The most interesting part is that yesterday when instead of FLASH ADDRESS 1B000 I mistakenly used 1F000, after having failed to discover the device and doing Segger - Target - JLink connect - Reset I could see the initial stock ble_beacon on the smartphone - the device was again alive!
Now, after I fixed the flash size issue, I cannot reproduce this behavior, the device doesn't work with my own build firmware.
The question is how to debug this elf file - how do I check, what's wrong?
Here's the log:
CPUID register: 0x410CC200. Implementer code: 0x41 (ARM) Found Cortex-M0 r0p0, Little endian. FPUnit: 4 code (BP) slots and 0 literal slots CoreSight components: ROMTbl @ F0000000 ROMTbl: E00FF000, CID: B105100D, PID: 000BB471 ROM Table ROMTbl @ E00FF000 ROMTbl: E000E000, CID: B105E00D, PID: 000BB008 SCS ROMTbl: E0001000, CID: B105E00D, PID: 000BB00A DWT ROMTbl: E0002000, CID: B105E00D, PID: 000BB00B FPB ROMTbl: F0002000, CID: B105900D, PID: 000BB9A3 ??? Preparing target for download Executing script TargetInterface.resetAndStop() Reset: Halt core after reset via DEMCR.VC_CORERESET. Reset: Reset device via AIRCR.SYSRESETREQ. Downloading ‘s130_nrf51_2.0.0_softdevice.hex’ to J-Link Programming 1.9 KB of addresses 00000000 — 000007bf Programming 103.9 KB of addresses 00001000 — 0001aff3 J-Link: Flash download: Bank 0 @ 0x00000000: Skipped. Contents already match Download successful Downloading ‘ble_app_beacon_s130_pca10028.elf’ to J-Link Programming 17.5 KB of addresses 0001b000 — 0001f613 Programming 0.0 KB of addresses 0001f614 — 0001f62a J-Link: Flash download: Bank 0 @ 0x00000000: 1 range affected (18432 bytes) J-Link: Flash download: Total time needed: 0.610s (Prepare: 0.083s, Compare: 0.023s, Erase: 0.170s, Program: 0.277s, Verify: 0.002s, Restore: 0.052s) Download successful
Besides, I am not sure about my memory map, but I couldn't find the working example
<!DOCTYPE Board_Memory_Definition_File> <root name="nRF51822_xxAA"> <MemorySegment name="FLASH" start="0x00000000" size="0x00040000" access="ReadOnly" /> <MemorySegment name="SRAM" start="0x20000000" size="0x00004000" access="Read/Write" /> </root>