Switch SDK Debug Console to UART

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Switch SDK Debug Console to UART

ソリューションへジャンプ
5,313件の閲覧回数
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 解決策
3,592件の閲覧回数
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)

元の投稿で解決策を見る

1 返信
3,593件の閲覧回数
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)