Skip to content

Commit 205948c

Browse files
kjbracey0xc0170
authored andcommitted
LPC546XX: Correct Ethernet MAC address write
Patch to LPC546XX SDK code - write the low Ethernet MAC address register last, as that synchronises the update. Without this change, the ENET_SetMacAddr call only seems to work prior to MAC initialisation, causing problems for the new mbed OS EMAC system, which expects it to be changable later. Updated emac greentea tests #6851.
1 parent 78df43e commit 205948c

File tree

1 file changed

+2
-2
lines changed
  • targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_LPC546XX/drivers

1 file changed

+2
-2
lines changed

targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_LPC546XX/drivers/fsl_enet.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -674,10 +674,10 @@ static inline void ENET_SetMacAddr(ENET_Type *base, uint8_t *macAddr)
674674
{
675675
assert(macAddr);
676676

677-
/* Set Macaddr */
677+
/* Set Macaddr - low last as that synchronizes the update */
678+
base->MAC_ADDR_HIGH = ((uint32_t)macAddr[5] << 8) | ((uint32_t)macAddr[4]);
678679
base->MAC_ADDR_LOW = ((uint32_t)macAddr[3] << 24) | ((uint32_t)macAddr[2] << 16) | ((uint32_t)macAddr[1] << 8) |
679680
((uint32_t)macAddr[0]);
680-
base->MAC_ADDR_HIGH = ((uint32_t)macAddr[5] << 8) | ((uint32_t)macAddr[4]);
681681
}
682682

683683
/*!

0 commit comments

Comments
 (0)