AnsweredAssumed Answered

STM32CubeMX: Possible bugs in ethernet configuration

Question asked by gorup.crt on Jul 30, 2014
Latest reply on Jul 25, 2015 by H.Rick

In the last few days I have spend few hours trying to setup FreeRTOS + LwIP TCP/IP stack. Now it is finally working (UDP echo, ICMP ping), but I believe there might be some bugs in STM32CubeMX.

- Interrupt priority for ETH_IRQn is left at default priority which is too low. This causes FreeRTOS hanging at assert. (see

- Some (important) settings for STM32CubeMX for LwIP don't get transferred into lwiopts.h. This means that default values (which are often 0) are used.

I did manually set:

#define TCPIP_THREAD_STACKSIZE          1000
#define TCPIP_MBOX_SIZE                 5
#define DEFAULT_UDP_RECVMBOX_SIZE       2000
#define DEFAULT_TCP_RECVMBOX_SIZE       2000
#define DEFAULT_ACCEPTMBOX_SIZE         2000
#define TCPIP_THREAD_PRIO               (configMAX_PRIORITIES - 2)

in addition CHECKSUM_BY_HARDWARE didn't get transferred into lwiopts.h so checksums were invalid. The solution was to add the following defines to lwiops.h.

#define CHECKSUM_GEN_IP                 0
#define CHECKSUM_GEN_UDP                0
#define CHECKSUM_GEN_TCP                0
#define CHECKSUM_CHECK_IP               0
#define CHECKSUM_CHECK_UDP              0
#define CHECKSUM_CHECK_TCP              0
#define CHECKSUM_GEN_ICMP               0

With this configuration I have tested UDP echo, pinging and ARP protocol and for now they work. However, I would be nice if authors of STM32CubeMX could check this issue and make sure all set parameters get converted into source code.

Thanks, Crt