Skip to main content
Associate
May 13, 2026
Question

STM32F746G-Discovery: Ethernet gnetif.ip_addr corrupted with Multicast value 0xf44fd102 (Cache Coherency?)

  • May 13, 2026
  • 2 replies
  • 129 views

I am working on an STM32F746G-Discovery board using LwIP (2.1.2) and FreeRTOS (CMSIS-RTOS V1) generated via STM32CubeMX. I am facing a persistent issue where the gnetif.ip_addr.addr field is populated with a garbage/static value before DHCP can complete, specifically 0xf44fd102.

The Issue: Even after performing a memset(&gnetif, 0, sizeof(struct netif)) before MX_LWIP_Init(), the debugger consistently reports the following for the IP address variable:

  • Hex: 0xf44fd102

  • Decimal: -196095742

  • Translated IP: 244.79.209.2 (Multicast)

It appears the Ethernet DMA is writing multicast network traffic into the memory space allocated for gnetif, or I am facing a D-Cache coherency issue where the CPU is reading "stale" data from a previous boot/session.

Current Configuration:

  • CPU: STM32F746NGH6 (Cortex-M7)

  • Cache: I-Cache and D-Cache enabled in main.c.

  • PHY: LAN8742A (RMII mode).

  • Clock: 216MHz (HSE used as source).

  • MPU: I have attempted to configure the MPU to set the SRAM1 region (0x20010000) as Non-Cacheable (TEX=1, C=0, B=0), but the value 0xf44fd102 persists.

    My Questions:

    1. Why is the gnetif structure being initialized or overwritten with 0xf44fd102 (Multicast) specifically?

    2. On the STM32F7 Discovery, what is the exact MPU region configuration required to ensure the LwIP descriptors and the netif structure remain coherent with the DMA?

    3. Could this indicate a linker script issue where LwIP buffers are overlapping with the .bss or .data sections used for global variables?

    Any guidance on resolving this "Ghost IP" issue on the M7 core would be greatly appreciated. or any link from where i can implement all thing from start or Zero.



2 replies

mƎALLEm
Technical Moderator
May 13, 2026

Hello @Manoj1985Ku and welcome to the ST community,

I invite you to refer to this knowledge base article: Implementing a LwIP and FreeRTOS™ v1 UDP echo server on the STM32F7 series

To give better visibility on the answered topics, please click "Best answer" on the reply which solved your issue or answered your question.
Graduate
May 14, 2026

Hi,

Yeah, I would it is very likely a DMA or D-Cache issue, probably a misconfiguration of the MPU or Ethernet descriptors in the linker, given the symptoms.. I suggest you disable MPU and D-Cache and see if the issue reoccurs.

However, since you mentioned you are open to implementing everything from zero, I can suggest you an alternative to lwIP consisting of a known-good project which you can run as a clean baseline.

Go to https://mongoose.ws/wizard/#/output?board=f746&ide=CubeIDE&rtos=FreeRTOS&file=README.md, it will open up a Cube project which you can download and later run. To do that, select the 'Settings' panel and choose a destination directory, then download the project to your computer by clicking the blue 'Generate C/C++ code' button on the upper right corner of the page. Then, open it with CubeIDE, build it, and flash it to your board. You should see the logs on the serial console indicating a successful DHCP connection.

This project is based on the Mongoose Networking Library, which is a lightweight alternative to LwIP. It runs a device dashboard and you can adapt the project for any networking task you require, with the Mongoose API being well documented. It runs its own networking stack, a simpler and lightweight version compared to lwip.

Heads up: I am part of the Mongoose development team. Hope this helps you get a clean start.

Associate
May 15, 2026

Thanks for ur guide, but first i want to crack this using LwIP. Now i am able to do UART communication and able to display "dhcp link status "  but still facing issue that i am unable to get DHCP IP for STM board and ping the same.