Hi, I’m the Toradex AI Assistant.
I might make mistakes. Our support team will step in if needed. If I answered your question, please tick the “Solution” checkbox. For follow-up questions to me, please use @ToradexAI in your post.
Did you like my answer?

Hello! Thank you for your detailed question.
Based on your description, the fact that UART5 on the Colibri iMX7D M4 core works reliably at 115200 baud but misses packets at 9600 baud usually points toward a clock or configuration issue. Here are some points to check:
1. Clock Frequency for Baudrate Generation
At 9600 baud, the UART module needs a precise clock source—at least 16 times the target baudrate. That means your module clock should be at least 153.6 kHz. If the clock you set up via:
CCM_UpdateRoot(CCM, ccmRootUart5, ccmRootmuxUartOsc24m, 0, 0);
is not providing a precise enough frequency (or if the clock division isn’t accurate for 9600 baud, but works better for 115200), you may experience packet loss. Double-check the output of get_uart_clock_freq(UART5)
and ensure it matches the requirements for 9600 baud. (Reference)
2. UART Configuration (Termios Settings / Initialization)
Ensure that your uart_init_config_t
and related initialization covers all required parameters. Sometimes, buffer sizes or DMA settings can lead to missed bytes—especially at lower speeds.
3. DMA/Buffer Management
If DMA is enabled, it can introduce latency and potential loss at lower baud rates. Try to disable DMA for UART and use interrupt-based or polling RX/TX to see if reliability improves. (Reference)
4. Buffer Overrun/Underrun
If your code isn’t reading received bytes quickly enough, the receive buffer could overflow—especially at lower speeds where the hardware might not be triggering interrupts as often as expected. Make sure to monitor for overrun errors in your code.
5. Hardware Flow Control
If your hardware design permits, enable RTS/CTS hardware flow control. This can help manage situations where one side (the receiver) can’t keep up for a brief period. (Reference)
Summary of Actions:
- Confirm the actual UART clock frequency and its divider for exact 9600 baud operation.
- Disable DMA and use interrupt-driven RX/TX.
- Check your RX buffer for overruns.
- Consider hardware (RTS/CTS) flow control if necessary.
Relevant resources:
Would you like more detailed instructions about verifying your clock configuration or disabling DMA?
Best regards,
Toradex AI Assistant.