Skip to main content
Explorer
May 1, 2024
Solved

STM32 Nucleo boards, Modbus TCP/IP, Server (Slave) and Client (Master) Examples

  • May 1, 2024
  • 3 replies
  • 2449 views

Hi all, 

Is there a Modbus tcp/ip Server (Slave) and client (Master) examples for STM32 Nucleo F429ZI board or any other similar boards?  

Thanks,

    This topic has been closed for replies.
    Best answer by ST-800

    Hello, 

    Currently, we do not have any examples implementing MODBUS protocol over TCP/IP. After doing a quick search, I found the links below that I think could help you. You could try and salvage what you can and adapt it to the board you are using.

    I also suggest you take a look at LWIP TCP client/server examples for other boards from our STM32Cube FW package (for example LwIP_TCP_Echo_Client, LwIP_TCP_Echo_Server) as you could use them to extract a template code for client/server communication.

    Best regards,

    3 replies

    ST-800Answer
    ST Employee
    May 29, 2024

    Hello, 

    Currently, we do not have any examples implementing MODBUS protocol over TCP/IP. After doing a quick search, I found the links below that I think could help you. You could try and salvage what you can and adapt it to the board you are using.

    I also suggest you take a look at LWIP TCP client/server examples for other boards from our STM32Cube FW package (for example LwIP_TCP_Echo_Client, LwIP_TCP_Echo_Server) as you could use them to extract a template code for client/server communication.

    Best regards,

    Visitor II
    July 21, 2024

    Hi data_cracker

    I've just come across your question - I'm trying exactly the same thing, did you make any progress on your project with Modbus TCP on Nucleo?

    Thanks

    Visitor II
    May 29, 2025

    I am also going to try this out. I need to establish a ModbusTCP connection between the STM32H7 NUCLEO board with an RJ-45 ethernet port. Has anyone had any success getting it to work with the HAL & FreeRTOS option above? I was looking for a native option using just code. 

    I was watching this video: Mastering Modbus TCP: STM32 as a Slave - Read & Write Registers - YouTube

    where he is using the Mongoose library.

     

    I'm just starting here. First time using an STM32 and hoping to have some success.