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

How to execute my app from RAM ?

Hi

I want to execute my app from the RAM to test if i'll get a considerable decrease in the current consumption.

I'm using : "s130_nrf51822_0.9.0-1.alpha" &"nrf51822QFAC"

I tried to follow this thread but it dosen't work (getting a hard default) .

My Questions :

  1. What is the IRAM configuration should i do ? When i use that config in the capture1 it's working if i don't add the main.c to be excuted from RAM as it's mentioned in the thread.
  2. Should i add only the main.c to be excuted from RAM, or it depends on the app ?
  3. When i add main.c to be excuted to RAM, i have to sleect IRAM2 (as in capture2) or IRAM1 ?

Thanks

image description

image description

Parents
  • FormerMember
    0 FormerMember

    First, I would recommend you to use the latest version of the S130, S130 v.2.0.0.

    The reason for the hardfault is most likely that the IRAM start address is too small. As you can see in the RAM map below, RAM address 0x2000000 is used by the MBR.

    image description

    The APP_RAM_BASE address is where you application can start. The procedure for finding the APP_RAM_BASE is described in the migration document that comes with the softdevice: image description

    Update 01.04.16:

    I would think that you will have to add all the files that you want to run from RAM into "properties". However, if you for example have 50 kB of code, you cannot put all the code in RAM, but instead the code that you think is executed often. The reason that you save power when running code from RAM is that you don't have to power flash that often.

    IRAM 1 and IRAM 2 refer to regions in the RAM. As you can see in the above figure, the application, heap, and call stack use RAM 1. If there is something else that you want to allocate RAM to, like for example running code from RAM, you can use use IRAM2 to that.

  • FormerMember
    0 FormerMember in reply to FormerMember

    How do you measure the current consumption? If your code is mainly sleeping for instance, I would assume that the overall current consumption is will not be changed a lot. Could you try to measure the current when some code from main.c is actually being executed? You can for example add a dummy loop and check if you see any difference when running from RAM and flash.

Reply
  • FormerMember
    0 FormerMember in reply to FormerMember

    How do you measure the current consumption? If your code is mainly sleeping for instance, I would assume that the overall current consumption is will not be changed a lot. Could you try to measure the current when some code from main.c is actually being executed? You can for example add a dummy loop and check if you see any difference when running from RAM and flash.

Children
No Data
Related