2015-04-08 11:54 AM
Hi, i'm trying to port hte STM32F4xG_EVAL example to STM32F4-Discovery along with STM32-DIS-BB. I have referenced the Embest's example for discovery and the 4xG example and i'm stuck.
I've copied the project:C:...\STM32Cube_FW_F4_V1.5.0\Projects\STM324xG_EVAL\Applications\LwIP\LwIP_HTTP_Server_Socket_RTOS\Src
and made minor changes to main.c about the LEDs present on the board. Then I changed the ethernetif.c. Basically what i've done is changed the GPIO mapping, media control to RMII and the phy address to LAN8720 (i'm not sure what does this address in the EthInit structure mean).
The lwIP reports netif link is up (via LED) and RTOS is scheduling it's task normally, but I cannot find it in my router's DHCP clients (nor access it for that matter). I've checked all the preprocessor defines, and they're ok. Router is also fine, the Embest's project works fine and i can access the webpage. Something's missing and for the past few days I have not figured out what. I'm new to ethernet and this driver library. Ethernetif is the only meaningful change i've made with regards to the provided 4xG example.
If anyone can help, I would appreciate it very much. I have attached the ethernetif.c and here's a pastebin link also.
http://pastebin.com/JenTubHQ
Thank you.
#dis-bb #cube #discovery #lwip
2018-12-09 01:05 PM
Posted my working STM32F4Discovery + STM32F4DIS-BB (lwIP v2.0.3) CubeMX (HAL) Atollic TrueStudio project on:
https://github.com/Broekman/STM32F4Discovery_DIS_BB_CubeMX
For all purposes sake, the things required to make it work (already included in the project above):
In CubeMX:
In the code:
//PHY reset for the STM32F4DIS-BB board.
GPIO_InitTypeDef GPIO_InitStruct;
GPIO_InitStruct.Pin = GPIO_PIN_2;
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
HAL_GPIO_Init(GPIOE, &GPIO_InitStruct);
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);
And of course not to forget in the main loop: MX_LWIP_Process();
Hope this helps, good luck!
2019-04-16 05:23 AM
Hello Broekman,
at first thank you for your project. It is my first time to work with Ethernet and working with LwIP.
I am able to see my STM32F4Discovery + STM32F4DIS-BB in my settings of the router. ( MAC Adress and IP).
But now I would like to communicate with my PC over UDP. Have you an advice, for my first steps? What kind of socket should I take? I am a bit confused...