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

NRF51822 IRAM1 Settings (multilinkCentral Projects)

Hi, Im using Nrf51422 DK board. When I try the ble_app_multilink_central example in the SDK12, it works on the DK board. But it does not work in NRF51822. (NRF51822 QFAA)

I tried the settings on this link but it did not. Link

Help me please.

image description

Parents
  • Hi Oguz,

    the nRF51822 QFAA variant only has 16kB (0x4000 bytes) of RAM while the SDK examples are compiled for the nRF51 DK, which uses the nRF51422 QFAC variant with 32kB(0x8000 bytes) of RAM.

    The ble_app_multilink_central example is by default configured to have up to 8 peripheral connections, for which the SoftDevice requires 0x3C78 bytes of RAM. In order to account for the reduction you have reduce the size of the IRAM1 block, i.e. set the size to 0x4000-0x3C78 = 0x388 bytes.

    However, the project will not compile with these settings, but if they did you also have to take into account that the SoftDevice and the application shares the call stack. The S130 v2.0.1 may use up to 1536bytes (0x600 bytes) which must be added to the application stack usage, see this page in the S130 SoftDevice Specification.

    Thus, if the project compiled with the IRAM1 size to 0x4000-0x3C78 = 0x388 bytes, we see that we'll get a stack overflow if the SoftDevice reaches the maximum stack usage( or if the application pushes lot to the stack).

    The solution is to reduce the number of peripheral connections from 8 to 4, which reduces the SoftDevice RAM requirement from 0x3C78 to 0x2BC0, i.e.

    image description

    Note: The SoftDevice returns the application ram base, i.e. how much RAM it needs, when you enable the stack using sd_ble_enable().

  • Yes, the unmodified ble_app_multilink central from SDK v12.x.0 will work with all nRF51x22 devices that has 256kB Flash and 32kB RAM.

Reply Children
No Data
Related