Intermittent TX/RX Error Debugging Guide
1. Check the Target UART Device-Tree Node Path
Run the following command to find the exact node path for your target UART port:
Bash
readlink -f /sys/class/tty/ttyTHS1/device/of_node
This will output a path like /bus@0/serial@3100000. Note: The address may vary depending on your model/board, so always check it directly (do not guess or use hardcoded example values).
2. Create the Overlay Source
Create and edit the overlay source file:
Bash
sudo vi uart-overlay.dts
Add the following content:
DTS
/dts-v1/;
/plugin/;
/ {
compatible = "nvidia,p3768-0000+p3767-0000", "nvidia,p3767-0000", "nvidia,tegra234";
fragment@0 {
target-path = "/bus@0/serial@3100000";
__overlay__ {
dma-names = "unused-rx", "unused-tx";
};
};
};
- Use
target-path (string path): While target = <&{/path}> (phandle reference) works syntactically, it is more fragile as it relies on symbol resolution.
- Override
dma-names: Overriding the DMA channel names with values different from what the driver expects ("rx"/"tx") causes name matching to fail. Once matching fails, the driver automatically falls back to non-DMA mode.
- Leave
dmas untouched: You don’t need to touch dmas since a failed name match prevents the subsequent array from being read.
- Update the address: Make sure to replace
serial@3100000 with the actual path verified in Step 1.
3. Compile and Verify
Compile the overlay and check the decompiled output:
Bash
sudo dtc -I dts -O dtb -o uart-overlay.dtbo -b 0 -@ uart-overlay.dts
sudo dtc -I dtb -O dts -f uart-overlay.dtbo
(The -f option ignores harmless __fixups__-related errors and forces output).
Crucial Check: Inspect the decompiled output to verify that dma-names = "unused-rx\0unused-tx"; actually exists inside the __overlay__ { } block. If it is empty, the overlay was not applied, and you must not proceed to the next step.
4. Deploy
Back up any existing file and copy the new overlay to the boot directory:
Bash
sudo cp /boot/uart-overlay.dtbo /boot/uart-overlay.dtbo.bak # Backup if exists
sudo cp uart-overlay.dtbo /boot/uart-overlay.dtbo
Ensure that the following line exists under LABEL primary in /boot/extlinux/extlinux.conf (add it if missing):
Plaintext
OVERLAYS /boot/uart-overlay.dtbo
- Note: Never touch the base
FDT line. The original dtb remains untouched, meaning the system will still boot normally even if the overlay fails.
5. Reboot and Final Verification
Reboot the system:
Bash
sudo reboot
After rebooting:
Bash
# Check if the overlay took effect (verify if the property has been overwritten)
cat /proc/device-tree/bus@0/serial@3100000/dma-names
# Restart AMS and verify MAVLink reception
sudo systemctl restart ams
journalctl -u ams -f
If HEARTBEAT (id=0) prints regularly every second, the issue is resolved.
Troubleshooting
1. Decompilation Error: ERROR (property_name_chars): /__fixups__:... Bad character '/' in property name
This is not an issue with overlay compilation itself, but rather a cosmetic error that dtc encounters when converting __fixups__ (phandle reference resolution metadata) back to dts. Use dtc -I dtb -O dts -f to force output and inspect the actual contents.
2. dmas properties remain unchanged in /proc/device-tree/.../ after reboot
- U-Boot/cboot overlay application logs often do not appear in Linux
dmesg, so you cannot judge success/failure using dmesg | grep overlay. Always verify using live values in /proc/device-tree.
- First, check if the
md5sum of /boot/uart-overlay.dtbo matches the newly compiled file (the cp command itself may have failed).
- Directly decompile the deployed file using
sudo dtc -I dts -O dts -f /boot/uart-overlay.dtbo to check if the contents actually exist inside __overlay__. If it is empty, restart from the compilation stage (Steps 2–3).
3. Getty / Kernel Console might be hogging the same port
Though unrelated to DMA issues, it’s worth checking:
Bash
systemctl status serial-getty@ttyTHS1.service # If active, the console is sharing the port
cat /proc/cmdline | grep console # Check if an entry like console=ttyTHS1 exists