This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MSP432E401Y: MAP_FlashUserSet is setting wrong data in the User Register

Part Number: MSP432E401Y

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.

  • Hi,

      I think the problem is your below line. 

        MAP_FlashUserSet(&ui32User0, &ui32User1);

      When I change to     MAP_FlashUserSet(ui32User0, ui32User1) then it works for me. See below.  if you want to make the USER0/USER1 permanent then you will need to call FlashUserSave(). But if you will always read from your external MAC ID chip then what you do is fine.