My project uses LPC54S018J4M built with Keil MDK, but this is a general question for NXP LPC MCUs. I have found https://www.keil.com/support/man/docs/armlink/armlink_chunk1880490665.htm that describes how to relocate a specific function to SRAM. I would like to know if there is any way to relocate entire objects or libraries to SRAM without specifying directives in front of every function.
Context: I have an application image that resides in internal SPIFI flash, in some higher memory address. A project requirement prevents the application image from being a plain image. I need to execute a large portion of code from SRAM to ensure good performance. The same code does not run fast enough in XIP mode. Some of the code that needs to be relocated to SRAM includes SDK files. I prefer to not update SDK files with directives in front of each function. It would be best if there is a way to specify relocating entire *.o to SRAM.
Any suggestion would be greatly appreciated.
Rex
Because this is a quite toolchain-specific question, I would ask it on the Keil forum as well.
My company uses the IAR WB for some projects, which has a specific __ramfunc keyword to execute code from RAM. Not sure how Keil supports this.
> I prefer to not update SDK files with directives in front of each function. It would be best if there is a way to specify relocating entire *.o to SRAM.
I suspect you most likely need to, unless you you can accept unnecessary "ballast" when moving whole modules to RAM.
Would moving critical code to the parallel Flash be an option ? You would just need to modify the linker settings / scatter file for that purpose.
Thank you for the suggestion. I posted the question on Keil forum and received a link that shows how to accomplish this at https://www.keil.com/support/man/docs/armlink/armlink_pge1362065974588.htm.