Let’s use DHCP and SNTP with SURF5
Guide post for using DHCP and SNTP services in SURF5
SUMMARY
아래 요약은 ChatGPT에게 게시된 블로그의 핵심 내용을 요약한 내용입니다.
This blog post shares our experience testing network functionality using existing DHCP and SNTP examples for Surf5. The WIZnet library structure is modified focusing on the W7500 chip, and DHCP and SNTP functions are integrated by adding it to hw/driver. This article explains specific implementation steps such as the library initialization process, wiznetUpdate() call in the main loop, and link connection event management. Finally, it verifies that the DHCP and SNTP functions operate normally through actual testing.
Contents
We will add the main network function of W7500. Among them, DHCP and SNTP were added first, and the library structure of WIZnet was slightly changed and added under hw/driver. This structure was referenced from what was previously written when implementing the wiz iot speaker using the W5300.
Most of the code in the library is the same, but the initialization is different. Other than this, libraries for controlling the W7500 were copied and used as files appropriate for the chip.
Proceed with initialization to use DHCP and SNTP.
When wiznetUpdate() is called in the main loop, DHCP and SNTP functions are processed.
In addition to DHCP and SNTP, the wiznetUpdate() function also adds a function to manage link connection events.
We used the previously implemented event module to generate events depending on the connection status of the link.
When you run the firmware and connect the cable, you will see link connection events and logs showing DHCP and SNTP being processed.
Although a different Wiznet chip was used than the one used previously, the libraries provided are similar, so it has the advantage of being able to be used without major changes.