Hi XR,
Thanks for the info. I have some questions about the demo that you sent.
Files attached:
--- A text file with the memory map for the 56F8013.
--- S-record generated by the demo project you provided
1) Why does .p_flash_ROM_data start at address 0x0001 (ORIGIN) instead of 0x0000 and end at address 0x7FF instead of 0x0800? This memory is "Unified RAM" so I would expect the ORIGIN address and length of the "p_flash_ROM_data" segment to be formatted the same as the "p_internal_RAM" segment. Unless, there is a specific reason to deduct "one" from each end. I thought that maybe it was due to Word access rather than Byte access. However, that would make sense for 0x7FF but NOT for 0x0001.
.p_flash_ROM_data (RX) : ORIGIN = 0x00000001, LENGTH = 0x000007FF
#Other memory segments
.p_internal_RAM (RWX) : ORIGIN = 0x00008000, LENGTH = 0x0800
2) Why is "p_flash_ROM_data" designated as (RX) but yet it starts at 0x0001? The memory map states that executable RAM space starts at 0x8000. Yes!, they are the same memory, "Unified and overlapping". BUT, the memory map states that it should be 0x8000 for (X)=executable. In fact the LCF has an entry for (RWX) at 0x8000.
This is a really confusing sticking point. Can you consult with the DSC compiler group for a definitive answer to this?
3) I enabled S-record generation in the demo project that you provided and compiled it in CW8.3. The demo generates entries in the S-record starting at 0x00008000. How can I suppress these RAM-based entries? I am downloading this to flash using a "custom" boot-loader. The app must then be responsible for copying out the data to RAM. So, I want the "Ram Functions Image" in flash. I want the linker to "know" that the final destination is RAM. But, I do not want any RAM entries put into the S-record.
4) Looking at the demo project you provided, the flash programming function is literally written twice, once for flash once for RAM.
static asm void Run_and_wait_in_prog_flash(dword address, word data, word command)
static asm void Run_and_wait_in_RAM(dword address, word data, word command)
This seems very odd?!?!?!
The linker should be able to manage this without duplicating the code.
Why maintain code in two places?
Perhaps the explanation of this will be part of eliminating the unwanted S-record entries in question 3 ?!?
Regards,
J