Dropped UART rx packets on Apalis imx8qm

Hi, I’m the Toradex AI Assistant.

I might make mistakes or occasionally get you wrong. Our support team will step in if needed.


Based on your UART packet dropping issue on ttyLP0 with the Apalis iMX8QM, let me address your questions about enabling DMA and using device tree overlays.

Device Tree Overlay Approach

For your DMA configuration issue, you can use device tree overlays to enable DMA on ttyLP0(1). The overlay approach is recommended for runtime modifications without rebuilding the entire device tree(2).

Creating Your Overlay

Based on the documentation, here’s the proper structure for a device tree overlay(1):

/dts-v1/;
/plugin/;

#include <soc-pinfunc.h>

/ {
    compatible = "toradex,apalis-imx8";
};

&node {
    pinctrl-names = "default";
    pinctrl-0 = <&pinctrl_my_pins>;
    status = "okay";
};

(1)

Common Overlay Issues

A critical point from the community experience is avoiding syntax errors in the &iomuxc node structure(3). Make sure your overlay doesn’t include unnecessary subnode wrappers that can cause conflicts with other peripherals(3).

Compilation and Deployment Options

Using TorizonCore Builder (Recommended)

For Torizon OS, you can use TorizonCore Builder for overlay compilation and deployment(1):

$ torizoncore-builder dto apply custom-overlay.dts

(1)

Or use the build command with a tcbuild.yaml file(1):

customization:
  device-tree:
    include-dirs:
      - device-trees/include/
    overlays:
      add:
        - your-dma-overlay.dts

(1)

Manual Compilation

If you need to compile manually, you can use the Device Tree Compiler (dtc)(4):

$ make DTC_FLAGS="-@" freescale/<custom-device-tree>.dtb

(4)

Deployment Strategies

You have two main deployment options(4):

  1. Deploy to Running Device: Copy the compiled overlay to /boot and apply it
  2. Deploy to Static Image: Integrate the overlay into your production image

For development and testing, deploying to a running device is more convenient(4).

Recommendations

  1. Use TorizonCore Builder: It provides integrated compilation and deployment in a single step(1)
  2. Overlay vs Full Device Tree: Overlays are preferable for isolated changes like enabling DMA, as they don’t require rebuilding the entire device tree(2)
  3. Test Incrementally: Start with a minimal overlay that only enables DMA, then expand if needed

The packet dropping at 921600 baud with 8KB transfers every 2.5-3 seconds suggests the UART buffer is being overwhelmed without DMA assistance. Enabling DMA should resolve this issue by offloading the data transfer from the CPU.

Best regards,
Toradex AI Assistant.


Did you like my answer? :+1: :-1:

If I answered your question, please tick the “Solution” checkbox.

For follow-up questions to me, please use @ToradexAI in your post.