stm32duino / STM32Ethernet

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

Support LAN8720 PHY #23

Closed nopnop2002 closed 4 years ago

nopnop2002 commented 5 years ago

I'm try to compile this on Generic STM32F4 Series.

I installed these.

https://github.com/stm32duino/STM32Ethernet

https://github.com/stm32duino/LwIP

STM32Ethernet

But compile error occure. This is compile options.

Compile_Options

Do you have any advice.

    Warning: Board atmega64:avr:memduino64_8MHz doesn't define a 'build.board' preference. Auto-set to: AVR_MEMDUINO64_8MHZ
    Warning: Board atmega644_1284:avr:avrmega644p doesn't define a 'build.board' preference. Auto-set to: AVR_AVRMEGA644P
    Warning: Board atmega644_1284:avr:avrmega644p16 doesn't define a 'build.board' preference. Auto-set to: AVR_AVRMEGA644P16
    Warning: Board atmega644_1284:avr:avrmega1284p doesn't define a 'build.board' preference. Auto-set to: AVR_AVRMEGA1284P
    Warning: Board atmega644_1284:avr:avrmega1284p16 doesn't define a 'build.board' preference. Auto-set to: AVR_AVRMEGA1284P16
    �T�u�f�B���N�g���܂��̓t�@�C�� sketch �͊��ɑ��݂��܂��B

    \\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.c:74:15: error: unknown type name 'ETH_DMADescTypeDef'; did you mean 'RTC_DateTypeDef'?
     __ALIGN_BEGIN ETH_DMADescTypeDef  DMARxDscrTab[ETH_RXBUFNB] __ALIGN_END;/* Ethernet Rx MA Descriptor */
                   ^~~~~~~~~~~~~~~~~~
                   RTC_DateTypeDef
    \\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.c:79:15: error: unknown type name 'ETH_DMADescTypeDef'; did you mean 'RTC_DateTypeDef'?
     __ALIGN_BEGIN ETH_DMADescTypeDef  DMATxDscrTab[ETH_TXBUFNB] __ALIGN_END;/* Ethernet Tx DMA Descriptor */
                   ^~~~~~~~~~~~~~~~~~
                   RTC_DateTypeDef
    In file included from C:\Users\user\Documents\ArduinoData\packages\STM32\hardware\stm32\1.6.1\system/STM32F4xx/stm32f4xx_hal_conf.h:13,
                     from C:\Users\user\Documents\ArduinoData\packages\STM32\hardware\stm32\1.6.1\system/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal.h:30,
                     from C:\Users\user\Documents\ArduinoData\packages\STM32\hardware\stm32\1.6.1\system/Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f4xx.h:250,
                     from C:\Users\user\Documents\ArduinoData\packages\STM32\hardware\stm32\1.6.1\cores\arduino/stm32/stm32_def.h:35,
                     from \\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.c:48:
    C:\Users\user\Documents\ArduinoData\packages\STM32\hardware\stm32\1.6.1\system/STM32F4xx/stm32f4xx_hal_conf_default.h:227:40: error: 'ETH_MAX_PACKET_SIZE' undeclared here (not in a function); did you mean 'ETH_TX_BUF_SIZE'?
     #define ETH_RX_BUF_SIZE                ETH_MAX_PACKET_SIZE /* buffer size for receive               */
                                            ^~~~~~~~~~~~~~~~~~~
    \\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.c:84:44: note: in expansion of macro 'ETH_RX_BUF_SIZE'
     __ALIGN_BEGIN uint8_t Rx_Buff[ETH_RXBUFNB][ETH_RX_BUF_SIZE] __ALIGN_END; /* Ethernet Receive Buffer */
                                                ^~~~~~~~~~~~~~~
    \\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.c:91:8: error: unknown type name 'ETH_HandleTypeDef'
     static ETH_HandleTypeDef EthHandle;
            ^~~~~~~~~~~~~~~~~
    \\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.c:105:22: error: unknown type name 'ETH_HandleTypeDef'; did you mean 'RTC_HandleTypeDef'?
     void HAL_ETH_MspInit(ETH_HandleTypeDef *heth)
                          ^~~~~~~~~~~~~~~~~
                          RTC_HandleTypeDef
    \\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.c: In function 'low_level_init':
    \\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.c:157:12: error: request for member 'Instance' in something not a structure or union
       EthHandle.Instance = ETH;
                ^
    \\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.c:158:12: error: request for member 'Init' in something not a structure or union
       EthHandle.Init.MACAddr = macaddress;
                ^
    \\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.c:159:12: error: request for member 'Init' in something not a structure or union
       EthHandle.Init.AutoNegotiation = ETH_AUTONEGOTIATION_ENABLE;
                ^
    \\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.c:159:36: error: 'ETH_AUTONEGOTIATION_ENABLE' undeclared (first use in this function); did you mean 'PHY_AUTONEGOTIATION'?
       EthHandle.Init.AutoNegotiation = ETH_AUTONEGOTIATION_ENABLE;
                                        ^~~~~~~~~~~~~~~~~~~~~~~~~~
                                        PHY_AUTONEGOTIATION
    \\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.c:159:36: note: each undeclared identifier is reported only once for each function it appears in
    \\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.c:160:12: error: request for member 'Init' in something not a structure or union
       EthHandle.Init.Speed = ETH_SPEED_100M;
                ^
    \\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.c:160:26: error: 'ETH_SPEED_100M' undeclared (first use in this function); did you mean 'I2C_SPEED_FAST'?
       EthHandle.Init.Speed = ETH_SPEED_100M;
                              ^~~~~~~~~~~~~~
                              I2C_SPEED_FAST
    \\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.c:161:12: error: request for member 'Init' in something not a structure or union
       EthHandle.Init.DuplexMode = ETH_MODE_FULLDUPLEX;
                ^
    \\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.c:161:31: error: 'ETH_MODE_FULLDUPLEX' undeclared (first use in this function)
       EthHandle.Init.DuplexMode = ETH_MODE_FULLDUPLEX;
                                   ^~~~~~~~~~~~~~~~~~~
    \\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.c:163:12: error: request for member 'Init' in something not a structure or union
       EthHandle.Init.MediaInterface = ETH_MEDIA_INTERFACE_RMII;
                ^
    \\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.c:163:35: error: 'ETH_MEDIA_INTERFACE_RMII' undeclared (first use in this function); did you mean 'ETH_MACFCR_RFCE_Msk'?
       EthHandle.Init.MediaInterface = ETH_MEDIA_INTERFACE_RMII;
                                       ^~~~~~~~~~~~~~~~~~~~~~~~
                                       ETH_MACFCR_RFCE_Msk
    \\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.c:170:12: error: request for member 'Init' in something not a structure or union
       EthHandle.Init.RxMode = ETH_RXPOLLING_MODE;
                ^
    \\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.c:170:27: error: 'ETH_RXPOLLING_MODE' undeclared (first use in this function); did you mean 'STM_PIN_MODE'?
       EthHandle.Init.RxMode = ETH_RXPOLLING_MODE;
                               ^~~~~~~~~~~~~~~~~~
                               STM_PIN_MODE
    \\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.c:172:12: error: request for member 'Init' in something not a structure or union
       EthHandle.Init.ChecksumMode = ETH_CHECKSUM_BY_HARDWARE;
                ^
    \\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.c:172:33: error: 'ETH_CHECKSUM_BY_HARDWARE' undeclared (first use in this function); did you mean 'CHECKSUM_BY_HARDWARE'?
       EthHandle.Init.ChecksumMode = ETH_CHECKSUM_BY_HARDWARE;
                                     ^~~~~~~~~~~~~~~~~~~~~~~~
                                     CHECKSUM_BY_HARDWARE
    \\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.c:173:12: error: request for member 'Init' in something not a structure or union
       EthHandle.Init.PhyAddress = LAN8742A_PHY_ADDRESS;
                ^
    \\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.c: In function 'low_level_output':
    \\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.c:238:42: error: request for member 'TxDesc' in something not a structure or union
       uint8_t *buffer = (uint8_t *)(EthHandle.TxDesc->Buffer1Addr);
                                              ^
    \\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.c:239:8: error: unknown type name 'ETH_DMADescTypeDef'
       __IO ETH_DMADescTypeDef *DmaTxDesc;
            ^~~~~~~~~~~~~~~~~~
    \\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.c:247:24: error: request for member 'TxDesc' in something not a structure or union
       DmaTxDesc = EthHandle.TxDesc;
                            ^
    \\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.c:254:18: error: request for member 'Status' in something not a structure or union
         if((DmaTxDesc->Status & ETH_DMATXDESC_OWN) != (uint32_t)RESET)
                      ^~
    \\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.c:254:29: error: 'ETH_DMATXDESC_OWN' undeclared (first use in this function); did you mean 'ETH_DMATDLAR_STL'?
         if((DmaTxDesc->Status & ETH_DMATXDESC_OWN) != (uint32_t)RESET)
                                 ^~~~~~~~~~~~~~~~~
                                 ETH_DMATDLAR_STL
    \\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.c:271:20: error: 'ETH_DMADescTypeDef' undeclared (first use in this function); did you mean 'RTC_DateTypeDef'?
           DmaTxDesc = (ETH_DMADescTypeDef *)(DmaTxDesc->Buffer2NextDescAddr);
                        ^~~~~~~~~~~~~~~~~~
                        RTC_DateTypeDef
    \\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.c:271:40: error: expected expression before ')' token
           DmaTxDesc = (ETH_DMADescTypeDef *)(DmaTxDesc->Buffer2NextDescAddr);
                                            ^
    \\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.c:271:51: error: request for member 'Buffer2NextDescAddr' in something not a structure or union
           DmaTxDesc = (ETH_DMADescTypeDef *)(DmaTxDesc->Buffer2NextDescAddr);
                                                       ^~
    \\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.c:274:20: error: request for member 'Status' in something not a structure or union
           if((DmaTxDesc->Status & ETH_DMATXDESC_OWN) != (uint32_t)RESET)
                        ^~
    \\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.c:280:37: error: request for member 'Buffer1Addr' in something not a structure or union
           buffer = (uint8_t *)(DmaTxDesc->Buffer1Addr);
                                         ^~
    \\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.c:302:17: error: request for member 'Instance' in something not a structure or union
       if ((EthHandle.Instance->DMASR & ETH_DMASR_TUS) != (uint32_t)RESET)
                     ^
    \\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.c:305:14: error: request for member 'Instance' in something not a structure or union
         EthHandle.Instance->DMASR = ETH_DMASR_TUS;
                  ^
    \\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.c:308:14: error: request for member 'Instance' in something not a structure or union
         EthHandle.Instance->DMATPDR = 0;
                  ^
    \\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.c: In function 'low_level_input':
    \\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.c:327:8: error: unknown type name 'ETH_DMADescTypeDef'
       __IO ETH_DMADescTypeDef *dmarxdesc;
            ^~~~~~~~~~~~~~~~~~
    \\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.c:339:18: error: request for member 'RxFrameInfos' in something not a structure or union
       len = EthHandle.RxFrameInfos.length;
                      ^
    \\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.c:340:32: error: request for member 'RxFrameInfos' in something not a structure or union
       buffer = (uint8_t *)EthHandle.RxFrameInfos.buffer;
                                    ^
    \\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.c:350:26: error: request for member 'RxFrameInfos' in something not a structure or union
         dmarxdesc = EthHandle.RxFrameInfos.FSRxDesc;
                              ^
    \\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.c:365:22: error: 'ETH_DMADescTypeDef' undeclared (first use in this function); did you mean 'RTC_DateTypeDef'?
             dmarxdesc = (ETH_DMADescTypeDef *)(dmarxdesc->Buffer2NextDescAddr);
                          ^~~~~~~~~~~~~~~~~~
                          RTC_DateTypeDef
    \\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.c:365:42: error: expected expression before ')' token
             dmarxdesc = (ETH_DMADescTypeDef *)(dmarxdesc->Buffer2NextDescAddr);
                                              ^
    \\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.c:365:53: error: request for member 'Buffer2NextDescAddr' in something not a structure or union
             dmarxdesc = (ETH_DMADescTypeDef *)(dmarxdesc->Buffer2NextDescAddr);
                                                         ^~
    \\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.c:366:39: error: request for member 'Buffer1Addr' in something not a structure or union
             buffer = (uint8_t *)(dmarxdesc->Buffer1Addr);
                                           ^~
    \\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.c:381:24: error: request for member 'RxFrameInfos' in something not a structure or union
       dmarxdesc = EthHandle.RxFrameInfos.FSRxDesc;
                            ^
    \\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.c:383:25: error: request for member 'RxFrameInfos' in something not a structure or union
       for (i=0; i< EthHandle.RxFrameInfos.SegCount; i++)
                             ^
    \\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.c:385:14: error: request for member 'Status' in something not a structure or union
         dmarxdesc->Status |= ETH_DMARXDESC_OWN;
                  ^~
    \\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.c:385:26: error: 'ETH_DMARXDESC_OWN' undeclared (first use in this function); did you mean 'ETH_DMARDLAR_SRL'?
         dmarxdesc->Status |= ETH_DMARXDESC_OWN;
                              ^~~~~~~~~~~~~~~~~
                              ETH_DMARDLAR_SRL
    \\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.c:386:38: error: expected expression before ')' token
         dmarxdesc = (ETH_DMADescTypeDef *)(dmarxdesc->Buffer2NextDescAddr);
                                          ^
    \\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.c:386:49: error: request for member 'Buffer2NextDescAddr' in something not a structure or union
         dmarxdesc = (ETH_DMADescTypeDef *)(dmarxdesc->Buffer2NextDescAddr);
                                                     ^~
    \\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.c:390:12: error: request for member 'RxFrameInfos' in something not a structure or union
       EthHandle.RxFrameInfos.SegCount =0;
                ^
    \\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.c:393:17: error: request for member 'Instance' in something not a structure or union
       if ((EthHandle.Instance->DMASR & ETH_DMASR_RBUS) != (uint32_t)RESET)
                     ^
    \\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.c:396:14: error: request for member 'Instance' in something not a structure or union
         EthHandle.Instance->DMASR = ETH_DMASR_RBUS;
                  ^
    \\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.c:398:14: error: request for member 'Instance' in something not a structure or union
         EthHandle.Instance->DMARPDR = 0;
                  ^
    \\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.c: In function 'ethernetif_update_config':
    \\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.c:520:17: error: request for member 'Init' in something not a structure or union
         if(EthHandle.Init.AutoNegotiation != ETH_AUTONEGOTIATION_DISABLE)
                     ^
    \\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.c:520:42: error: 'ETH_AUTONEGOTIATION_DISABLE' undeclared (first use in this function); did you mean 'PHY_AUTONEGOTIATION'?
         if(EthHandle.Init.AutoNegotiation != ETH_AUTONEGOTIATION_DISABLE)
                                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~
                                              PHY_AUTONEGOTIATION
    \\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.c:549:18: error: request for member 'Init' in something not a structure or union
             EthHandle.Init.DuplexMode = ETH_MODE_FULLDUPLEX;
                      ^
    \\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.c:549:37: error: 'ETH_MODE_FULLDUPLEX' undeclared (first use in this function)
             EthHandle.Init.DuplexMode = ETH_MODE_FULLDUPLEX;
                                         ^~~~~~~~~~~~~~~~~~~
    \\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.c:554:18: error: request for member 'Init' in something not a structure or union
             EthHandle.Init.DuplexMode = ETH_MODE_HALFDUPLEX;
                      ^
    \\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.c:554:37: error: 'ETH_MODE_HALFDUPLEX' undeclared (first use in this function); did you mean 'STM_MODE_AF_PP'?
             EthHandle.Init.DuplexMode = ETH_MODE_HALFDUPLEX;
                                         ^~~~~~~~~~~~~~~~~~~
                                         STM_MODE_AF_PP
    \\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.c:560:18: error: request for member 'Init' in something not a structure or union
             EthHandle.Init.Speed = ETH_SPEED_10M;
                      ^
    \\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.c:560:32: error: 'ETH_SPEED_10M' undeclared (first use in this function)
             EthHandle.Init.Speed = ETH_SPEED_10M;
                                    ^~~~~~~~~~~~~
    \\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.c:565:18: error: request for member 'Init' in something not a structure or union
             EthHandle.Init.Speed = ETH_SPEED_100M;
                      ^
    \\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.c:565:32: error: 'ETH_SPEED_100M' undeclared (first use in this function); did you mean 'I2C_SPEED_FAST'?
             EthHandle.Init.Speed = ETH_SPEED_100M;
                                    ^~~~~~~~~~~~~~
                                    I2C_SPEED_FAST
    \\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.c:576:74: error: request for member 'Init' in something not a structure or union
           HAL_ETH_WritePHYRegister(&EthHandle, PHY_BCR, ((uint16_t)(EthHandle.Init.DuplexMode >> 3) |
                                                                              ^
    \\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.c:577:74: error: request for member 'Init' in something not a structure or union
                                                          (uint16_t)(EthHandle.Init.Speed >> 1)));
                                                                              ^
    \\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.c:581:36: error: 'ETH_MACInitTypeDef' undeclared (first use in this function); did you mean 'RTC_InitTypeDef'?
         HAL_ETH_ConfigMAC(&EthHandle, (ETH_MACInitTypeDef *) NULL);
                                        ^~~~~~~~~~~~~~~~~~
                                        RTC_InitTypeDef
    \\LANDISK-HDL-AA1\disk1\Arduino\libraries\STM32Ethernet-master\src\utility\ethernetif.c:581:56: error: expected expression before ')' token
         HAL_ETH_ConfigMAC(&EthHandle, (ETH_MACInitTypeDef *) NULL);
                                                            ^
    exit status 1
