LPC1768 copy & execute isr from sram

Hi, Is there any example code to make the ISR to run out of SRAM. I know that it involves the following steps:

1) Copy ISR from flash to SRAM. 2) Copy vector table to SRAM 3) Remap vector table to SRAM using VTOR

I'm struggling here. Any examples for such code? I'm using the LPC1768 processor with LPCxpresso IDE/compiler. I need to do this to avoid the annoying lag when jumping to interrupt (maybe due to flash access resulting from a page fault).

--------------------------------------- Posted through

formatting link

Reply to
navman
Loading thread data ...

I was under the impression that M3 was slower executing from RAM because of load/store conflicting with ifetch. However, you'd have a similar issue accessing flash for data when executing from flash.

Peter

Reply to
Peter Dickerson

The stock LPCXpresso IDE is going to fight with you a little on this as it is going to try and make sure everything is in flash. You will have to modify the startup files, cr_startup_lpc176x.c and the files in the CMSIS library if you are using those. You can use the same method as the startup files do to move your code into ram. Look at how the static data sections are initialized from flash. You will probably have to modify the linker script to make sure the stack and other memory areas dont overlap your code. The linker scripts are created by the IDE and I'm not sure what the IDE will do when you modify them. I'm not saying it wont play nicely, just that I have never tried.

You might need to convert your project to using your own make file and linker scripts.

--
Joe Chisolm
Reply to
Joe Chisolm

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.