**** BEGIN LOGGING AT Fri May 07 02:59:57 2021 May 07 08:02:20 hello May 07 12:14:20 Trying to figure out a little about setting the serialports (ttyO4/5) to RS485 (eg own pin with de/re (TxEnable) for RS485 driver). I'm using latest Debian. It seems like serial port drivers are loaded by default, but pinmux is not set up. Setting pinmux manually works, also enabling BB-UART4-00A0.dtbo in uEnv. May 07 12:14:20 Trying to use BB-UART4-RS485-00A0.dtbo to get re/de on p9.27 (testing with minicom - hwflowctr=ON) but no success. May 07 12:14:21 Does the deafult loadedof serialport drivers conflict with BB-UART4-RS485-00A0.dtbo in some way? May 07 12:14:21 Also no success getting RTS/CTS signals with BB-UART4-00A0.dtbo + BB-UART4-RTSCTS-00A0.dtbo - and this should hopefully not conflict with default loading of driver? May 07 12:14:22 I did get RS485 to work some years ago (on 3.x something), then it was an issue with default serial driver not working for rs485 and an 'omap' version had to be compiled into the kernel, but that's not an issue an more? May 07 12:19:44 by default you don't need to mess with any overlays, you can configure the pinmux at runtime using config-pin May 07 12:20:35 using the UART4 + RTSCTS overlays should still work though, not sure why you'd have "no success getting RTS/CTS signals" May 07 12:21:19 the RS485 overlay no longer works, it's for the old omap-serial driver and not compatible with the current 8250-omap driver May 07 12:21:32 instead you should use the RTS pin as driver-enable and setup rs485 from userspace May 07 12:22:09 e.g. in C: https://pastebin.com/r1rJFUfr May 07 12:24:35 thanks, then i know what to not try to get work. I'll look into the rts/cts thing, the rts pin doesn't match my current pcb layout, but I can fix that with a little 'wirestrapping' for my first batch of boards. May 07 12:25:50 yeah using a gpio for rts requires kernel 5.3 or later, or recompiling it to use the omap-serial driver (assuming it still works) instead of the 8250-omap driver May 07 12:26:13 my notes about RS485-related DT properties: https://pastebin.com/7DKDZ0NP May 07 12:27:54 with BB-UART4-00A0.dtbo + BB-UART4-RTSCTS-00A0.dtbo the pinmux get set up ok (show-pins), but rts stays low all the time. It should work with minicom when Hardware Flow Control is set to Yes ? May 07 12:28:12 I don't know anything about minicom May 07 12:28:40 but if show-pins shows the pins being setup correctly when the obvious conclusion is that the port has not been configured correctly by software May 07 12:29:20 rts/cts flow control is definitely not enabled by default, it will have to be enabled via stty / tcsetattr() May 07 12:30:20 also, aren't RTS/CTS active-low signals? so RTS being low all the time sounds correct to me May 07 12:32:18 The BB-UART4-RTSCTS-00A0.dtbo has rs485-rts-active-high;  (this is TTL levels; RS232 levels are 'inverse') May 07 12:33:22 well 1. as my notes mention, those properties have the exact opposite effect of what their name says 2. that property is only relevant for the omap-serial driver and moreover has no effect outside of RS485 mode May 07 12:33:57 and yeah I'm talking about the levels on the pin, not those of RS232 May 07 12:34:53 But it may be my (mis)use of minicom is the issue. I had some notes on this from last time, but they got lost (wiki, domain got canceled, didnt have local backup). May 07 12:35:15 well no it sounds like it's working correctly May 07 12:36:12 ok. but if rts controls rs485 re/de, it should change level every time you send (and return after sending) May 07 12:36:44 yes but that's if you enable rs485 mode May 07 12:37:00 which has nothing to do with hardware flow control mode May 07 12:37:05 (and in fact is incompatible with it) May 07 12:37:58 ok.. I'll probably should read your notes before asking more :) May 07 12:39:12 and I just double-checked, in hardware flow control mode RTS and CTS are active-low signals (RTS will be low when ready to receive data, CTS must be externally driven low to enable transmission of data) May 07 12:41:13 thanks again, you soon need to invoice me :) May 07 13:10:42 zmatt rts/cts works as supposed and as you said **** ENDING LOGGING AT Sat May 08 02:59:57 2021