fpistm commented 5 years ago

Hi @nopnop2002 the issue is that the HAL_ETH_MODULE_ENABLED is not defined by default for this board (I guess you use the DIYMROE_F407VGT. You can enable it by adding a hal_conf_extra.h file at sketch level with: #define HAL_ETH_MODULE_ENABLED

nopnop2002 commented 5 years ago

Yes. I'm using DIYMROE_F407VGT.

I added hal_conf_extra.h file in sketch folder.

Case1

Case2

But these error occure:

Warning: Board atmega644_1284:avr:avrmega644p doesn't define a 'build.board' preference. Auto-set to: AVR_AVRMEGA644P
Warning: Board atmega644_1284:avr:avrmega644p16 doesn't define a 'build.board' preference. Auto-set to: AVR_AVRMEGA644P16
Warning: Board atmega644_1284:avr:avrmega1284p doesn't define a 'build.board' preference. Auto-set to: AVR_AVRMEGA1284P
Warning: Board atmega644_1284:avr:avrmega1284p16 doesn't define a 'build.board' preference. Auto-set to: AVR_AVRMEGA1284P16
Warning: Board atmega64:avr:memduino64_8MHz doesn't define a 'build.board' preference. Auto-set to: AVR_MEMDUINO64_8MHZ
�T�u�f�B���N�g���܂��̓t�@�C�� sketch �͊��ɑ��݂��܂��B

c:/users/user/documents/arduinodata/packages/stm32/tools/arm-none-eabi-gcc/8.2.1-1.7/bin/../lib/gcc/arm-none-eabi/8.2.1/../../../../arm-none-eabi/bin/ld.exe: libraries\STM32Ethernet-master\utility\ethernetif.c.o: in function `low_level_output':

ethernetif.c:(.text.low_level_output+0x1e): undefined reference to `HAL_ETH_TransmitFrame'

c:/users/user/documents/arduinodata/packages/stm32/tools/arm-none-eabi-gcc/8.2.1-1.7/bin/../lib/gcc/arm-none-eabi/8.2.1/../../../../arm-none-eabi/bin/ld.exe: libraries\STM32Ethernet-master\utility\ethernetif.c.o: in function `ethernetif_input':

ethernetif.c:(.text.ethernetif_input+0xa): undefined reference to `HAL_ETH_GetReceivedFrame_IT'

c:/users/user/documents/arduinodata/packages/stm32/tools/arm-none-eabi-gcc/8.2.1-1.7/bin/../lib/gcc/arm-none-eabi/8.2.1/../../../../arm-none-eabi/bin/ld.exe: libraries\STM32Ethernet-master\utility\ethernetif.c.o: in function `ethernetif_init':

ethernetif.c:(.text.ethernetif_init+0x3a): undefined reference to `HAL_ETH_Init'

c:/users/user/documents/arduinodata/packages/stm32/tools/arm-none-eabi-gcc/8.2.1-1.7/bin/../lib/gcc/arm-none-eabi/8.2.1/../../../../arm-none-eabi/bin/ld.exe: ethernetif.c:(.text.ethernetif_init+0x54): undefined reference to `HAL_ETH_DMATxDescListInit'

c:/users/user/documents/arduinodata/packages/stm32/tools/arm-none-eabi-gcc/8.2.1-1.7/bin/../lib/gcc/arm-none-eabi/8.2.1/../../../../arm-none-eabi/bin/ld.exe: ethernetif.c:(.text.ethernetif_init+0x60): undefined reference to `HAL_ETH_DMARxDescListInit'

c:/users/user/documents/arduinodata/packages/stm32/tools/arm-none-eabi-gcc/8.2.1-1.7/bin/../lib/gcc/arm-none-eabi/8.2.1/../../../../arm-none-eabi/bin/ld.exe: ethernetif.c:(.text.ethernetif_init+0xa2): undefined reference to `HAL_ETH_Start'

c:/users/user/documents/arduinodata/packages/stm32/tools/arm-none-eabi-gcc/8.2.1-1.7/bin/../lib/gcc/arm-none-eabi/8.2.1/../../../../arm-none-eabi/bin/ld.exe: ethernetif.c:(.text.ethernetif_init+0xac): undefined reference to `HAL_ETH_ReadPHYRegister'

c:/users/user/documents/arduinodata/packages/stm32/tools/arm-none-eabi-gcc/8.2.1-1.7/bin/../lib/gcc/arm-none-eabi/8.2.1/../../../../arm-none-eabi/bin/ld.exe: ethernetif.c:(.text.ethernetif_init+0xbc): undefined reference to `HAL_ETH_WritePHYRegister'

c:/users/user/documents/arduinodata/packages/stm32/tools/arm-none-eabi-gcc/8.2.1-1.7/bin/../lib/gcc/arm-none-eabi/8.2.1/../../../../arm-none-eabi/bin/ld.exe: libraries\STM32Ethernet-master\utility\ethernetif.c.o: in function `ethernetif_set_link':

ethernetif.c:(.text.ethernetif_set_link+0xe): undefined reference to `HAL_ETH_ReadPHYRegister'

c:/users/user/documents/arduinodata/packages/stm32/tools/arm-none-eabi-gcc/8.2.1-1.7/bin/../lib/gcc/arm-none-eabi/8.2.1/../../../../arm-none-eabi/bin/ld.exe: ethernetif.c:(.text.ethernetif_set_link+0x24): undefined reference to `HAL_ETH_ReadPHYRegister'

c:/users/user/documents/arduinodata/packages/stm32/tools/arm-none-eabi-gcc/8.2.1-1.7/bin/../lib/gcc/arm-none-eabi/8.2.1/../../../../arm-none-eabi/bin/ld.exe: libraries\STM32Ethernet-master\utility\ethernetif.c.o: in function `ethernetif_update_config':

ethernetif.c:(.text.ethernetif_update_config+0x20): undefined reference to `HAL_ETH_WritePHYRegister'

c:/users/user/documents/arduinodata/packages/stm32/tools/arm-none-eabi-gcc/8.2.1-1.7/bin/../lib/gcc/arm-none-eabi/8.2.1/../../../../arm-none-eabi/bin/ld.exe: ethernetif.c:(.text.ethernetif_update_config+0x32): undefined reference to `HAL_ETH_ReadPHYRegister'

c:/users/user/documents/arduinodata/packages/stm32/tools/arm-none-eabi-gcc/8.2.1-1.7/bin/../lib/gcc/arm-none-eabi/8.2.1/../../../../arm-none-eabi/bin/ld.exe: ethernetif.c:(.text.ethernetif_update_config+0x50): undefined reference to `HAL_ETH_ReadPHYRegister'

c:/users/user/documents/arduinodata/packages/stm32/tools/arm-none-eabi-gcc/8.2.1-1.7/bin/../lib/gcc/arm-none-eabi/8.2.1/../../../../arm-none-eabi/bin/ld.exe: ethernetif.c:(.text.ethernetif_update_config+0x74): undefined reference to `HAL_ETH_ConfigMAC'

c:/users/user/documents/arduinodata/packages/stm32/tools/arm-none-eabi-gcc/8.2.1-1.7/bin/../lib/gcc/arm-none-eabi/8.2.1/../../../../arm-none-eabi/bin/ld.exe: ethernetif.c:(.text.ethernetif_update_config+0x7a): undefined reference to `HAL_ETH_Start'

c:/users/user/documents/arduinodata/packages/stm32/tools/arm-none-eabi-gcc/8.2.1-1.7/bin/../lib/gcc/arm-none-eabi/8.2.1/../../../../arm-none-eabi/bin/ld.exe: ethernetif.c:(.text.ethernetif_update_config+0x98): undefined reference to `HAL_ETH_WritePHYRegister'

c:/users/user/documents/arduinodata/packages/stm32/tools/arm-none-eabi-gcc/8.2.1-1.7/bin/../lib/gcc/arm-none-eabi/8.2.1/../../../../arm-none-eabi/bin/ld.exe: ethernetif.c:(.text.ethernetif_update_config+0xa0): undefined reference to `HAL_ETH_Stop'

collect2.exe: error: ld returned 1 exit status
exit status 1

So i re-start Arduino-ide. There is no compile error.

Case3


I wrote a sketch on DIYMROE_F407VGT.

Case4

Case5

I will review my connection.

fpistm commented 5 years ago

Right you have to restart because arduino does not see change.... So this is ok now?

nopnop2002 commented 5 years ago

I'm using DIYMROE_F407VGT + LAN8720, I referred this page.

https://os.mbed.com/users/hudakz/code/STM32F407VET6_Hello/shortlog/

In Ethernet.begin, it repeat Link Up. And finally become failed.

Case6

fpistm commented 5 years ago

Well hard to tell what's going wrong. I never test with this module, will try to find one but don't know when. You will have to try to debug on your side.

nopnop2002 commented 5 years ago

Hello.

The problem has not been solved yet, but I will close this issue. What do you think? ?

fpistm commented 5 years ago

Original issue is solved. Currently this Library support LAN8742A so mabe some update required to support the LAN8720. You can try to see if the PHY configuration section is aligned with this: https://github.com/stm32duino/Arduino_Core_STM32/blob/85fd492c15a87048086e7e82318c555fb6410a41/system/STM32F4xx/stm32f4xx_hal_conf_default.h#L233-L273

nopnop2002 commented 5 years ago

I changed stm32f4xx_hal_conf_default.h to this: It work fine!!.

/* Section 2: PHY configuration section */
/* LAN8742A PHY Address*/
//#define LAN8742A_PHY_ADDRESS            0x00U
#define LAN8742A_PHY_ADDRESS            0x01U

Case10

Eventually I changed to this:

stm32f4xx_hal_conf_default.h file

at Documents\ArduinoData\packages\STM32\hardware\stm32\1.6.1\system\STM32F4xx

/* Section 2: PHY configuration section */
#if !defined  (LAN8742A_PHY_ADDRESS)
/* LAN8742A PHY Address*/
#define LAN8742A_PHY_ADDRESS            0x00U
#endif

hal_conf_extra.h file

at sketch level

#define HAL_ETH_MODULE_ENABLED
#define LAN8742A_PHY_ADDRESS 0x01U

I did PR. Please see here https://github.com/stm32duino/Arduino_Core_STM32/pull/581

Thank you for your help.

fpistm commented 4 years ago

Track in #34