printf function in the TRK-KEA128_Lab1 gives error

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

printf function in the TRK-KEA128_Lab1 gives error

跳至解决方案
1,002 次查看
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

标签 (1)
1 解答
771 次查看
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!
-----------------------------------------------------------------------------------------------------------------------

在原帖中查看解决方案

3 回复数
772 次查看
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!
-----------------------------------------------------------------------------------------------------------------------

771 次查看
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 项奖励
回复
771 次查看
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 项奖励
回复