STM32F4DIS-BB + ETH + CubeMX
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2014-04-25 3:56 AM
Created a project targeting STM32F4DISCOVERY + STM32F4DIS-BB from a scratch with CubeMX. Managed to blink LEDs and send bytes over UART but now struggling with Ethernet and LwIP. I have referenced STM32F4DIS-BB example and have added PHY reset into generated ETH GPIO function and both LEDs at ETH connector is set on, but when pinging from pc no input interrupts are triggered nor low_level_input() being called. Any ideas or experience is this HW or LwIP configuration problems. Attached is my *.ioc file. Thanks.
#stm32f4dis-bb #stm32f4-bb+cubemx- Labels:
-
STM32F4 Series
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2014-04-25 6:34 AM
Hello
there are two things to make Ethernet running on STM32F4DIS-BB
First, PHY address of STM32F4DIS-BB is 0, Mx by default MX set an address 1Second, declare PE2 as Output and before the call to HAL_ETH_Init, do// reset du PHY on the STM32F4DIS-BB board
HAL_GPIO_WritePin(GPIOE, GPIO_PIN_2, GPIO_PIN_RESET);
HAL_Delay(50);
HAL_GPIO_WritePin(GPIOE, GPIO_PIN_2, GPIO_PIN_SET);
HAL_Delay(50);
After that, the Ethernet interface is functionnal. After, the configuration of Lwip, is not completly done by MX. AT your charge, => you do make a DHCP client, a real server ( not a demo echo as exemple source in the HAL) on TCP or UDP. Rémi- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2014-04-25 11:00 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2014-04-25 1:32 PM
HAL_Delay works before the launch of FreeRTOS. In a thread, I use osDelay(50). ( 50 ms)
Also, the PHY on BB, has no interrupt pin to signal a lost link. So, there are a thread for the link state, that in BB is not necessary. If you want I can send you the code for DHCP, and my lwipots for have the full IP connectivity.Actually I work with the native Lwip API. I am writting C++ class to make server and client UDP and TCP in 32K of memory.Rémi- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2014-04-26 3:51 AM
Rèmi, sure would, thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2014-07-01 2:33 AM
Hello Remi,
I'm trying to make stm32f4discovery-BB expansion work through CubeMX as well so I could try some functions in it. I am doing a project with the same ethernet schematic as STM32F4-BB has so this will be very useful.Whould you mind sending the STM32F4-BB configuration file and the code for DHCP?Thanks in advanceBorja- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2015-02-11 11:18 PM
I generate one IAR project by Cube, it doesn't work.
The function __ETH_CLK_ENABLE() in ethernetif.c (Line 102) is nothing, I suspect this causing problem, how to fix it?- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2015-02-12 5:33 AM
This thread is almost one year old, so I guess it's mere existence has dropped off that poster's minds.
And honestly, I'm not very impressed by Cube, nor would I recommend it for non-ST hardware. There is a working ethernet example (amongst others) for STM32F4DIS-BB around at thehttp://www.element14.com/community/docs/DOC-51670/l/stm32f4dis-bb-discover-more-software-examples
. It is for the StdPeriph-Library, but would much better serve as a starting point.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2016-04-22 4:03 AM
Man, glad I found this thread. The PHY address is what fixed it for me! If anyone is interested I can share my STM32CubeMX .IOC file so you can generate your own project. Right now I just have it configured for standalone lwip operation (no FreeRTOS) but it successfully connects to the network with a static IP.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2016-06-08 9:26 AM
Hello3ftins!
I would be interested in your cubemx file. Can you please share it? Here is my post about the things ive already done, however i could not manage to make the ethernet work on my stm32f407: Thank you in advance. Best regards, �?kos