2023-08-03 12:39 AM
I'm trying to get the ethernet working on the nucleo-F746ZG eval board.
I've found the LwIP_HTTP_Server_Netconn_RTOS example which works great
(first time EVER for me, that code on embedded device actually worked without spending several days to fix things : )
Now, I'm trying to reproduce the functionality in a project generated for IOC file,
And I can't get the ethernet to work.
I can see that the link status is OK, but I don't get replies from ping messages.
I've been trying to compare the code generated from the IOC to the code in the example,
and change the IOC to generate the same code, but so far without success.
Is there someplace where I can get an IOC file for nucleo-F746ZG eval board with ethernet enabled?
Thanks,
Nadav
2023-08-03 09:10 AM - edited 2023-08-07 12:46 AM
Hello @nadavpp,
You can simply create the project from board selector and configure Ethernet in CubeMX.
However, to get this example working, you need to align it to the example.
Hope this helps!
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2023-08-06 12:06 AM
Hi @F.Belaid,
Thanks for your reply,
I've looked at the LwIP_HTTP_Server_Netconn_RTOS example (which works) and it configures the ethernet as RMII (the user manual also says that you need to configure the ethernet as RMII)
The CubeMX will not let me configure the ethernet as MII because it conflicts with PB0 which configured as IO (led1)
I've looked at the code of the LwIP_HTTP_Server_Netconn_RTOS and I noticed two things:
1. the ethernet interrupt is configured with priority 7 , in the CubeMX project the property is configured as 5 (and you can't change it.
I tried to manually change the code to priority 7, but it did not change anything.
1. it configures pin PG2 (as RMII_MII_RXER)
The RMII_MII_RXER definition does not exist in the CubeMX project, and as far I can see from the STM32 documentation there is NO alternate functionality for the pin in AF11 mode.
/* Ethernet pins configuration ************************************************/
/*
RMII_REF_CLK ----------------------> PA1
RMII_MDIO -------------------------> PA2
RMII_MDC --------------------------> PC1
RMII_MII_CRS_DV -------------------> PA7
RMII_MII_RXD0 ---------------------> PC4
RMII_MII_RXD1 ---------------------> PC5
RMII_MII_RXER ---------------------> PG2
RMII_MII_TX_EN --------------------> PG11
RMII_MII_TXD0 ---------------------> PG13
RMII_MII_TXD1 ---------------------> PB13
*/
/* Configure PA1, PA2 and PA7 */
GPIO_InitStructure.Speed = GPIO_SPEED_HIGH;
GPIO_InitStructure.Mode = GPIO_MODE_AF_PP;
GPIO_InitStructure.Pull = GPIO_NOPULL;
GPIO_InitStructure.Alternate = GPIO_AF11_ETH;
GPIO_InitStructure.Pin = GPIO_PIN_1 | GPIO_PIN_2 | GPIO_PIN_7;
HAL_GPIO_Init(GPIOA, &GPIO_InitStructure);
/* Configure PB13 */
GPIO_InitStructure.Pin = GPIO_PIN_13;
HAL_GPIO_Init(GPIOB, &GPIO_InitStructure);
/* Configure PC1, PC4 and PC5 */
GPIO_InitStructure.Pin = GPIO_PIN_1 | GPIO_PIN_4 | GPIO_PIN_5;
HAL_GPIO_Init(GPIOC, &GPIO_InitStructure);
/* Configure PG2, PG11, PG13 and PG14 */
GPIO_InitStructure.Pin = GPIO_PIN_2 | GPIO_PIN_11 | GPIO_PIN_13;
HAL_GPIO_Init(GPIOG, &GPIO_InitStructure);
Thanks,
Nadav
2023-08-06 12:39 AM
Regarding the priority of the ethernet IRQ, I found where it's configured in CubeMX
Changed it to 7, still does not work :(
Nadav
2023-08-06 06:41 AM - edited 2023-08-06 06:45 AM
@nadavpp You can download the schema of the board here: https://www.st.com/en/evaluation-tools/nucleo-f746zg.html#cad-resources Unpack the zip and extract MB1137.pdf.
From this schema, indeed the RMII has only 9 lines and RMII_MII_RXER does not belong there.
#bugreport
2023-08-07 01:13 AM
Hello @Pavel A. ,
Thank you for bringing this issue to my attention.
I confirm and I reported Internally.
CubeMX related issue tracked under the number 158834.
These are internal tracking numbers and are not accessible or usable by customers.
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2023-08-07 03:50 AM
Hello @nadavpp,
According to Interrupt priority, it should be 5 - preemption and 0 - subpriority. This is required by default for FreeRTOS configuration.
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2023-08-07 06:59 AM
The requirement is to not exceed the priority level defined by the configMAX_SYSCALL_INTERRUPT_PRIORITY macro, not set it exactly at that value. And the number 5 is also just an arbitrary number taken from FreeRTOS examples, not a requirement.
For the author...
2023-08-10 12:19 AM
Looks like the problem I have is with sending packets:
I've added debug to the LWIP and I see that I get ping messages:
2023-08-10 05:27 AM
What do you see with wireshark?