Associate II
July 30, 2014
Question
STM32CubeMX: Possible bugs in ethernet configuration
- July 30, 2014
- 3 replies
- 1432 views
Posted on July 30, 2014 at 10:30
Hi,
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: &sharpdefine TCPIP_THREAD_STACKSIZE 1000 &sharpdefine TCPIP_MBOX_SIZE 5 &sharpdefine DEFAULT_UDP_RECVMBOX_SIZE 2000 &sharpdefine DEFAULT_TCP_RECVMBOX_SIZE 2000 &sharpdefine DEFAULT_ACCEPTMBOX_SIZE 2000 &sharpdefine DEFAULT_THREAD_STACKSIZE 500 &sharpdefine 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. &sharpdefine CHECKSUM_GEN_IP 0 &sharpdefine CHECKSUM_GEN_UDP 0 &sharpdefine CHECKSUM_GEN_TCP 0 &sharpdefine CHECKSUM_CHECK_IP 0 &sharpdefine CHECKSUM_CHECK_UDP 0 &sharpdefine CHECKSUM_CHECK_TCP 0 &sharpdefine 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 #stm32cubemx-ethernet