Pardon my stupidity, but I am currently at a loss....
I am trying to port a program from uV3 to uV5.1 and am having an issue with remapping the vector table from ROM into RAM. This method works fine in uV3. The processor is an LPC2136.
Code:
int main(void) { // Copy the IVT from ROM into RAM memcpy((UINT8 *)IVT_RAM_START, (UINT8 *)IVT_ROM_START, IVT_SIZE); // Direct interrupt fetch from Static RAM. MEMMAP = 2; os_sys_init_user(StartupTask, 1, &StartupStack, sizeof(StartupStack)); }
Target Options: IROM1 0x0 0x17FE0
IRAM1 0x40000040 0x7FC0
When I enter os_sys_init_user() and it hits the SWI i get the following error: *** error 65: access violation at 0x00000008 : no 'execute/read' permission
In searching the web for this error (and keil) I found that it could be a couple of things: (1) Debug memory map need to be setup to allow. (2) The remapped RAM memory attributes are used, so RW would need to change to RO to execute.
I then proceed to 'play' with the following: -Change IRAM1 to start at 0x40000000 - NOPE. -Change Debug memory map to allow .exe at 0x40000000 - NOPE. -Create a IROM2 area at 0x40000000 for length 0x3F - NOPE. -Reserve memory with : //UINT8 RAMVectorTable[64] __attribute__ ((at(0x40000000))); - NOPE.
However, if I change MEMMAP back to FLASH and restep it works fine. This is almost driving me nuts. What am I missing here?
Debugging on real hardware or SIMULATING?
My bad....
Weston, Thank you. Soon as I saw your comment I switched back into debugger from simulator. Guess what? Functional.
Tunnel vision is NOT a good thing.