cancel
Showing results for 
Search instead for 
Did you mean: 

STM32CubeMX LwIP - Simple pings only seem to work without FreeRTOS? (CubeMX code generation fault found)

morten1
Associate

I'm working with the STM32F429ZI (Nucleo) board. STM32CubeMX v5.2.0, generating code for TrueSTUDIO.

I've created a basic CubeMX project with just LWIP enabled, which responds fine out of the box to pings, and I've successfully implemented the echo server examples, so I'm rather sure the hardware is working.

Naturally, I'd rather tie lwIP to an OS if I could.

I've created a new project in CubeMX with FreeRTOS and LWIP. I've set a static IP address, and otherwise kept default settings. The SYS timebase is set to TIM1.

The code seems to be running, but I cannot ping my dev board.  

Wireshark shows traffic when the board starts up, but I'm not an expert in debugging it. I have had a look at various example projects with netconn, but it appears they use older/different files/function calls than those generated by the latest version of CubeMX, and I haven't been successful in porting them.

I know that without FreeRTOS the main loop requires calls to MX_LWIP_Process();. Is there some form of equivalent function that should be called in the background? I can see in the init code that various RTOS tasks are started in the background and I would have assumed these tasks would handle a ping response.

Open to any and all suggestions.

EDIT:

After a more thorough look through github, the following is a link to a functional example for anyone struggling. Albeit using older software versions.

https://github.com/DutchEngineer/STM32F429_NUCLEO_LWIP_FREERTOS

I still need to look through for differences when I get the chance.

1 ACCEPTED SOLUTION

Accepted Solutions
morten1
Associate

It appears the fault lies in CubeMX code generation.

My code and the github code follow the same settings but there is an option in the code generation which I found was different across the two. At first glance the code appears to be the same, with various init code shuffled around... But nevertheless something is different enough to break things.

Enabling the following setting is required for a ping to work out of the box with both FreeRTOS and LWIP enabled,

0690X000008i7gZQAQ.png

View solution in original post

1 REPLY 1
morten1
Associate

It appears the fault lies in CubeMX code generation.

My code and the github code follow the same settings but there is an option in the code generation which I found was different across the two. At first glance the code appears to be the same, with various init code shuffled around... But nevertheless something is different enough to break things.

Enabling the following setting is required for a ping to work out of the box with both FreeRTOS and LWIP enabled,

0690X000008i7gZQAQ.png