[M467] Get Time from SNTP Server using CyCloneTCP and FreeRTOS

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


2024/6/5 update : Oryx Embedded has released version 2.4.2, which includes new demos for Modbus, SNTP, and various others. You can download this latest version directly from the Oryx Embedded website at https://www.oryx-embedded.com/download . There is no need to download the following demo source code; please choose the official one.


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 SNTP client 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_sntp_client_demo.zip

numaker_iot_m467_sntp_client_demo.zip (36.36 KiB)


The SNTP client demo is located in the YOUR-CYCLONE_TCP-DIRECTORY\demo\nuvoton\numaker_iot_m467 directory:
  • _sntp_client_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.

    sntp_client_demo_1.png (30.49 KiB)

  • Enable DHCP to get a IP address
  • SNTP server is time.google.com. Your can change it to another SNTP server.

    sntp_client_demo_2.png (30.88 KiB)


To evaluate the demo, program the demo binary firmware onto a NuMaker-IoT-M467 board and connect it to a router with an Ethernet cable and also run a terminal tool to open Nu-Link Virtual COM as console. Press BTN0 on the board, you can see the corresponding message on the console.

sntp_client_demo_3s.png (20.93 KiB)


Enjoy it.