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 {
100100// Override mbed_mac_address of mbed_interface.c to provide ethernet devices with a semi-unique MAC address
101101void mbed_mac_address (char * mac )
102102{
103+ uint32_t uID1 ;
103104 // Fetch word 0
104105 uint32_t word0 = * (uint32_t * )0x7F804 ; // 2KB Data Flash at 0x7F800
105106 // Fetch word 1
@@ -116,8 +117,9 @@ void mbed_mac_address(char *mac)
116117 SYS_UnlockReg ();
117118 FMC_Open ();
118119 // = 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 );
121123 /* Disable FMC ISP function */
122124 FMC_Close ();
123125 /* Lock protected registers */
You can’t perform that action at this time.
0 commit comments