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.

Recover chip after writing BOOTCFG?

Other Parts Discussed in Thread: LMFLASHPROGRAMMER

Hi,

I'm using GCC + openocd on a DK-TM4C123G kit. I was attempting to get the ROM bootloader working, and loaded a program which did the following:

uint32_t desiredBootCfgValue = 0x0000A812;
uint32_t presentBootCfgValue = HWREG(0x400FE000 + 0x1D0);

if (presentBootCfgValue != desiredBootCfgValue)
{
  HWREG(FLASH_CTRL_BASE + 0x00) = 0x75100000;
  HWREG(FLASH_CTRL_BASE + 0x04) = desiredBootCfgValue;
  HWREG(FLASH_CTRL_BASE + 0x08) = 0xA4420008;

  while(1)
  {
  };
}

The intent was to set it so that pulling PF2 low on startup would enter the bootloader, and pulling it high would enter the user program. That part is working great!

Unfortunately, I inadvertently also changed the KEY value (bit 4) from 1 to 0 so that the flashing key is 0x71D5 rather than 0xA442, so now the ROM bootloader is using the wrong key and no longer works. Unfortunately, it seems like the key is also affecting the ability for the flash memory to be written by OpenOCD, so I've basically bricked my dev kit.

Am I wrong? What can I do to save it?