-
Notifications
You must be signed in to change notification settings - Fork 29
Description
Almost every SDK examples uses PRINTF macro to forward debug messages.
As an example
mcux-sdk-examples/evkbimxrt1050/freertos_examples/freertos_hello/freertos_hello.c
Line 65 in e69523c
PRINTF("Hello world.\r\n"); |
This macro is expanded based on SDK_DEBUGCONSOLE
https://github.com/nxp-mcuxpresso/mcux-sdk/blob/78064ea443c7f4523e995e4b7f4ef8b9bfb47974/utilities/debug_console/fsl_debug_console.h#L39-L42
But when DEBUGCONSOLE_REDIRECT_TO_SDK
is selected, the implementation follows this chain:
PRINTF
>> DbgConsole_Printf
>> ... >> SerialManager_WriteBlocking
https://github.com/nxp-mcuxpresso/mcux-sdk/blob/78064ea443c7f4523e995e4b7f4ef8b9bfb47974/components/serial_manager/fsl_component_serial_manager.c#L1713-L1720
and then Serial_UartWrite
https://github.com/nxp-mcuxpresso/mcux-sdk/blob/78064ea443c7f4523e995e4b7f4ef8b9bfb47974/components/serial_manager/fsl_component_serial_port_uart.c#L287
then HAL_UartSendBlocking
https://github.com/nxp-mcuxpresso/mcux-sdk/blob/78064ea443c7f4523e995e4b7f4ef8b9bfb47974/components/uart/fsl_adapter_iuart.c#L327
and this falls to UART_WriteBlocking
https://github.com/nxp-mcuxpresso/mcux-sdk/blob/78064ea443c7f4523e995e4b7f4ef8b9bfb47974/drivers/iuart/fsl_uart.c#L681
I would like knowing if NXP designed this kind of macro expansion so that is there an easy way to have it falling back to some functions from FreeRTOS implementation
https://github.com/nxp-mcuxpresso/mcux-sdk/blob/78064ea443c7f4523e995e4b7f4ef8b9bfb47974/drivers/iuart/fsl_uart_freertos.c