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.

TM4C1230D5PM: XDS110 command line erase EEPROM for tm4c123

Part Number: TM4C1230D5PM
Other Parts Discussed in Thread: UNIFLASH

During hardware testing, I'm looking for a way to clear all contents of the eeprom automatically.

The XDS110 command line utility allows me to erase flash memory, which works fine.  But I need to erase all calibration/user settings back to a known state.

Ideally there would be a command line option for uniflash that allows me to do this, but I couldn't find it.

If anyone knows of a way to do this, please say.  I found something referring to a scripting language for uniflash - which sounds complicated, but maybe that's the only way.  If so, does anyone have an example?  I just want to wipe it all to 0xFF or 0x00 - nothing fancy.

  • Hi Dave,

      In this app note, on section 5.3.2, it talks about using dbgjtag.exe (a command line tool) to unlock the device to its factory setting. This operation will erase both the on-chip flash and EEprom. 

      http://www.ti.com/lit/an/spma075/spma075.pdf

  • Thanks for the quick reply.  This did not resolve my issue because I don't have a way of toggling the reset line manually.  Also my test is meant to run unattended.  Is there a way of telling the XDS110 to toggle the reset pin?

  • Solved it via a powershell script in the end:

    erase_tm4c_via_xds110.ps1

    # Automated erase of tm4c via XDS110 debugger
    # D Thompson 28/7/2021

    # FIXME should power off the device before starting (but it seems to work if you don't)

    # put the device in reset
    &"C:\ti\uniflash_6.3.0\deskdb\content\TICloudAgent\win\ccs_base\common\uscif\xds110\xds110reset.exe" -a assert
    sleep 1

    # Start the debug process to reset the chip
    $p = Start-Process "C:\ti\uniflash_6.3.0\deskdb\content\TICloudAgent\win\ccs_base\common\uscif\dbgjtag.exe" "-f@xds110 -Y unlock,mode=tiva"
    $wshell = New-Object -ComObject wscript.shell
    $wshell.AppActivate($p)
    sleep 1
    # should power on the device here (but it seems to work if it's already on)
    sleep 1

    # continue the on-screen prompt
    $wshell.SendKeys(' ')
    sleep 1

    # According to the on-screen instruction we need to deassert the reset here, but
    # we can't because dbgjtag.exe is still holding the xds110 usb (it seems to work if we do this later)
    #&"C:\ti\uniflash_6.3.0\deskdb\content\TICloudAgent\win\ccs_base\common\uscif\xds110\xds110reset.exe" -a deassert
    $wshell.SendKeys(' ')
    sleep 1

    # take device out of reset
    &"C:\ti\uniflash_6.3.0\deskdb\content\TICloudAgent\win\ccs_base\common\uscif\xds110\xds110reset.exe" -a deassert
    # Note that after this you really need to do a power cycle otherwise uniflash etc won't talk to the device.

  • Hi Dave,

      Glad that you found the solution before I was about to seek help from our tooling team. I have not seen this done myself. I'm sure the script you provide here will benefit many in the community. 

  • Ok good to know.  The dbgjtag.exe unlock,mode=tiva is not that friendly as it requires user interaction ("press a key").  The ideal from the tooling team would be an additional option to dbgjtag which toggled nreset by itself.   If it really needs power to be turned off/on during the sequence, then could be split into two commands, to run before and after power applied.  But my experience was that the power off-on was only needed after dbgjtag.exe had completed.

  • Hi Dave,

      I think the dbgjtag.exe is trying to follow the instructions depicted in the datasheet. You can find more details in the datasheet. I have unlocked some devices a few times without holding the reset active and then releasing it.  It seems to work for me. However, I must run through a power cycle at the end before the debugger can connect to the target again.