platformio / platform-ststm32

ST STM32: development platform for PlatformIO
https://registry.platformio.org/platforms/platformio/ststm32
Apache License 2.0
394 stars 308 forks source link

Compilation errors while using STM32Ethernet for genericSTM32F407VGT6 board #771

Closed HareshPrajapati closed 5 months ago

HareshPrajapati commented 5 months ago

I am using latest ststm32 and latest STM32Ethernet for genericSTM32F407VGT6 board.

below is platformio.ini file

[env:genericSTM32F407VGT6]
platform = ststm32
board = genericSTM32F407VGT6
monitor_port = COM12
monitor_speed = 115200
upload_protocol = stlink
build_flags = -DENABLE_HWSERIAL2
framework = arduino
lib_deps = https://github.com/stm32duino/STM32Ethernet.git
           https://github.com/stm32duino/LwIP.git

I also added hal_conf_extra.h file with HAL_ETH_LEGACY_MODULE_ENABLED define as suggested here

Still unable to compile project.

I am getting below errors while compiling

Compiling .pio\build\genericSTM32F407VGT6\lib949\STM32duino LwIP\api\netifapi.c.o
Compiling .pio\build\genericSTM32F407VGT6\lib949\STM32duino LwIP\api\sockets.c.o
.pio\libdeps\genericSTM32F407VGT6\STM32Ethernet\src\utility\ethernetif.cpp: In function 'void low_level_init(netif*)':
.pio\libdeps\genericSTM32F407VGT6\STM32Ethernet\src\utility\ethernetif.cpp:170:18: error: 'struct ETH_InitTypeDef' has no member named 'AutoNegotiation'
  170 |   EthHandle.Init.AutoNegotiation = ETH_AUTONEGOTIATION_ENABLE;
      |                  ^~~~~~~~~~~~~~~
.pio\libdeps\genericSTM32F407VGT6\STM32Ethernet\src\utility\ethernetif.cpp:171:18: error: 'struct ETH_InitTypeDef' has no member named 'Speed'
  171 |   EthHandle.Init.Speed = ETH_SPEED_100M;
      |                  ^~~~~
.pio\libdeps\genericSTM32F407VGT6\STM32Ethernet\src\utility\ethernetif.cpp:172:18: error: 'struct ETH_InitTypeDef' has no member named 'DuplexMode'
  172 |   EthHandle.Init.DuplexMode = ETH_MODE_FULLDUPLEX;
      |                  ^~~~~~~~~~
.pio\libdeps\genericSTM32F407VGT6\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\Mikrotroniks\.platformio\packages\framework-arduinoststm32\system\Drivers\CMSIS\Device\ST\STM32F4xx\Include/stm32f4xx.h:132,
                 from C:\Users\Mikrotroniks\.platformio\packages\framework-arduinoststm32\cores\arduino\stm32/stm32_def.h:36,
                 from .pio\libdeps\genericSTM32F407VGT6\STM32Ethernet\src\utility\ethernetif.cpp:48:
C:\Users\Mikrotroniks\.platformio\packages\framework-arduinoststm32\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\Mikrotroniks\.platformio\packages\framework-arduinoststm32\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\Mikrotroniks\.platformio\packages\framework-arduinoststm32\system\Drivers\STM32F4xx_HAL_Driver\Inc/stm32f4xx_hal_eth.h:1346:40: note: in expansion of macro 'SYSCFG_PMC_MII_RMII_SEL'
 1346 | #define ETH_MEDIA_INTERFACE_RMII      (SYSCFG_PMC_MII_RMII_SEL)
      |                                        ^~~~~~~~~~~~~~~~~~~~~~~
.pio\libdeps\genericSTM32F407VGT6\STM32Ethernet\src\utility\ethernetif.cpp:174:35: note: in expansion of macro 'ETH_MEDIA_INTERFACE_RMII'
  174 |   EthHandle.Init.MediaInterface = ETH_MEDIA_INTERFACE_RMII;
      |                                   ^~~~~~~~~~~~~~~~~~~~~~~~
.pio\libdeps\genericSTM32F407VGT6\STM32Ethernet\src\utility\ethernetif.cpp:181:18: error: 'struct ETH_InitTypeDef' has no member named 'RxMode'
  181 |   EthHandle.Init.RxMode = ETH_RXPOLLING_MODE;
      |                  ^~~~~~
