Modbus Crash
Posted: Thu Jul 15, 2021 4:35 am
I'm trying to communicate over modbus with a ESP32-WROOM-32D but I keep getting crashes while trying to read it. I've based my code on the modbus code in the examples and it works reliably until it randomly crashes.
I always get one of the two following crash logs;
or
I always get one of the two following crash logs;
Code: Select all
assertion "eSndState == STATE_TX_IDLE" failed: file "C:/msys32/home/user/esp/esp-idf/components/freemodbus/modb
us/rtu/mbrtu.c", line 229, function: xMBRTUReceiveFSM
abort() was called at PC 0x400dfe33 on core 1
0x400dfe33: __assert_func at /Users/ivan/e/newlib_xtensa-2.2.0-bin/newlib_xtensa-2.2.0/xtensa-esp32-elf/newlib/libc/std
lib/../../../.././newlib/libc/stdlib/assert.c:63 (discriminator 8)
ELF file SHA256: 6b6a25b031be9da47933bd8915456fbbebbd1bc913aabf799b6a3479e6c83782
Backtrace: 0x4008d7d0:0x3ffdb630 0x4008da1d:0x3ffdb650 0x400dfe33:0x3ffdb670 0x4014ce32:0x3ffdb6a0 0x4014bd62:0x3ffdb6d
0 0x4014bda9:0x3ffdb6f0 0x40090331:0x3ffdb720
0x4008d7d0: invoke_abort at C:/msys32/home/user/esp/esp-idf/components/esp32/panic.c:716
0x4008da1d: abort at C:/msys32/home/user/esp/esp-idf/components/esp32/panic.c:716
0x400dfe33: __assert_func at /Users/ivan/e/newlib_xtensa-2.2.0-bin/newlib_xtensa-2.2.0/xtensa-esp32-elf/newlib/libc/std
lib/../../../.././newlib/libc/stdlib/assert.c:63 (discriminator 8)
0x4014ce32: xMBRTUReceiveFSM at C:/msys32/home/user/esp/esp-idf/components/freemodbus/modbus/rtu/mbrtu.c:229 (d
iscriminator 1)
0x4014bd62: vMBPortSerialRxPoll at C:/msys32/home/user/esp/esp-idf/components/freemodbus/port/portserial.c:278
(discriminator 1)
0x4014bda9: vUartTask at C:/msys32/home/user/esp/esp-idf/components/freemodbus/port/portserial.c:278 (discrimin
ator 1)
0x40090331: vPortTaskWrapper at C:/msys32/home/user/esp/esp-idf/components/freertos/port.c:403
Code: Select all
assertion "( eRcvState == STATE_RX_INIT ) || ( eRcvState == STATE_RX_RCV ) || ( eRcvState == STATE_RX_ERROR )" failed:
file "C:/msys32/home/user/esp/esp-idf/components/freemodbus/modbus/rtu/mbrtu.c", line 350, function: xMBRTUTime
rT35Expired
abort() was called at PC 0x400dfe33 on core 1
0x400dfe33: __assert_func at /Users/ivan/e/newlib_xtensa-2.2.0-bin/newlib_xtensa-2.2.0/xtensa-esp32-elf/newlib/libc/std
lib/../../../.././newlib/libc/stdlib/assert.c:63 (discriminator 8)
ELF file SHA256: 6b6a25b031be9da47933bd8915456fbbebbd1bc913aabf799b6a3479e6c83782
Backtrace: 0x4008d7d0:0x3ffdb5c0 0x4008da1d:0x3ffdb5e0 0x400dfe33:0x3ffdb600 0x4014cfe1:0x3ffdb630 0x4014bd7d:0x3ffdb65
0 0x4014bda9:0x3ffdb670 0x40090331:0x3ffdb6a0
0x4008d7d0: invoke_abort at C:/msys32/home/user/esp/esp-idf/components/esp32/panic.c:716
0x4008da1d: abort at C:/msys32/home/user/esp/esp-idf/components/esp32/panic.c:716
0x400dfe33: __assert_func at /Users/ivan/e/newlib_xtensa-2.2.0-bin/newlib_xtensa-2.2.0/xtensa-esp32-elf/newlib/libc/std
lib/../../../.././newlib/libc/stdlib/assert.c:63 (discriminator 8)
0x4014cfe1: xMBRTUTimerT35Expired at C:/msys32/home/user/esp/esp-idf/components/freemodbus/modbus/rtu/mbrtu.c:3
50 (discriminator 3)
0x4014bd7d: vMBPortSerialRxPoll at C:/msys32/home/user/esp/esp-idf/components/freemodbus/port/portserial.c:278
(discriminator 1)
0x4014bda9: vUartTask at C:/msys32/home/user/esp/esp-idf/components/freemodbus/port/portserial.c:278 (discrimin
ator 1)
0x40090331: vPortTaskWrapper at C:/msys32/home/user/esp/esp-idf/components/freertos/port.c:403