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

(RAM_SIZE + RAM_START) larger than (RAM_PH_START + RAM_PH_SIZE)

Env.: nRF52 customBoard, SES, nRF5_SDK_16.0.0_98a08e2

Hi,

I'am working with ble_app_template example and currently trying, to merge it with the experimental multiperipheral example, to have the possibility, to let more than one device connect to my peripheral.

NRF_LOG is already disabled, so I'am getting no output where it crashes, but after debugging it, it seems like inside the ble_stack_init() the nrf_sdh_ble_enable() function failed, because p_app_ram_start (0x20002270) was smaller than app_ram_start_link (0x200024a8).

Now I've simply increased the RAM_START to 0x200024a8 inside the Section Placement Macros and the project working again.

But i've seen in this post: https://devzone.nordicsemi.com/nordic/short-range-guides/b/getting-started/posts/adjustment-of-ram-and-flash-memory

that the (RAM_SIZE + RAM_START) ahould not be larger than (RAM_PH_START + RAM_PH_SIZE), but with my setup:

RAM_START=0x200024a8

RAM_SIZE=0x3dda0

RAM_PH_START=0x20000000

RAM_PH_SIZE=0x40000

0x3dda0 + 0x200024a8 = 0x20040248 > 0x20000000 + 0x40000 = 20040000

So my question is, what could happen, if this area is even bigger than aloowed? What can i do to prevent that this area is bigger? Should I decrease the RAM_SIZE, that it fits again into the area?

Thanks a lot!

SJ

Parents
  • Hi

    What you're doing by leaving RAM_SIZE + RAM_START larger than the PH versions, is that you're allowing the application to write outside what are valid addresses of the RAM. When you increase the RAM_START you'll have to decrease RAM_SIZE accordingly so that the application won't exceed the valid RAM addresses. So yes, you'll have to decrease the RAM_SIZE by 248, making it 0x3DB58‬

    Best regards,

    Simon

Reply
  • Hi

    What you're doing by leaving RAM_SIZE + RAM_START larger than the PH versions, is that you're allowing the application to write outside what are valid addresses of the RAM. When you increase the RAM_START you'll have to decrease RAM_SIZE accordingly so that the application won't exceed the valid RAM addresses. So yes, you'll have to decrease the RAM_SIZE by 248, making it 0x3DB58‬

    Best regards,

    Simon

Children
Related