This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Place static variable in RAM?

Hi All

If I declare a variable (or a data struct) static, the data is placed in the IRAM.
I guess the static data is moved to the IRAM before the "main" in called and probally also before the SDRAM is up running.

But is it possible to locate any static declared data to RAM instead of IRAM?

Thomas

Parents
  • Hi

    RAM is SDRAM on my CPU.

    If I declare a structure non-static, the data is located according to my scatter file for that module.

    RW_RAM2 0xA0025800 0x00FDA800 { module.o (+ZI) }

    If I put the 'static' keyword in front of it and move it to the header file, I get a link error that it exceeds the maximum space in the IRAM.

    So, the linker allocated in the IRAM space when I have static in front of it. Need the linker to allocate it in the SDRAM instead

    Thomas

Reply
  • Hi

    RAM is SDRAM on my CPU.

    If I declare a structure non-static, the data is located according to my scatter file for that module.

    RW_RAM2 0xA0025800 0x00FDA800 { module.o (+ZI) }

    If I put the 'static' keyword in front of it and move it to the header file, I get a link error that it exceeds the maximum space in the IRAM.

    So, the linker allocated in the IRAM space when I have static in front of it. Need the linker to allocate it in the SDRAM instead

    Thomas

Children