2025-08-04 10:09 AM
Hello ST Community,
I’m currently developing on the STM32H743 using STM32CubeIDE, with the following configuration:
FreeRTOS v1 (CMSIS v1 style tasks)
LWIP stack configured in RAW API mode (not using netconn or socket layers)
Network communication is up and running, and TCP/IP works as expected.
---
Requirement:
I want to monitor or intercept the raw LWIP buffers, especially:
RX and TX pbuf contents
Packet payloads
PCB-level metadata
...but I want to achieve this without using:
lwip_recv(), lwip_send()
lwip_select() or POSIX socket APIs
---
Goal:
Build a diagnostic/logging mechanism to observe incoming/outgoing TCP/UDP packets
Possibly build a lightweight mirror/sniffer on the MCU itself
Debug real-time network traffic without affecting application-level task logic
---
Key Questions:
1. Can we hook into pbuf_alloc(), pbuf_free(), or similar functions to mirror buffer contents?
2. Is there a safe and clean way to tap into the LWIP receive/transmit paths at the core level?
3. Can tcp_input() or eth_input() be instrumented for monitoring without breaking TCP state?
4. Is there any ST-recommended way to log or clone traffic from the Ethernet interface before it hits the application?
---
Any guidance, insights, or experience on raw-level packet monitoring inside STM32H7 + CubeMX-generated LWIP would be greatly appreciated.
Looking forward to expert suggestions from the community.
Warm regards,
Jumman