2024-09-24 04:09 AM - last edited on 2024-09-24 04:28 AM by SofLit
Hi,
I am working with an STM32 microcontroller (STM32 C0 & STM32H5 series) and want to implement Modbus communication without using FreeRTOS . Most examples I found are based on FreeRTOS, but I need to handle Modbus protocol in a non-RTOS environment.
Are there any recommended Modbus libraries that can work without an RTOS?
Solved! Go to Solution.
2024-09-24 04:36 AM - edited 2024-09-24 04:36 AM
Hello @himani ,
You need also to specify which Modbus flavor? RTU? TCP/IP?
Knowing that STM32C0 has no ETH interface.
See for example these links for Modbus RTU: https://github.com/urands/stModbus
https://github.com/cwalter-at/freemodbus
2024-09-24 04:36 AM - edited 2024-09-24 04:36 AM
Hello @himani ,
You need also to specify which Modbus flavor? RTU? TCP/IP?
Knowing that STM32C0 has no ETH interface.
See for example these links for Modbus RTU: https://github.com/urands/stModbus
https://github.com/cwalter-at/freemodbus
2024-09-24 05:02 AM - edited 2024-09-24 05:03 AM
Hi,
Yes you are right, I need ModbusSlave library for RTU without FreeRTOS .
2024-09-24 05:05 AM
Checkout the links I provided.
2024-09-25 04:48 AM
Modbus Serial is simple in the sense that the modbus master sends the commands and the addressed slave respond with the data. You have to study the modbus command response of the slave device(assuming that stm32 is the master). Otherwise stm32 as slave has to respond. It all depends on your slave device documentation. they would have given some sample command and response, Else generate a specific command response packet and try it . Ultimately it is send out through the UART and received though the same uart. If it is Rs485, you have to control the
DE/RE pin to put the module into TX or RX . Normally it is simplex communication. only one device is active at the same time.