Skip to main content
MStra.3
Associate III
December 11, 2021
Question

LWIP_NUM_SYS_TIMEOUT_INTERNAL does not have LWIP_SNTP in it.

  • December 11, 2021
  • 5 replies
  • 1964 views

When I enabled SNTP I got an error message that basically said there were not enough timers. When I disabled it, the error went away. I had to add LWIP_SNTP to the define for LWIP_NUM_SYS_TIMEOUT_INTERNAL in opt.h. However, every time I Generate Code, that disappears. It appears to be a bug in CubeMX. Am I right? Can it get fixed?

5 replies

Walid ZRELLI
Visitor II
January 21, 2022

Hello @MStra.3​ ,

Are you using the FreeRTOS?

Otherwise, Could you share the exact error message or how found out about the timers issue?

BeST Regards,

Walid

MStra.3
MStra.3Author
Associate III
January 21, 2022

Yes I am using FreeRTOS.

Here is the error I get:

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

This happens when the following line in opt.h has the LWIP_SNTP commented out. The LWIP_SNTP was put in manually by me and here I have commented it out to force the error. What appears to be happening is that LWIP is running out of timers with the LWIP_SNTP missing from  LWIP_NUM_SYS_TIMEOUT_INTERNAL. Seems like the Code Generator should be putting it in there and it is not.

#define LWIP_NUM_SYS_TIMEOUT_INTERNAL  (/*LWIP_SNTP + */LWIP_TCP + IP_REASSEMBLY + LWIP_ARP + (2*LWIP_DHCP) + LWIP_AUTOIP + LWIP_IGMP + LWIP_DNS + PPP_NUM_TIMEOUTS + (LWIP_IPV6 * (1 + LWIP_IPV6_REASS + LWIP_IPV6_MLD)))

Mike.

Walid ZRELLI
Visitor II
January 24, 2022

Hello @MStra.3​ ,

Can you please provide the MCU part number used?

Thanks in advance.

BeST Regards,

Walid

MStra.3
MStra.3Author
Associate III
January 24, 2022

It is the STM32F407

Associate II
June 4, 2024

Hi,

I have the same error on the same controller (STM32F407).
The only difference is that I use lwip + freertos + mqtt. 
My code runs fine for a couple of minutes and then crashes.

There is not a  "LWIP_MQTT" instead of "LWIP_SNTP".
So I can't use your fix. 

All help is appreciated!


I have published my findings here.
https://community.st.com/t5/stm32-mcus-products/stm32-mqtt/td-p/666703


Kind Regards,

William