Linker command file problem - MPC5644A

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Linker command file problem - MPC5644A

812 Views
janos_murai
Contributor III

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

Labels (1)
2 Replies

524 Views
stanish
NXP Employee
NXP Employee

Hello 

Seems you are trying to add your custom section into .lcf am I right?

If your custom section should contain a code please make sure:

1) you use this pragma in your C code:

   #pragma code_type ".foo"

2) the custom section should be defined in .lcf as VLECODE (assume you are building VLE code): 

.foo (VLECODE) LOAD ...

Hope it helps.

Stan

524 Views
janos_murai
Contributor III

Stan,

Thank you for your answer!
As you suggested I changed the pragma in the c source from:
#pragma section code_type ".ivor_branch_table_p0"
to
#pragma code_type ".ivor_branch_table_p0"
(So I removed the “section” expression), and now it doesn’t throw that error.
Although, I don’t understand why…
If you create a new Bare-board project with CW, it generates the .lcf file and the ivor_branch_table.c file. In the c file the pragma contains the “section” expression too and of course it works that way. So what’s the point of “section”?

Yes, I build VLE code and I'd like to extend the lcf file later.

János

0 Kudos