Skip to content

Unable to build with STM32F4 #2003

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
nopnop2002 opened this issue Apr 13, 2023 · 3 comments · Fixed by #2004
Closed

Unable to build with STM32F4 #2003

nopnop2002 opened this issue Apr 13, 2023 · 3 comments · Fixed by #2004
Labels
bug 🐛 Something isn't working
Milestone

Comments

@nopnop2002
Copy link

nopnop2002 commented Apr 13, 2023

I built this.

I got this error:

Arduino: 1.8.19 (Windows 10), Board: "Generic STM32F4 series, Black F407VE, STM32CubeProgrammer (SWD), Enabled (generic 'Serial'), None, Low/Full Speed, Smallest (-Os default), None, Newlib Nano (default)"





















Warning: Board breadboard:avr:atmega328bb doesn't define a 'build.board' preference. Auto-set to: AVR_ATMEGA328BB

\\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32duino_STM32Ethernet\src\utility\ethernetif.cpp: In function 'void low_level_init(netif*)':

\\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32duino_STM32Ethernet\src\utility\ethernetif.cpp:170:18: error: 'struct ETH_InitTypeDef' has no member named 'AutoNegotiation'

  170 |   EthHandle.Init.AutoNegotiation = ETH_AUTONEGOTIATION_ENABLE;

      |                  ^~~~~~~~~~~~~~~

\\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32duino_STM32Ethernet\src\utility\ethernetif.cpp:171:18: error: 'struct ETH_InitTypeDef' has no member named 'Speed'

  171 |   EthHandle.Init.Speed = ETH_SPEED_100M;

      |                  ^~~~~

\\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32duino_STM32Ethernet\src\utility\ethernetif.cpp:172:18: error: 'struct ETH_InitTypeDef' has no member named 'DuplexMode'

  172 |   EthHandle.Init.DuplexMode = ETH_MODE_FULLDUPLEX;

      |                  ^~~~~~~~~~

\\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32duino_STM32Ethernet\src\utility\ethernetif.cpp:172:31: error: 'ETH_MODE_FULLDUPLEX' was not declared in this scope

  172 |   EthHandle.Init.DuplexMode = ETH_MODE_FULLDUPLEX;

      |                               ^~~~~~~~~~~~~~~~~~~

In file included from C:\Users\user\AppData\Local\Arduino15\packages\STMicroelectronics\hardware\stm32\2.5.0\system/Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f4xx.h:132,

                 from C:\Users\user\AppData\Local\Arduino15\packages\STMicroelectronics\hardware\stm32\2.5.0\cores\arduino/stm32/stm32_def.h:36,

                 from \\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32duino_STM32Ethernet\src\utility\ethernetif.cpp:48:

C:\Users\user\AppData\Local\Arduino15\packages\STMicroelectronics\hardware\stm32\2.5.0\system/Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f407xx.h:11633:53: error: invalid conversion from 'long unsigned int' to 'ETH_MediaInterfaceTypeDef' [-fpermissive]

11633 | #define SYSCFG_PMC_MII_RMII_SEL_Msk          (0x1UL << SYSCFG_PMC_MII_RMII_SEL_Pos) /*!< 0x00800000 */

C:\Users\user\AppData\Local\Arduino15\packages\STMicroelectronics\hardware\stm32\2.5.0\system/Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f407xx.h:11634:46: note: in expansion of macro 'SYSCFG_PMC_MII_RMII_SEL_Msk'

11634 | #define SYSCFG_PMC_MII_RMII_SEL              SYSCFG_PMC_MII_RMII_SEL_Msk       /*!<Ethernet PHY interface selection */

      |                                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~

C:\Users\user\AppData\Local\Arduino15\packages\STMicroelectronics\hardware\stm32\2.5.0\system/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_eth.h:1344:40: note: in expansion of macro 'SYSCFG_PMC_MII_RMII_SEL'

 1344 | #define ETH_MEDIA_INTERFACE_RMII      (SYSCFG_PMC_MII_RMII_SEL)

      |                                        ^~~~~~~~~~~~~~~~~~~~~~~

\\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32duino_STM32Ethernet\src\utility\ethernetif.cpp:174:35: note: in expansion of macro 'ETH_MEDIA_INTERFACE_RMII'

  174 |   EthHandle.Init.MediaInterface = ETH_MEDIA_INTERFACE_RMII;

      |                                   ^~~~~~~~~~~~~~~~~~~~~~~~

