AnsweredAssumed Answered

Linker command file problem - MPC5644A

Question asked by Ferenc Kovacs on Jan 20, 2017
Latest reply on Jan 20, 2017 by Ferenc Kovacs

Dear all,

 

I'd like to create an MQX test application on an MPC5644A MCU. In order to configure the memory usage, I modified the "shipped" lcf file.  

My problem is that wherever I use the section ".Foo" expression, the linker throws the following error:

 Linker command file output section '.Foo' has a type or input which is incompatible with section '.__Foo' in file ... Change the type or add an input for this section. 

 

For example I'd like set where to put the interrupt table. The relevant part of my lcf file:

  1. MEMORY
  2. {
  3.     resetvector:           org = 0x00000000,   len = 0x00000008
  4.     init:                  org = 0x00000010,   len = 0x0000FFF0 /*64K */
  5.     exception_handlers: org = 0x00010000,   len = 0x0030000 /* 192K */
  6.  
  7.     internal_flash:        org = 0x00040000,   len = 0x003C0000 /* 3840K */
  8.  
  9.     internal_ram:          org = 0x40000000,   len = 0x00020000
  10.     heap  :                org = 0x40020000,   len = 0x00008000
  11.     stack :                org = 0x40028000,   len = 0x00008000
  12.  
  13.     end_of_kd:             org = 0x4001DFF0,   len = 0x00000000
  14. }
  15.  
  16. FORCEACTIVE { "bam_rchw" "bam_resetvector"}
  17.  
  18. SECTIONS
  19. {
  20.    GROUP : {
  21.         .intc_hw_branch_table (VLECODE) LOAD (ADDR(exception_handlers)) ALIGN (0x10) : {}
  22.         .ivor_branch_table_p0 (VLECODE) LOAD (_e_intc_hw_branch_table) ALIGN (0x10) : {}
  23.         .__exception_handlers (VLECODE) LOAD (_e_ivor_branch_table_p0) : {}
  24.    } > exception_handlers
  25.  
  26. }
  27.  
  28. __IVPR_VALUE = ADDR(exception_handlers);
  29.  
  30. EXCEPTION_HANDLERS = ADDR(.ivor_branch_table_p0);

 

And in the c source code I use the following pragmas:

  1. #pragma section code_type ".ivor_branch_table_p0"
  2. #pragma force_active on
  3. #pragma function_align 16
  4. #pragma require_prototypes off
  5.  
  6. asm void ivor_branch_table_p0(void) {
  7.   nofralloc
  8.  
  9.     ...
  10. }

 

Finally the error:

Description Resource Path Location Type
Linker command file output section '.__exception_handlers' has a type or input which is incompatible with section '.__exception_handlers' in file 'C:\Freescale\Freescale_MQX_4_2\lib\xpc564a.cw10\bsp\Debug\build-bsp_xpc564a- Debug\BSP_Files\IntcInterrupts_c.obj'. Change the type or add an input for this section. 

 

To be honest, I don't understand the lcf syntax for 100%... so any help appreciated!

 

Thank you!

 

János Murai

Outcomes