This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nRF5 SDK 12.3.0 Eddystone on nRF51822 beacon

Hi,

I've seen that SDK 12.3.0 contains a new version of the application sample using the Eddystone protocol for BLE. I would like to know if this version is compatible with nRF51 chips as it was said in GitHub:

Experimental support for nRF51 is found in nRF5 SDK Version 12.2.0 A future 12.x release will add production quality support for nRF51 for Eddystone.

I tried to program a beacon with nRF51822 chip using the SDK example (nRF5_SDK_12.3.0_d7731ad\examples\ble_peripheral\ble_app_eddystone), but I did not succeed.

GCC (after make flash_softdevice)

nRF5_SDK_12.3.0_d7731ad\examples\ble_peripheral\ble_app_eddystone\pca10028\s130\armgcc>make flash
Flashing: _build/nrf51822_xxab.hex
nrfjprog --program _build/nrf51822_xxab.hex -f nrf51 --sectorerase
Parsing hex file.
ERROR: The file specified is not a valid hex file, has data outside valid areas
ERROR: or does not have data in valid areas.
Makefile:250: recipe for target 'flash' failed
make: *** [flash] Error 52

Keil + nRFgo Studio (after Program SoftDevice)

image description

Could you guys help me identify the cause of the errors above?

Thanks in advance!

  • Hi,

    Have you flashed the beacon with S130 v2.0 ?

    Could you post how did you configure the IROM and IRAM of the project ? Make sure IROM1 starts at 0x1B000

  • Thanks for your reply, Bui.

    Yes, I did the flash with S130 (s130_nrf51_2.0.1_softdevice.hex) before trying to program with the Eddystone example.

    On GCC I've used the "make flash_softdevice" instruction:

    On nRFgo Studio I've used the Program SoftDevice tab.

    These are the configs of IROM and IRAM:

    GCC (ble_app_eddystone_gcc_nrf51.ld)

    MEMORY { FLASH (rx) : ORIGIN = 0x1b000, LENGTH = 0x25000 RAM (rwx) : ORIGIN = 0x20003440, LENGTH = 0x4bc0 }

    Keil (default values when you select nRF51822_xxAB device on Keil)

    IROM: START= 0x0, SIZE = 0x20000 IRAM: START = 0x20000000, SIZE = 0x4000

  • On Keil , you need to reconfigure the memory setting after you select the new chip configuration. Please follow the original configuration of the project. And update the size to match with your flash size.

    Note that the nRF51822 only has 128kB of flash, the softdevice S130 already occupies 108 kB leaving 20 kB for the application. Could you check how big your application is ?

  • Thanks again, Bui.

    I've changed the configs to match the initial project configuration:

    IROM: START= 0x1B000, SIZE = 0x20000 IRAM: START = 0x20003440, SIZE = 0x4BC0

    Now when I try to program the application the error says "The flash is not erased."

    The Keil build outputs the following:

    Program Size: Code=32844 RO-data=2152 RW-data=412 ZI-data=5996

    That means that I need 32kB of flash free for the application? If true, what can I do to reduce the "Program Size"?

  • When you use nrfjprog to program the chip ("make flash" uses nrfjprog) make sure you use --sectorerase as the parameter, so that nrfjprog will erase the sector before it writes. Like this:

    nrfjprog --program yourprogram.hex --sectorerase
    

    Total Flash/ROM size required is Code + RO + RW , so in your case you need 35408 bytes. You can try to apply optimization and reduce other feature of the application to reduce flash size.

    But my suggestion is to move down to SDK v10 and use S110 which only requries 96kB and the Eddy stone example there only requires 8kB of flash.

    [Update] I just checked and seems that in SDK v12.0 the Eddy stone example S130 also require 8kB flash, I would suggest you to use that SDK.

Related