\\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32duino_STM32Ethernet\src\utility\ethernetif.cpp:181:18: error: 'struct ETH_InitTypeDef' has no member named 'RxMode'

  181 |   EthHandle.Init.RxMode = ETH_RXPOLLING_MODE;

      |                  ^~~~~~

\\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32duino_STM32Ethernet\src\utility\ethernetif.cpp:183:18: error: 'struct ETH_InitTypeDef' has no member named 'ChecksumMode'

  183 |   EthHandle.Init.ChecksumMode = ETH_CHECKSUM_BY_HARDWARE;

      |                  ^~~~~~~~~~~~

\\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32duino_STM32Ethernet\src\utility\ethernetif.cpp:184:18: error: 'struct ETH_InitTypeDef' has no member named 'PhyAddress'

  184 |   EthHandle.Init.PhyAddress = LAN8742A_PHY_ADDRESS;

      |                  ^~~~~~~~~~

\\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32duino_STM32Ethernet\src\utility\ethernetif.cpp:193:3: error: 'HAL_ETH_DMATxDescListInit' was not declared in this scope

  193 |   HAL_ETH_DMATxDescListInit(&EthHandle, DMATxDscrTab, &Tx_Buff[0][0], ETH_TXBUFNB);

      |   ^~~~~~~~~~~~~~~~~~~~~~~~~

\\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32duino_STM32Ethernet\src\utility\ethernetif.cpp:196:3: error: 'HAL_ETH_DMARxDescListInit' was not declared in this scope

  196 |   HAL_ETH_DMARxDescListInit(&EthHandle, DMARxDscrTab, &Rx_Buff[0][0], ETH_RXBUFNB);

      |   ^~~~~~~~~~~~~~~~~~~~~~~~~

\\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32duino_STM32Ethernet\src\utility\ethernetif.cpp:223:48: error: invalid conversion from 'uint32_t*' {aka 'long unsigned int*'} to 'uint32_t' {aka 'long unsigned int'} [-fpermissive]

  223 |   HAL_ETH_ReadPHYRegister(&EthHandle, PHY_IMR, &regvalue);

      |                                                ^~~~~~~~~

      |                                                |

      |                                                uint32_t* {aka long unsigned int*}

\\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32duino_STM32Ethernet\src\utility\ethernetif.cpp:223:26: error: too few arguments to function 'HAL_StatusTypeDef HAL_ETH_ReadPHYRegister(ETH_HandleTypeDef*, uint32_t, uint32_t, uint32_t*)'

  223 |   HAL_ETH_ReadPHYRegister(&EthHandle, PHY_IMR, &regvalue);

      |   ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

In file included from C:\Users\user\AppData\Local\Arduino15\packages\STMicroelectronics\hardware\stm32\2.5.0\system/STM32F4xx/stm32f4xx_hal_conf_default.h:346,

                 from C:\Users\user\AppData\Local\Arduino15\packages\STMicroelectronics\hardware\stm32\2.5.0\system/STM32F4xx/stm32f4xx_hal_conf.h:19,

                 from C:\Users\user\AppData\Local\Arduino15\packages\STMicroelectronics\hardware\stm32\2.5.0\system/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal.h:29,

                 from C:\Users\user\AppData\Local\Arduino15\packages\STMicroelectronics\hardware\stm32\2.5.0\system/Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f4xx.h:287:

