Tool/software:
Hello Team,
We have a custom board so to get unique MAC ID we have placed a MAC ID chip. In that after reading from MAC ID chip, we have written the User Reg0 and 1 with MAP_FlashUserSet. But it is giving wrong MAC address. So to debug the same, we have printed the register in each step.
macid_arr = mac_id_read(I2C_MAC_ID_SLAVE_1);
for(i=0;i<6;i++)
{
UARTprintf("macid_arr[%d] = %x\n",i,macid_arr[i]); //print the MAC id read from IC
}
//Initially after a Unlock sequence
MAP_FlashUserGet(&ui32User0, &ui32User1);
UARTprintf(" 1 User0 %x \n",ui32User0);
UARTprintf("1 User1 %x\n",ui32User1);
//Initializing the MAC ID read from the chip to register
ui32User0 = (macid_arr[0] & 0xff) | ((macid_arr[1] & 0xff) << 8) | ((macid_arr[2] & 0xff) << 16);
ui32User1 = (macid_arr[3] & 0xff) | ((macid_arr[4] & 0xff) << 8) | ((macid_arr[5] & 0xff) << 16);
UARTprintf("2 User0 %x\n",ui32User0);
UARTprintf("2 User1 %x\n",ui32User1);
//writing to User register 0 and 1
MAP_FlashUserSet(&ui32User0, &ui32User1);
UARTprintf("4 User0 %x\n",ui32User0);
UARTprintf("4 User1 %x\n",ui32User1);
//reading the User Register 0 and 1
MAP_FlashUserGet(&ui32User0, &ui32User1);
UARTprintf("3 User0 %x\n",ui32User0);
UARTprintf("3 User1 %x\n",ui32User1);
Terminal Output
Can you please tell whats wrong here?
Thank you.