2023-04-19 10:02 PM
I am using stm32f756zg. In which i configure LWIP with FREERTOS cmsisv2. I am getting hard faults when ping devices from other devices.
It works fine when I change FREERTOS cmsis v1 and increase the default task stake.
2024-11-04 08:58 AM
same problem here. I get DMA errors on V2, and packet corruption on V1!
freeRTOS 10.3.1, CMSIS-RTOS 2.00.
STM32H743ZIT6 - STMH7 1.11.2
STM32CubeIDE 1.16.1
I see a warning in software saying I should updata CMSIS, but I have the latest H7 firmware available installed already.
2025-01-19 02:34 PM
Had the same problem on stm32f767 trying to use LWIP with CMSISv2. I narrowed the problem down to erroneous data being written to the "TxPktSemaphore" Semaphores being used by the LWIP library. Turns out its because the assigned stack for the tasks are overflowing and writing into other areas of memory. All over the LWIP code the difference between the task size in words and in bytes is muddled. For example in the configurator I've chosen 1024 words as TCPIP_THREAD_STACKSIZE:
but in the code its actually 1024 bytes:
This seems to be a none issue for the tcpip thread, as they seem to have already set the default value to 1024 to account for it actually being bytes, but they seem to have forgotten to do this for INTERFACE_THREAD_STACK_SIZE in ethernetif.c. I manually added a * 4 shown below and it fixed the problems:
Hope this helps :)
2025-01-19 02:50 PM
Oh and fyi for anyone with the same chip, you also want to:
- #undef LWIP_RAM_HEAP_POINTER in lwipopts.h
- Increase the stack size of the default task in the FREERTOS settings, I set mine 512 words, you might be able to get away with less by experimenting
- Change the thread priorities because the default values were valid for CMSIS v1. Heres what I chose:
- Probably also increase your FREERTOS heap size
2025-01-19 06:42 PM
Very likely the same problem and fix I'd posted at https://community.st.com/t5/stm32cubemx-mcus/bugs-caveats-misc-fixes-stm32h7s-cube/td-p/710992. Refer the lwIP list of problems.