I am working on code that is running on a Waveshare ESP32-S3 4.3. This has the ESP32-S3 CPU on it. In general I have things working well while using IDF 5.4.2 with lvgl display, I2C touch and RS485 communications at 9600 Baud. However there were some occasional issues (crashes, probably due to threads and memory issues) and I thought I would try IDF 5.5.1 marked as the latest stable release. In general my program works with 5.5.1 (GUI displays etc) but there is no RS485 reception over the UART at all, no bytes received.
To test I tried building and using the simple uart_echo_rs485 example, modifying it a touch to just transmit a short string or receive a short string from another system at 9600 Baud. When built with IDF 5.4.2 everything works fine. With IDF 5.5.1 sending from the ESP32 to the remote system works fine, but on receive I do get bytes, but I get random bytes, even if the remote side isn't sending anything. I get as shown below, 23 bytes received immediately, then random lengths no matter if my remote program is sending or not.
I am using a GIT IDF download on Fedora41.
Is the UART driver actually working in 5.5.1 (I also tried 6.0 and that failed as well) ?
Code: Select all
while (1) {
//Read data from UART
int len = uart_read_bytes(uart_num, data, BUF_SIZE, 2000 / portTICK_PERIOD_MS);
printf("Read: len: %d first bytes: 0x%2.2x '%c'\n", len, data[0], data[0]);
printf("Hexdump: "); bhd8(data, len);
}
Code: Select all
I (286) RS485_ECHO_APP: UART start receive loop.
I (296) main_task: Returned from app_main()
Read: len: 23 first bytes: 0x00 ''
Hexdump: 00 df a7 ef 98 01 88 f7 7d a8 30 9b 04 fe 11 bd
5b 29 46 9c 52 05 e9
Read: len: 10 first bytes: 0x0a '
'
Hexdump: 0a c6 3c 11 ce 85 86 ce 94 21
Read: len: 7 first bytes: 0x62 'b'
Hexdump: 62 c6 74 10 8e 18 fd
Read: len: 6 first bytes: 0x0a '
'
Hexdump: 0a 85 94 38 90 fc
Read: len: 6 first bytes: 0x14 ''
Hexdump: 14 c6 97 98 21 f6
Read: len: 6 first bytes: 0x62 'b'
Hexdump: 62 91 9d 29 a4 fc
Read: len: 5 first bytes: 0x0a '
'
Hexdump: 0a 85 94 18 10
Read: len: 6 first bytes: 0x14 ''
Hexdump: 14 c6 97 98 21 fc
Read: len: 6 first bytes: 0x62 'b'
Hexdump: 62 91 9d 29 a4 fc
Read: len: 5 first bytes: 0x0a '
'
Hexdump: 0a 85 94 18 10
Read: len: 6 first bytes: 0x14 ''
Hexdump: 14 c6 97 98 21 fc