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.

TM4C1290NCPDT: ROM_FlashProtectSet Wrong value

Part Number: TM4C1290NCPDT

Hi,

We wanted to write the mac address to the FLASH in TM4c1290. But when we try as mentioned below the value which we written is not getting reflected when we do ROM_FlashProtectGet.

Below is the method we flow to set the FLASH.

ui32User0 = (0x00 << 24);
ui32User0 |= (0xB6 << 16);
ui32User0 |= (0x1A << 8);
ui32User0 |= (0x00 << 0);
ui32User1 = (0x00 << 24);
ui32User1 |= (0x74 << 16);
ui32User1 |= (0x02 << 8);
ui32User1 |= (0x00 << 0);
ret = ROM_FlashUserSet(ui32User0, ui32User1);

(or)

ret = ROM_FlashUserSet(0x00B61A00, 0x00740200);

Ours is a Bare metal code. And please help us know how to set the proper value in the Flashprotect.

Thank you,

Deepanraj.A

  • Hello Deepanraj,

    I am not sure why you are using ROM_FlashProtectGet after writing data. That is to get protect settings. You need to use FlashUserGet to read the result. Try that and see if you are getting the right results now.

    You don't need to do any Flash protect for the MAC address by the way. Once committed, the USER registers retains their value through power-on reset. The only way to restore the factory default value of USER registers is to perform the "Recover Locked Device" sequence detailed in the JTAG section.

  • Hi,

    Sorry, it was a mistake we are using ROM_FlashUserGet only to read the user registers. But whatever value which we have set is not getting reflected in the ROM_FlashUserGet. Please help us.

    Below is the code,

    ui32User0 = (0x00 << 24);
    ui32User0 |= (0xB6 << 16);
    ui32User0 |= (0x1A << 8);
    ui32User0 |= (0x00 << 0);
    ui32User1 = (0x00 << 24);
    ui32User1 |= (0x74 << 16);
    ui32User1 |= (0x02 << 8);
    ui32User1 |= (0x00 << 0);
    ret = ROM_FlashUserSet(ui32User0, ui32User1);

     UARTprintf("ret %d \n\r",ret);

    //
    // Convert the 24/24 split MAC address from NV ram into a 32/16 split MAC
    // address needed to program the hardware registers, then program the MAC
    // address into the Ethernet Controller registers.
    //
    ROM_FlashUserGet(&ui32User0, &ui32User1);
    pui8MACArray[0] = ((ui32User0 >> 0) & 0xff);
    pui8MACArray[1] = ((ui32User0 >> 8) & 0xff);
    pui8MACArray[2] = ((ui32User0 >> 16) & 0xff);
    pui8MACArray[3] = ((ui32User1 >> 0) & 0xff);
    pui8MACArray[4] = ((ui32User1 >> 8) & 0xff);
    pui8MACArray[5] = ((ui32User1 >> 16) & 0xff);

    Thank you,

    Deepanraj.A

  • Hello Deepanaj,

    I suspect that the issue then is that the MAC address has already been configured. It can only be configured the one time unless the commits are cleared via the locked device recovery method.

    Try using LM Flash programmer to do a JTAG unlock process on the device which would clear the MAC address as well. You'll be able to see the MAC address in clear with LM Flash too.

    Once that is done, then re-load your code and see if you get the expected results now.