CodeWarrior 10.6 - MCF52259: stdio.h link fail

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

CodeWarrior 10.6 - MCF52259: stdio.h link fail

Jump to solution
1,794 Views
benhouston
Contributor III

Hi everyone,

 

New to the Freescale MCU development process and Codewarrior 10.6 IDE.

 

I am trying to get basic sanity around the ColdFire V2 MCF52259 using Processor Expert by creating a Hello World program.

 

In my main.c I have a simple printf statement with Hello World and have included stdio.h.

At compile time I receive a link fail error for stdio.h.  Without the printf and stdio.h, the program is back to the auto generated default and the program compiles fine.

 

I've gone in and looked at the Librarian settings in the Project properties and EWL has been selected.  According to what I've read online, this is expected and needed.

 

At this point, I'm thinking either I'm missing something very trivial in the project setup process, or projects created using Processor Expert do not support standard lib inclusions in the main.c and there is a different interface to use when outputting to the console.

 

Any thoughts?

Labels (1)
0 Kudos
1 Solution
410 Views
DavidS
NXP Employee
NXP Employee

Hi Ben,

You are on the right track but needed to add a few headers and "C" file to enable printf capability.

It has been long time since I've done this and worked with ColdFire.

In general I found the files in the CW10.6.4 path and copied them into the project.  Like many things in life, you probably could do this differently and potentially more efficiently so I'll leave that as exercise for your choosing.

The ZIP of the project is attached.  I used the TWRMCF52259 Tower kit as my hardware as FYI and that means I used the TWR-SER port which is tied to MCF52259 UART1.

If you are new to Freescale and tools enablement, I might suggest looking at the Kinetis portfolio as it is the latest and greatest.  http://www.freescale.com/kinetis .

ColdFire is a great MCU/MPU architecture but is now mostly on maintenance for production based customers.  A good start might be the Kinetis K60 family.

Regards,

David

View solution in original post

2 Replies
411 Views
DavidS
NXP Employee
NXP Employee

Hi Ben,

You are on the right track but needed to add a few headers and "C" file to enable printf capability.

It has been long time since I've done this and worked with ColdFire.

In general I found the files in the CW10.6.4 path and copied them into the project.  Like many things in life, you probably could do this differently and potentially more efficiently so I'll leave that as exercise for your choosing.

The ZIP of the project is attached.  I used the TWRMCF52259 Tower kit as my hardware as FYI and that means I used the TWR-SER port which is tied to MCF52259 UART1.

If you are new to Freescale and tools enablement, I might suggest looking at the Kinetis portfolio as it is the latest and greatest.  http://www.freescale.com/kinetis .

ColdFire is a great MCU/MPU architecture but is now mostly on maintenance for production based customers.  A good start might be the Kinetis K60 family.

Regards,

David

410 Views
benhouston
Contributor III

Here is the console output from the build.  Perhaps it is not stdio.h causing the problem, but instead a UART driver instantiation issue.

**** Build of configuration RAM for project cw10x_getting_started_v2 ****

"C:\\Freescale\\CW MCU v10.6.4\\gnu\\bin\\mingw32-make" -j8 all

'Building file: ../Sources/main.c'

'Executing target #2 ../Sources/main.c'

'Invoking: ColdFire Compiler'

"C:/Freescale/CW MCU v10.6.4/MCU/ColdFire_Tools/Command_Line_Tools/mwccmcf" @@"Sources/main.args" -o "Sources/main_c.obj" "../Sources/main.c" -MD -gccdep

'Finished building: ../Sources/main.c'

' '

'Building target: cw10x_getting_started_v2.elf'

'Executing target #11 cw10x_getting_started_v2.elf'

'Invoking: ColdFire Linker'

"C:/Freescale/CW MCU v10.6.4/MCU/ColdFire_Tools/Command_Line_Tools/mwldmcf" -o "cw10x_getting_started_v2.elf" @@"cw10x_getting_started_v2.args"  

C:/Freescale/CW MCU v10.6.4/MCU/ColdFire_Tools/Command_Line_Tools/mwldmcf|Linker|Error

>Undefined : "InitializeUART"

>Referenced from "__init_uart_console" in

C:/Freescale/CW MCU v10.6.4/MCU/ColdFire_Tools/Command_Line_Tools/mwldmcf|Linker|Error

>Undefined : "WriteUARTN"

>Referenced from "__write_console" in

C:/Freescale/CW MCU v10.6.4/MCU/ColdFire_Tools/Command_Line_Tools/mwldmcf|Linker|Error

>Link failed.

Errors caused tool to abort.

mingw32-make: *** [cw10x_getting_started_v2.elf] Error 1

0 Kudos