C/C++ startup for CodeWarrior and/or GCC ?

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

C/C++ startup for CodeWarrior and/or GCC ?

2,184 Views
jpa
Contributor IV

I'm in the process of (re)writing a CompactFlash boot loader, and if I knew the intimate details of the linker file and startup process, I think I could reduce the load times and memory image.  By leaving the C initialization data on the CompactFlash and performing that task in the bootloader, for instance. 

 

Are there documents that explain this for the CodeWarrior (Coldfire 52xx) and GNU compilers (recognizing that they'll be similar but different) ?

 

John

Labels (1)
4 Replies

971 Views
Jorge_Gonzalez
NXP Employee
NXP Employee

Hello John:

Not sure if I understand correctly. Are you working with both ColdFire and Kinetis?

In any case, you have the required documents in CodeWarrior installation.

GNU GCC TOOLS:


General guide on GNU compiler and linker: ..\Freescale\CW MCU v10.5\MCU\Help\PDF\MCU_Kinetis_GCC.pdf

GNU Linker file: ..\Freescale\CW MCU v10.5\Cross_Tools\arm-none-eabi-gcc-4_7_3\share\doc\gcc-arm-none-eabi\pdf\ld.pdf

GNU Compiler: ..\Freescale\CW MCU v10.5\Cross_Tools\arm-none-eabi-gcc-4_7_3\share\doc\gcc-arm-none-eabi\pdf\gcc\gcc.pdf

For the startup process you can create a new bareboard project and refer to the startup files (_arm_start.c, kinetis_sysinit.c), as well as the next file:

..\Freescale\CW MCU v10.5\MCU\ARM_GCC_Support\ewl\EWL_Runtime\src\arm\__arm_eabi_init.c

CW COLDFIRE TOOLS:


Compiler and linker information: C:\Freescale\CW MCU v10.5\MCU\Help\PDF\MCU_ColdFire_Compiler.pdf


For the startup routines, refer to the next file:

..\Freescale\CW MCU v10.5\MCU\ColdFire_Support\ewl\EWL_Runtime\Runtime_ColdFire\Source\CF_startup.c

Hope this helps.


Regards!
Jorge Gonzalez

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

971 Views
sven_kaemmer
Contributor III

Hello Jorge,

these documents are very helpful, but in the linker file syntax for Freescale Linker  the command "OBJECT" accessible. Is there an equivalent command for the GCC-Linker?

Thanks.

0 Kudos

971 Views
Jorge_Gonzalez
NXP Employee
NXP Employee

Hi John:

I think there is not an equivalent command that does the same thing as OBJECT. You want to locate specific functions according to your needs, right? In such case there is an alternative, please check the next tutorial by colleague Erich Styger:

Defining Variables at Absolute Addresses with gcc | MCU on Eclipse

and also the next threads in this community with explanations by myself:

Re: Controlling data and function placement in memory

Re: Re: Syntax to allocate memory assignments to faster memory

Hope this helps!


Regards!
Jorge Gonzalez

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

971 Views
sven_kaemmer
Contributor III

Hi Jorge,

many thanks for your reply.

Yes, I want to locate specific function at a specific position in memory. The problem is, it is a library function. So I can't use commands like "__attribute__" without rebuilding all the libraries. With the "OBJECT" command from CodeWarrior-Linker-Syntax you could place specific function at every position in memory without rebuilding some lib's.

Regards!

Sven Kämmer

0 Kudos