.pio\libdeps\genericSTM32F407VGT6\STM32Ethernet\src\utility\ethernetif.cpp:183:18: error: 'struct ETH_InitTypeDef' has no member named 'ChecksumMode'
  183 |   EthHandle.Init.ChecksumMode = ETH_CHECKSUM_BY_HARDWARE;
      |                  ^~~~~~~~~~~~
.pio\libdeps\genericSTM32F407VGT6\STM32Ethernet\src\utility\ethernetif.cpp:184:18: error: 'struct ETH_InitTypeDef' has no member named 'PhyAddress'
  184 |   EthHandle.Init.PhyAddress = LAN8742A_PHY_ADDRESS;
      |                  ^~~~~~~~~~
C:\Users\Mikrotroniks\.platformio\packages\framework-arduinoststm32\system\Drivers\STM32F4xx_HAL_Driver\Inc/stm32f4xx_hal_eth.h:1306:35: error: expected identifier before numeric constant
 1306 | #define HAL_ETH_STATE_RESET       0x00000000U    /*!< Peripheral not yet Initialized or disabled */
      |                                   ^~~~~~~~~~~
C:\Users\Mikrotroniks\.platformio\packages\framework-arduinoststm32\system\Drivers\STM32F4xx_HAL_Driver\Inc/Legacy/stm32f4xx_hal_eth_legacy.h:354:3: note: in expansion of macro 'HAL_ETH_STATE_RESET'
  354 |   HAL_ETH_STATE_RESET             = 0x00U,    /*!< Peripheral not yet Initialized or disabled         */
      |   ^~~~~~~~~~~~~~~~~~~
C:\Users\Mikrotroniks\.platformio\packages\framework-arduinoststm32\system\Drivers\STM32F4xx_HAL_Driver\Inc/stm32f4xx_hal_eth.h:1306:35: error: expected '}' before numeric constant
 1306 | #define HAL_ETH_STATE_RESET       0x00000000U    /*!< Peripheral not yet Initialized or disabled */
      |                                   ^~~~~~~~~~~
C:\Users\Mikrotroniks\.platformio\packages\framework-arduinoststm32\system\Drivers\STM32F4xx_HAL_Driver\Inc/Legacy/stm32f4xx_hal_eth_legacy.h:354:3: note: in expansion of macro 'HAL_ETH_STATE_RESET'
  354 |   HAL_ETH_STATE_RESET             = 0x00U,    /*!< Peripheral not yet Initialized or disabled         */
      |   ^~~~~~~~~~~~~~~~~~~
C:\Users\Mikrotroniks\.platformio\packages\framework-arduinoststm32\system\Drivers\STM32F4xx_HAL_Driver\Inc/Legacy/stm32f4xx_hal_eth_legacy.h:353:1: note: to match this '{'
  353 | {
      | ^
C:\Users\Mikrotroniks\.platformio\packages\framework-arduinoststm32\system\Drivers\STM32F4xx_HAL_Driver\Inc/stm32f4xx_hal_eth.h:1306:35: error: expected unqualified-id before numeric constant
 1306 | #define HAL_ETH_STATE_RESET       0x00000000U    /*!< Peripheral not yet Initialized or disabled */
      |                                   ^~~~~~~~~~~
C:\Users\Mikrotroniks\.platformio\packages\framework-arduinoststm32\system\Drivers\STM32F4xx_HAL_Driver\Inc/Legacy/stm32f4xx_hal_eth_legacy.h:354:3: note: in expansion of macro 'HAL_ETH_STATE_RESET'    
  354 |   HAL_ETH_STATE_RESET             = 0x00U,    /*!< Peripheral not yet Initialized or disabled         */
      |   ^~~~~~~~~~~~~~~~~~~
C:\Users\Mikrotroniks\.platformio\packages\framework-arduinoststm32\system\Drivers\STM32F4xx_HAL_Driver\Inc/Legacy/stm32f4xx_hal_eth_legacy.h:364:2: error: declaration does not declare anything [-fpermissive]
  364 | }HAL_ETH_StateTypeDef;
      |  ^~~~~~~~~~~~~~~~~~~~
