Redirect printf() to lpuart

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

Redirect printf() to lpuart

跳至解决方案
1,741 次查看
KhaledG
Contributor I

I try to redirect printf() to lpuart3 to use it in the bootloader on a costumed board. So i imported a SDK example but it didn’t work.

image (3).pngimage (4).png

image (5).png

 

The microcontroller i use is a MIMXRT1024CAG4A not a MIMXRT1024DAG5A how I can change it.

 

image (10).png

What I did wrong?

Thanks in advance.

0 项奖励
回复
1 解答
1,710 次查看
jingpan
NXP TechSupport
NXP TechSupport

Hi @KhaledG ,

You should set SDK_DEBUGCONSOLE 0 0. It means DEBUGCONSOLE_REDIRECT_TO_TOOLCHAIN.

I can use printf to print out via lpuart1 on my evk.

(I havent rt1024 evk, so I use rt1170 evk to make the demo.)

 

Regards,

Jing

在原帖中查看解决方案

0 项奖励
回复
4 回复数
1,724 次查看
jingpan
NXP TechSupport
NXP TechSupport

Hi @KhaledG ,

Except change in config tools, you should also modify the code.

For example, BOARD_DEBUG_UART_INSTANCE in board.h.

 

Regards,

Jing

1,717 次查看
KhaledG
Contributor I

Hi @jingpan,
Even if I do it still doesn’t work. It was necessary that I add xip devices and xip board. Now PRINTF() works but not printf().
Are there any changes needed to make printf() work?
Thank you.

0 项奖励
回复
1,711 次查看
jingpan
NXP TechSupport
NXP TechSupport

Hi @KhaledG ,

You should set SDK_DEBUGCONSOLE 0 0. It means DEBUGCONSOLE_REDIRECT_TO_TOOLCHAIN.

I can use printf to print out via lpuart1 on my evk.

(I havent rt1024 evk, so I use rt1170 evk to make the demo.)

 

Regards,

Jing

0 项奖励
回复
1,698 次查看
KhaledG
Contributor I

Hi @jingpan,
PRINTF() works thank you. To use printf() i added  SDK_DEBUGCONSOLE_UART in Project → Properties → C/C++ Build → Settings →Tools settings→Preprocessor.
Thanks for help.

0 项奖励
回复