Skip to content

Commit 884f9c9

Browse files
author
Zhiyonh Li
committed
Fixed bug that EthernetInterface doesn't detect change of connection status on ARCH_MAX board.
ARCH_MAX board uses 0x01 as PHY address, different from other NUCLEO STM32 boards. To faciliate change of PHY address of customized boards, a configuration entry eth-phyaddr was added and can be overriden as needed in mbed_app.json by adding "stm32-emac.eth-phyaddr": X. Macro ETH_ARCH_PHY_ADDRESS was also renamed to ETH_PHY_ADDRESS, because it is not only used by ARCH_MAX board but also other boards.
1 parent 8c51f4f commit 884f9c9

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
"name": "stm32-emac",
33
"config": {
44
"eth-rxbufnb": 4,
5-
"eth-txbufnb": 4
5+
"eth-txbufnb": 4,
6+
"eth-phyaddr": 0
67
},
78
"target_overrides": {
89
"NUCLEO_F207ZG": {

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)