Hi, I've asked this same question a couple of times before and haven't got a single answer. I'm surprised if nobody has ever done this. So, here it is again: I have the 8k internal RAM of the EZ-USB FX chip to use. I debug with the monitor which takes up half the RAM. I want to have every byte that remains. There are gaps in the monitor memory usage, so how do I link to use them? Thanks, Harri
If they're truly gaps in RAM, that is space used to hold data variables and not executable code then they may be reserved by the monitor and thus not to be used by the user. If you are sure that you can use those locations without corrupting the monitor, then use the _at_ directive to place variables at precise locations in memory. Or, just get an emulator and dispense with the monitor altogether. - Mark
Thanks Mark. What I really look for is to exclude the monitor areas with some linker directives. There's a map file of the monitor in the same package the monitor hex file is from. I'd like to use this info so that I can just add variables & code and the linker takes care of the allocations. Is there a way to simulate eg. DON'T_USE(0x11c0-0x11df)? Harri
You could make a c module and just allocate memory at those area(s) using the _at_ directive. as an example: char dummy[50] _at_ 0x1100; You don't have to access the dummy array anywhere, but it will be reserved by the linker.
Is there a way to simulate eg. DON'T_USE(0x11c0-0x11df)? Since the monitor is separately linked (I assume) you can use the following trick:
// Put this in your globals.c file // and add to your project (g_ denotes a global var). const unsigned char g_dontUse[0x11DF -0x11C0] _at_ 0x11C0;
WHOOPS! Don't for get the memory space qualifier like I did:
const unsigned char xdata g_dontUse[0x11DF -0x11C0] _at_ 0x11C0;
You could specify the code ranges that are available to your program. Refer to the following knowledgebase entry for details: http://www.keil.com/support/docs/1450.htm Also, as far as I know, there are not any empty gaps in the monitor. Keil Support