stm32duino / STM32Ethernet

Arduino library to support Ethernet for STM32 based board
151 stars 42 forks source link

How to fix? LAN8720 vs STM32F407ZG #55

Closed Ddh012345dhD closed 3 years ago

Ddh012345dhD commented 3 years ago

image

fpistm commented 3 years ago

Hi @Ddh012345dhD we do not support PIO here only Arduino IDE. Try with Arduino IDE if it is the same then we could investigate. Anyway I know it is ok.

Ddh012345dhD commented 3 years ago

I try Adruino IDE. C:\Users\PC\Documents\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.cpp:80:15: error: 'ETH_DMADescTypeDef' does not name a type 80 | ALIGN_BEGIN ETH_DMADescTypeDef DMARxDscrTab[ETH_RXBUFNB] ALIGN_END;/ Ethernet Rx MA Descriptor / | ^~~~~~ C:\Users\PC\Documents\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.cpp:85:15: error: 'ETH_DMADescTypeDef' does not name a type 85 | ALIGN_BEGIN ETH_DMADescTypeDef DMATxDscrTab[ETH_TXBUFNB] ALIGN_END;/ Ethernet Tx DMA Descriptor / | ^~~~~~ In file included from C:\Users\PC\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.9.0\system/STM32F4xx/stm32f4xx_hal_conf.h:13, from C:\Users\PC\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.9.0\system/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal.h:30, from C:\Users\PC\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.9.0\system/Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f4xx.h:250, from C:\Users\PC\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.9.0\cores\arduino/stm32/stm32_def.h:34, from C:\Users\PC\Documents\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.cpp:48: C:\Users\PC\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.9.0\system/STM32F4xx/stm32f4xx_hal_conf_default.h:227:40: error: 'ETH_MAX_PACKET_SIZE' was not declared in this scope 227 | #define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE / buffer size for receive / | ^~~~~~~ C:\Users\PC\Documents\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.cpp:90:44: note: in expansion of macro 'ETH_RX_BUF_SIZE' 90 | ALIGN_BEGIN uint8_t Rx_Buff[ETH_RXBUFNB][ETH_RX_BUF_SIZE] ALIGN_END; / Ethernet Receive Buffer / | ^~~~~~~ C:\Users\PC\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.9.0\system/STM32F4xx/stm32f4xx_hal_conf_default.h:228:40: error: 'ETH_MAX_PACKET_SIZE' was not declared in this scope 228 | #define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE / buffer size for transmit / | ^~~~~~~ C:\Users\PC\Documents\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.cpp:95:44: note: in expansion of macro 'ETH_TX_BUF_SIZE' 95 | ALIGN_BEGIN uint8_t Tx_Buff[ETH_TXBUFNB][ETH_TX_BUF_SIZE] ALIGN_END; / Ethernet Transmit Buffer / | ^~~~~~~ C:\Users\PC\Documents\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.cpp:97:8: error: 'ETH_HandleTypeDef' does not name a type; did you mean 'RTC_HandleTypeDef'? 97 | static ETH_HandleTypeDef EthHandle; | ^~~~~ | RTC_HandleTypeDef C:\Users\PC\Documents\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.cpp:116:22: error: variable or field 'HAL_ETH_MspInit' declared void 116 | void HAL_ETH_MspInit(ETH_HandleTypeDef heth) | ^~~~~ C:\Users\PC\Documents\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.cpp:116:22: error: 'ETH_HandleTypeDef' was not declared in this scope; did you mean 'RTC_HandleTypeDef'? 116 | void HAL_ETH_MspInit(ETH_HandleTypeDef heth) | ^~~~~ | RTC_HandleTypeDef C:\Users\PC\Documents\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.cpp:116:41: error: 'heth' was not declared in this scope 116 | void HAL_ETH_MspInit(ETH_HandleTypeDef heth) | ^~~~ C:\Users\PC\Documents\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.cpp: In function 'void low_level_init(netif)': C:\Users\PC\Documents\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.cpp:168:3: error: 'EthHandle' was not declared in this scope 168 | EthHandle.Instance = ETH; | ^~~~~ C:\Users\PC\Documents\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.cpp:170:36: error: 'ETH_AUTONEGOTIATION_ENABLE' was not declared in this scope 170 | EthHandle.Init.AutoNegotiation = ETH_AUTONEGOTIATION_ENABLE; | ^~~~~~ C:\Users\PC\Documents\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.cpp:171:26: error: 'ETH_SPEED_100M' was not declared in this scope 171 | EthHandle.Init.Speed = ETH_SPEED_100M; | ^~~~~~ C:\Users\PC\Documents\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.cpp:172:31: error: 'ETH_MODE_FULLDUPLEX' was not declared in this scope 172 | EthHandle.Init.DuplexMode = ETH_MODE_FULLDUPLEX; | ^~~~~~~ C:\Users\PC\Documents\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.cpp:174:35: error: 'ETH_MEDIA_INTERFACE_RMII' was not declared in this scope 174 | EthHandle.Init.MediaInterface = ETH_MEDIA_INTERFACE_RMII; | ^~~~~~~~ C:\Users\PC\Documents\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.cpp:181:27: error: 'ETH_RXPOLLING_MODE' was not declared in this scope 181 | EthHandle.Init.RxMode = ETH_RXPOLLING_MODE; | ^~~~~~ C:\Users\PC\Documents\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.cpp:183:33: error: 'ETH_CHECKSUM_BY_HARDWARE' was not declared in this scope; did you mean 'CHECKSUM_BY_HARDWARE'? 183 | EthHandle.Init.ChecksumMode = ETH_CHECKSUM_BY_HARDWARE; | ^~~~~~~~ | CHECKSUM_BY_HARDWARE C:\Users\PC\Documents\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.cpp:187:7: error: 'HAL_ETH_Init' was not declared in this scope; did you mean 'HAL_RTC_Init'? 187 | if (HAL_ETH_Init(&EthHandle) == HAL_OK) { | ^~~~ | HAL_RTC_Init C:\Users\PC\Documents\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.cpp:193:41: error: 'DMATxDscrTab' was not declared in this scope 193 | HAL_ETH_DMATxDescListInit(&EthHandle, DMATxDscrTab, &Tx_Buff[0][0], ETH_TXBUFNB); | ^~~~ C:\Users\PC\Documents\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.cpp:193:56: error: 'Tx_Buff' was not declared in this scope 193 | HAL_ETH_DMATxDescListInit(&EthHandle, DMATxDscrTab, &Tx_Buff[0][0], ETH_TXBUFNB); | ^~~ C:\Users\PC\Documents\Arduino\libraries\STM32Ethernet-master\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); | ^~~~~~~~~ C:\Users\PC\Documents\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.cpp:196:41: error: 'DMARxDscrTab' was not declared in this scope 196 | HAL_ETH_DMARxDescListInit(&EthHandle, DMARxDscrTab, &Rx_Buff[0][0], ETH_RXBUFNB); | ^~~~ C:\Users\PC\Documents\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.cpp:196:56: error: 'Rx_Buff' was not declared in this scope 196 | HAL_ETH_DMARxDescListInit(&EthHandle, DMARxDscrTab, &Rx_Buff[0][0], ETH_RXBUFNB); | ^~~ C:\Users\PC\Documents\Arduino\libraries\STM32Ethernet-master\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); | ^~~~~~~~~ C:\Users\PC\Documents\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.cpp:217:3: error: 'HAL_ETH_Start' was not declared in this scope; did you mean 'HAL_DAC_Start'? 217 | HAL_ETH_Start(&EthHandle); | ^~~~~ | HAL_DAC_Start C:\Users\PC\Documents\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.cpp:223:3: error: 'HAL_ETH_ReadPHYRegister' was not declared in this scope 223 | HAL_ETH_ReadPHYRegister(&EthHandle, PHY_IMR, &regvalue); | ^~~~~~~ C:\Users\PC\Documents\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.cpp:228:3: error: 'HAL_ETH_WritePHYRegister' was not declared in this scope 228 | HAL_ETH_WritePHYRegister(&EthHandle, PHY_IMR, regvalue); | ^~~~~~~~ C:\Users\PC\Documents\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.cpp: In function 'err_t low_level_output(netif, pbuf)': C:\Users\PC\Documents\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.cpp:254:33: error: 'EthHandle' was not declared in this scope 254 | uint8_t buffer = (uint8_t )(EthHandle.TxDesc->Buffer1Addr); | ^~~~~ C:\Users\PC\Documents\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.cpp:255:8: error: 'ETH_DMADescTypeDef' does not name a type 255 | __IO ETH_DMADescTypeDef DmaTxDesc; | ^~~~~~ C:\Users\PC\Documents\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.cpp:263:3: error: 'DmaTxDesc' was not declared in this scope 263 | DmaTxDesc = EthHandle.TxDesc; | ^~~~~ C:\Users\PC\Documents\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.cpp:269:30: error: 'ETH_DMATXDESC_OWN' was not declared in this scope 269 | if ((DmaTxDesc->Status & ETH_DMATXDESC_OWN) != (uint32_t)RESET) { | ^~~~~ In file included from C:\Users\PC\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.9.0\system/STM32F4xx/stm32f4xx_hal_conf.h:13, from C:\Users\PC\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.9.0\system/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal.h:30, from C:\Users\PC\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.9.0\system/Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f4xx.h:250, from C:\Users\PC\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.9.0\cores\arduino/stm32/stm32_def.h:34, from C:\Users\PC\Documents\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.cpp:48: C:\Users\PC\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.9.0\system/STM32F4xx/stm32f4xx_hal_conf_default.h:228:40: error: 'ETH_MAX_PACKET_SIZE' was not declared in this scope 228 | #define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE / buffer size for transmit / | ^~~~~~~ C:\Users\PC\Documents\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.cpp:279:47: note: in expansion of macro 'ETH_TX_BUF_SIZE' 279 | while ((byteslefttocopy + bufferoffset) > ETH_TX_BUF_SIZE) { | ^~~~~~~ C:\Users\PC\Documents\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.cpp:284:20: error: 'ETH_DMADescTypeDef' was not declared in this scope 284 | DmaTxDesc = (ETH_DMADescTypeDef )(DmaTxDesc->Buffer2NextDescAddr); | ^~~~~~ C:\Users\PC\Documents\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.cpp:284:40: error: expected primary-expression before ')' token 284 | DmaTxDesc = (ETH_DMADescTypeDef )(DmaTxDesc->Buffer2NextDescAddr); | ^ C:\Users\PC\Documents\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.cpp:287:32: error: 'ETH_DMATXDESC_OWN' was not declared in this scope 287 | if ((DmaTxDesc->Status & ETH_DMATXDESC_OWN) != (uint32_t)RESET) { | ^~~~~ C:\Users\PC\Documents\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.cpp:307:3: error: 'HAL_ETH_TransmitFrame' was not declared in this scope 307 | HAL_ETH_TransmitFrame(&EthHandle, framelength); | ^~~~~ C:\Users\PC\Documents\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.cpp: In function 'pbuf low_level_input(netif)': C:\Users\PC\Documents\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.cpp:338:8: error: 'ETH_DMADescTypeDef' does not name a type 338 | __IO ETH_DMADescTypeDef dmarxdesc; | ^~~~~~ C:\Users\PC\Documents\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.cpp:346:36: error: 'EthHandle' was not declared in this scope 346 | if (HAL_ETH_GetReceivedFrame_IT(&EthHandle) != HAL_OK) { | ^~~~~ C:\Users\PC\Documents\Arduino\libraries\STM32Ethernet-master\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) { | ^~~~~~~ C:\Users\PC\Documents\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.cpp:351:9: error: 'EthHandle' was not declared in this scope 351 | len = EthHandle.RxFrameInfos.length; | ^~~~~ C:\Users\PC\Documents\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.cpp:360:5: error: 'dmarxdesc' was not declared in this scope 360 | dmarxdesc = EthHandle.RxFrameInfos.FSRxDesc; | ^~~~~ In file included from C:\Users\PC\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.9.0\system/STM32F4xx/stm32f4xx_hal_conf.h:13, from C:\Users\PC\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.9.0\system/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal.h:30, from C:\Users\PC\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.9.0\system/Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f4xx.h:250, from C:\Users\PC\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.9.0\cores\arduino/stm32/stm32_def.h:34, from C:\Users\PC\Documents\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.cpp:48: C:\Users\PC\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.9.0\system/STM32F4xx/stm32f4xx_hal_conf_default.h:227:40: error: 'ETH_MAX_PACKET_SIZE' was not declared in this scope 227 | #define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE / buffer size for receive / | ^~~~~~~ C:\Users\PC\Documents\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.cpp:368:49: note: in expansion of macro 'ETH_RX_BUF_SIZE' 368 | while ((byteslefttocopy + bufferoffset) > ETH_RX_BUF_SIZE) { | ^~~~~~~ C:\Users\PC\Documents\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.cpp:373:22: error: 'ETH_DMADescTypeDef' was not declared in this scope 373 | dmarxdesc = (ETH_DMADescTypeDef )(dmarxdesc->Buffer2NextDescAddr); | ^~~~~~ C:\Users\PC\Documents\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.cpp:373:42: error: expected primary-expression before ')' token 373 | dmarxdesc = (ETH_DMADescTypeDef )(dmarxdesc->Buffer2NextDescAddr); | ^ C:\Users\PC\Documents\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.cpp:389:3: error: 'dmarxdesc' was not declared in this scope 389 | dmarxdesc = EthHandle.RxFrameInfos.FSRxDesc; | ^~~~~ C:\Users\PC\Documents\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.cpp:392:26: error: 'ETH_DMARXDESC_OWN' was not declared in this scope 392 | dmarxdesc->Status |= ETH_DMARXDESC_OWN; | ^~~~~ C:\Users\PC\Documents\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.cpp:393:18: error: 'ETH_DMADescTypeDef' was not declared in this scope 393 | dmarxdesc = (ETH_DMADescTypeDef )(dmarxdesc->Buffer2NextDescAddr); | ^~~~~~ C:\Users\PC\Documents\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.cpp:393:38: error: expected primary-expression before ')' token 393 | dmarxdesc = (ETH_DMADescTypeDef )(dmarxdesc->Buffer2NextDescAddr); | ^ C:\Users\PC\Documents\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.cpp: In function 'uint8_t ethernetif_is_init()': C:\Users\PC\Documents\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.cpp:449:11: error: 'EthHandle' was not declared in this scope 449 | return (EthHandle.State != HAL_ETH_STATE_RESET); | ^~~~~ C:\Users\PC\Documents\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.cpp:449:30: error: 'HAL_ETH_STATE_RESET' was not declared in this scope; did you mean 'HAL_RTC_STATE_RESET'? 449 | return (EthHandle.State != HAL_ETH_STATE_RESET); | ^~~~~~~ | HAL_RTC_STATE_RESET C:\Users\PC\Documents\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.cpp: In function 'void ethernetif_set_link(netif)': C:\Users\PC\Documents\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.cpp:509:28: error: 'EthHandle' was not declared in this scope 509 | HAL_ETH_ReadPHYRegister(&EthHandle, PHY_ISFR, &regvalue); | ^~~~~ C:\Users\PC\Documents\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.cpp:509:3: error: 'HAL_ETH_ReadPHYRegister' was not declared in this scope 509 | HAL_ETH_ReadPHYRegister(&EthHandle, PHY_ISFR, &regvalue); | ^~~~~~~ C:\Users\PC\Documents\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.cpp: In function 'void ethernetif_update_config(netif)': C:\Users\PC\Documents\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.cpp:542:9: error: 'EthHandle' was not declared in this scope 542 | if (EthHandle.Init.AutoNegotiation != ETH_AUTONEGOTIATION_DISABLE) { | ^~~~~ C:\Users\PC\Documents\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.cpp:542:43: error: 'ETH_AUTONEGOTIATION_DISABLE' was not declared in this scope 542 | if (EthHandle.Init.AutoNegotiation != ETH_AUTONEGOTIATION_DISABLE) { | ^~~~~~~ C:\Users\PC\Documents\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.cpp:545:7: error: 'HAL_ETH_ReadPHYRegister' was not declared in this scope 545 | HAL_ETH_ReadPHYRegister(&EthHandle, PHY_SR, &regvalue); | ^~~~~~~ C:\Users\PC\Documents\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.cpp:553:37: error: 'ETH_MODE_FULLDUPLEX' was not declared in this scope 553 | EthHandle.Init.DuplexMode = ETH_MODE_FULLDUPLEX; | ^~~~~~~ C:\Users\PC\Documents\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.cpp:556:37: error: 'ETH_MODE_HALFDUPLEX' was not declared in this scope 556 | EthHandle.Init.DuplexMode = ETH_MODE_HALFDUPLEX; | ^~~~~~~ C:\Users\PC\Documents\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.cpp:561:32: error: 'ETH_SPEED_10M' was not declared in this scope 561 | EthHandle.Init.Speed = ETH_SPEED_10M; | ^~~~~ C:\Users\PC\Documents\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.cpp:564:32: error: 'ETH_SPEED_100M' was not declared in this scope 564 | EthHandle.Init.Speed = ETH_SPEED_100M; | ^~~~~~ C:\Users\PC\Documents\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.cpp:573:7: error: 'HAL_ETH_WritePHYRegister' was not declared in this scope 573 | HAL_ETH_WritePHYRegister(&EthHandle, PHY_BCR, ((uint16_t)(EthHandle.Init.DuplexMode >> 3) | | ^~~~~~~~ C:\Users\PC\Documents\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.cpp:578:24: error: 'EthHandle' was not declared in this scope 578 | HAL_ETH_ConfigMAC(&EthHandle, (ETH_MACInitTypeDef ) NULL); | ^~~~~ C:\Users\PC\Documents\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.cpp:578:36: error: 'ETH_MACInitTypeDef' was not declared in this scope; did you mean 'TIM_IC_InitTypeDef'? 578 | HAL_ETH_ConfigMAC(&EthHandle, (ETH_MACInitTypeDef ) NULL); | ^~~~~~ | TIM_IC_InitTypeDef C:\Users\PC\Documents\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.cpp:578:56: error: expected primary-expression before ')' token 578 | HAL_ETH_ConfigMAC(&EthHandle, (ETH_MACInitTypeDef ) NULL); | ^ C:\Users\PC\Documents\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.cpp:578:5: error: 'HAL_ETH_ConfigMAC' was not declared in this scope 578 | HAL_ETH_ConfigMAC(&EthHandle, (ETH_MACInitTypeDef ) NULL); | ^~~~~ C:\Users\PC\Documents\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.cpp:581:5: error: 'HAL_ETH_Start' was not declared in this scope; did you mean 'HAL_DAC_Start'? 581 | HAL_ETH_Start(&EthHandle); | ^~~~~ | HAL_DAC_Start C:\Users\PC\Documents\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.cpp:584:19: error: 'EthHandle' was not declared in this scope 584 | HAL_ETH_Stop(&EthHandle); | ^~~~~ C:\Users\PC\Documents\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.cpp:584:5: error: 'HAL_ETH_Stop' was not declared in this scope; did you mean 'HAL_DAC_Stop'? 584 | HAL_ETH_Stop(&EthHandle); | ^~~~ | HAL_DAC_Stop Using library LwIP-master at version 2.1.2 in folder: C:\Users\PC\Documents\Arduino\libraries\LwIP-master Using library STM32Ethernet-master at version 1.2.0 in folder: C:\Users\PC\Documents\Arduino\libraries\STM32Ethernet-master Using library SrcWrapper at version 1.0.1 in folder: C:\Users\PC\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.9.0\libraries\SrcWrapper exit status 1 Error compiling for board Generic STM32F4 series.