C:\Users\Mikrotroniks\.platformio\packages\framework-arduinoststm32\system\Drivers\STM32F4xx_HAL_Driver\Inc/Legacy/stm32f4xx_hal_eth_legacy.h:397:3: error: conflicting declaration 'typedef struct ETH_InitTypeDef ETH_InitTypeDef'
  397 | } ETH_InitTypeDef;
      |   ^~~~~~~~~~~~~~~
C:\Users\Mikrotroniks\.platformio\packages\framework-arduinoststm32\system\Drivers\STM32F4xx_HAL_Driver\Inc/stm32f4xx_hal_eth.h:443:3: note: previous declaration as 'typedef struct ETH_InitTypeDef ETH_InitTypeDef'
  443 | } ETH_InitTypeDef;
      |   ^~~~~~~~~~~~~~~
C:\Users\Mikrotroniks\.platformio\packages\framework-arduinoststm32\system\Drivers\STM32F4xx_HAL_Driver\Inc/Legacy/stm32f4xx_hal_eth_legacy.h:587:3: error: conflicting declaration 'typedef struct ETH_DMADescTypeDef ETH_DMADescTypeDef'
  587 | } ETH_DMADescTypeDef;
      |   ^~~~~~~~~~~~~~~~~~
C:\Users\Mikrotroniks\.platformio\packages\framework-arduinoststm32\system\Drivers\STM32F4xx_HAL_Driver\Inc/stm32f4xx_hal_eth.h:71:3: note: previous declaration as 'typedef struct ETH_DMADescTypeDef ETH_DMADescTypeDef'
   71 | } ETH_DMADescTypeDef;
      |   ^~~~~~~~~~~~~~~~~~
C:\Users\Mikrotroniks\.platformio\packages\framework-arduinoststm32\system\Drivers\STM32F4xx_HAL_Driver\Inc/Legacy/stm32f4xx_hal_eth_legacy.h:642:3: error: conflicting declaration 'typedef struct ETH_HandleTypeDef ETH_HandleTypeDef'
  642 | } ETH_HandleTypeDef;
      |   ^~~~~~~~~~~~~~~~~
C:\Users\Mikrotroniks\.platformio\packages\framework-arduinoststm32\system\Drivers\STM32F4xx_HAL_Driver\Inc/stm32f4xx_hal_eth.h:589:3: note: previous declaration as 'typedef struct ETH_HandleTypeDef ETH_HandleTypeDef'
  589 | } ETH_HandleTypeDef;
      |   ^~~~~~~~~~~~~~~~~
C:\Users\Mikrotroniks\.platformio\packages\framework-arduinoststm32\system\Drivers\STM32F4xx_HAL_Driver\Inc/Legacy/stm32f4xx_hal_eth_legacy.h:2153:19: error: conflicting declaration of C function 'HAL_StatusTypeDef HAL_ETH_ReadPHYRegister(ETH_HandleTypeDef*, uint16_t, uint32_t*)'
 2153 | HAL_StatusTypeDef HAL_ETH_ReadPHYRegister(ETH_HandleTypeDef *heth, uint16_t PHYReg, uint32_t *RegValue);
      |                   ^~~~~~~~~~~~~~~~~~~~~~~
