Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure PRINTF macro to use drivers\fsl_uart_freertos.c #24

Open
escherstair opened this issue Feb 12, 2024 · 0 comments
Open

Configure PRINTF macro to use drivers\fsl_uart_freertos.c #24

escherstair opened this issue Feb 12, 2024 · 0 comments

Comments

@escherstair
Copy link

Almost every SDK examples uses PRINTF macro to forward debug messages.
As an example

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant