Hi
I cannot get any way to map a variable to a specific section to work.
Memory section is created by processor expert, here it is called mysection
From processorexpert.lcf
MEMORY { interrupts (RX) : ORIGIN = 0x1FFF0000, LENGTH = 0x000001E0 code (RX) : ORIGIN = 0x1FFF01E0, LENGTH = 0x00015220 data14000000 (RW) : ORIGIN = 0x14000000, LENGTH = 0x00001000 data (RW) : ORIGIN = 0x20005400, LENGTH = 0x00006C00 mysection (RW) : ORIGIN = 0x2000C000, LENGTH = 0x00004000 cfmprotrom (RX) : ORIGIN = 0x00000400, LENGTH = 0x00000010}
Here are some traces on what I have tried to map a variable to "mysection"
#pragma define_section MYSECTION ".bss" far_absolute RW//#pragma section MYSECTION begin//uint16_t adcIn[8192] __attribute__ ((align (8));uint16_t adcIn[8192] __attribute__ ((section ("MYSECTION")));//__declspec(MYSECTION) uint16_t adcIn[8192];//uint16_t adcIn[8192];//#pragma section MYSECTION end
The compilation/linking is OK, but the variable "adcIn" maps to section "data" no matter what.
Any ideas?
已解决! 转到解答。
#pragma define_section MYSECTION ".mysection" abs32 RW__declspec(MYSECTION) uint16_t adcIn[8*2*512];/* lcf file .mysection : { __START_MYSECTION = .; * (.mysection) __END_MYSECTION = .; . = ALIGN(0x4); } > mysection*/
The above is working, but ProcessorExpert must be configured to not generate linker file due to the manually added code in lcf file.
#pragma define_section MYSECTION ".mysection" abs32 RW__declspec(MYSECTION) uint16_t adcIn[8*2*512];/* lcf file .mysection : { __START_MYSECTION = .; * (.mysection) __END_MYSECTION = .; . = ALIGN(0x4); } > mysection*/
The above is working, but ProcessorExpert must be configured to not generate linker file due to the manually added code in lcf file.