C:\Users\Mikrotroniks\.platformio\packages\framework-arduinoststm32\system\Drivers\STM32F4xx_HAL_Driver\Inc/stm32f4xx_hal_eth.h:2068:19: note: previous declaration 'HAL_StatusTypeDef HAL_ETH_ReadPHYRegister(ETH_HandleTypeDef*, uint32_t, uint32_t, uint32_t*)'
 2068 | HAL_StatusTypeDef HAL_ETH_ReadPHYRegister(ETH_HandleTypeDef *heth, uint32_t PHYAddr, uint32_t PHYReg,
      |                   ^~~~~~~~~~~~~~~~~~~~~~~
C:\Users\Mikrotroniks\.platformio\packages\framework-arduinoststm32\system\Drivers\STM32F4xx_HAL_Driver\Inc/Legacy/stm32f4xx_hal_eth_legacy.h:2154:19: error: conflicting declaration of C function 'HAL_StatusTypeDef HAL_ETH_WritePHYRegister(ETH_HandleTypeDef*, uint16_t, uint32_t)'
 2154 | HAL_StatusTypeDef HAL_ETH_WritePHYRegister(ETH_HandleTypeDef *heth, uint16_t PHYReg, uint32_t RegValue);
      |                   ^~~~~~~~~~~~~~~~~~~~~~~~
C:\Users\Mikrotroniks\.platformio\packages\framework-arduinoststm32\system\Drivers\STM32F4xx_HAL_Driver\Inc/stm32f4xx_hal_eth.h:2066:19: note: previous declaration 'HAL_StatusTypeDef HAL_ETH_WritePHYRegister(const ETH_HandleTypeDef*, uint32_t, uint32_t, uint32_t)'
 2066 | HAL_StatusTypeDef HAL_ETH_WritePHYRegister(const ETH_HandleTypeDef *heth, uint32_t PHYAddr, uint32_t PHYReg,
      |                   ^~~~~~~~~~~~~~~~~~~~~~~~
C:\Users\Mikrotroniks\.platformio\packages\framework-arduinoststm32\system\Drivers\STM32F4xx_HAL_Driver\Inc/Legacy/stm32f4xx_hal_eth_legacy.h:2185:22: error: conflicting declaration of C function 'HAL_ETH_StateTypeDef HAL_ETH_GetState(ETH_HandleTypeDef*)'
 2185 | HAL_ETH_StateTypeDef HAL_ETH_GetState(ETH_HandleTypeDef *heth);
      |                      ^~~~~~~~~~~~~~~~
C:\Users\Mikrotroniks\.platformio\packages\framework-arduinoststm32\system\Drivers\STM32F4xx_HAL_Driver\Inc/stm32f4xx_hal_eth.h:2121:22: note: previous declaration 'HAL_ETH_StateTypeDef HAL_ETH_GetState(const ETH_HandleTypeDef*)'
 2121 | HAL_ETH_StateTypeDef HAL_ETH_GetState(const ETH_HandleTypeDef *heth);
      |                      ^~~~~~~~~~~~~~~~
C:\Users\Mikrotroniks\.platformio\packages\framework-arduinoststm32\system\Drivers\CMSIS\Device\ST\STM32F4xx\Include/stm32f4xx.h:291:1: error: expected declaration before '}' token
  291 | }
      | ^
.pio\libdeps\genericSTM32F407VGT6\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);
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~
.pio\libdeps\genericSTM32F407VGT6\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);
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~
.pio\libdeps\genericSTM32F407VGT6\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*}
.pio\libdeps\genericSTM32F407VGT6\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\Mikrotroniks\.platformio\packages\framework-arduinoststm32\system\STM32F4xx/stm32f4xx_hal_conf_default.h:424,
                 from C:\Users\Mikrotroniks\.platformio\packages\framework-arduinoststm32\system\STM32F4xx/stm32f4xx_hal_conf.h:13,
                 from C:\Users\Mikrotroniks\.platformio\packages\framework-arduinoststm32\system\Drivers\STM32F4xx_HAL_Driver\Inc/stm32f4xx_hal.h:29,
                 from C:\Users\Mikrotroniks\.platformio\packages\framework-arduinoststm32\system\Drivers\CMSIS\Device\ST\STM32F4xx\Include/stm32f4xx.h:287:
