We are migrating from 12.3 SDK version to 15.3 version.
We observed the almost 22 KB of RAM is reserved. Where as in 12.3SD version we don't see this.
We are still in development stage but it shows only 4KB free space is left.
Please help us how to reduce the RAM utilization.
Thanks in advance!
Where do you read this number from? What example?`Or is it from the softdevice specification?
Please find below. I have started with taking this example code ble_app_hrs_freertos_pca10040_s132.
where is this screenshot from?
I built the project, and it looks like this in SES:
That is the ble_app_hrs_freertos example.
If your app uses more flash than that, then it is probably because something you do in your application requires a lot of ram.
However, the "Reserved RAM" is the RAM reserved for the softdevice.
On the nRF52832, the RAM is mapped from 0x2000 0000 to 0x2001 0000. If you look in the RAM settings of the ble_app_hrs_freertos you will see that it looks like this:
So the RAM from 0x2000 0000 to 0x2000 57b8 is reserved for the softdevice.
0x57b8 = 21.92kB. This is the RAM that the softdevice needs, based on the number of supported connections, the number of services and characteristics.
In SDK12.3.0 the RAM settings of the same example is starting at 0x2000 2128, which is about 8kB. So yes, the later softdevices use more ram, but it is probably because they are more complex, and support more features.
I forgot to mention, but if you want a smaller softdevice, with a bit less features, you can look into using the S112 softdevice. In SDK16.0.0 there are examples for the nrf52832 using s112. Look at SDK16.0.0\examples\ble_peripheral\ble_app_uart\pca10040\s112.
I looked into this example code ble_app_hrs_pca10040_s132(without FreeRTOS). Here the reserved RAM size is only 10.8KB. Accordingly I adjusted the RAM start location for my project after this reserved RAM size reduced to 10KB.
My firmware works without any issues.
Note: My firmware uses 5 services.
Original RAM start = 0x57B8
I modified it to 0x2800.
Please let me know your suggestion.