**** BEGIN LOGGING AT Thu Sep 29 02:59:56 2022 Sep 29 10:33:09 Hello zmatt Sep 29 10:33:53 Could you please help cmpile the uart dtsi file, i tried place it into the device tree, it seems to compile all dts files Sep 29 10:42:20 Ok i found overlay-utils, seems to be going on Sep 29 12:12:24 zmatt Sep 29 12:12:30 Hi Sep 29 12:12:50 This works : Sep 29 12:12:54 (uEnv.txt) Sep 29 12:12:57 uboot_overlay_addr2=/lib/firmware/BB-UART2-RTSCTS-00A0.dtbo Sep 29 12:13:04 This doesn't Sep 29 12:13:07 uboot_overlay_addr1=/lib/firmware/BB-UART2-RTSCTS-00A0.dtbo Sep 29 12:13:21 RTS signal get low allright, never returns high. Sep 29 12:13:31 Just changing slot makes RTS work, strange. Sep 29 12:20:44 My mistake both are the same Sep 29 16:20:44 jfsimon1981: yeah what I linked to is part of overlay-utils, and should be build as part of that repository (using its makefile) Sep 29 16:23:17 yes i could do it thank you Sep 29 16:24:01 although i have now strange behaviour, the RTS line will work with UART4 after boot, but using libmodbus will (with RTS NONE) brings it back to zero and it will remain there. Sep 29 16:24:37 Onward after lib usage, the sending through console also fails where it worked before using the library. Sep 29 16:24:55 So i'm investigating still. Sep 29 16:25:06 is the polarity just inverted? Sep 29 16:25:09 of the rts? Sep 29 16:25:29 (i.e. the problem I already anticipated, warned about, and gave a solution for) Sep 29 16:25:35 But it's getting better, it looks like once brought to zero yes, it's inverted, doesn't move from there anywmore. Sep 29 16:25:59 I mean, in rs485 mode it should move during transmit obviously Sep 29 16:26:00 Yes i check it all. Compile dtbo with or without the inversion makes no difference. Sep 29 16:26:15 yes, it does not. Sep 29 16:26:19 the setting in dt doesn't do anything, I already said that Sep 29 16:26:36 (it's _intended_ to work, but doesn't) Sep 29 16:26:48 it needs to be configured from userspace Sep 29 16:26:57 The library does something to the device that locks rts to 0, i don't get it yet. Sep 29 16:27:09 yes right Sep 29 16:27:15 if rts is not changing at all during transmit, is rs485 mode enabled at all? Sep 29 16:27:18 with the c file Sep 29 16:27:24 i did that too Sep 29 16:27:56 i'll check again perhaps i missed something Sep 29 16:28:09 if you use my initialization code, be sure to pass true to active_low Sep 29 16:33:35 yes except my mistake i do it and still i have no rts. https://pastebin.com/U7VU6gcm Sep 29 16:34:55 The plan is dwelve into the library and find where it modifies or disables rts. That's what i'll do next. Sep 29 16:35:43 ehm what, my code takes a file descriptor not a FILE* ... this shouldn't even compile Sep 29 16:37:14 ah Sep 29 16:39:05 yes i get a waring message about conversion, let me make it work Sep 29 16:41:39 https://pastebin.com/iDWRgnVK Sep 29 16:50:43 indeed i had it not working, seems better Sep 29 16:50:51 i'll run the libmodbus test Sep 29 16:51:55 I seem to have something Sep 29 16:52:25 although the message don't return from the client, ie bebahiour is better Sep 29 17:12:40 The line behavious seem right, words are erroneous, which is similar to what i saw last week. At least the RTS timing issue seems fixed. Sep 29 17:12:58 I'll usea UART4, this one is working with proper rts. Sep 29 17:17:09 Got it the line transmits a 0a char at the end. Sep 29 17:20:08 The device terminates the line apparently, that messes modbus frame as i understand. Sep 29 17:20:37 Specific to uart4 then. Sep 29 17:25:43 it works i have no idea why Sep 29 17:26:28 At least the client responds (messages have a crc still). Sep 29 17:28:11 That looks somehow better though Sep 29 17:32:18 Just too strange, reboot and device/host now communicate allright. Sep 29 17:32:40 A persistent timing error fixed by reboot. Sep 29 17:33:25 Went from 50% success with library timer to what looks like 100% pass at the moment, all good. Sep 29 17:45:57 0,8% error rate be it, i'll accept this. Sep 29 22:28:43 jfsimon1981: do I remember correctly that this was with a device that sends its response way too quickly, in violation of the modbus specification? Sep 29 22:29:25 if so, if fixing the device isn't an option, probably the only way to deal with that completely reliably would be by using PRU **** ENDING LOGGING AT Fri Sep 30 02:59:57 2022