Skip to content

Commit 667f8bb

Browse files
authored
Merge pull request #12405 from zhiyong80/Customize-Etherhet-Phy-Addr-of-STM32-Boards
EthernetInterface fix detecting change of connection status on ARCH_MAX
2 parents ba2a1bc + 128d5b5 commit 667f8bb

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

features/netsocket/emac-drivers/TARGET_STM/mbed_lib.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,19 @@
22
"name": "stm32-emac",
33
"config": {
44
"eth-rxbufnb": 4,
5-
"eth-txbufnb": 4
5+
"eth-txbufnb": 4,
6+
"eth-phyaddr": {
7+
"help" : "Configures actual PHY address according to pullup/down status of PHYAD pin(s)",
8+
"value" : 0
9+
}
610
},
711
"target_overrides": {
812
"NUCLEO_F207ZG": {
913
"eth-rxbufnb": 2,
1014
"eth-txbufnb": 4
15+
},
16+
"ARCH_MAX": {
17+
"eth-phyaddr": 1
1118
}
1219
}
1320
}

features/netsocket/emac-drivers/TARGET_STM/stm32xx_emac.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
#define THREAD_PRIORITY (osPriorityHigh)
4444

4545
#define PHY_TASK_PERIOD_MS 200
46-
#define ETH_ARCH_PHY_ADDRESS (0x00)
46+
#define ETH_PHY_ADDRESS MBED_CONF_STM32_EMAC_ETH_PHYADDR
4747

4848
#define STM_HWADDR_SIZE (6)
4949
#define STM_ETH_MTU_SIZE 1500
@@ -282,7 +282,7 @@ bool STM32_EMAC::low_level_init_successful()
282282
EthHandle.Init.AutoNegotiation = ETH_AUTONEGOTIATION_ENABLE;
283283
EthHandle.Init.Speed = ETH_SPEED_100M;
284284
EthHandle.Init.DuplexMode = ETH_MODE_FULLDUPLEX;
285-
EthHandle.Init.PhyAddress = ETH_ARCH_PHY_ADDRESS;
285+
EthHandle.Init.PhyAddress = ETH_PHY_ADDRESS;
286286
#if (MBED_MAC_ADDRESS_SUM != MBED_MAC_ADDR_INTERFACE)
287287
MACAddr[0] = MBED_MAC_ADDR_0;
288288
MACAddr[1] = MBED_MAC_ADDR_1;

0 commit comments

Comments
 (0)