Redirect printf() to lpuart

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

Redirect printf() to lpuart

Jump to solution
1,571 Views
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 Kudos
Reply
1 Solution
1,540 Views
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

View solution in original post

0 Kudos
Reply
4 Replies
1,554 Views
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,547 Views
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 Kudos
Reply
1,541 Views
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 Kudos
Reply
1,528 Views
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 Kudos
Reply