RAM and Flash start adresses

Hello,

I was reading this post on the forum: "Adjustment of RAM and Flash memory - Getting Started - nRF5 SDK guides - Nordic DevZone (nordicsemi.com)"

At point 4. "Change start addresses in Segger Embedded Studio" I wondered if you change the start adress of RAM to an adress that is further then the original adress. What happens to the RAM that is not defined?

Does the linker not put code there anymore? If that is true, is there any way you can put your own specific code there?

I want to achieve a data block where I can put specific arrays in and where the linker does not put anything else in.

Parents
  • Hi Chriis,

    If you are referring to the RAM_START configuration, then the RAM the application "moved away" from is going to be reserved for the SoftDevice.

    Regarding reserving a RAM section for variable, I am going to refer you to some answers by my colleagues on DevZone:

    - How to place data at a location by Einar:  RE: RAM Section allocated by Linker . 
    - Details about RAM usage and variable placement in RAM by Håkon: RE: Some questions about RAM non_init .
    - Another thread where a bootloader is also used: how to reserve memory segment using SES . 

    If you have any further questions please let me know.

    Hieu

  • Thanks for answering!

    I am quite new to this so I may find understanding a little harder than usual so please bear that in mind.

    My goal is to make a sensor, the sensor needs to make a couple readings per hour. So when it is not active it will go into sleep mode. 

    The sensor has data that needs to be stored to work properly. So this data has to be retained when the chip is off.

    Now from what I understand is that normally the Linker puts all data in code on a "random" place in memory and I don't have control over where it is placed, so I need to seperate a section of RAM where the Linker does not put anything but when I need data to be retained I can place it there.

    I am using the SES workspace.

    This is my plan:

    - Open linker file

    - Split the RAM partition into 2 partitions.

    - 1 partition the Linker can touch, and the new partition where I can put specific data in that needs to be retained.

    - Place specific data in the partition that has been added (another question/problem that i need to solve).

    Questions:

    Where do I find the Linker file where I can edit the partitions?

    When I edit the existing partition and make a new one, do I need to keep something in mind?

    I hope that you can help me.

  • Chriis said:
    a not initialized RAM section would be perfect too, it will be basically the same thing in the project. The problem is how is this done?

    This is discussed in one of the links from my first reply.  RE: Some questions about RAM non_init .

    Chriis said:
    Is it not just easier to offload the desired data to Flash and then disable all RAM sections?

    As I mentioned, storing the sensor data to flash is a perfectly fine option. Please just take care to let the flash write completes before putting the device to sleep; it is far less instantaneous than a RAM write.

    Disabling RAM sections is only for lowering power consumption, since your device's sleep time (two hours) is so much more than its wake time (likely seconds just to read the sensor and save it). What are you planning to do with disabling RAM sections?

    Chriis said:
    Also I am taking over the project from someone else so there has been done quite a few things already. I don't think it is a good idea to switch to nRF connect.

    I see. If the project is in maintenance, then that is a fine reason not to change SDK.

    Please be informed that it is the Easter holiday here, and responses on DevZone can be delayed. I will also be out of office from tomorrow and will return to support you from Tuesday next week. My apology for the inconvenience.

    Hieu

  • Ok, I had a hard time understanding that link, I will try and look at it again this week with some other colleagues. 

    Thanks, I will keep in mind that Flash writing is not as fast. Also, my goal with disabling RAM is like you said. The device will be in sleep more often than not, so to reduce power consumption. 

    The thing with Flash is that the program will be more error sensitive. So I don't really want to do that to be honest.

    Happy Holidays, I will try and look at it myself and I will let you know when I am still stuck.

  • Hey Hieu

    First of all, hope you had a good easter!

    Now to the code, I think I almost figured it out.

    I am working with a renesas sensor which has a library that needs to be stored. 
    I want to put this library directly in the linker script so I can know where it is placed and which RAM sections need to be powered.
    However, Nordic uses a custom Linker script that is translated to a normal script when compiled.

    The problem here is, I have no idea how to use or edit this script. So can you tell me and show me how I edit the existing linker script (flash_placement.xml) so I can put the object file directly in the linker?

    So I want to connect this file to the linker. It is 6048 Bytes.

  • Hi Chriis,

    I had a good time. Thank you Smiley

    If you want to integrate a library into your project, shouldn't it be on Flash memory and not on RAM? Or perhaps there are some special functionalities that you need on RAM?

  • Hey Hieu,

    There are some algoritms and AI functionality in the library so I am quite sure it needs to be in RAM.

    To be sure I have asked Renesas, but for now I will assume that it needs to be in RAM.

Reply Children
Related