fpistm commented 3 years ago

OK. The generic F407 does not enable the HAL_ETH_MODULE_ENABLED

https://github.com/stm32duino/wiki/wiki/HAL-configuration#customize-hal-or-variant-definition

So you have to enable it. Probably you also need to redefined the PinMap_Ethernet array in order to have only the requested pin.

https://github.com/stm32duino/wiki/wiki/Custom-definitions#custom-pinmap-array

I've tested and it build OK.

Ddh012345dhD commented 3 years ago

In file included from C:\Users\PC\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.9.0\system/Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f4xx.h:250, from C:\Users\PC\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.9.0\cores\arduino/stm32/stm32_def.h:34, from C:\Users\PC\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.9.0\cores\arduino/stm32/clock.h:43, from C:\Users\PC\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.9.0\cores\arduino/wiring_time.h:23, from C:\Users\PC\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.9.0\cores\arduino/wiring.h:38, from C:\Users\PC\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.9.0\cores\arduino/Arduino.h:36, from C:\Users\PC\AppData\Local\Temp\arduino_build_997497\sketch\DhcpAddressPrinter.ino.cpp:1: C:\Users\PC\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.9.0\system/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal.h:220:1: error: 'HAL_StatusTypeDef' does not name a type 220 | HAL_StatusTypeDef HAL_Init(void); | ^~~~~ C:\Users\PC\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.9.0\system/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal.h:221:1: error: 'HAL_StatusTypeDef' does not name a type 221 | HAL_StatusTypeDef HAL_DeInit(void); | ^~~~~ C:\Users\PC\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.9.0\system/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal.h:224:1: error: 'HAL_StatusTypeDef' does not name a type 224 | HAL_StatusTypeDef HAL_InitTick (uint32_t TickPriority); | ^~~~~ C:\Users\PC\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.9.0\system/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal.h:237:1: error: 'HAL_StatusTypeDef' does not name a type 237 | HAL_StatusTypeDef HAL_SetTickFreq(HAL_TickFreqTypeDef Freq); | ^~~~~ In file included from C:\Users\PC\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.9.0\cores\arduino/HardwareTimer.h:31, from C:\Users\PC\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.9.0\cores\arduino/stm32/analog.h:45, from C:\Users\PC\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.9.0\cores\arduino/board.h:8, from C:\Users\PC\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.9.0\cores\arduino/wiring.h:41, from C:\Users\PC\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.9.0\cores\arduino/Arduino.h:36, from C:\Users\PC\AppData\Local\Temp\arduino_build_997497\sketch\DhcpAddressPrinter.ino.cpp:1: C:\Users\PC\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.9.0\cores\arduino/stm32/timer.h:245:3: error: 'TIM_HandleTypeDef' does not name a type; did you mean 'TIM_TypeDef'? 245 | TIM_HandleTypeDef handle; | ^~~~~ | TIM_TypeDef C:\Users\PC\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.9.0\cores\arduino/stm32/timer.h:251:27: error: 'TIM_HandleTypeDef' was not declared in this scope; did you mean 'TIM_TypeDef'? 251 | timerObj_t get_timer_obj(TIM_HandleTypeDef htim); | ^~~~~ | TIM_TypeDef C:\Users\PC\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.9.0\cores\arduino/stm32/timer.h:251:46: error: 'htim' was not declared in this scope; did you mean 'tm'? 251 | timerObj_t get_timer_obj(TIM_HandleTypeDef htim); | ^~~~ | tm C:\Users\PC\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.9.0\cores\arduino/stm32/timer.h:253:23: error: variable or field 'enableTimerClock' declared void 253 | void enableTimerClock(TIM_HandleTypeDef htim); | ^~~~~ C:\Users\PC\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.9.0\cores\arduino/stm32/timer.h:253:23: error: 'TIM_HandleTypeDef' was not declared in this scope; did you mean 'TIM_TypeDef'? 253 | void enableTimerClock(TIM_HandleTypeDef htim); | ^~~~~ | TIM_TypeDef C:\Users\PC\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.9.0\cores\arduino/stm32/timer.h:253:42: error: 'htim' was not declared in this scope; did you mean 'tm'? 253 | void enableTimerClock(TIM_HandleTypeDef htim); | ^~~~ | tm C:\Users\PC\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.9.0\cores\arduino/stm32/timer.h:254:24: error: variable or field 'disableTimerClock' declared void 254 | void disableTimerClock(TIM_HandleTypeDef htim); | ^~~~~ C:\Users\PC\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.9.0\cores\arduino/stm32/timer.h:254:24: error: 'TIM_HandleTypeDef' was not declared in this scope; did you mean 'TIM_TypeDef'? 254 | void disableTimerClock(TIM_HandleTypeDef htim); | ^~~~~ | TIM_TypeDef C:\Users\PC\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.9.0\cores\arduino/stm32/timer.h:254:43: error: 'htim' was not declared in this scope; did you mean 'tm'? 254 | void disableTimerClock(TIM_HandleTypeDef htim); | ^~~~ | tm In file included from C:\Users\PC\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.9.0\cores\arduino/stm32/analog.h:45, from C:\Users\PC\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.9.0\cores\arduino/board.h:8, from C:\Users\PC\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.9.0\cores\arduino/wiring.h:41, from C:\Users\PC\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.9.0\cores\arduino/Arduino.h:36, from C:\Users\PC\AppData\Local\Temp\arduino_build_997497\sketch\DhcpAddressPrinter.ino.cpp:1: C:\Users\PC\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.9.0\cores\arduino/HardwareTimer.h:148:40: error: 'TIM_HandleTypeDef' has not been declared 148 | static void captureCompareCallback(TIM_HandleTypeDef htim); // Generic Caputre and Compare callback which will call user callback | ^~~~~ C:\Users\PC\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.9.0\cores\arduino/HardwareTimer.h:149:32: error: 'TIM_HandleTypeDef' has not been declared 149 | static void updateCallback(TIM_HandleTypeDef htim); // Generic Update (rollover) callback which will call user callback | ^~~~~ C:\Users\PC\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.9.0\cores\arduino/HardwareTimer.h:152:5: error: 'TIM_HandleTypeDef' does not name a type; did you mean 'TIM_TypeDef'? 152 | TIM_HandleTypeDef *getHandle(); // return the handle address for HAL related configuration | ^~~~~ | TIM_TypeDef In file included from C:\Users\PC\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.9.0\cores\arduino/board.h:9, from C:\Users\PC\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.9.0\cores\arduino/wiring.h:41, from C:\Users\PC\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.9.0\cores\arduino/Arduino.h:36, from C:\Users\PC\AppData\Local\Temp\arduino_build_997497\sketch\DhcpAddressPrinter.ino.cpp:1: C:\Users\PC\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.9.0\cores\arduino/stm32/backup.h: In function 'void resetBackupDomain()': C:\Users\PC\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.9.0\cores\arduino/stm32/backup.h:67:3: error: 'HAL_PWR_EnableBkUpAccess' was not declared in this scope 67 | HAL_PWR_EnableBkUpAccess(); | ^~~~~~~~ C:\Users\PC\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.9.0\cores\arduino/stm32/backup.h:74:3: error: 'HAL_RCC_BACKUPRESET_FORCE' was not declared in this scope 74 | __HAL_RCC_BACKUPRESET_FORCE(); | ^~~~~~~ C:\Users\PC\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.9.0\cores\arduino/stm32/backup.h:75:3: error: 'HAL_RCC_BACKUPRESET_RELEASE' was not declared in this scope 75 | __HAL_RCC_BACKUPRESET_RELEASE(); | ^~~~~~~~~ C:\Users\PC\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.9.0\cores\arduino/stm32/backup.h: In function 'void enableBackupDomain()': C:\Users\PC\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.9.0\cores\arduino/stm32/backup.h:88:3: error: 'HAL_PWR_EnableBkUpAccess' was not declared in this scope 88 | HAL_PWR_EnableBkUpAccess(); | ^~~~~~~~ C:\Users\PC\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.9.0\cores\arduino/stm32/backup.h: In function 'void disableBackupDomain()': C:\Users\PC\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.9.0\cores\arduino/stm32/backup.h:104:3: error: 'HAL_PWR_DisableBkUpAccess' was not declared in this scope 104 | HAL_PWR_DisableBkUpAccess(); | ^~~~~~~~~ In file included from C:\Users\PC\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.9.0\cores\arduino/stm32/low_power.h:44, from C:\Users\PC\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.9.0\cores\arduino/board.h:15, from C:\Users\PC\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.9.0\cores\arduino/wiring.h:41, from C:\Users\PC\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.9.0\cores\arduino/Arduino.h:36, from C:\Users\PC\AppData\Local\Temp\arduino_build_997497\sketch\DhcpAddressPrinter.ino.cpp:1: C:\Users\PC\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.9.0\cores\arduino/stm32/uart.h: At global scope: C:\Users\PC\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.9.0\cores\arduino/stm32/uart.h:69:3: error: 'UART_HandleTypeDef' does not name a type 69 | UART_HandleTypeDef handle; | ^~~~~~ Using library LwIP-master at version 2.1.2 in folder: C:\Users\PC\Documents\Arduino\libraries\LwIP-master Using library STM32Ethernet-master at version 1.2.0 in folder: C:\Users\PC\Documents\Arduino\libraries\STM32Ethernet-master Using library SrcWrapper at version 1.0.1 in folder: C:\Users\PC\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.9.0\libraries\SrcWrapper exit status 1 Error compiling for board Generic STM32F4 series.

fpistm commented 3 years ago

Don't know what you made but you have to simply add a file name hal_conf_extra.h with inside: #define HAL_ETH_MODULE_ENABLED

Then you will be able to compile. Here the result of the webclient example built for Generic F407

Using library STM32duino_LwIP at version 2.1.2 in folder: C:\STM32\arduino\arduino-1.8.13\portable\sketchbook\libraries\STM32duino_LwIP 
Using library STM32duino_STM32Ethernet at version 1.2.0 in folder: C:\STM32\arduino\arduino-1.8.13\portable\sketchbook\libraries\STM32duino_STM32Ethernet 
Using library SrcWrapper at version 1.0.1 in folder: C:\STM32\arduino\arduino-1.8.13\portable\packages\STM32\hardware\stm32\2.0.0-dev\libraries\SrcWrapper 

Sketch uses 55256 bytes (5%) of program storage space. Maximum is 1048576 bytes.
Global variables use 44168 bytes (33%) of dynamic memory, leaving 86904 bytes for local variables. Maximum is 131072 bytes.