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

  • 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.

  • What i did the first time, is putting the main.c and some other files to be excuted from RAM (as you said :you cannot put all the code in RAM, but instead the code that you think is executed often). and i didn't see a diference !! (in the while (1) of main.c all i do is going to sleep) . Now, i did another test, exactly like you asked me to do, i delted the sleep function, and i put a dummy loop: while(i<1) { i++; i--;} then i measured with and withoud RAM execution, i got a difference of 1.76 mA , thats really awsome , and very logic, because in the DataSheet we have :

    Icpu,flash = 4.1 mA and Icpu,ram =2.4mA a difference of 1.7mA exactly like i found.
    thanks for your help.

Related