File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
features/FEATURE_LWIP/lwip-interface/lwip-eth/arch/TARGET_NUVOTON/TARGET_NUC472 Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -100,6 +100,7 @@ struct ethernetif {
100
100
// Override mbed_mac_address of mbed_interface.c to provide ethernet devices with a semi-unique MAC address
101
101
void mbed_mac_address (char * mac )
102
102
{
103
+ uint32_t uID1 ;
103
104
// Fetch word 0
104
105
uint32_t word0 = * (uint32_t * )0x7F804 ; // 2KB Data Flash at 0x7F800
105
106
// Fetch word 1
@@ -116,8 +117,9 @@ void mbed_mac_address(char *mac)
116
117
SYS_UnlockReg ();
117
118
FMC_Open ();
118
119
// = FMC_ReadUID(0);
119
- word1 = FMC_ReadUID (1 ) >> 8 ;
120
- word0 = ((FMC_ReadUID (0 ) >> 4 ) << 20 ) | (FMC_ReadUID (2 ) & 0xFFFFF );
120
+ uID1 = FMC_ReadUID (1 );
121
+ word1 = (uID1 & 0x003FFFFF ) | ((uID1 & 0x030000 ) << 6 ) >> 8 ;
122
+ word0 = ((FMC_ReadUID (0 ) >> 4 ) << 20 ) | ((uID1 & 0xFF )<<12 ) | (FMC_ReadUID (2 ) & 0xFFF );
121
123
/* Disable FMC ISP function */
122
124
FMC_Close ();
123
125
/* Lock protected registers */
You can’t perform that action at this time.
0 commit comments