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:
And in the c source code I use the following pragmas:
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!
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.
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"
#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.