C:\Users\Mikrotroniks\.platformio\packages\framework-arduinoststm32\system\Drivers\STM32F4xx_HAL_Driver\Inc/stm32f4xx_hal_eth.h:2068:19: note: declared here
 2068 | HAL_StatusTypeDef HAL_ETH_ReadPHYRegister(ETH_HandleTypeDef *heth, uint32_t PHYAddr, uint32_t PHYReg,
      |                   ^~~~~~~~~~~~~~~~~~~~~~~
.pio\libdeps\genericSTM32F407VGT6\STM32Ethernet\src\utility\ethernetif.cpp:228:27: error: too few arguments to function 'HAL_StatusTypeDef HAL_ETH_WritePHYRegister(const ETH_HandleTypeDef*, uint32_t, uint32_t, uint32_t)'
  228 |   HAL_ETH_WritePHYRegister(&EthHandle, PHY_IMR, regvalue);
      |   ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\Users\Mikrotroniks\.platformio\packages\framework-arduinoststm32\system\Drivers\STM32F4xx_HAL_Driver\Inc/stm32f4xx_hal_eth.h:2066:19: note: declared here
 2066 | HAL_StatusTypeDef HAL_ETH_WritePHYRegister(const ETH_HandleTypeDef *heth, uint32_t PHYAddr, uint32_t PHYReg,
      |                   ^~~~~~~~~~~~~~~~~~~~~~~~
.pio\libdeps\genericSTM32F407VGT6\STM32Ethernet\src\utility\ethernetif.cpp: In function 'err_t low_level_output(netif*, pbuf*)':
.pio\libdeps\genericSTM32F407VGT6\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
.pio\libdeps\genericSTM32F407VGT6\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
.pio\libdeps\genericSTM32F407VGT6\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) {
      |                     ^~~~~~
.pio\libdeps\genericSTM32F407VGT6\STM32Ethernet\src\utility\ethernetif.cpp:284:53: error: 'volatile struct ETH_DMADescTypeDef' has no member named 'Buffer2NextDescAddr'
  284 |       DmaTxDesc = (ETH_DMADescTypeDef *)(DmaTxDesc->Buffer2NextDescAddr);
      |                                                     ^~~~~~~~~~~~~~~~~~~
.pio\libdeps\genericSTM32F407VGT6\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) {
      |                       ^~~~~~
.pio\libdeps\genericSTM32F407VGT6\STM32Ethernet\src\utility\ethernetif.cpp:292:39: error: 'volatile struct ETH_DMADescTypeDef' has no member named 'Buffer1Addr'
  292 |       buffer = (uint8_t *)(DmaTxDesc->Buffer1Addr);
      |                                       ^~~~~~~~~~~
.pio\libdeps\genericSTM32F407VGT6\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
Compiling .pio\build\genericSTM32F407VGT6\lib949\STM32duino LwIP\api\tcpip.c.o
.pio\libdeps\genericSTM32F407VGT6\STM32Ethernet\src\utility\ethernetif.cpp: In function 'pbuf* low_level_input(netif*)':
.pio\libdeps\genericSTM32F407VGT6\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) {
      |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~
.pio\libdeps\genericSTM32F407VGT6\STM32Ethernet\src\utility\ethernetif.cpp:351:19: error: 'struct ETH_HandleTypeDef' has no member named 'RxFrameInfos'
  351 |   len = EthHandle.RxFrameInfos.length;
      |                   ^~~~~~~~~~~~
.pio\libdeps\genericSTM32F407VGT6\STM32Ethernet\src\utility\ethernetif.cpp:352:33: error: 'struct ETH_HandleTypeDef' has no member named 'RxFrameInfos'
  352 |   buffer = (uint8_t *)EthHandle.RxFrameInfos.buffer;
      |                                 ^~~~~~~~~~~~
.pio\libdeps\genericSTM32F407VGT6\STM32Ethernet\src\utility\ethernetif.cpp:360:27: error: 'struct ETH_HandleTypeDef' has no member named 'RxFrameInfos'
  360 |     dmarxdesc = EthHandle.RxFrameInfos.FSRxDesc;
      |                           ^~~~~~~~~~~~
.pio\libdeps\genericSTM32F407VGT6\STM32Ethernet\src\utility\ethernetif.cpp:373:55: error: 'volatile struct ETH_DMADescTypeDef' has no member named 'Buffer2NextDescAddr'
  373 |         dmarxdesc = (ETH_DMADescTypeDef *)(dmarxdesc->Buffer2NextDescAddr);
      |                                                       ^~~~~~~~~~~~~~~~~~~
.pio\libdeps\genericSTM32F407VGT6\STM32Ethernet\src\utility\ethernetif.cpp:374:41: error: 'volatile struct ETH_DMADescTypeDef' has no member named 'Buffer1Addr'
  374 |         buffer = (uint8_t *)(dmarxdesc->Buffer1Addr);
      |                                         ^~~~~~~~~~~
.pio\libdeps\genericSTM32F407VGT6\STM32Ethernet\src\utility\ethernetif.cpp:389:25: error: 'struct ETH_HandleTypeDef' has no member named 'RxFrameInfos'
  389 |   dmarxdesc = EthHandle.RxFrameInfos.FSRxDesc;
      |                         ^~~~~~~~~~~~
.pio\libdeps\genericSTM32F407VGT6\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++) {
      |                             ^~~~~~~~~~~~
.pio\libdeps\genericSTM32F407VGT6\STM32Ethernet\src\utility\ethernetif.cpp:392:16: error: 'volatile struct ETH_DMADescTypeDef' has no member named 'Status'
  392 |     dmarxdesc->Status |= ETH_DMARXDESC_OWN;
      |                ^~~~~~
.pio\libdeps\genericSTM32F407VGT6\STM32Ethernet\src\utility\ethernetif.cpp:393:51: error: 'volatile struct ETH_DMADescTypeDef' has no member named 'Buffer2NextDescAddr'
  393 |     dmarxdesc = (ETH_DMADescTypeDef *)(dmarxdesc->Buffer2NextDescAddr);
      |                                                   ^~~~~~~~~~~~~~~~~~~
.pio\libdeps\genericSTM32F407VGT6\STM32Ethernet\src\utility\ethernetif.cpp:397:13: error: 'struct ETH_HandleTypeDef' has no member named 'RxFrameInfos'
  397 |   EthHandle.RxFrameInfos.SegCount = 0;
      |             ^~~~~~~~~~~~
.pio\libdeps\genericSTM32F407VGT6\STM32Ethernet\src\utility\ethernetif.cpp: In function 'uint8_t ethernetif_is_init()':
.pio\libdeps\genericSTM32F407VGT6\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
.pio\libdeps\genericSTM32F407VGT6\STM32Ethernet\src\utility\ethernetif.cpp: In function 'void ethernetif_set_link(netif*)':
.pio\libdeps\genericSTM32F407VGT6\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*}
.pio\libdeps\genericSTM32F407VGT6\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\Mikrotroniks\.platformio\packages\framework-arduinoststm32\system\Drivers\STM32F4xx_HAL_Driver\Inc/stm32f4xx_hal_eth.h:2068:19: note: declared here
 2068 | HAL_StatusTypeDef HAL_ETH_ReadPHYRegister(ETH_HandleTypeDef *heth, uint32_t PHYAddr, uint32_t PHYReg,
      |                   ^~~~~~~~~~~~~~~~~~~~~~~
.pio\libdeps\genericSTM32F407VGT6\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*}
.pio\libdeps\genericSTM32F407VGT6\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\Mikrotroniks\.platformio\packages\framework-arduinoststm32\system\Drivers\STM32F4xx_HAL_Driver\Inc/stm32f4xx_hal_eth.h:2068:19: note: declared here
 2068 | HAL_StatusTypeDef HAL_ETH_ReadPHYRegister(ETH_HandleTypeDef *heth, uint32_t PHYAddr, uint32_t PHYReg,
      |                   ^~~~~~~~~~~~~~~~~~~~~~~
.pio\libdeps\genericSTM32F407VGT6\STM32Ethernet\src\utility\ethernetif.cpp: In function 'void ethernetif_update_config(netif*)':
.pio\libdeps\genericSTM32F407VGT6\STM32Ethernet\src\utility\ethernetif.cpp:542:24: error: 'struct ETH_InitTypeDef' has no member named 'AutoNegotiation'
  542 |     if (EthHandle.Init.AutoNegotiation != ETH_AUTONEGOTIATION_DISABLE) {
      |                        ^~~~~~~~~~~~~~~
.pio\libdeps\genericSTM32F407VGT6\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*}
.pio\libdeps\genericSTM32F407VGT6\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\Mikrotroniks\.platformio\packages\framework-arduinoststm32\system\Drivers\STM32F4xx_HAL_Driver\Inc/stm32f4xx_hal_eth.h:2068:19: note: declared here
 2068 | HAL_StatusTypeDef HAL_ETH_ReadPHYRegister(ETH_HandleTypeDef *heth, uint32_t PHYAddr, uint32_t PHYReg,
      |                   ^~~~~~~~~~~~~~~~~~~~~~~
.pio\libdeps\genericSTM32F407VGT6\STM32Ethernet\src\utility\ethernetif.cpp:553:24: error: 'struct ETH_InitTypeDef' has no member named 'DuplexMode'
  553 |         EthHandle.Init.DuplexMode = ETH_MODE_FULLDUPLEX;
      |                        ^~~~~~~~~~
.pio\libdeps\genericSTM32F407VGT6\STM32Ethernet\src\utility\ethernetif.cpp:553:37: error: 'ETH_MODE_FULLDUPLEX' was not declared in this scope
  553 |         EthHandle.Init.DuplexMode = ETH_MODE_FULLDUPLEX;
      |                                     ^~~~~~~~~~~~~~~~~~~
.pio\libdeps\genericSTM32F407VGT6\STM32Ethernet\src\utility\ethernetif.cpp:556:24: error: 'struct ETH_InitTypeDef' has no member named 'DuplexMode'
  556 |         EthHandle.Init.DuplexMode = ETH_MODE_HALFDUPLEX;
      |                        ^~~~~~~~~~
.pio\libdeps\genericSTM32F407VGT6\STM32Ethernet\src\utility\ethernetif.cpp:556:37: error: 'ETH_MODE_HALFDUPLEX' was not declared in this scope
  556 |         EthHandle.Init.DuplexMode = ETH_MODE_HALFDUPLEX;
      |                                     ^~~~~~~~~~~~~~~~~~~
.pio\libdeps\genericSTM32F407VGT6\STM32Ethernet\src\utility\ethernetif.cpp:561:24: error: 'struct ETH_InitTypeDef' has no member named 'Speed'
  561 |         EthHandle.Init.Speed = ETH_SPEED_10M;
      |                        ^~~~~
.pio\libdeps\genericSTM32F407VGT6\STM32Ethernet\src\utility\ethernetif.cpp:564:24: error: 'struct ETH_InitTypeDef' has no member named 'Speed'
  564 |         EthHandle.Init.Speed = ETH_SPEED_100M;
      |                        ^~~~~
.pio\libdeps\genericSTM32F407VGT6\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) |
      |                                                                                ^~~~~~~~~~
.pio\libdeps\genericSTM32F407VGT6\STM32Ethernet\src\utility\ethernetif.cpp:574:80: error: 'struct ETH_InitTypeDef' has no member named 'Speed'
  574 |                                                      (uint16_t)(EthHandle.Init.Speed >> 1)));
      |                                                                                ^~~~~
