cancel
Showing results for 
Search instead for 
Did you mean: 

Move specific function to ITCM ram from library

SeyyedMohammad
Senior III

I want to move some function from library (DSP cmsis) to ITCM of MCU. I can't move it's myLib.o completely since it's big. I mean *myLib.a:*(.text .text*) (copied from AN4296). what is the right output-section-command to do my job?

Assume I want to move `void arm_lms_f32(.....)` and the objdump -t output of library file is:

arm_lms_norm_f32.o:   file format elf32-little
 
SYMBOL TABLE:
00000000 l  df *ABS* 00000000 arm_lms_norm_f32.c
00000000 l  d .text 00000000 .text
00000000 l  d .data 00000000 .data
00000000 l  d .bss  00000000 .bss
00000000 l  d .text.arm_lms_norm_f32 00000000 .text.arm_lms_norm_f32
00000000 l    .text.arm_lms_norm_f32 00000000 $t
00000000 l  d .debug_info  00000000 .debug_info
00000000 l  d .debug_abbrev 00000000 .debug_abbrev
00000000 l  d .debug_loc   00000000 .debug_loc
00000000 l  d .debug_aranges 00000000 .debug_aranges
00000000 l  d .debug_ranges 00000000 .debug_ranges
00000000 l  d .debug_line  00000000 .debug_line
00000000 l  d .debug_str   00000000 .debug_str
00000000 l  d .debug_frame  00000000 .debug_frame
00000000 l  d .comment    00000000 .comment
00000000 l  d .ARM.attributes    00000000 .ARM.attributes
00000000     *UND* 00000000 __aeabi_fmul
00000000     *UND* 00000000 __aeabi_fsub
00000000     *UND* 00000000 __aeabi_fadd
00000000     *UND* 00000000 __aeabi_fdiv
00000001 g   F .text.arm_lms_norm_f32 000002b2 arm_lms_norm_f32
 
 
arm_lms_init_q31.o:   file format elf32-little
 
SYMBOL TABLE:
00000000 l  df *ABS* 00000000 arm_lms_init_q31.c
00000000 l  d .text 00000000 .text
.
.
.

I have write the linker script for general movement of newly defined functions in .c file and required startup modification:

_sifastcode = LOADADDR(.fastcode);
  .fastcode :
  {
	  . = ALIGN(4);
	  _sfastcode = .;
	  *(.fastcode)
	  *(.fastcode*)
      /*IN BETWEEN*/
	  . = ALIGN(4);
	  _efastcode = .;
  } >ITCMRAM AT> FLASH

I just need the required command to place in between.

There is a code copied from CCM RAM application not:

*myLib.a:*(.text .text.arm_lms_norm_f32)

I've found a way to do this by:

libarm_cortexM7lfdp_math.a:arm_fir_f32.o(.txt .txt*)

But whats wrong? Since I think this doesn't work.

11 REPLIES 11

I agree, as you said we also need exclusion in including libraries. I mean why that App note does told about libraries but doesn't tell we need to exclude from flash, what we including in sram. I think it's a documentation bug/wrong_guidance, Are you agree with me too?

No docu show example how place all library into ram, in this situation exclude isnt required. Too docu show keil and iar variants etc. Skiped is variant for separate func from library, but isnt bug/wrong. GCC definition isnt only for STM and exist globaly. I agree with you, that linker scripting require learn and learn ....