cancel
Showing results for 
Search instead for 
Did you mean: 

CubeMX LWIP not working

Raymond Buck
Senior
Posted on March 15, 2017 at 02:47

I have just started experimenting with ST products. I have a STM32F4 Discovery board. I bought a DP83848 PHY on Ebay and connected it to the Discovery board. I downloaded a hex file from here:[

https://community.st.com/external-link.jspa?url=http%3A%2F%2Fblog.tkjelectronics.dk%2F2012%2F08%2Fethernet-on-stm32f4discovery-using-external-phy%2F

]

I am able to ping the board and access the web page with no issues.

I then used CubeMX to create a project with nothing but LWIP and two GPIO pins. I figured I would start out simple. The goal was to see if I could get LWIP working. I generated the code and imported it into System Workbench and used STLink to program the board.

I cannot ping the board (I enabled ICMP in CubeMX) and it does not make a DHCP request. I know the request is not being made because Wireshark never sees it.

Do I have to put anything in the main() while loop for lwip to work? Do I need to make any modifications to use the DP83848? I noticed in CubeMX that in the Ethernet Settings, it states LAN8742A for the PHY. Maybe this is my issue? If so, what modifications need to be made to tell CubeMX to use the DP83848?

I have been working on this for two days and making zero progress.

18 REPLIES 18
Posted on June 13, 2017 at 12:31

Hello Raymond,

how did you get the ethernet running ? Im sitting here since hours with the STM3210C-Eval board (F107) and cant get a ping or anything else... . I generated the sourcecode from cubemx and inserted the 'MX_LWIP_Process();' into the while(1) of the main-loop.

What have i already tried ?

-changed phy adress of the DP83848 to 1

-fixed the ip adress and connected directly to the pc

Read everything what i can find ....

Do you have any suggestions ?

Posted on June 15, 2017 at 17:38

Mathias,

Yes, I got everything working. I am in the process of moving so I have the board packed up. I was using an F407 board and there may be differences between it and your board. I can place all the files from my project into a zip file and send them to a shared upload site if you think it would help.

Raymond

Posted on June 19, 2017 at 10:12

Hi Raymond, 

that would be great, if you can do that. I´m also wondering that i only can choose 'Rx Mode = Polling Mode' under Ethernet Basic Configuration in STM32CubeMX. Was this the same in your project ?

Thank you for your support !

Mathias

Posted on June 20, 2017 at 19:28

Mathias,

I uploaded the zip file to here:

https://ufile.io/8e4ls

The name of the file is 'STM_Ethernet.zip.

You do not need a username or password as no login is required. The file will remain there for 30 days.

Yes, the only option that was available under Basic Configuration was 'Rx Mode = Pollng Mode'. My guess is there was no option to choose interrupt as polling is probably the most easiest way to receive incoming data.

I didn't look at the schematic of your board to see if the RMII connection pin numbers are the same as the F407 processor. If they are, you could load my hex file into your board and it should work. The hex file is in the Release folder and is named Eth-Test.hex.

Good luck.

Raymond

Posted on June 21, 2017 at 11:02

Hi Raymond, 

thank you again for uploading your files. I compared my code to yours and found some differences. Now i can ping the board :-). Now i want to try to setup a webserver. Unluckily the CubeMx only support LwIP version 1.4.1 for F107 series. So there is no 'httpd' field to choose in CubeMx. I think i have to implement it somehow by hand.

Mathias
Posted on July 05, 2017 at 16:42

Hello Mathias,

The update of

STM32CubeF1 with

LwIP V 2.0.0 will come with next release STM32CubeMX 4.22 normally on the web next week (week 28).

Eric

Posted on September 15, 2017 at 14:33

Hi Raymond, how are you?

Can you send me your project? I'm trying to connect a STM32F4Discovery to a LAN8710 PHY but my network cannot find the uC. I'm using this project (blog.tkjelectronics.dk/2012/08/ethernet-on-stm32f4discovery-using-external-phy/) to upload to my board with the provided changes for the LAN8710. Can you help me?

dieter 123
Associate III
Posted on November 10, 2017 at 13:22

Hi

How does it come ST is not fixing this issue:

Bug description:

1. start FW with ethernet disconnected

2. wait for 10 secnds

3. plug ethernet cable

4. ping board

-> board wont reply to ping.

I am using the latest CUBE and F4 repository.

What is the recommended fix here?

Thx

Barber.Mark
Associate III

yes i am having the same problem if the cable disconnects then there is no recovery. i am thinking monitor the cable connection if i disconnects release the IP address then try to renew. i cannot be the only one with this trouble. tanks any help appreciated.