2018-09-06 03:00 AM
Im using nucleo stm32f103. Does a modbus library exist or how would one go on with using modbus? Could not find any tutorials online.
2018-09-06 06:46 AM
MODBUS is a protocol over a physical layer be it Ethernet or a serial port. You need to handle that protocol. See the MODBUS protocol reference guide found here: http://modbus.org/docs/PI_MBUS_300.pdf
Andy
2018-09-06 07:03 AM
I don't know of any free implementation for STM32 variants.
There are other free libs available though. You only need to write/rewrite the HAL layer (not to be confused with ST's Cube/HAL !!!). There had been requests here (in earlier incarnations of this forum), but I guess they ended up in proprietary implementations.
ASCII is easy, but the inter-character and inter-message timing for RTU needs a few thoughts.
2018-09-06 10:05 AM
>>Could not find any tutorials online.
I'll put that down to appallingly poor search skillz.
I was able to find videos and assorted online resources.
https://github.com/urands/stModbus
https://github.com/kiltum/modbus
https://github.com/eziya/STM32_HAL_FREEMODBUS_RTU
2019-01-31 01:49 AM
Hello,
Modbus is a very simple protocol and the management of a TCP server (Is Modbus TCP what you need?) in embedded systems is tricky enough to bet for not using any standard Modbus library. I strongly recommend you to start with a simple TCP echo server (in the STM32CubeMX repository) and modify it to suit the Modbus specifications. I am using STM32F7+LwIP(Netconn API)+Freertos, so if you need more help let me know.
Best regards,
Eduard
2021-10-31 12:30 AM
Hi,
I am also working with the same thing - Modbus + TCP IP protocol to communicate and exchange data between the HMI and stm32f7 nucleo board(stm32f767zi).
I have tried many iterations on the example but unable to get it done properly, So I request you please let me know that which example is preferable for this communications processes.
I tried to searched out for the examples documentations for steps for config & usage but it is not available in the repository or on online to perform test with lwip examples.
So, I request you please share any information or document for Modbus Tcp ip communication with the stm32f767zi nucleo board & HMI module. Also which example is used for it - tcp client or tcp server ?
Thanks & Regards
SS
2021-11-30 07:05 AM
Dear sir, have you succeeded with MODBUS communication problem. I'm trying to work on it maybe you experience can help to resolve issues
2022-07-12 02:28 AM
Hello @edugodori ,
thank you for sharing this information. In fact, I was able to communicate with my nucleo-f7 board with TCP/IP over ethernet. But now, I'm stuck to how to how to move from this step to a Modbus TCP library. I couldn't find anything helpful yet.
Any ideas ?