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

The S120 APP RAM is not enough for RSA calculation

Hi,

I want do RSA on NRF51822. The build environment is GCC. And the develop base on S120. The RSA need 1K to do calculation. If I enable the RSA calculation, the APP may have some tricky problem.

I want to decrease the RAM using. But all is needed. I found in the link file has reserved 2K RAM. Does those RAM reserved for SoftDevice?

S120 Link file RAM (rwx) : ORIGIN = 0x20002800, LENGTH = 0x1800

S110 Link file RAM (rwx) : ORIGIN = 0x20002000, LENGTH = 0x2000

Can I use those RAM for APP?

And I found the NRF51822 has 16K RAM. Why the configure file configured as 8K?

Thanks!

Parents
  • @Bihu: which "reserved 2K" you talked about ? Did you mean 8k ?

    The nRF51 has 16kB Ram but the S110 stack already used (and blocked) 8KB. That's why in the application you only have 8kB left. Note in that 8kB you would need to spare 1.5kB for the call stack for the stack (documented in the Softdevice spec)

    If you are running out of memory and if you don't use any dynamic allocated memory (malloc) you can reduce the heap_size in gcc_startup_nrf51.s. We are currently leave it at 2048 byte. You can set it to 0 if you don't plan to use malloc.

  • @bihu: Setting the stack size of 512 byte maybe not a very good idea. As described in the S110 Spec, in worst case it would need 1.5kB call stack.

    If you don't have many characteristics, service, and with small value size, you may want to consider to reduce the size of the attribute table to have some more RAM for the application.

    The default attribute table size is 0x700 bytes and the minimum you can reduce to is 216 bytes. The extra saved RAM can be retreived by modifying the IRAM layout (0x20002000).

Reply
  • @bihu: Setting the stack size of 512 byte maybe not a very good idea. As described in the S110 Spec, in worst case it would need 1.5kB call stack.

    If you don't have many characteristics, service, and with small value size, you may want to consider to reduce the size of the attribute table to have some more RAM for the application.

    The default attribute table size is 0x700 bytes and the minimum you can reduce to is 216 bytes. The extra saved RAM can be retreived by modifying the IRAM layout (0x20002000).

Children
No Data
Related