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.

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

  • Hi Chriis,

    Execute code from RAM can be done. There can be some benefits to performance due to the access speed, but the benefits will be minimal, because the nRF SoCs' caches are pretty good, while the CPU is not fast enough to leverage the advantage of code being on RAM.

    Could you please share a link to your conversation with Renasas if it is public? I would like to wait for their answer before we commit to what you are asking for. I just feel that it is not worth it because it's just too much work for too little benefit.

Reply Children
No Data
Related