cancel
Showing results for 
Search instead for 
Did you mean: 

LWIP_NUM_SYS_TIMEOUT_INTERNAL does not have LWIP_SNTP in it.

MStra.3
Associate III

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 5

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
Associate III

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.

Hello @MStra.3​ ,

Can you please provide the MCU part number used?

Thanks in advance.

BeST Regards,

Walid

MStra.3
Associate III

It is the STM32F407

WilliamVR
Associate III

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