Switch SDK Debug Console to UART

cancel
Showing results for 
Search instead for 
Did you mean: 

Switch SDK Debug Console to UART

Jump to solution
4,340 Views
deniscollis
Contributor V

Environment:  MCUXpresso, K81 target, Segger J-Link debug probe, 

Reference: MCUXpresso IDE and Semihosting

With Semihosting the printf output appears in the MCUXpresso Console, as expected.  However, when I switch to UART (Quick Settings -> SDK Debug Console -> UART Console) no output is seen on the LPUART.   With UART selected, no output is sent to the MCUXpresso Console, as expected. 

I have checked that the  SDK_DEBUGCONSOLE define is correctly set (Quick Settings -> Defined Symbols).

I have also checked that the LPUART settings (In my case this is LPUART2 on PTD2/3.) are good.

 

BTW, LPUART Debug output works just fine with my projects on IAR EWARM, so I know the physical HW is OK.

1 Solution
2,619 Views
deniscollis
Contributor V

Oops!  Found the problem, it is not directly related to the routing of the debug console.  It's about printf().  The code uses DEBUG_PRINT(), defined as follows:

define DEBUG_PRINT(fmt, ...) printf("%s: " fmt, __FUNCTION__, ##__VA_ARGS__)

 I.e. it uses printf instead of PRINTF.  (Only PRINTF will work as it's defined as DbgConsole_Printf)

View solution in original post

1 Reply
2,620 Views
deniscollis
Contributor V

Oops!  Found the problem, it is not directly related to the routing of the debug console.  It's about printf().  The code uses DEBUG_PRINT(), defined as follows:

define DEBUG_PRINT(fmt, ...) printf("%s: " fmt, __FUNCTION__, ##__VA_ARGS__)

 I.e. it uses printf instead of PRINTF.  (Only PRINTF will work as it's defined as DbgConsole_Printf)