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.

1232D5PM LM Flash Programmer USB DFU stuck at 0%

I'm using a 4C1232D5PM on a custom board. I've programmed the micro to enter the ROM boot loader when pin B6 is low:

        HWREG(0x400FD000 + 0x000) = 0x75100000;        //FMA=BOOTCFG "address"
        HWREG(0x400FD000 + 0x004) = 0x00003802;        //Port B6 low to initiate boot loader
        HWREG(0x400FD000 + 0x008) = 0x71D50008;        //FMC=key+commit

The unit shows up in the USB DFU list in LM Flash Programmer as 0 - Stellaris Device Firmware Update.

I've programmed the part using JTAG and I can use the Verify Flash Contents option in LM Flash Programmer successfully. If I run verify with a different bin file it fails, so verify appears to be working.

However, when I try to program the part it gets stuck at Programming... 0% forever. The only way out is to unplug the device at which point I get a "An error occurred during USB download!" message.

Any help would be greatly appreciated!

Paul.

  • Hi Paul,

    Have you verified that the BOOTCFG register contains the value you expect after the power cycle (you must power cycle to commit changes to the BOOTCFG register)?  Have you tried using the 0xA442 key instead of the 0x71D5 key?  Do you get the same results?

    Regards,

    Sue

  • Hi Sue,

    I have verified that the BOOTCFG register contains the 0x00003802 value that I programmed into it.

    Also, with pin B6 low it enters the boot loader, and with the pin high it goes to my main program, so it seems to function correctly.

    I have not tried using the different key since the register seemed to be programmed correctly.

    Thanks,

    Paul.

  • Paul,

      The problem you are having is caused by the fact that you have configured the system to use the alternate flash write key. Unfortunately, LMFlash doesn't support this so it is unable to program the part after BOOTCFG is changed. If you use 0x3812 in BOOTCFG, all will be well for now. We hope to add support for the alternate key to all the flash tools but this won't be in the next couple of months, I'm afraid, because it impacts quite a lot of modules and drivers.

  • How do I change the BOOTCFG register to 0x3812? Do I have to erase the entire FLASH to reset it?

    I'm using a XDS200 as a debug interface.

    Thanks for your help,

    Paul.

  • Once the non-volatile registers have been programmed, the only way to erase them and get the part back to it's factory default condition is to execute a JTAG/SWD unlock operation. This erases the main flash array, the EEPROM and also all the non-volatile registers. Note that the normal flash mass erase as used by debuggers only affects the main flash array so your EEPROM and non-volatile registers are preserved.

    As far as I am aware, the XDS200 or, more accurately, the software that runs it, doesn't allow you to perform this sequence. LMFlash will allow it, though, but you will need to connect a different JTAG or ICDI adapter to your board to allow LMFlash to talk to your target part's JTAG because LMFlash doesn't support XDS200. If you have an old Luminary Micro evaluation kit, you can connect it's Debug Out port to your board and use it as the JTAG interface. This will work with LMFlash. Alternatively, you can use a Tiva or Stellaris LaunchPad's ICDI for Debug Out function with only a few modifications to the board. These are described here.

    When you get LMFlash talking to the board via JTAG, go to the "Other Utilities" tab and select "Debug Port Unlock" making sure you have the TM4C123 option checked. Press "Unlock" and follow the instructions to erase the part.

    If you have some way to program the XDS200 at a low level (I have to apologize - I've never used that debug probe) then you can find the line toggling pattern required to perform the debug erase in the "Recovering a Locked Microcontroller" section of the TM4C123 datasheet.

  • Dave,

    Thank you for your clear explanation. I have a TIVA LaunchPad that I can use.

    Paul.

    P.S. Worked great!