Content originally posted in LPCWare by g_mocken on Wed Jul 16 05:55:33 MST 2014 Hi,
I know how to run individual functions of my own code from RAM (see here), but is there also a simple way to relocate an existing function in the CMSIS-DSP library to RAM without modifying the Library source code and recompiling it?
Content originally posted in LPCWare by g_mocken on Thu Jul 24 01:49:17 MST 2014 Thanks a lot, using the provided link_template.ld seems to work, and the performance boost is impressive, too.
Content originally posted in LPCWare by lpcxpresso-support on Wed Jul 16 07:17:55 MST 2014 You will need to modify the linker script or linker script template to explicitly include/exclude the appropriate code sections in the appropriate memory. For more information, see:
But anyway, the attached project does exactly this using a linker script template. The key bits to note are that in the .text output section, the input section description:
*(.text*)
has been changed to:
*(EXCLUDE_FILE(*libCMSIS_DSPLIB_CM4.a:) .text*)
Then later in the script template, an extra .data output section has been added, to place the DSP functions into:
Check the map file after building to see where the code has been placed.
The actual code in the project is the standard CMSIS_DSP "arm_class_marks_example_f32.c" example. See the CMSIS documentation for details.
The project has been created for the LPC4337. But you should be able to copy the source into a project of your own for a different MCU, and also copy the linkscripts folder (and its template) into your own project too.