cancel
Showing results for 
Search instead for 
Did you mean: 

Modbus Library without FreeRTOS

himani
Associate II

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?

1 ACCEPTED SOLUTION

Accepted Solutions
SofLit
ST Employee

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

 

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

View solution in original post

4 REPLIES 4
SofLit
ST Employee

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

 

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

Hi,
Yes you are right, I need ModbusSlave library for RTU without FreeRTOS .

Checkout the links I provided.

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

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.

If you feel a post has answered your question, please click "Accept as Solution".