Part Number: LAUNCHXL2-570LC43
Other Parts Discussed in Thread: HALCOGEN,
Tool/software: Code Composer Studio
Good day, i have a problem and dont know how to solve it.
I have a structure.
struct TelemPackStruct
{
uint32_t tmMarker;
float32_t wx ;
float32_t wy ;
float32_t wz ;
float32_t m1 ;
float32_t m2 ;
float32_t m3 ;
float32_t q0 ;
float32_t q1 ;
float32_t q2 ;
float32_t q3 ;
struct BinData{
uint32_t seconds :32;
uint32_t indication :8;
uint32_t mode :8;
uint32_t modeArea :8;
}binDataTM;
};
I need to save this type of structure every second with different values in the emif.
I enabled the emif in the Halcogen.
I modified the linker file :
MEMORY
{
VECTORS (X) : origin=0x00000000 length=0x00000020
KERNEL (RX) : origin=0x00000020 length=0x00008000
FLASH0 (RX) : origin=0x00008020 length=0x001F7FE0
FLASH1 (RX) : origin=0x00200000 length=0x00200000
STACKS (RW) : origin=0x08000000 length=0x00000800
KRAM (RW) : origin=0x08000800 length=0x00000800
RAM (RW) : origin=(0x08000800+0x00000800) length=(0x0007F800 - 0x00000800)
/* USER CODE BEGIN (2) */
SDRAM (RXW) : origin=0x80000000 length=0x007FFFE0
/* USER CODE END */
}
and
SECTIONS
{
.intvecs : {} > VECTORS
/* FreeRTOS Kernel in protected region of Flash */
.kernelTEXT align(32) : {} > KERNEL
.cinit align(32) : {} > KERNEL
.pinit align(32) : {} > KERNEL
/* Rest of code to user mode flash region */
.text align(32) : {} > FLASH0 | FLASH1
.const align(32) : {} > FLASH0 | FLASH1
/* FreeRTOS Kernel data in protected region of RAM */
.kernelBSS : {} > KRAM
.kernelHEAP : {} > RAM
.bss : {} > RAM
.data : {} > RAM
/* USER CODE BEGIN (4) */
.sysmem : {} > SDRAM
/* USER CODE END */
}
i though i can handle this problem with this way:
struct TelemPackStruct telemetryStruct __attribute__((section(".sysmem")));
telemetryStruct.tmMarker= 0xf99ff99f;
telemetryStruct.q0=1;
telemetryStruct.q1=1;
telemetryStruct.q2=1;
telemetryStruct.q3=1;
telemetryStruct.wx=1;
telemetryStruct.wy=1;
telemetryStruct.wz=1;
telemetryStruct.m1=1;
telemetryStruct.m2=1;
telemetryStruct.m3=1;
telemetryStruct.binDataTM.seconds=0;
telemetryStruct.binDataTM.modeArea=0;
telemetryStruct.binDataTM.mode=0;
telemetryStruct.binDataTM.indication=0;
And then i wanted to create a pointer to a struct and make pointer++ to store next data.
but compiler says " attribute "section" does not apply to automatic variables" when i create i struct localy. its works only when i make telemetryStruct a global variable. but i suppose i wont be able to write a numerous data in the emif using this way.
Please help me to solve this problem.
EDIT 1:
When i tried to save changes to a global variable, changes didnt work, and in the memory map value at the adress is 0, but the value name is "emifed"
uint32_t emifed __attribute__((section(".sysmem")));
void (){
emifed = 2;
}

