zephyr/subsys
Maksim Salau c2fd84fdd5 modbus: serial: Ignore received data when reception is disabled
A byte received when reception has been disabled
corrupts internal state of the server
(e.g. during transmission of a reply in server mode).
The reponse packet is corrupted and its transmission is aborted and the
data in the buffer is treated by the server as a new incoming packet.
Since the buffer is corrupted CRC doesn't match and the following log
message is printed:

  <wrn> modbus_serial: Calculated CRC does not match received CRC

This condition happens when uart_irq_rx_ready() returns true if there is
a new byte in the receive FIFO even with disabled RX interrupt.

The issue has been discovered on a nucleo_u083rc board with a RS485
transceiver with the RI signal floating (a pull-down gives more stable
reproduction). The pull-down ensures that RI is low during transmission
which is seen as byte 0 with a framing error by the receiver.
The byte is received by the MCU and corrupts the response.
Similar effect can be achieved by not disabling the receiver during
transmission (i.e. nRE is driven by the MCU and is fixed low).

The fix discards any data received when reception has been disabled.

Signed-off-by: Maksim Salau <msalau@iotecha.com>
2025-06-11 10:08:25 -07:00
..
bindesc
bluetooth Bluetooth: ASCS: Sonarcloud fixes 2025-06-11 08:58:09 -04:00
canbus
console
dap
debug debug: ASSERT_VERBOSE depends on PRINTK 2025-05-29 15:16:41 +01:00
demand_paging
dfu
disk
dsp
emul
fb cfb: support non vtiled displays 2025-06-04 17:00:30 +02:00
fs subsys/fs/fuse: Fix adding missing stddef header 2025-05-28 01:48:13 +02:00
input
ipc ipc: icbmsg: Add a workqueue name 2025-06-04 16:59:04 +02:00
jwt modules: mbedtls: make key exchange Kconfigs depend on, not select 2025-05-13 22:22:43 -04:00
llext llext: add context save and restore 2025-06-10 12:52:38 -04:00
logging logging: backend: net: use connection mgr 2025-05-10 13:02:21 +02:00
lorawan lorawan: add link check support. 2025-04-17 17:23:12 +02:00
mem_mgmt
mgmt mgmt: hawkbit: add shell autohandler timeout Kconfig 2025-06-02 22:10:13 +02:00
modbus modbus: serial: Ignore received data when reception is disabled 2025-06-11 10:08:25 -07:00
modem ubx: Refactor codebase in order to improve usability 2025-05-30 19:40:19 +02:00
net net: shell: iface: Add link speed settings command 2025-06-11 09:54:56 +02:00
pm pm: Add API to check if a state disables a device 2025-05-30 19:40:11 +02:00
pmci pmci: mctp: Fix No SOURCES CMake warning 2025-04-23 17:55:19 +02:00
portability subsys/portability/cmsis_rtos_v2: Fix code compliance issues 2025-05-21 12:35:28 +02:00
profiling arch: Unify declaration of text region 2025-04-23 02:15:25 +02:00
random
retention
rtio rtio: Introduce OP_DELAY as a valid SQE operation 2025-04-30 09:48:16 +02:00
sd sd: fix incorrect error logging 2025-06-05 15:02:15 -05:00
secure_storage secure_storage: its: transform: improve expandability 2025-05-27 15:46:37 +02:00
sensing
settings settings: replace [[maybe_unused]] by __maybe_unused 2025-05-15 22:13:49 +02:00
shell shell: Introduce structured help message 2025-06-11 09:55:21 +02:00
sip_svc
stats
storage storage/flash_map: Fix is_in_flash_area_bounds 2025-05-05 10:57:51 +02:00
task_wdt task_wdt: Add suspend and resume API functions 2025-04-02 13:05:14 +02:00
testsuite unit_testing: Fix NATIVE_APPLICATION kconfig dependency 2025-06-10 13:29:28 +02:00
timing
tracing kernel: kheap: decouple simple alloc from aligned_alloc 2025-04-01 22:13:04 +02:00
usb usb: device_next: allow to use label as interface string descriptor 2025-06-11 08:18:30 +02:00
zbus zbus: Improve consistency with runtime observers 2025-05-16 09:37:20 +02:00
CMakeLists.txt pmci: Move MCTP into the PMCI subsys 2025-04-21 12:43:33 +02:00
Kconfig pmci: Move MCTP into the PMCI subsys 2025-04-21 12:43:33 +02:00