Skip to main content
SHers
Associate III
Nov 4, 2026 10:04 PM UTC
Question

Looking for functional STM32F7 LwIP + FreeRTOS example

I’m trying to bring up a simple application on a dual-core STM32H755 Nucleo board. Requirements are Ethernet (fixed IP address) and FreeRTOS, using the M7 core (the M4 core can thumb-twiddle, it’s not needed yet).

I have tried configuring a bare-minimum project with these parameters in fully-updated STM32CubeMX and opening it in STM32CubeIDE, but surprise! It won’t build. No custom code, just the ST-created framework.

First issue is that ethernetif.c’s low_level_init() function is trying to initialize a nonexistent TxConfig variable. (I commented that out.)

Second issue is that the linker now throws 97 errors, starting with many errors of the form “Unknown destination type (ARM/Thumb) in ...”, followed by a flock of “dangerous relocation: unsupported relocation” errors. 

It should NOT be this hard to get a dead-simple program skeleton for a bog-standard use case to build on a current ST dev board using ST tools. 

None of the example code I can find on the ST Web site addresses the dual-core H7 MCU and the LwIP/FreeRTOS combination. 

 Can anyone point me at a basic example for this combination that will build? 

6 replies

Pavel A.
Nov 4, 2026 11:08 PM UTC

So do you have an F7 or H7? The ETH drivers and memory maps are different, please be certain.

Examples for H745 are here:  https://github.com/stm32-hotspot/STM32H7-LwIP-Examples -  should work for H755 as well.

 

 

 

SHers
SHersAuthor
Associate III
Nov 5, 2026 2:42 PM UTC

It’s an H7, thanks. (That’s what makes it all so tricky; a dual-core project in the CubeIDE is very different from a single-core project, so I can’t just file the serial numbers off my F4 code and assume that it will build. 

Based on the 745/755 datasheet, I think a 745 project ought to transfer to the 755 if I change the processor setting. 

Thanks!

Steve

Graduate
Nov 5, 2026 3:13 PM UTC

Hi,

 

May I ask if using lwIP is a requirement for your project?

 

If you are interested in a much simpler alternative, there is a solution that uses the Mongoose Networking library running on FreeRTOS on H755. The example is here, featuring a modern webserver with a dashboard. You can try and download it to your local workspace by going to the ‘Settings’ tab of the page, in the ‘Source Code Generator’ select the directory and then click the blue ‘Generate C/C++ Code’ in the upper right corner of the page to download. Open the project with CubeIDE, build it and run it.

 

This approach could save you quite a bit of time compared to configuring lwIP, which can sometimes require careful tuning of numerous settings to get everything working correctly. Mongoose has its own builtin network driver and its own builtin TCP/IP stack, avoiding lwIP. It also carries a much smaller memory footprint and with the well documented API you can implement most of the modern features of an embedded server (HTTP/HTTPS, MQTT, DNS, SNTP, etc.).

 

Alternatively, Mongoose can also be plugged with lwIP and offer you access to its application-level API. Let me know if you’d be interested in such an example.

 

Heads up, I’m part of the Mongoose development team, I hope this helps you with your project.

SHers
SHersAuthor
Associate III
Nov 5, 2026 3:32 PM UTC

This looks interesting; I’ll check it out. Thanks!

SHers
SHersAuthor
Associate III
Nov 10, 2026 5:30 PM UTC

A few updates on the above:

  1. The undefined TxConfig variable is ONLY undefined if you’re using LwIP with the RTOS. If the RTOS is not enabled, the CubeMX code generator generates the definition and uses it (apparently) properly. So it’s a code generator issue with the LwIP + RTOS combination.
  2. Those 97 errors went away when I redid the code generation and IDE prohect from sctarch.
  3. WARNING: The Nucleo board’s default strapping requires using HAL_PWREx_ConfigSupply(PWR_DIRECT_SMPS_SUPPLY) in SystemClock_Config(). With the latest (1.13.0) revision of the Cube H7 support package, the code generator DOES NOT ALLOW the PWR_DIRECT_SMPS_SUPPLY option; you must set this option by hand. Using any of the code generator’s allowed options bricks the board and requires power-cycling and pulling BOOT0 high at the next boot, followed by a full chip-erase, to recover it.
  4. I’m still struggling to get ANY Nucleo example for this board to work with the RTOS and LwIP, even when using sworn-to-work examples I haven't changed at all. Some of this seems to be chip errata for my older-revision MCU. I can get the RTOS to run and blink LEDs from the default task, but the Ethernet stack doesn’t play well with others. The software stacks for this chip are, shall we say, still a work in progress.
Pavel A.
Nov 11, 2026 5:25 AM UTC

> WARNING: The Nucleo board’s default strapping requires using HAL_PWREx_ConfigSupply(PWR_DIRECT_SMPS_SUPPLY) in SystemClock_Config(). With the latest (1.13.0) revision of the Cube H7 support package, the code generator DOES NOT ALLOW the PWR_DIRECT_SMPS_SUPPLY option; you must set this option by hand.

In newer versions of STM32H7 device library (since 1.12?) the power configuration is introduced in the new function ExitRun0Mode in system_stm32h7xx.c; it will be automatically called by the startup before SystemInit.

https://github.com/STMicroelectronics/cmsis-device-h7/blob/81db1ec63cdc191fae1565b772da3ea5aa29a683/Source/Templates/system_stm32h7xx.c#L474

One of macros described here should be defined in the compiler #defines. 

For compatibility with previous projects, if none of these macros is defined, ExitRun0Mode does nothing (see line 540);  the needed setup can be added in SystemConfig() or where you like to.

 

> I’m still struggling to get ANY Nucleo example for this board to work with the RTOS and LwIP, even when using sworn-to-work examples

Which have you tried from https://github.com/stm32-hotspot/STM32H7-LwIP-Examples ? How it failed?