2022-03-17 06:44 AM
I have tried to generate a new project using STM32CubeIDE from scratch (fw V1.27.0, no way to modify it[!!!]) but it does not compile.
A lot of descriptors are missing, like there is no resolution for the following:
ETH_TxPacketConfig TxConfig;
ETH_DMADescTypeDef DMARxDscrTab[ETH_RX_DESC_CNT]; /* Ethernet Rx DMA Descriptors */
ETH_DMADescTypeDef DMATxDscrTab[ETH_TX_DESC_CNT]; /* Ethernet Tx DMA Descriptors */
No ETH_TxPacketConfig and ETH_RX_DESC_CNT and ETH_TX_DESC_CNT defined anywhere.
Also, there is no HAL_ETH_RMII_MODE defined (for example) anywhere and if I try to resolve these issues, it reveals:
ETH_InitTypeDef does not have TxDesc and RxDesc and RxBuffLen members, so practically ethernet layer is completely messed up.
Solved! Go to Solution.
2022-07-15 08:13 AM
Hello,
This is actually not an issue, it is a new implementation.
The ETH_InitTypeDef has a new definition. As an example, In V1.26.2, TxDesc and RxDesc and RxBuffLen were not defined but in V1.27.0 they exists and they are mentioned in stm32f4xx_hal_eth.h, HAL_ETH_RMII_MODE was defined as ETH_MEDIA_INTERFACE_RMII in the previous FW version.
When the project is created with CubeMX 6.5.0 the FW has to be v1.27.0 otherwise there will be compilation errors.
Sara.
2022-03-17 07:25 AM
This is likely because in 1.27.2 the ETH driver has undergone major changes (aka "reworked"); this change requires also change in the user code.
The previous ETH driver version is in STM32F4xx_HAL_Driver/Src/Legacy/
Try to build with that. If it works, consider updating your code to the new driver.
2022-03-17 07:29 AM
Right but it is a code generated from scratch, so there are no user codes written by me there.
Practically this is an STM32CubeMX/IDE version which contains an updated ETH driver code but outdated code generation - so it should has not been released yet considering ETH function.
So I have no user code in this project, it was simply fresh-generated but ETH was messed up...
2022-03-17 07:31 AM
Moreover, these codes are generated in main at places where user can not redefine it easily (not in USER section).
2022-03-20 07:10 PM
Yes this is the situation, you're right. We'll have to live with it for some time, until they get around to update the templates.
2022-03-22 06:52 AM
Hello @VaZso ,
Thanks for your feedback,
Could you please share your ioc file?
Thanks,
Sara.
2022-03-22 07:34 AM
Thank you your reply.
Now I have disabled almost everything except ETH and some other things.
After completely deleting project files (except .ioc) then regenerating project in STM32CubeIDE, it misses respective PHY files and if I copy them from GitHUB location of latest firmware, it still drops a lot of errors regarding ethernet interface.
If I do not select PHY, it simply drops a lot of errors regarding ethernet interface.
These errors are related to missing macros and incorrect type definitions.
If it matters, I am running it under Linux.
Project's IOC file is attached and here are some compiling errors:
../Src/ethernetif.c:100:34: error: 'ETH_RX_DESC_CNT' undeclared here (not in a function)
100 | ETH_DMADescTypeDef DMARxDscrTab[ETH_RX_DESC_CNT]; /* Ethernet Rx DMA Descriptors */
| ^~~~~~~~~~~~~~~
../Src/ethernetif.c:101:34: error: 'ETH_TX_DESC_CNT' undeclared here (not in a function)
101 | ETH_DMADescTypeDef DMATxDscrTab[ETH_TX_DESC_CNT]; /* Ethernet Tx DMA Descriptors */
| ^~~~~~~~~~~~~~~
../Src/ethernetif.c:109:1: error: unknown type name 'ETH_TxPacketConfig'
109 | ETH_TxPacketConfig TxConfig;
| ^~~~~~~~~~~~~~~~~~
../Src/ethernetif.c: In function 'low_level_init':
../Src/ethernetif.c:160:30: error: 'HAL_ETH_RMII_MODE' undeclared (first use in this function); did you mean 'IS_ETH_RX_MODE'?
160 | heth.Init.MediaInterface = HAL_ETH_RMII_MODE;
| ^~~~~~~~~~~~~~~~~
| IS_ETH_RX_MODE
../Src/ethernetif.c:160:30: note: each undeclared identifier is reported only once for each function it appears in
../Src/ethernetif.c:161:12: error: 'ETH_InitTypeDef' has no member named 'TxDesc'
161 | heth.Init.TxDesc = DMATxDscrTab;
| ^
../Src/ethernetif.c:162:12: error: 'ETH_InitTypeDef' has no member named 'RxDesc'
162 | heth.Init.RxDesc = DMARxDscrTab;
| ^
../Src/ethernetif.c:163:12: error: 'ETH_InitTypeDef' has no member named 'RxBuffLen'
163 | heth.Init.RxBuffLen = 1536;
2022-07-12 11:35 PM
This is still not fixed. Any idea for when ST will come with a fix ?
2022-07-15 08:13 AM
Hello,
This is actually not an issue, it is a new implementation.
The ETH_InitTypeDef has a new definition. As an example, In V1.26.2, TxDesc and RxDesc and RxBuffLen were not defined but in V1.27.0 they exists and they are mentioned in stm32f4xx_hal_eth.h, HAL_ETH_RMII_MODE was defined as ETH_MEDIA_INTERFACE_RMII in the previous FW version.
When the project is created with CubeMX 6.5.0 the FW has to be v1.27.0 otherwise there will be compilation errors.
Sara.