UART Transmitting Garbage Data When Using FreeRTOS S32k118

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

UART Transmitting Garbage Data When Using FreeRTOS S32k118

479件の閲覧回数
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 返信

466件の閲覧回数
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 件の賞賛
返信