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.
I'm locating a 32K variable in peripheral RAM with using this compiler/linker attribute:
__attribute__((section(".ARM.__at_0x20000000"))); //Locate in the ARM Peripheral RAM
I build the code with no errors and try to load it, The loader then says:
-----------------
Load "C:\\Users\\cordc_admin\\Documents\\Keil Projects\\Wavebuoy V5.1\\Objects\\wavebuoy_CORDC.axf" No Algorithm found for: 20000000H - 20000103H Partial Erase Done (areas with no algorithms skipped!) No Algorithm found for: 20000000H - 20000103H Partial Programming Done (areas with no algorithms skipped!) Partial Verify OK (areas with no algorithms skipped!) Application running ... Flash Load finished at 16:07:04
------------------
Which confuses me because it thinks it needs to program FLASH at that RAM address for the first 0x103 bytes. The memory map says this:
Load Region LR$$.ARM.__at_0x20000000 (Base: 0x20000000, Size: 0x00008000, Max: 0x00008000, ABSOLUTE, COMPRESSED[0x00000104]) Execution Region ER$$.ARM.__at_0x20000000 (Exec base: 0x20000000, Load base: 0x20000000, Size: 0x00008000, Max: 0x00008000, ABSOLUTE, UNINIT, COMPRESSED[0x00000104]) Exec Addr Load Addr Size Type Attr Idx E Section Name Object 0x20000000 COMPRESSED 0x00008000 Data RW 1360 .ARM.__at_0x20000000 spectral_processing_sophia_2.o
which indicates there is indeed a "Load Region" at those RAM addresses.
I have checked my Programming Algorithm definition in the ULINK Target Driver Setup, and FLASH is defined as on-chip FLASH
from 0x00000000 - 0x0007ffff for my 512K of ROM.
Can anyone explain this to me? Why does the loader think it needs to FLASH those 0x103 bytes in RAM?
Because presumably it has some content, or isnt handled as part of the load region in the scatter file.
Instead of using the AT directive, use a pointer with an address assigned to it.
Haha, that's funny. I used to assign a pointer address to the data, but my coworkers said it was "bad programming practice". I was trying to appease them. It works just fine though.
"it has some content": what is "it" and what is "content"? It's a data structure declared in a .c file. I don't think there's any code associated with it.
thanks for the help.
The linker map file will probably explain what's going on, or at least give a strong hint about what is taking up that 0x103 bytes. What does the map file say?
The ELF/AXF contains some tangible content for the block of data at 0x20000000, so not some NOINIT/NOLOAD section.
Specifying hard addresses isn't the most portable concept. The AT directives are even less portable, tending to be compiler or toolchain specific.
For data passing, or persistent data beyond the scope of the linker, I'd define as a structure and point to it. Would have code to initialize defaults for configuration data (calibration, serialization, keys, etc) in NVRAM, EEPROM or FLASH
Could also inspect dump from FromELF tool. Should be able to spit symbols and data.