cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F207ZGT6- Ethernet (LwIP, NO_SYS Mode) and UART Not Working in Parallel

Karthik_Ramadoss
Associate

Dear Team,

I am currently working on an STM32F207-based custom board using Ethernet (RMII with LAN8742A PHY) and LwIP in NO_SYS (bare-metal, no RTOS) mode. I am facing an issue where Ethernet and UART are not functioning correctly in parallel.

Project Details:

  • MCU: STM32F207

  • PHY: LAN8742A (RMII mode, PHY address = 1)

  • LwIP Operating Mode: NO_SYS = 1 (No RTOS)

  • DHCP enabled (also tested with static IP)

  • UART2 used for debug output (blocking HAL_UART_Transmit)

Issue Description:

When Ethernet (LwIP) is enabled and initialized using MX_LWIP_Init(), UART output stops working. Even simple debug prints placed before Ethernet processing in the main loop are not printed.

However:

  • If Ethernet/LwIP is disabled, UART works normally.

  • If MX_LWIP_Init() is commented out, UART works.

  • Ethernet link LEDs indicate that PHY is active.

This suggests that enabling Ethernet + LwIP in NO_SYS mode is interfering with system execution or blocking during initialization or processing.

Observations:

  • MX_LWIP_Init() is called after peripheral initialization.

  • In NO_SYS mode, MX_LWIP_Process() is called inside the main loop.

  • PHY reset sequence is handled before initialization.

  • RMII mode is configured in CubeMX.

  • Interrupt priorities are default.

  • No FreeRTOS is used in this project.

Questions:

  1. Is there any known issue when using LwIP in NO_SYS mode on STM32F207?

  2. Are there specific requirements for RMII reference clock configuration that could cause blocking during Ethernet initialization?

  3. Could Ethernet interrupt configuration interfere with UART execution in bare-metal mode?

  4. Is there a recommended minimal working initialization sequence for STM32F2 + LwIP (NO_SYS)?

I would appreciate guidance on proper Ethernet initialization and configuration to allow Ethernet and UART to operate reliably in parallel without RTOS.

Please let me know if project configuration files or further details are required.

Thank you for your support.

2 REPLIES 2
STackPointer64
ST Employee

Hello @Karthik_Ramadoss, and welcome to ST community!

Could you please attach a minimal version of your project that reproduces the issue so I can review it? If the project is private, feel free to send me a message privately i can provide a secure line for you to upload the project.

Best regards,

To improve visibility of answered topics, please click 'Accept as Solution' on the reply that resolved your issue or answered your question.
Andrew Neil
Super User

No, there is no particular reason why Ethernet and UART shouldn't be usable together.

 

Sounds like your MX_LWIP_Init()  is disabling and/or reconfiguring something which your UART relies upon; eg,

  • GPIO pins;
  • Clocks.

So step through the code; carefully compare & contrast the two cases ...

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.