We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hello,
i am using scatter file to make load region for RW and ZI.
ROM 0x0 { ER_RO 0x0 {
CStartUp.o (RESET, +First) * (+RO) ;*(PUBLIC_VARS) }
NVIC_DEFINE 0x480000 { irq.o (+ZI) ; only for ISRs
}
ER_RM 0x480100 { *(+RW)
ER_ZI +0 { *(+ZI) } }
Global variables are not initializing to their assigned value.
i am copying the ER_RM and ER_ZI value to RAM area :
extern unsigned int Load$$ER_RM$$Base; extern unsigned int Image$$ER_RM$$Base; extern unsigned int Image$$ER_RM$$Limit; extern unsigned int Image$$ER_ZI$$ZI$$Limit; extern unsigned int Image$$ER_ZI$$Base;
void RAMInit(void) { volatile u32 index_u32; volatile u8 *source_u32; volatile u8 *end_u32; volatile u8 *destination_u32; volatile u32 i = 0;
end_u32 = (u8*) &Image$$ER_ZI$$ZI$$Limit; destination_u32 = (u8 *) &Image$$ER_ZI$$Base; index_u32 = ((u32)(end_u32 - destination_u32));
// ZI Initialization for(i=0; i<index_u32; i++) { *(destination_u32 + i) = 0x00; }
end_u32 = (u8 *)&Image$$ER_RM$$Limit; source_u32 = (u8*)&Load$$ER_RM$$Base; destination_u32 = (u8 *)&Image$$ER_RM$$Base; index_u32 = ((u32)(end_u32 - destination_u32)); // copy word
// RW Copy if(source_u32 != destination_u32) { for(i=0; i<index_u32; i++) { *(destination_u32 + i) = *(source_u32 + i); } }