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.

Fail to download program onto a custom board with launchpad ICDI + LMFlashProgrammer

Other Parts Discussed in Thread: LMFLASHPROGRAMMER, TM4C1233H6PM

Hi All,

I built a custom board with TM4C1233H6PM and routed the JTag to a header.  The plan was to utilize the TI LaunchPad ICDI to server as programmer with LMFlashProgrammer through jump wires.  When I loaded the the program onto the device on Launchpad, it was successful.  Meaning that I was able to program the device as many times as I want without problems.

However, when I debug-out the ICDI to my custom board, I could only program the first time (LMflashprogrammer shows it passes and return correct checksum).  If I pressed the "program" again, the error showed up "Unable to initialize target -0!"  The only way to be able to re-program it was to do the "Debug Port Unlock" with Tempest and Firestorm Classes checked procedure provided on this forum.  I dont know what is causing this.  I pretty much copied the launchpad schematics (device portion) to my board with little change which I dont think it would matter much.  

Attached is my schematics.

TI Tiva uController.pdf

dig_power_PCB.pdf

  • Hello Ming,

    The problem may be in the application code that you downloaded to the TM4C123 custom board. Please look at Issue #5 in the following post

    e2e.ti.com/.../374640

    Regards
    Amit
  • Hi ,

    Like I said, the application shouldn't have problem, because I could do the same thing when program onto the "device on LaunchPad" with out any problems. Plus, inside the app, it doesn't use the GPIO which defaulted as JTag pins.

    I believed I have copied 90% of the launchpad design onto my custom board, could you check my schematic and see if there's potential issue?

    Also, I noticed that when I just powered my board, there's not clock coming out of the external 16MHz Xtal (the voltage reading on both ends of the xtal are around 1.1V) However, when I powered up the LaunchPad device, I could see the 16MHz Xtal output no problems. The Xtal on my board is the same one on LaunchPad

    Thanks
    Paul
  • Hello Paul,

    OK. So first of all why is GNDX connected to GND pin on the schematic (this is not there on the LP schematic).

    Did you check the soldering of the crystal on the board, the capacitors for the 16MHz crystal. Also how has the layout of the crystal placement been done (something a schematic will not show). Did you attempt to replace the crystal?

    If the flash is empty and you connect a debugger IDE, can you clear the SYSCTL.RCC.MOSCDIS to see if the oscillator starts to work or not.

    Regards
    Amit
  • Hi,

    Actually just observed one thing. When I programmed thru LMFlashProgrammer, I checked "Erase Entire Flash", "Verify After Program", and "Reset MCU After Program". I realized that if I unchecked "Reset MCU After Program", I was able to press "Program" to successfully download app as many times as I wanted. (with matched "Source CRC32" and "Device CRC32") However, if I checked "Reset MCU After Program", then I could only program once after "Unlock debug port", following downloadings would just fails until I unlock it again.

    This is very strange because there's no such problem when I downloaded to the device on LaunchPad.

    Paul
  • Hello Paul,

    If you do not reset the device the new application may not be running at all, hence the device uses the internal oscillator and is able to reprogram. That is my thought on this new input.

    If you reset the board or power cycle the board, you may still run into the original issue.

    Regards
    Amit
  • Hi,

    Would that GNDX matter? It's for hibernate mode anyway, which I will not be using.

    The Xtal solder is good, otherwise how could I observe the 1.1V on both ends???? The Crystal layout is very good. very close to the device. I will use the this 16MHz Xtal with no change.
  • Hello Paul

    Firstly if 32K is not required, then there is no point in having the 32K oscillator at all, reduces BOM cost.

    Secondly, a lose solder contact on one of the terminals or capacitor is sufficient to prevent the crystal from oscillating or being very erratic. I can't perhaps help your anymore since re-soldering the crystal or replacing the crystal with another 16MHz crystal is not being looked at. This is a debug of a non working board, so all causes need to be eliminated. Also if possible do check if the VDDC is holding at 1.2V and supplies are a good 3.3V for VDD and VDDA pins.

    Regards
    Amit
  • Hi,

    First, I dont care about BOM now.

    Second, the issue now is not able to reprogram the device once reset the device after a successful programming until a debug port unlock. The 3.3V and 1.2V are all good.

    I will try to resolder 16MHz Xtal. The same time, could you consult with colleagues about my issue?

    Thanks
    Paul
  • Hello Paul,

    I believe the issue is with the crystal. A simpler way would be to change the application code to run from 16MHz PIOSC instead of 16MHz external crystal. When you do so, the Program/Erase from LMFlashProgrammer should work.

    Regards
    Amit
  • Hi,

    Problem solved. It indeed is related to the xtal. Supposedly the cap on both ends should be 10pF, however, due to some mis-labeling, one cap was soldered with 1uF! That's why I couldn't see xtal output. After fixing this cap value, xtal outputs clear 16MHz and reset after first downloading works fine.

    Thanks
    Paul
  • Hello Paul

    I have seen this issue quite too often on the forum and it does turn up in most cases to be soldering or component issue. Glad that problem is solved

    Regards
    Amit