C:\Users\user\AppData\Local\Arduino15\packages\STMicroelectronics\hardware\stm32\2.5.0\system/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_eth.h:2064:19: note: declared here

 2064 | HAL_StatusTypeDef HAL_ETH_ReadPHYRegister(ETH_HandleTypeDef *heth, uint32_t PHYAddr, uint32_t PHYReg,

      |                   ^~~~~~~~~~~~~~~~~~~~~~~

\\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32duino_STM32Ethernet\src\utility\ethernetif.cpp:228:27: error: too few arguments to function 'HAL_StatusTypeDef HAL_ETH_WritePHYRegister(ETH_HandleTypeDef*, uint32_t, uint32_t, uint32_t)'

  228 |   HAL_ETH_WritePHYRegister(&EthHandle, PHY_IMR, regvalue);

      |   ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

C:\Users\user\AppData\Local\Arduino15\packages\STMicroelectronics\hardware\stm32\2.5.0\system/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_eth.h:2062:19: note: declared here

 2062 | HAL_StatusTypeDef HAL_ETH_WritePHYRegister(ETH_HandleTypeDef *heth, uint32_t PHYAddr, uint32_t PHYReg,

      |                   ^~~~~~~~~~~~~~~~~~~~~~~~

\\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32duino_STM32Ethernet\src\utility\ethernetif.cpp: In function 'err_t low_level_output(netif*, pbuf*)':

\\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32duino_STM32Ethernet\src\utility\ethernetif.cpp:254:43: error: 'struct ETH_HandleTypeDef' has no member named 'TxDesc'; did you mean 'TxDescList'?

  254 |   uint8_t *buffer = (uint8_t *)(EthHandle.TxDesc->Buffer1Addr);

      |                                           ^~~~~~

      |                                           TxDescList

\\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32duino_STM32Ethernet\src\utility\ethernetif.cpp:263:25: error: 'struct ETH_HandleTypeDef' has no member named 'TxDesc'; did you mean 'TxDescList'?

  263 |   DmaTxDesc = EthHandle.TxDesc;

      |                         ^~~~~~

      |                         TxDescList

\\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32duino_STM32Ethernet\src\utility\ethernetif.cpp:269:21: error: 'volatile struct ETH_DMADescTypeDef' has no member named 'Status'

  269 |     if ((DmaTxDesc->Status & ETH_DMATXDESC_OWN) != (uint32_t)RESET) {

      |                     ^~~~~~

\\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32duino_STM32Ethernet\src\utility\ethernetif.cpp:284:53: error: 'volatile struct ETH_DMADescTypeDef' has no member named 'Buffer2NextDescAddr'

  284 |       DmaTxDesc = (ETH_DMADescTypeDef *)(DmaTxDesc->Buffer2NextDescAddr);

      |                                                     ^~~~~~~~~~~~~~~~~~~

\\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32duino_STM32Ethernet\src\utility\ethernetif.cpp:287:23: error: 'volatile struct ETH_DMADescTypeDef' has no member named 'Status'

  287 |       if ((DmaTxDesc->Status & ETH_DMATXDESC_OWN) != (uint32_t)RESET) {

      |                       ^~~~~~

\\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32duino_STM32Ethernet\src\utility\ethernetif.cpp:292:39: error: 'volatile struct ETH_DMADescTypeDef' has no member named 'Buffer1Addr'

  292 |       buffer = (uint8_t *)(DmaTxDesc->Buffer1Addr);

      |                                       ^~~~~~~~~~~

\\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32duino_STM32Ethernet\src\utility\ethernetif.cpp:307:3: error: 'HAL_ETH_TransmitFrame' was not declared in this scope; did you mean 'HAL_ETH_Transmit_IT'?

  307 |   HAL_ETH_TransmitFrame(&EthHandle, framelength);

      |   ^~~~~~~~~~~~~~~~~~~~~

      |   HAL_ETH_Transmit_IT

\\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32duino_STM32Ethernet\src\utility\ethernetif.cpp: In function 'pbuf* low_level_input(netif*)':

\\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32duino_STM32Ethernet\src\utility\ethernetif.cpp:346:7: error: 'HAL_ETH_GetReceivedFrame_IT' was not declared in this scope

  346 |   if (HAL_ETH_GetReceivedFrame_IT(&EthHandle) != HAL_OK) {

      |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~

\\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32duino_STM32Ethernet\src\utility\ethernetif.cpp:351:19: error: 'struct ETH_HandleTypeDef' has no member named 'RxFrameInfos'

  351 |   len = EthHandle.RxFrameInfos.length;

      |                   ^~~~~~~~~~~~

\\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32duino_STM32Ethernet\src\utility\ethernetif.cpp:352:33: error: 'struct ETH_HandleTypeDef' has no member named 'RxFrameInfos'

  352 |   buffer = (uint8_t *)EthHandle.RxFrameInfos.buffer;

      |                                 ^~~~~~~~~~~~

\\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32duino_STM32Ethernet\src\utility\ethernetif.cpp:360:27: error: 'struct ETH_HandleTypeDef' has no member named 'RxFrameInfos'

  360 |     dmarxdesc = EthHandle.RxFrameInfos.FSRxDesc;

      |                           ^~~~~~~~~~~~

\\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32duino_STM32Ethernet\src\utility\ethernetif.cpp:373:55: error: 'volatile struct ETH_DMADescTypeDef' has no member named 'Buffer2NextDescAddr'

  373 |         dmarxdesc = (ETH_DMADescTypeDef *)(dmarxdesc->Buffer2NextDescAddr);

      |                                                       ^~~~~~~~~~~~~~~~~~~

\\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32duino_STM32Ethernet\src\utility\ethernetif.cpp:374:41: error: 'volatile struct ETH_DMADescTypeDef' has no member named 'Buffer1Addr'

  374 |         buffer = (uint8_t *)(dmarxdesc->Buffer1Addr);

      |                                         ^~~~~~~~~~~

\\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32duino_STM32Ethernet\src\utility\ethernetif.cpp:389:25: error: 'struct ETH_HandleTypeDef' has no member named 'RxFrameInfos'

  389 |   dmarxdesc = EthHandle.RxFrameInfos.FSRxDesc;

      |                         ^~~~~~~~~~~~

\\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32duino_STM32Ethernet\src\utility\ethernetif.cpp:391:29: error: 'struct ETH_HandleTypeDef' has no member named 'RxFrameInfos'

  391 |   for (i = 0; i < EthHandle.RxFrameInfos.SegCount; i++) {

      |                             ^~~~~~~~~~~~

\\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32duino_STM32Ethernet\src\utility\ethernetif.cpp:392:16: error: 'volatile struct ETH_DMADescTypeDef' has no member named 'Status'

  392 |     dmarxdesc->Status |= ETH_DMARXDESC_OWN;

      |                ^~~~~~

\\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32duino_STM32Ethernet\src\utility\ethernetif.cpp:393:51: error: 'volatile struct ETH_DMADescTypeDef' has no member named 'Buffer2NextDescAddr'

  393 |     dmarxdesc = (ETH_DMADescTypeDef *)(dmarxdesc->Buffer2NextDescAddr);

      |                                                   ^~~~~~~~~~~~~~~~~~~

\\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32duino_STM32Ethernet\src\utility\ethernetif.cpp:397:13: error: 'struct ETH_HandleTypeDef' has no member named 'RxFrameInfos'

  397 |   EthHandle.RxFrameInfos.SegCount = 0;

      |             ^~~~~~~~~~~~

\\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32duino_STM32Ethernet\src\utility\ethernetif.cpp: In function 'uint8_t ethernetif_is_init()':

\\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32duino_STM32Ethernet\src\utility\ethernetif.cpp:449:21: error: 'struct ETH_HandleTypeDef' has no member named 'State'; did you mean 'gState'?

  449 |   return (EthHandle.State != HAL_ETH_STATE_RESET);

      |                     ^~~~~

      |                     gState

\\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32duino_STM32Ethernet\src\utility\ethernetif.cpp: In function 'void ethernetif_set_link(netif*)':

\\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32duino_STM32Ethernet\src\utility\ethernetif.cpp:509:49: error: invalid conversion from 'uint32_t*' {aka 'long unsigned int*'} to 'uint32_t' {aka 'long unsigned int'} [-fpermissive]

  509 |   HAL_ETH_ReadPHYRegister(&EthHandle, PHY_ISFR, &regvalue);

      |                                                 ^~~~~~~~~

      |                                                 |

      |                                                 uint32_t* {aka long unsigned int*}

\\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32duino_STM32Ethernet\src\utility\ethernetif.cpp:509:26: error: too few arguments to function 'HAL_StatusTypeDef HAL_ETH_ReadPHYRegister(ETH_HandleTypeDef*, uint32_t, uint32_t, uint32_t*)'

  509 |   HAL_ETH_ReadPHYRegister(&EthHandle, PHY_ISFR, &regvalue);

      |   ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

C:\Users\user\AppData\Local\Arduino15\packages\STMicroelectronics\hardware\stm32\2.5.0\system/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_eth.h:2064:19: note: declared here

 2064 | HAL_StatusTypeDef HAL_ETH_ReadPHYRegister(ETH_HandleTypeDef *heth, uint32_t PHYAddr, uint32_t PHYReg,

      |                   ^~~~~~~~~~~~~~~~~~~~~~~

\\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32duino_STM32Ethernet\src\utility\ethernetif.cpp:516:48: error: invalid conversion from 'uint32_t*' {aka 'long unsigned int*'} to 'uint32_t' {aka 'long unsigned int'} [-fpermissive]

  516 |   HAL_ETH_ReadPHYRegister(&EthHandle, PHY_BSR, &regvalue);

      |                                                ^~~~~~~~~

      |                                                |

      |                                                uint32_t* {aka long unsigned int*}

\\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32duino_STM32Ethernet\src\utility\ethernetif.cpp:516:26: error: too few arguments to function 'HAL_StatusTypeDef HAL_ETH_ReadPHYRegister(ETH_HandleTypeDef*, uint32_t, uint32_t, uint32_t*)'

  516 |   HAL_ETH_ReadPHYRegister(&EthHandle, PHY_BSR, &regvalue);

      |   ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

C:\Users\user\AppData\Local\Arduino15\packages\STMicroelectronics\hardware\stm32\2.5.0\system/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_eth.h:2064:19: note: declared here

 2064 | HAL_StatusTypeDef HAL_ETH_ReadPHYRegister(ETH_HandleTypeDef *heth, uint32_t PHYAddr, uint32_t PHYReg,

      |                   ^~~~~~~~~~~~~~~~~~~~~~~

\\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32duino_STM32Ethernet\src\utility\ethernetif.cpp: In function 'void ethernetif_update_config(netif*)':

\\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32duino_STM32Ethernet\src\utility\ethernetif.cpp:542:24: error: 'struct ETH_InitTypeDef' has no member named 'AutoNegotiation'

  542 |     if (EthHandle.Init.AutoNegotiation != ETH_AUTONEGOTIATION_DISABLE) {

      |                        ^~~~~~~~~~~~~~~

\\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32duino_STM32Ethernet\src\utility\ethernetif.cpp:545:51: error: invalid conversion from 'uint32_t*' {aka 'long unsigned int*'} to 'uint32_t' {aka 'long unsigned int'} [-fpermissive]

  545 |       HAL_ETH_ReadPHYRegister(&EthHandle, PHY_SR, &regvalue);

      |                                                   ^~~~~~~~~

      |                                                   |

      |                                                   uint32_t* {aka long unsigned int*}

\\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32duino_STM32Ethernet\src\utility\ethernetif.cpp:545:30: error: too few arguments to function 'HAL_StatusTypeDef HAL_ETH_ReadPHYRegister(ETH_HandleTypeDef*, uint32_t, uint32_t, uint32_t*)'

  545 |       HAL_ETH_ReadPHYRegister(&EthHandle, PHY_SR, &regvalue);

      |       ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

C:\Users\user\AppData\Local\Arduino15\packages\STMicroelectronics\hardware\stm32\2.5.0\system/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_eth.h:2064:19: note: declared here

 2064 | HAL_StatusTypeDef HAL_ETH_ReadPHYRegister(ETH_HandleTypeDef *heth, uint32_t PHYAddr, uint32_t PHYReg,

      |                   ^~~~~~~~~~~~~~~~~~~~~~~

\\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32duino_STM32Ethernet\src\utility\ethernetif.cpp:553:24: error: 'struct ETH_InitTypeDef' has no member named 'DuplexMode'

  553 |         EthHandle.Init.DuplexMode = ETH_MODE_FULLDUPLEX;

      |                        ^~~~~~~~~~

\\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32duino_STM32Ethernet\src\utility\ethernetif.cpp:553:37: error: 'ETH_MODE_FULLDUPLEX' was not declared in this scope

  553 |         EthHandle.Init.DuplexMode = ETH_MODE_FULLDUPLEX;

      |                                     ^~~~~~~~~~~~~~~~~~~

\\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32duino_STM32Ethernet\src\utility\ethernetif.cpp:556:24: error: 'struct ETH_InitTypeDef' has no member named 'DuplexMode'

  556 |         EthHandle.Init.DuplexMode = ETH_MODE_HALFDUPLEX;

      |                        ^~~~~~~~~~

\\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32duino_STM32Ethernet\src\utility\ethernetif.cpp:556:37: error: 'ETH_MODE_HALFDUPLEX' was not declared in this scope

  556 |         EthHandle.Init.DuplexMode = ETH_MODE_HALFDUPLEX;

      |                                     ^~~~~~~~~~~~~~~~~~~

\\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32duino_STM32Ethernet\src\utility\ethernetif.cpp:561:24: error: 'struct ETH_InitTypeDef' has no member named 'Speed'

  561 |         EthHandle.Init.Speed = ETH_SPEED_10M;

      |                        ^~~~~

\\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32duino_STM32Ethernet\src\utility\ethernetif.cpp:564:24: error: 'struct ETH_InitTypeDef' has no member named 'Speed'

  564 |         EthHandle.Init.Speed = ETH_SPEED_100M;

      |                        ^~~~~

\\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32duino_STM32Ethernet\src\utility\ethernetif.cpp:573:80: error: 'struct ETH_InitTypeDef' has no member named 'DuplexMode'

  573 |       HAL_ETH_WritePHYRegister(&EthHandle, PHY_BCR, ((uint16_t)(EthHandle.Init.DuplexMode >> 3) |

      |                                                                                ^~~~~~~~~~

\\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32duino_STM32Ethernet\src\utility\ethernetif.cpp:574:80: error: 'struct ETH_InitTypeDef' has no member named 'Speed'

  574 |                                                      (uint16_t)(EthHandle.Init.Speed >> 1)));

      |                                                                                ^~~~~

\\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32duino_STM32Ethernet\src\utility\ethernetif.cpp:578:36: error: 'ETH_MACInitTypeDef' was not declared in this scope; did you mean 'ETH_InitTypeDef'?

  578 |     HAL_ETH_ConfigMAC(&EthHandle, (ETH_MACInitTypeDef *) NULL);

      |                                    ^~~~~~~~~~~~~~~~~~

      |                                    ETH_InitTypeDef

\\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32duino_STM32Ethernet\src\utility\ethernetif.cpp:578:56: error: expected primary-expression before ')' token

  578 |     HAL_ETH_ConfigMAC(&EthHandle, (ETH_MACInitTypeDef *) NULL);

      |                                                        ^

\\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32duino_STM32Ethernet\src\utility\ethernetif.cpp:578:5: error: 'HAL_ETH_ConfigMAC' was not declared in this scope

  578 |     HAL_ETH_ConfigMAC(&EthHandle, (ETH_MACInitTypeDef *) NULL);

      |     ^~~~~~~~~~~~~~~~~

exit status 1

Error compiling for board Generic STM32F4 series.



This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

So,I enabled HAL_ETH_LEGACY_MODULE_ENABLED according to this.

stm32f4xx_hal_conf.h

#ifndef __STM32F4xx_HAL_CONF_H
#define __STM32F4xx_HAL_CONF_H

#include "variant.h"

// Enable legacy HAL Ethernet driver
#define HAL_CAN_LEGACY_MODULE_ENABLED

/* STM32F4xx specific HAL configuration options. */
#if __has_include("hal_conf_custom.h")
#include "hal_conf_custom.h"
#else
#if __has_include("hal_conf_extra.h")
#include "hal_conf_extra.h"
#endif
#include "stm32f4xx_hal_conf_default.h"
#endif

#endif /* __STM32F4xx_HAL_CONF_H */

I got this error:

Arduino: 1.8.19 (Windows 10), Board: "Generic STM32F4 series, Black F407VE, STM32CubeProgrammer (SWD), Enabled (generic 'Serial'), None, Low/Full Speed, Smallest (-Os default), None, Newlib Nano (default)"





















Warning: Board breadboard:avr:atmega328bb doesn't define a 'build.board' preference. Auto-set to: AVR_ATMEGA328BB

In file included from C:\Users\user\AppData\Local\Arduino15\packages\STMicroelectronics\hardware\stm32\2.5.0\system/STM32F4xx/stm32f4xx_hal_conf.h:19,

                 from C:\Users\user\AppData\Local\Arduino15\packages\STMicroelectronics\hardware\stm32\2.5.0\system/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal.h:29,

                 from C:\Users\user\AppData\Local\Arduino15\packages\STMicroelectronics\hardware\stm32\2.5.0\system/Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f4xx.h:287,

                 from C:\Users\user\AppData\Local\Arduino15\packages\STMicroelectronics\hardware\stm32\2.5.0\cores\arduino/stm32/stm32_def.h:36,

                 from C:\Users\user\AppData\Local\Arduino15\packages\STMicroelectronics\hardware\stm32\2.5.0\cores\arduino/stm32/clock.h:19,

                 from C:\Users\user\AppData\Local\Arduino15\packages\STMicroelectronics\hardware\stm32\2.5.0\cores\arduino/wiring_time.h:23,

                 from C:\Users\user\AppData\Local\Arduino15\packages\STMicroelectronics\hardware\stm32\2.5.0\cores\arduino/wiring.h:38,

                 from C:\Users\user\AppData\Local\Arduino15\packages\STMicroelectronics\hardware\stm32\2.5.0\cores\arduino/Arduino.h:36,

                 from sketch\DhcpAddressPrinter.ino.cpp:1:

C:\Users\user\AppData\Local\Arduino15\packages\STMicroelectronics\hardware\stm32\2.5.0\system/STM32F4xx/stm32f4xx_hal_conf_default.h:322:10: fatal error: stm32f4xx_hal_can_legacy.h: No such file or directory

  322 | #include "stm32f4xx_hal_can_legacy.h"

      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

compilation terminated.

exit status 1

Error compiling for board Generic STM32F4 series.



This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

My environment:

Arduino-STM32-Ethernet-LAN8720-1
Arduino-STM32-Ethernet-LAN8720-2

Build options:

Arduino-STM32-Ethernet-LAN8720-3

@nopnop2002 nopnop2002 changed the title Unable to build with HAL_ETH_LEGACY_MODULE_ENABLED enabled Unable to build with HAL_ETH_MODULE_ENABLED Apr 13, 2023
@nopnop2002 nopnop2002 changed the title Unable to build with HAL_ETH_MODULE_ENABLED Unable to build with legacy HAL Ethernet driver Apr 13, 2023
@nopnop2002 nopnop2002 changed the title Unable to build with legacy HAL Ethernet driver Unable to build with SRM32F4 Apr 13, 2023
@nopnop2002 nopnop2002 changed the title Unable to build with SRM32F4 Unable to build with STM32F4 Apr 13, 2023
@fpistm
Copy link
Member

fpistm commented Apr 13, 2023

Hi @nopnop2002

First you do not enable the ETH legacy but the CAN one 😉

// Enable legacy HAL Ethernet driver
#define HAL_CAN_LEGACY_MODULE_ENABLED

Second, the Ethernet was not enabled by default for the BLACK F407VE so the support I've added thanks #1710 does not update this variant.
The fix required to update the variant to at least add the define in the dedicated PeripheralPins_BLACK_F407VX.c

@fpistm fpistm transferred this issue from stm32duino/STM32Ethernet Apr 13, 2023
fpistm added a commit to fpistm/Arduino_Core_STM32 that referenced this issue Apr 13, 2023
in some custom PeripheralPins_*.c

Fixes stm32duino#2003.

Signed-off-by: Frederic Pillon <[email protected]>
@fpistm
Copy link
Member

fpistm commented Apr 13, 2023

With the patch provided and the hal_conf_extra.h used to define the HAL_ETH_LEGACY_MODULE_ENABLED
Build is OK:

Using library STM32duino LwIP at version 2.1.2 in folder: C:\IDE\data\Arduino\libraries\STM32duino_LwIP 
Using library STM32duino STM32Ethernet at version 1.3.0 in folder: C:\IDE\data\Arduino\libraries\STM32duino_STM32Ethernet 
Using library SrcWrapper at version 1.0.1 in folder: C:\Users\<username>\AppData\Local\Arduino15\packages\STMicroelectronics\hardware\stm32\2.5.0\libraries\SrcWrapper 
"C:\\Users\\<username>\\AppData\\Local\\Arduino15\\packages\\STMicroelectronics\\tools\\xpack-arm-none-eabi-gcc\\12.2.1-1.2/bin/arm-none-eabi-size" -A "C:\\Users\\<username>\\AppData\\Local\\Temp\\arduino\\sketches\\E3567535FEA69530F5CDAF21D4439ED4/DhcpAddressPrinter.ino.elf"
Sketch uses 55168 bytes (10%) of program storage space. Maximum is 524288 bytes.
Global variables use 44456 bytes (33%) of dynamic memory, leaving 86616 bytes for local variables. Maximum is 131072 bytes.

@fpistm fpistm added the bug 🐛 Something isn't working label Apr 13, 2023
@fpistm fpistm added this to the 2.6.0 milestone Apr 13, 2023
@nopnop2002
Copy link
Author

I will wait for the release of 2.6.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants