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.

How to manually write User0 and User1 register for MAC Address without LM Flash Programmer?

Other Parts Discussed in Thread: LMFLASHPROGRAMMER

Hello,

I am trying to find a way to programatically program MAC address into the user0 and user1 regsiters .

Is there any way to modify user0/1 register for changing mac address programtically , without using lm flash programmer ?

Thanks,

Sanchit Mehra

  • Hello Sanchit,

    The USER0 and 1 register can be programmed by the application code. However for the application using ethernet on TM4C129 the MAC address have to remain constant. So your application code has to be smart enough not to change the MAC address every time it starts up.

    Programming sequence for this register is a part of the Internal Memory Section of TM4C129 data sheets. It requires a sequence of operation which you need to carefully read.

    Regards

    Amit

  • Hi Amit, 

    How about using these two flash APIs to set the user0 and user1 registers for mac address ?

    int32_t ROM_FlashUserSet(uint32_t ui32User0, uint32_t ui32User1) ;

    and then 

    int32_t ROM_FlashUserSave(void)

    ui32User0 is the value to store in USER Register 0.
    ui32User1 is the value to store in USER Register 1.

    Please Suggest,

    Thanks,

    Sanchit Mehra

  • Hello Sanchit,

    That is what the LMFlashProgrammer also effectively does. By doing this in your code there is a catch. if the value programmed does not match the first time committed value, you may end up with an Error.

    That is why ensure that it is one time operation.

    Regards

    Amit

  • Hi Amit,

    Thanks for information, I have been success in one time programming when flash is all 0xFF .

    Non Volatile registers are 0XFF ( user0/1).

    but, if later on ,again if I want to modify the user0 and user1 regsiters within application by :

    if( ROM_FlashUserSet(0X00B61AE2, 0X0074B2DA) == 0)
    {
    UARTprintf("\nmac address programmed successfully ... \n");

    if(ROM_FlashUserSave() == 0)
    {
    UARTprintf("\n Mac Add committed ... \n");
    }
    }
    else
    {
    UARTprintf("\n MAC programm failed .. \n");
    }

     

    It is NOT Set, as it first requires unlock procedure so as to set the user0 user 1 registers as 0XFF.

    is there any way, I can modify the user0 and user1 register second time ?

    Thanks,

    Sanchit Mehra

  • Hello Sanchit,

    No, that would not be possible. Instead you can use the EEPROM to write as many times. and instead of checking the USER Registers you can check EEPROM Word0 and Word1.

    Regards

    Amit