.pio\libdeps\genericSTM32F407VGT6\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
.pio\libdeps\genericSTM32F407VGT6\STM32Ethernet\src\utility\ethernetif.cpp:578:56: error: expected primary-expression before ')' token
  578 |     HAL_ETH_ConfigMAC(&EthHandle, (ETH_MACInitTypeDef *) NULL);
      |                                                        ^
.pio\libdeps\genericSTM32F407VGT6\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);
      |     ^~~~~~~~~~~~~~~~~
Compiling .pio\build\genericSTM32F407VGT6\lib949\STM32duino LwIP\core\altcp.c.o
*** [.pio\build\genericSTM32F407VGT6\src\main.cpp.o] Error 1
*** [.pio\build\genericSTM32F407VGT6\lib9b1\STM32Ethernet\utility\ethernetif.cpp.o] Error 1

Please Help...

valeros commented 5 months ago

Hi @HareshPrajapati, could you please check if it works in Arduino IDE?

HareshPrajapati commented 5 months ago

@valeros It is completely compiled on an Arduino.

fpistm commented 5 months ago

@valeros It is completely compiled on an Arduino.

No, if you only defined HAL_ETH_LEGACY_MODULE_ENABLED it does not compile but this is normal.

You have to define also: HAL_ETH_MODULE_DISABLED So you have to define both:

