Running a CMSIS-DSP-Library function from RAM

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Running a CMSIS-DSP-Library function from RAM

1,001 次查看
lpcware
NXP Employee
NXP Employee
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?

Guido
0 项奖励
回复
2 回复数

909 次查看
lpcware
NXP Employee
NXP Employee
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.
0 项奖励
回复

909 次查看
lpcware
NXP Employee
NXP Employee
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:

http://www.lpcware.com/content/faq/lpcxpresso/own-linker-scripts
http://www.lpcware.com/content/faq/lpcxpresso/linker-script-templates

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:

.data : ALIGN(4)
{
   FILL(0xff)
   . = ALIGN(4) ;
   *libCMSIS_DSPLIB_CM4.a:(.text*)
   . = ALIGN(4) ;
} >  ${DATA} AT>${CODE}


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.

Note that in order to build this example, you will need to have imported the 'CMSIS_DSPLIB_CM4" project into your workspace too. For background information, see http://www.lpcware.com/content/faq/lpcxpresso/cmsis-dsp-library

Regards,
LPCXpresso Support
0 项奖励
回复