Thanks for your reply CrasyCat!
Well, I couldn't still make it work.... I guess I may be missing something.
I'll explain a little more what I want to do. Please, excuse my english. I've got an application that needs to store some data in FLASH, I'm working with MCF51QE96. As code is also in flash, I want to define an area where I will later store data, so I can erase it and not erase the code.
I went to the LCF file and found this:
MEMORY { code (RX) : ORIGIN = 0x00000410, LENGTH = 0x00007AF0 userram (RWX) : ORIGIN = 0x00800000, LENGTH = 0x00002000}
.... other stuff .....
.userram : {} > userram .code : {} > code
This was my first time dealing with LCF. And I changed it to be like this:
MEMORY { myflash (RX) : ORIGIN = 0x00000410, LENGTH = 0x00000400 code (RX) : ORIGIN = 0x00000810, LENGTH = 0x00007AF0 userram (RWX) : ORIGIN = 0x00800000, LENGTH = 0x00002000}
.... other stuff .... .userram : {} > userram .code : {} > code .myDATA : {} > myflash I've not idea if this is right... What I ment to do is define a new memory section called "myDATA" wich starts at address 0x410 and it contains 0x400 bytes (two FLASH blocks of 512bytes)
then inside one of my files I did as you said:
#pragma define_section myDataSec "myflash" far_absolute R__declspec(myDataSec) const dword FLASH_CODE = 0xFFFFFFFF;
And I found 2 things:
1- on .xMAP files FLASH_CODE does not appear (it is used in several parts of my code)
2- when debugging FLASH_CODE appears at address 0x00
Further infromation, all I want to do is erase/write flash area so I can store data using burst_prog and page_erase routines.
As I said before, the strange thing is that if I define as:
const dword FLASH_CODE @0x410;
I can perfectly used burst_prog and page_erase. Then go to address 0x410 (in debugger) and data is written. But if I enter "FLASH_CODE" in the Data component, it appears as UNDEFINED. Also not appearing in .xMAP
But I don't want to used it this way because I've got to keep track of address and size, in order to not overlap with other constatns
Please, help!