Merge pull request #12405 from zhiyong80/Customize-Etherhet-Phy-Addr-of-STM32-Boards

EthernetInterface fix detecting change of connection status on ARCH_MAX
pull/12431/head
Martin Kojtal 2020-02-13 09:44:53 +00:00 committed by GitHub
commit 667f8bbcd3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 3 deletions

View File

@ -2,12 +2,19 @@
"name": "stm32-emac",
"config": {
"eth-rxbufnb": 4,
"eth-txbufnb": 4
"eth-txbufnb": 4,
"eth-phyaddr": {
"help" : "Configures actual PHY address according to pullup/down status of PHYAD pin(s)",
"value" : 0
}
},
"target_overrides": {
"NUCLEO_F207ZG": {
"eth-rxbufnb": 2,
"eth-txbufnb": 4
},
"ARCH_MAX": {
"eth-phyaddr": 1
}
}
}

View File

@ -43,7 +43,7 @@
#define THREAD_PRIORITY (osPriorityHigh)
#define PHY_TASK_PERIOD_MS 200
#define ETH_ARCH_PHY_ADDRESS (0x00)
#define ETH_PHY_ADDRESS MBED_CONF_STM32_EMAC_ETH_PHYADDR
#define STM_HWADDR_SIZE (6)
#define STM_ETH_MTU_SIZE 1500
@ -282,7 +282,7 @@ bool STM32_EMAC::low_level_init_successful()
EthHandle.Init.AutoNegotiation = ETH_AUTONEGOTIATION_ENABLE;
EthHandle.Init.Speed = ETH_SPEED_100M;
EthHandle.Init.DuplexMode = ETH_MODE_FULLDUPLEX;
EthHandle.Init.PhyAddress = ETH_ARCH_PHY_ADDRESS;
EthHandle.Init.PhyAddress = ETH_PHY_ADDRESS;
#if (MBED_MAC_ADDRESS_SUM != MBED_MAC_ADDR_INTERFACE)
MACAddr[0] = MBED_MAC_ADDR_0;
MACAddr[1] = MBED_MAC_ADDR_1;