[M467] Modbus TCP client/server demo using CycloneTCP and FreeRTOS

Post Reply
morgandu
Posts: 45
Joined: 28 Apr 2017, 22:47

19 Dec 2023, 10:09

[For further inquiries, please e-mail to shchen2@nuvoton.com]
[Visit https://www.nuvoton.com/iot_startup for more IoT solutions]


CyCloneTCP, developed by Oryx Embedded, is an IPv4/IPv6 TCP/IP stack specifically designed for resource-constrained microcontrollers. The post provides detailed instructions on creating a demonstration using CyCloneTCP and FreeRTOS on NuMaker IoT boards. Although Oryx Embedded has not yet released a Modbus TCP demo for NuMaker IoT boards, we have undertaken the task of porting the demo to the NuMaker-IoT-M467 board.

To proceed, kindly refer to the post for downloading and extracting the CyCloneTCP Open Source Version. Subsequently, download and extract the attached zip file to the YOUR-CYCLONE_TCP-DIRECTORY\demo\nuvoton directory.

numaker_iot_m467_modbus_demo.zip
(75.31 KiB) Downloaded 570 times

The two new demos can be located in the YOUR-CYCLONE_TCP-DIRECTORY\demo\nuvoton\numaker_iot_m467 directory:
  • _modbus_client_demo
  • _modbus_server_demo
Distinguishing features of the demo code in comparison to other CyCloneTCP demos:
  • Includes #define GPL_LICENSE_TERMS_ACCEPTED in os_port_config.h, indicating acceptance of the GPL license for using the demo code.
  • Disables DHCP and utilizes a fixed IP address (192.168.0.20) for client and fixed IP address (192.168.0.100) for server.
To evaluate the demo, program both the client and server demos onto two NuMaker-IoT-M467 boards and connect them with an Ethernet cable. press BTN0 on the client board. The server will display the corresponding message on the console.

For those preferring DHCP for IP address allocation, locate #define APP_USE_DHCP_CLIENT in main.c and set it to ENABLE. Additionally, modify the server address in the client demo by finding #define APP_MODBUS_SERVER_NAME in main.c to ensure successful client-server connectivity.

Enjoy it. ;)

morgandu
Posts: 45
Joined: 28 Apr 2017, 22:47

12 Mar 2024, 09:42

If the CyClone TCP Open Source version you downloaded is v2.3.4 or later, please use the updated file because the task creation API has changed.
numake_iot_m467_modbus_demo_v2.3.4.zip
(74.14 KiB) Downloaded 880 times

Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 72 guests