alejoseb / Modbus-STM32-HAL-FreeRTOS

Modbus TCP and RTU, Master and Slave for STM32 using Cube HAL and FreeRTOS
GNU Lesser General Public License v2.1
519 stars 182 forks source link

Modbus RTU Slave Transmit Wrong Frame #68

Closed phamnamhien closed 1 year ago

phamnamhien commented 1 year ago

Hi there, thank you for your interesting project. However, I have an issue with the Mobus RTU library.

Specifically, when I use your original library, the slave device sends incorrect transmission frames to the master. It adds an extra 0xFF character in front of each transmission frame to the master. image image I don't understand why this is happening, but when I add a delay function to your Modbus.c library, it works. image However, it is still unstable. When I add some code to other tasks (not the Modbus task) in the program, it seems to be causing errors!

phamnamhien commented 1 year ago

I have figured out the issue. It's because I haven't added a pull-up resistor for the TxD pin of the UART.