printf function in the TRK-KEA128_Lab1 gives error

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

printf function in the TRK-KEA128_Lab1 gives error

Jump to solution
999 Views
ddpd
Contributor III

I am trying to debug the code of the example Lab1. I know its not the correct way.

Just wanted to ensure the correctness of the modified example program.

 

Basically I am trying to read and write from the UART line from my PC using a software C code.

 

I am getting this error

 

ARM_GCC_Support/ewl/EWL_C/src/sys/uart_console_io.c:200: undefined reference to `InitializeUART'

C:/Freescale/CW MCU v10.6/MCU/ARM_GCC_Support/ewl/lib/armv6-m\libuart.a(uart_console_io.o): In function `__read_console':

ARM_GCC_Support/ewl/EWL_C/src/sys/uart_console_io.c:93: undefined reference to `ReadUARTN'

C:/Freescale/CW MCU v10.6/MCU/ARM_GCC_Support/ewl/lib/armv6-m\libuart.a(uart_console_io.o): In function `__init_uart_console':

ARM_GCC_Support/ewl/EWL_C/src/sys/uart_console_io.c:200: undefined reference to `InitializeUART'

C:/Freescale/CW MCU v10.6/MCU/ARM_GCC_Support/ewl/lib/armv6-m\libuart.a(uart_console_io.o): In function `__write_console':

ARM_GCC_Support/ewl/EWL_C/src/sys/uart_console_io.c:151: undefined reference to `WriteUARTN'

mingw32-make: *** [TRK-KEA128_Lab1.elf] Error 1

 

I didn't get any satisfying answer from the previous blogs.

Please help me out in sorting this issue.

Thanks in advance

Labels (1)
1 Solution
768 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi,

I just downloaded TRK-KEA128_LABTS1.zip from this url:

http://cache.freescale.com/files/microcontrollers/software/board_support_packages/TRK-KEA128_LABTS1....

I built it with CW10.6.4, there is no error.

if you want to use printf(), please pay attention to these points:

1. we need add

#include <stdio.h>

in your project.

2. if you want to print to console, choose ewl_hosted library model

pastedImage_3.png

3. "\n" is necessary to be added to the end of the string that we need printed out:

pastedImage_4.png

does this answer your question? If yes, please click the Correct Answer button. Thank you!


Have a great day,
Zhang Jun

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

View solution in original post

3 Replies
769 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi,

I just downloaded TRK-KEA128_LABTS1.zip from this url:

http://cache.freescale.com/files/microcontrollers/software/board_support_packages/TRK-KEA128_LABTS1....

I built it with CW10.6.4, there is no error.

if you want to use printf(), please pay attention to these points:

1. we need add

#include <stdio.h>

in your project.

2. if you want to print to console, choose ewl_hosted library model

pastedImage_3.png

3. "\n" is necessary to be added to the end of the string that we need printed out:

pastedImage_4.png

does this answer your question? If yes, please click the Correct Answer button. Thank you!


Have a great day,
Zhang Jun

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

768 Views
ddpd
Contributor III

Thanks ZhangJennie.

Yes I wanted to print in the console. The output was displayed in the console after changing the settings to ewl_hosted.

0 Kudos
Reply
768 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

you are welcome!


Have a great day,
Zhang Jun

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

0 Kudos
Reply