How to define variable on same RAM area?

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

How to define variable on same RAM area?

1,086件の閲覧回数
leilovelei100
Contributor II

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!

1 返信

903件の閲覧回数
lpcxpresso_supp
NXP Employee
NXP Employee

Take a look at the __DATA / __BSS macros provided by MCUXpresso IDE's cr_section_macros.h header file. For more details see section 12.9.6 "Placement of specific code/data items" in the MCUXpresso IDE v10.0.0 User Guide.

Regards,

MCUXpresso IDE Support