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

memory mappings for nrf51 sdk examples

I have the "old style" nRF6310 board + nrf51422 boards. I want to test different examples from the latest sdk, and possibly with different softdevices as well. I appreciate that for every softdevice I have to change the memory settings in "Options for target" in Keil, however I find it hard to find a comprehensive collection of the different values for the different Softdevices, and for the different flash memory sizes as well. Everytime I want to adapt an example for my board it's a pain. Where can I find such information? Thanks!

  • Ok, I have finally found it by myself, maybe it can be useful for someone else (pls correct me if I am wrong): the memory mapping information is in the sxxx_SoftDevice_specification_vx.pdf, in the chapter 10. There is a chart like this: image description

    When you modify the target CPU of the example project in Keil, the parameters of the memory are overwritten, and you need to adapt them again to accomodate the softdevice.

    So, for instance, let's suppose you want to use nrf51422_xxac with S110: In Options for Target you now have this: image description

    What you have to do is change the values as follows:

    Replace IROM1 Start with CODE_R1_BASE (you can find it in the following page of the pdf)

    Replace IROM1 Size with: current value - CODE_R1_BASE (Example, CODE_R1_BASE is 0x16000-> Start = 0x16000, Size = 0x40000-0x16000 = 0x2A000)

    Replace IRAM1 with RAM_R1_BASE;

    Replace Size with: currentsize - (RAM_R1_BASE - current start) (Example, RAM_R1_BASE is 0x20002000-> Start = 0x20002000, Size = 0x4000 - (0x20002000-0x2000000) = 0x2000

  • You have found the information in the softdevice specification. Thank you very much for the update of the case. I'm sure it will be useful for others in the future as well.

    Good luck on the development.

  • I have an additional question. My procedure above works when I flash the SoftDevice by programming the .hex file with the nRFgo Studio. I have noticed that if I start by cloning an example project from the pack installer, the memory of the target does not take into account what my procedure above (i.e. IROM1 starts from 0). Does it mean that if I add the SoftDevice frim the Manage Run-Time environment window, the SoftDevice is already integrated in the project? How does it integrate a .hex file in the project? Thanks

  • We haven't added the functionality of flashing the softdevice from Keil based on the package and project. It's a feature we have been considering, but it adds some additional time for every time you change your code and update it during development. You also shouldn't have to re-flash the softdevice between different projects/examples as long as they all are dependent on the same softdevice.

Related