This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Memory/Flash RW guidelines

So I am trying to figure out what i do and dont have access to as far as flash and ram is concerned. From the nRF51822 spec it discusses this in general but im finding myself not confident with writing non-violating code since im not sure what memory locations the softdevice and API function use.

nRFgo says the softdevice uses 80kb, but is that exact?, do i assume its the first 80kb's of the flash? Where is program code, above or below the softdevice. Im sure there is some document im missing but cant seem to recall seeing it.

There is also the issue of setting up a project and defining ROM and RW memory areas via the Target Options Menu. Ive had problems with programming the eval board because these were wrong before.

  • Hi,

    Do you have access to the nRF51822 SDK ? If you have, you will be able to find the ble example for the evaluation kit in pca10001 folder. If you have a look at the target option of the ble_app_hrs or ble_app_proximity, you can find that when softdevice is programmed: The application ROM starts at 0x14000 with the size of 0x2B000 Application RAM starts at 0x20002000 with the size of 0x2000.

    So the Softdevice will reserve exactly 80KB of flash and 8KB or RAM. (note that if the softdevice is enabled, it will use 1.5KB more of RAM for the calling stack)

  • One thing that should be mentioned is that although 8 kB is reserved for the softdevice, it won't actually use it before it is enabled. This means that if you absolutely need access to the remaining 8 kB of RAM when the softdevice is not active, this is in principle possible. The exact resource requirements, both when enabled and not are given in table 2 of the SoftDevice Specification.

Related