how we enable standard printf() IO in IMXRT1060 SDK code without using LPUART ?

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

how we enable standard printf() IO in IMXRT1060 SDK code without using LPUART ?

Jump to solution
1,475 Views
naresh2
Contributor I

Hi,

 

i am using IMXRT1062, IAR IDE is 8.40.1

how we enable printf() IO console in IMXRT1062, SDK code without using LPUART, in my custom board i don't have UART. I have done semihost configuration in the IAR IDE but i am not able get printf in the debug terminal window.

 

please help me out on this

0 Kudos
Reply
1 Solution
1,470 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @naresh2 ,

   It's easy, just take the SDK hello_world project as an example, please check my following picture:

kerryzhou_0-1655900985418.png

You can see, after the modification:

#define SDK_DEBUGCONSOLE DEBUGCONSOLE_REDIRECT_TO_TOOLCHAIN

The printf is into the IAR console window.

 

Wish it helps you!

Best Regards,

Kerry

 

View solution in original post

0 Kudos
Reply
3 Replies
1,471 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @naresh2 ,

   It's easy, just take the SDK hello_world project as an example, please check my following picture:

kerryzhou_0-1655900985418.png

You can see, after the modification:

#define SDK_DEBUGCONSOLE DEBUGCONSOLE_REDIRECT_TO_TOOLCHAIN

The printf is into the IAR console window.

 

Wish it helps you!

Best Regards,

Kerry

 

0 Kudos
Reply
1,465 Views
naresh2
Contributor I

Hi kerryzhou,

Thanks for the quick response. I have configured as per your suggestion its not working, i am not able to see console.

i am using IMXRT1062 customized board, i dont have LPUART.


#define DEBUGCONSOLE_REDIRECT_TO_TOOLCHAIN 0U 

the above macro should be 0U or 1U, please let me know ?

#ifndef SDK_DEBUGCONSOLE
#define SDK_DEBUGCONSOLE DEBUGCONSOLE_REDIRECT_TO_TOOLCHAIN
#endif

Note: in SDK Hello world example code i have checked,  they are  mapping with LPUART1

i have attached images  please have a look, please help me out on this

 

 

0 Kudos
Reply
1,458 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @naresh2 ,

  No, you misunderstand it, when you modify the sdk :

SDK_2_11_1_EVK-MIMXRT1060\boards\evkmimxrt1060\demo_apps\hello_world\iar

#define SDK_DEBUGCONSOLE DEBUGCONSOLE_REDIRECT_TO_TOOLCHAIN

The printf will print to the IAR console: terminal I/O

This is my testing with the above sdk on my MIMXRT1060-EVK board:

 

kerryzhou_0-1655944936789.png

 

You can see, the real uart didn't receive the data now, it all loop to the IAR terminal I/O.

If you have the MIMXRT1060-EVK board, you totally can test it.

Please also make sure your IAR version matches the SDK:

IAR Embedded Workbench for Arm, version is 9.20.2

All the picture which I share with you is from my testing with RT1060.

Wish it helps you!

Best Regards,

Kerry

 

 

0 Kudos
Reply