AnsweredAssumed Answered

How to define variable on same RAM area?

Question asked by 磊 石 on May 26, 2017
Latest reply on May 28, 2017 by LPCX presso support

I want to define two array on some RAM area.

 

__attribute__ ((section(".mysection1"))) char test1[128] = "aaaaaaa";

__attribute__ ((section(".mysection2"))) char test2[128] = "bbbbbbb";

 

    .mysection1 ORIGIN(SRAM_UPPER_96): ALIGN(4)

    {

       . += 0;

       . = ALIGN(4) ;   

    } > SRAM_UPPER_96

   

    .mysection2 ORIGIN(SRAM_UPPER_96) :  ALIGN(4)

    {

 

       . += 0;

       . = ALIGN(4) ;   

    } > SRAM_UPPER_96

 

but it comes error:  arm-none-eabi/bin/ld.exe: section .mysection2 loaded at [20018000,2001807f] overlaps section .mysection1 loaded at [20018000,2001817f]

 

what shall I do? thanks!

Outcomes