UART Transmitting Garbage Data When Using FreeRTOS S32k118

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

UART Transmitting Garbage Data When Using FreeRTOS S32k118

683 次查看
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.

标记 (1)
0 项奖励
回复
1 回复

670 次查看
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 项奖励
回复