2024-11-29 03:34 AM - last edited on 2024-11-29 04:43 AM by Andrew Neil
Originally a reply to https://community.st.com/t5/stm32cubemx-mcus/lwip-lan8720/m-p/690602 but needs a new thread
How do i manually add file C and file H ??
2024-11-29 03:49 AM
You haven't said what IDE you're using but, for STM32CubeIDE:
(depending on how your project is set up, those could be the same folder)
2024-11-29 03:55 AM
I am using STM32CubeIDE. need to add in Core>Inc and Core> Src ???
Lwip Should be enabled or disabled??
2024-11-29 03:56 AM
Sorry for so many questions, as I am just starting to work with stm32 controllers and practicing
2024-11-29 04:13 AM - edited 2024-11-29 04:23 AM
Ethernet is really not a beginner's project - you should probably start with some more basic projects to get familiar with the tools...
https://www.youtube.com/watch?v=gL8OoS9E1rw&list=PLnMKNibPkDnFCosVVv98U5dCulE6T3Iy8
EDIT:
You also haven't said what STM32 you're using, what hardware, etc.
Again, please see the Posting Tips:
PS:
Try a search in the Knowledge Base; eg,
Also, as previously noted, LwIP is a widely-used independent 3rd-party project - so a general web search should find a lot...
2024-11-29 04:26 AM - last edited on 2024-11-29 04:43 AM by Andrew Neil
I am using STM32F407VGT6. ETH mode: RMII.
PA1 | ETH_REF_CLK | n/a | Alternate Function Push Pull | No pull-up and no pull-down | Very High | false | |
PA2 | ETH_MDIO | n/a | Alternate Function Push Pull | Pull-up | Very High | true | |
PA7 | ETH_CRS_DV | n/a | Alternate Function Push Pull | No pull-up and no pull-down | Very High | false | |
PB11 | ETH_TX_EN | n/a | Alternate Function Push Pull | No pull-up and no pull-down | Very High | false | |
PB12 | ETH_TXD0 | n/a | Alternate Function Push Pull | No pull-up and no pull-down | Very High | false | |
PB13 | ETH_TXD1 | n/a | Alternate Function Push Pull | No pull-up and no pull-down | Very High | false | |
PC1 | ETH_MDC | n/a | Alternate Function Push Pull | Pull-up | Very High | true | |
PC4 | ETH_RXD0 | n/a | Alternate Function Push Pull | No pull-up and no pull-down | Very High | false | |
PC5 | ETH_RXD1 | n/a | Alternate Function Push Pull | No pull-up and no pull-down | Very High | false |
Also I activate RCC_MCO_1 -- 25Mhz.
2024-11-29 04:29 AM
Is that a commercial board, or your own custom design?
2024-11-29 04:30 AM
My custom design
2024-11-29 10:41 AM - edited 2024-11-29 10:42 AM
Hi Murad,
The CubeMX and the libraries offered in the "Software pack" have evolved since I've last time dealt with ETH and LwIP. Maybe there's a new straight method now to change the PHY. I'd still do this in the old way, simply because this is easier for me. The changes for the PHY will be in LwIP/Target/ethernetif.c and the original files for the PHY are under Drivers/BSP. Basically you just find all calls to the PHY module in ethernetif.c and replace by similar calls in the actual C file (lan8720_driver.c or whatever) and replace the PHY .h file to the corresponding new .h. Then remove the c,h files for the old PHY and copy the new PHY files in your project. Just copy both .c and .h files in the same directory with your ethernetif.c and add to the project. Only ethernetif.c will use it, so no reason to be fancy.
Compile and fix errors. That will be the easy part.
The hard part is to debug and verify that the new PHY routines are actually called and do what they should.
Good luck.