#define HAL_ETH_LEGACY_MODULE_ENABLED
#define HAL_ETH_MODULE_DISABLED
HareshPrajapati commented 5 months ago

I already did it. see.. still throwing same errors image

AirLongDian commented 5 months ago

i have the same problem

HareshPrajapati commented 5 months ago

Any Update?

valeros commented 5 months ago

What happens if you set those defines globally in the platformio.ini file? For example:

...
build_flags =
  -DENABLE_HWSERIAL2
  -DHAL_ETH_LEGACY_MODULE_ENABLED
  -DHAL_ETH_MODULE_DISABLED
HareshPrajapati commented 5 months ago

Thank you very much @valeros

It Works !

HareshPrajapati commented 5 months ago
build_flags =
-DENABLE_HWSERIAL2
-DHAL_ETH_LEGACY_MODULE_ENABLED
-DHAL_ETH_MODULE_DISABLED

Solution..

fpistm commented 5 months ago

Just a quick thought, the hal_conf_extra.h file should work in pio environment. https://github.com/stm32duino/Arduino_Core_STM32/blob/f31d070d1f2059494c6369ab52808729381f9750/system/STM32F4xx/stm32f4xx_hal_conf.h#L10-L12 If not (it seems the case), the way pio builds and includes files is not correct and would hide other issue compare to Arduino IDE env.