Hi,
I try to simulate a target with code memory starting at 0x80000000 (LPC 2220). When I try to simulate, I get prefetch abort.
How can I tell the simulator to start at 0x80000000?
I tried "R15 = 0x80000000" in the ini file. That helps for the first start in debug mode. But when I do a reset and after that a single step, there is again a prefetch abort at 0x00000000.
How can I modify the reset vector for the simulation?
BR DW
Use a RAM.ini file that the debugger loads before starting to debug, and that sets PC = 0x80000000;
Examples of RAM.ini exists among the sample projects you got with the compiler.
Hi Per,
I use a "simulator.ini", currently containing that:
MAP 0x40000000, 0x4000FFFF READ WRITE EXEC //SRAM intern MAP 0x80000000, 0x800FFFFF READ EXEC //Flash Code MAP 0x82000000, 0x820FFFFF READ WRITE EXEC //SRAM extern FUNC void Setup (void) { PC = 0x80000000; } Setup();
After entering the debug mode, the program counter starts at the right position, but when I make a reset the PC starts at 0.
Best regards DW
Of course. The processor _always_ starts at address 0 after reset. So you either store a boot loader at the start of the flash, or you make sure to always run your ini script before starting to debug.
Next thing is that the application needs to remap the vector table into RAM, because the other vectors are also at the start of flash. The remap register maps a couple of bytes of RAM to overlap the flash address range - but the remap register gets reset to default too when you reset the processor.
The LPC2220 has no memory at address 0, cause it's a flashless device. It has two boot pins for the configuration of the external memory bank at 0x80000000. So the device boots from that address and the exception vectors are also in that address area.
I would say the simulator ignores the settings I made under OptionsForTheTarget/Target/ReadOnlyMemoryAreas:
I checked ROM1, start at 0x80000000, Size 0x800000, and I also set the startup radio button for that entry. Why doesn't the compiler use that memory area for startup? I did not specify any further ROM area.
Does anyone know how to handle this without writing a simulator specific application?
BR Detlef