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 want to reserve memory region for specific data. So I edit the scatter file and I add following line to the scatter file.
; ************************************************************* ; *** Scatter-Loading Description File generated by uVision *** ; *************************************************************
LR_IROM1 0x08000000 0x00040000 { ; load region size_region ER_IROM1 0x08000000 0x00040000 { ; load address = execution address *.o (RESET, +First) *(InRoot$$Sections) .ANY (+RO) } RW_IRAM1 0x20000000 0x00040000 { ; RW data .ANY (+RW +ZI) } RW_IRAM2 +0 EMPTY 0x10000 // I ADD THIS SECTION ! {
} }
My first question is, Is this way is true for reserve memory region ? second question is, independent from first question, How can I access this memory region (RW_IRAM2) from c code ?
Thanks for your answers ! Best Regards.
Thanks for your reply.
Actualy, I will use this memory for updating the firmware. Our plan is like : We store new firmware in this memory, then in boot mode, we read new firmware from this memory region.
I dont understand your comment's last section. What does it mean Use structure/pointers? Use #pramga or attributes? Could you explain in more detail ?
Best Regards.
If you're remotely curious about how things work review the docs or use Google/Bing to find details.
You can use the scatter file to direct objects/sections to specific load region. You can use #pragma or attributes to control where
www.keil.com/.../armclang_ref_cmf1493390581125.htm www.keil.com/.../armclang_intro_pge1362066000009.htm
FirmwareStuct *FW = (FirmwareStuct *)0x2001C000; uint8_t *FWBuffer = (uint8_t *)0x20024000; uint8_t *SlackSpace = (uint8_t *)&Image$$RW_IRAM2$$Base;
You might want to consider better ways to stage firmware for update or OTA implementations as SRAM is usually smaller than FLASH.
Thanks for your answers ! Really helped me .