Quantcast
Viewing all articles
Browse latest Browse all 7401

Interfacing (DSI, CSI, I2C, etc.) • Re: CM4 UART RTS - Unexpected Behaviour

For the RTS on/off delay overrides, will the values passed into the dtoverlay string be automatically parsed as 32-bit values, i.e. would "dtoverlay=uart3,rs485,rs485_rts_on_delay="1",rs485_rts_off_delay="1"" work OK? Or will I have to explicitly declare them as 32-bit values, i.e. rs485_rts_off_delay="0xXXXXXXXX"? I was concerned that if the on delay was parsed as a 64-bit value it could overwrite the off value too, if that makes sense, if it's just addressing an array of bytes.
The use of : in the override specifies a 32bit value.
See https://www.raspberrypi.com/documentati ... #part2.2.2 for the 4 different sized options.
Hi again,

Thanks for confirming, the documentation you linked is very useful.
I've modified the kernel source and rebuilt the DTBs as part of my custom kernel build, notably:
arch/arm/boot/dts/overlays/README
arch/arm/boot/dts/overlays/uart2-overlay.dts
arch/arm/boot/dts/overlays/uart3-overlay.dts
arch/arm/boot/dts/overlays/uart4-overlay.dts
arch/arm/boot/dts/overlays/uart5-overlay.dts

I haven't made changes to uart0-overlay.dts or uart1-overlay.dts as the syntax is quite different, I'm guessing this is legacy.
I also haven't made changes to uartX-pi5-overlay.dts as I'm unable to test these due to them being Pi5-only.

From /boot/firmware/config.txt

Code:

# Configure UARTs.enable_uart=1dtoverlay=uart3,rs485dtoverlay=uart4,rs485
From the output of "$ dtc -I fs /proc/device-tree", the actual device tree entries for UART3 and UART4 after the new overlays are applied:

Code:

serial@7e201600 {arm,primecell-periphid = <0x341011>;pinctrl-names = "default";pinctrl-0 = <0x19>;clock-names = "uartclk\0apb_pclk";interrupts = <0x00 0x79 0x04>;clocks = <0x08 0x13 0x08 0x14>;linux,rs485-enabled-at-boot-time;rs485-rts-delay = <0x00 0x00>;compatible = "arm,pl011\0arm,primecell";status = "okay";reg = <0x7e201600 0x200>;phandle = <0xc9>;};serial@7e201800 {arm,primecell-periphid = <0x341011>;pinctrl-names = "default";pinctrl-0 = <0x1a>;clock-names = "uartclk\0apb_pclk";interrupts = <0x00 0x79 0x04>;clocks = <0x08 0x13 0x08 0x14>;linux,rs485-enabled-at-boot-time;rs485-rts-delay = <0x00 0x00>;compatible = "arm,pl011\0arm,primecell";status = "okay";reg = <0x7e201800 0x200>;phandle = <0xca>;};
I'm imaging the CM4 at the moment, then I'll reinstall it to double-check that Modbus comms on UART3 and UART4 is still happy before I create a pull request and commit my source and documentation changes.

Many thanks,

Adam
Hi all,

RS485 comms are still working happily, I've created a pull request with my changes here.

Many thanks,

Adam

Statistics: Posted by AdamWTracerco — Mon Apr 28, 2025 1:17 pm



Viewing all articles
Browse latest Browse all 7401

Trending Articles