如何在stm32的sntp客户端中修复MEMP_SYS_TIMEOUT

时间:2019-04-04 08:54:33

标签: c stm32 ntp lwip

在STM32H7上,我运行LwIP,以了解有关原始API(NOSYS = 1)的更多信息。 现在,UDP(和TCP)服务器和客户端可以正常工作。

我接下来要设置NTP客户端。

我以此方式初始化它(在sntp_client.c中):

#define SNTP_CONF_IPADDR0   185
#define SNTP_CONF_IPADDR1   255
#define SNTP_CONF_IPADDR2   55
#define SNTP_CONF_IPADDR3   20

sntp_setoperatingmode(SNTP_OPMODE_POLL);
sntp_setservername(0, (char*)"pool.ntp.org");
sntp_init();

启动后,我得到了错误

Assertion "sys_timeout: timeout != NULL, pool MEMP_SYS_TIMEOUT is empty" 
failed at line 212 in 
..\..\..\Middlewares\Third_Party\LwIP\src\core\timeouts.c

在Wireshark中,我看不到任何NTP程序包被跟踪。

在sntp_init中,sntp_request(NULL);会被调用,然后显示超时。

接下来我需要检查什么?

我的资源在这里,在sntp_client.c中很重要: https://github.com/bkht/LAN8742A_KSZ8851SNL_LwIP

0 个答案:

没有答案
相关问题