UART Transmitting Garbage Data When Using FreeRTOS S32k118

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

UART Transmitting Garbage Data When Using FreeRTOS S32k118

475 Views
Arunpk
Contributor II

I attempted to send and receive data via UART using FreeRTOS. However, the transmitted data appears as random or corrupted characters, for example:
tK�Z)J�Z)J�{hK�ZtJ�ZtK�KhK�)J�Z)J�)J�)J�)J�KtK�KtK�)J�ZtJ�{hK�KtK�KtK�ZtK


My actual intended message is:
"Welcome to RTOS \r\n"

When I run the same UART communication code without FreeRTOS, it works correctly and the message is transmitted as expected.

Please assist as soon as possible to help resolve this issue.

Thank you.

Tags (1)
0 Kudos
Reply
1 Reply

462 Views
PavelL
NXP Employee
NXP Employee

Hello @Arunpk ,

You have shared your code on our system already. So, please kindly review my observations:

1. You are currently using an outdated SDK. It is recommended to migrate to the RTD (Real-Time Drivers) for better support and long-term maintainability.
2. Clock initialization is being performed inside a task. This should be done before the scheduler starts, ideally during system initialization.
3. If you are using FreeRTOS, it is preferable to use vTaskDelay(MS_TO_TICKS(1000)) instead of delay_ms(1000) to ensure proper task scheduling and timing accuracy.

Best regards,

Pavel

0 Kudos
Reply