As a follow up to my earlier post, this is my current attempt at locating a variable in a section of memory that I define. Not having a lot of luck.
1. Added an entry to the default Linker Control File MEMORY directive to represent the NVRAM area as I need it like this:
MEMORY{ SDRAM: org = 0x00000000, len = 0x10000000 // 256 MB DDR SDRAM NVRAM: org = 0x10000000, len = 0x04000000 // 64 MB NVRAM SRAM: org = 0x30000000, len = 0x00008000 // 32K Internal SRAM IMMR: org = 0x80000000, len = 0x00100000 // 1 MB FLASH: org = 0xfff00000, len = 0x00800000 // 8 MB }
Then I added an entry to the default Linker Control File SECTIONS directive to create a section name for my NVRAM area (note: several GROUP entries removed for clarity):
SECTIONS{ GROUP : { .nvram_data : {} } > NVRAM GROUP : { .rosdata : {} .sdata : {} .sbss : {} } > ram}
Finally, when I declared a variable I use the __declspec (section ".nvram_data") tool like this in an attempt to locate an intiger variable (iTemp) in the NVRAM section of the address space.
__declspec (section ".nvram_data")unsigned int iTemp = 0xA5A5;
When I try to build the project I get "ERROR : unknown section name '.nvram_data'
I think I'm on the right track here but I'm obviously missing some step(s). By the way it looks like the
"#pragma section("NVRAM",read,write)" pragma has fallen out of favor (according to the CW help file) so I've not been trying to use that. Anyadvice or observations? Thanks!
~Tim