cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F439 with FreeRTOS & ETH gets stuck in MX_LWIP_Init()

debug
Associate III

Hi,

I want to creater a telnet server but can't even get the board to respond to a ping. I followed the following sequence:

  1. Crearted a new project
  2. selected my Nucleo-F439ZI board
  3. selected to initialize the peripherals to their default mode
  4. Got the following clock config (note I changed the HSE to 25MHz):debug_1-1711042245301.png
  5. Enabled FreeRTOS CMSIS_V

  6. Changed Timebase Source to TIM14 (in SYS config)
  7. Enabled USE_NEWLIB_REENTRANT (In FREERTOS config)
  8. Confirmed that ETH is enabled with RMII & confirmed all the pins are routed correctly (no changes needed)
  9. Enabled LWIP
  10. Changed the Driver_PHY to LAN8742
  11. Disabled DHCP 
  12. Set IP to 192.168.000.123 with 255.255.255.0 as subnet
  13. Ctrl+s to create the sources!
  14. compiled & loaded the application & tried to ping the above IP (.123) from my laptop (set to 192.168.0.111) but do not get any response.
  15. I realized that it appears to get stuck in MX_LWIP_Init(). Why is this and how can I fix it?
1 ACCEPTED SOLUTION

Accepted Solutions
STea
ST Employee

Hello @debug,

as a first guess I recommend that you check the Tim14 Timebase is working as well as Systick initialization as it will be used by LWIP maybe try using anther Timer like TIM6 and see the difference.

Another point to be aware of is memory management (pool allocation, buffer placement in SRAM ...).

A general recommendation will be to see the working example STM32Cube_FW_F4_V1.27.0\Projects\STM32F429ZI-Nucleo\Applications\LwIP\LwIP_HTTP_Server_Netconn_RTOS which can be run on your board. And try to see the difference between this code and your generated code to pinpoint your issue.  

BR

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

View solution in original post

4 REPLIES 4
STea
ST Employee

Hello @debug,

as a first guess I recommend that you check the Tim14 Timebase is working as well as Systick initialization as it will be used by LWIP maybe try using anther Timer like TIM6 and see the difference.

Another point to be aware of is memory management (pool allocation, buffer placement in SRAM ...).

A general recommendation will be to see the working example STM32Cube_FW_F4_V1.27.0\Projects\STM32F429ZI-Nucleo\Applications\LwIP\LwIP_HTTP_Server_Netconn_RTOS which can be run on your board. And try to see the difference between this code and your generated code to pinpoint your issue.  

BR

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

You have the source code - use your debugger.  WHERE in MX_LWIP_Init() is it hanging?  If it is in a HAL_Delay() call, then, yeah, your timer config is probably incorrect.

debug
Associate III

Hi,

 

My apologies for replying late! I finally got back to it. I created a new project, set the timebase source to TIM6, enabled FreeRTOS, LWIP & Ethernet compiled and loaded and it looks like I can get LWIP_Init() fine now and my project will enter infinite loop in StartDefaultTask.

I set the IP to 192.168.000.123/24 and my computer to 192.168.0.234/24 and when I try to send pings from my computer to 192.168.0.123, it won't respond. In Wireshark, I see the ARP requests for 192.168.0.123 going out but there's no reply to the requests from the board. What else am I missing? LWIP_ICMP is Enabled in the config (LWIP -> General Settings)

I cloned the repo from STM32Cube_FW_F4_V1.27.0\Projects\STM32F429ZI-Nucleo\Applications\LwIP\LwIP_HTTP_Server_Netconn_RTOS, imported the project but it wouldn't build, it appears to be missing the complete contents of  LwIP_HTTP_Server_Netconn_RTOS\STM32CubeIDE\Drivers\STM32F4xx_HAL_Driver I tried to manually copy the missing files but have not succeeded in building this project yet. Not exactly sure how I can use these examples

Hello @debug

if you are missing some files, you are clearly using the download button to get the Repo .

you can try to use the command.

 git clone GitHub - STMicroelectronics/STM32CubeF4: STM32Cube MCU Full Package for the STM32F4 series - (HAL + LL Drivers, CMSIS Core, CMSIS Device, MW libraries plus a set of Projects running on all boards provided by ST (Nucleo, Evaluation and Discovery Kits))

this should resolve your issue.

you can also still get the package from the ST.com website

BR

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.