2022-04-17 03:53 AM
I have an STM32F407 and I'm using LwIP + DP83848 Ethernet PHY. I'm facing problems to ping the unit and I don't know why.
The pinouts for the RMII settings.
Red rings got to the processor. The blue ring shows RESET. It need to be logic 1 (HIGH) for the Ethernet PHY to start. The green ring shows a LED lamp that flashes when something happen on the internet cable e.g I ping an IP-address.
The oscillator is at 50 Mhz and I don't know why it should go inside my processor. This is from the datasheet DS8626 of the ST-microcontroller. https://www.st.com/resource/en/datasheet/dm00037051.pdf
I think this is OK to just write 50 MHz for Ethernet PTP?
I have connected my RJ45 connector like this
Other tiny pins of the Ethernet PHY
Pins that are not used are:
Special pinns:
https://i.stack.imgur.com/UszLt.png
Some pins have Pull-up and pull-down. I have pull-downs on all input pins of the ethernet PHY.
https://i.stack.imgur.com/CRwSZ.png
Last picture is the LwIP configuration. Were I select the IP address and the ram address at 0x20014000 with a size of 1600 bytes. My RAM address goes from 0x2000000 to 0x20020000 e.g 128 kB.
https://i.stack.imgur.com/dEliW.png
https://i.stack.imgur.com/HaCJR.png
/* USER CODE BEGIN 0 */
extern struct netif gnetif;
int main(){
/* USER CODE END 0 */
/* USER CODE BEGIN 1 */
/* USER CODE END 1 */
/* MCU Configuration--------------------------------------------------------*/
/* Reset of all peripherals, Initializes the Flash interface and the Systick. */
HAL_Init();
/* USER CODE BEGIN Init */
/* USER CODE END Init */
/* Configure the system clock */
SystemClock_Config();
/* USER CODE BEGIN SysInit */
/* USER CODE END SysInit */
/* Initialize all configured peripherals */
MX_GPIO_Init();
MX_FSMC_Init();
MX_DCMI_Init();
MX_SPI2_Init();
MX_TIM1_Init();
MX_TIM3_Init();
MX_ADC1_Init();
MX_CAN1_Init();
MX_RTC_Init();
MX_TIM4_Init();
MX_DMA_Init();
MX_UART5_Init();
MX_LWIP_Init();
/* USER CODE BEGIN 2 */
/* Activate DP83848 */
HAL_GPIO_WritePin(ETH_RESET_GPIO_Port, ETH_RESET_Pin, GPIO_PIN_SET);
while (1)
{
/* USER CODE END WHILE */
/* USER CODE BEGIN 3 */
ethernetif_input(&gnetif);
sys_check_timeouts();
}
Result:
Nothing happens when I ping
https://i.stack.imgur.com/rhihe.png
Only the LED D1 flashes when I ping. So that means the pin LED_ACT/COL at my Ethernet PHY goes from HIGH to LOW when something happening at the ethernet cable. Right?
https://i.stack.imgur.com/7T9ZD.png
https://i.stack.imgur.com/Vphkh.png
Question:
What should I do in STM32CubeIDE to make my processor work with the Ethernet PHY? What have I missed?
I have follow this manual that shows how to connect a processor to the network using LwIP and an external Ethernet PHY.
https://controllerstech.com/stm32-ethernet-1-connection/
Datasheets:
50 Mhz oscillator: ECS_3225MVQ-1825332.pdf (mouser.se)
RJ45 connector: https://eu.mouser.com/datasheet/2/445/74990101212-1723960.pdf
Solved! Go to Solution.
2022-04-17 07:48 AM
Hey! I found an error! HAL_ETH_ERROR_DMA do I get when I'm only using ETH and not LwIP.. I will open a new question about that.
2022-04-17 04:11 AM
> What should I do in STM32CubeIDE to make my processor work with the Ethernet PHY?
2022-04-17 04:17 AM
2022-04-17 07:36 AM
The current version of STM32F4 cube package has Ethernet (LwIP) examples only for few boards, unfortunately.
See these:
2022-04-17 07:48 AM
Hey! I found an error! HAL_ETH_ERROR_DMA do I get when I'm only using ETH and not LwIP.. I will open a new question about that.
2022-06-16 11:07 PM
Hi @Daniel Mårtensson I am facing same problem with F107 with DP83848 and F407 with LAN8720 chips. Both setups do not ping at all. Please help. I am stuck :(
2022-06-19 11:54 PM
Contact ST team. Upplagd your project here.
2022-06-20 02:03 AM
You can try this HAL 1.27 ETH driver fix for F4. I fixed some bugs mentioned in this thread:
You must replace driver file, you will probably have it in the folder:
C:\Users\<user_folder>\STM32Cube\Repository\STM32Cube_FW_F4_V1.27.0\Drivers\STM32F4xx_HAL_Driver\Src