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.

1294 will only run while debugging

Other Parts Discussed in Thread: TM4C1294KCPDT, TM4C1294NCPDT

I have a custom board with a TM4C1294KCPDT. I'm using a XDS200 Emulator.

When I program and debug using the XDS200 the board works as expected.

When I quit the debugger the board keeps running. When I then power the board down and back up, the board does not start. This happens with the Emulator connected or disconnected.

I have configured BOOTCFG to use a push button to enter the USB boot loader. When I power up the board while holding the button the device will show up in the LM Flash Programmer's device list. (LM Flash Build 1613)

However, when I select a BIN file and click the Program button it will show Programming... 0% and give a USB Error: "An error occurred during USB download!".

I have implemented a USB MSC device and it is working correctly so I'm sure the USB interface is working correctly.

Any suggestions on how I debug this issue?

Thanks in advance for your help,

Paul.

  • Paul B said:
    Any suggestions on how I debug this issue?

    If you leave the XDS200 connected, after you power the board down and back up, try attaching the debugger to see what state the target is in. That may highlight where the code is getting stuck. See Connecting to a running target for how to attach the debugger to a running program [the referenced Wiki page is written for a MSP430, but also applies to TM4C devices]

    Which compiler are you using?

    The reason for asking is that the use of the GNU ARM compiler with SemiHosting enabled can cause the program to only run while debugging - see GNU examples for EK-TM4C123GXL fail to start unless debugger connected

  • Thanks Chester for your reply.

    I connected tot he running target like you selected and it is stuck in the FaultISR.
    I'm using the TI v5.1.9 compiler.

    Any idea why the LM Flash Programmer does not work? Since that is using the ROM Boot loader it seems more hardware related.

  • Hello Paul,

    Please check Issue#3 Point-6 in the following post

    http://e2e.ti.com/support/microcontrollers/tiva_arm/f/908/t/374640

    Since you have a Ethernet Enabled Part on a custom board, did you mount the RBIAS pin with a Resistor to GND?

    Regards
    Amit
  • Hi Amit,
    I'm not using the Ethernet module at this point, should I still have the bias resistor?
    Also, I am using a 16MHz crystal.
    Thanks,
    Paul.
  • Hello Paul,

    Absolutely. Even though you do not use it the ROM does not know. It see a Ethernet PHY enabled part and will try to use Ethernet as a boot loader interface.

    Regards
    Amit
  • The interesting thing is that it shows up as a USB DFU "Tiva Device Firmware Update" but it does not function correctly.

    I will add the RBIAS resistor.

    When the board does not start correctly and it is stuck in the FaultISR, the Stack Pointer is 0x20001FE0. Is it possible to trace back where it was before the fault?

    Thanks,
    Paul.
  • Unfortunately adding the RBIAS resistor did not help.
    Since the chip shows up as a USB Update device it may not be related to the Ethernet module?

    Thanks,
    Paul.
  • Hello Paul,

    Last week we debugged the same issue where the USB DFU shows up in the Device Manager but the fails. On connecting the RBIAS it started working. The second item to check is when it shows up a Device Manager, what is the Date Stamp on the driver? If it shows up the year as 2012/2013 or latter then the driver needs to be reverted to an older version.

    Regards
    Amit
  • Amit,

    I uninstalled the driver and installed the driver from TivaWare_C_Series-2.0.1.11577 and the LM Flash Programmer software now works correctly. Thank you very much, I would have never found this without your help.

    Paul.

  • Hello Paul.

    Naaa.. You would have. Forum Search reveals... a lot of common points that you have raised.

    Great to see you ungated.

    Regards
    Amit
  • Poster "Paul" wrote, "I would have never found this without your help."

    May this post stand as "Vote #2" for that same sentiment?

    Good/great as your availability & assistance is - should not this (very) inside info be better high-lighted - saving all from (quite predictable) delay/frustration?

  • Hello cb1, All,

    The Errata will contain this with the details on the ROM requirement. As for the issue with the USB DFU driver, this was found during the debug of CCSv6 where an updated driver actually causes the USB driver from TivaWare to be over-ridden. The fix has been since verified but yet to see the light of new release.

    Regards
    Amit
  • Amit Ashara said:
    but yet to see the light of new release.

    And that (better, faster - seeing the light) is exactly the point!

    Critical "insider data" (stockpiled) @ HQ - may not be best for your (hapless) client/users.  (poster Paul proves that)

    Should not such data be "promoted" - placed w/some prominence - (by part no.) so that becalmed users may, "save themselves?" 

    We note that (immediately) upon receiving that "insider-only" info - Paul quickly/easily dispatched his issue.  Such data - remaining "secret" - may not best serve your clients...

  • Hello cb1,

    Good point. In the meantime I would update the Diagnostic Post to mention the reversion of the Drivers manually till CCS fixes the same. And the update to the Issue note as well.

    Regards
    Amit
  • Thank you, Amit.  Your firm is not unique in, "locking down" such data.  Yet - as multiple business studies have revealed - "Quick, transparent communications" to your client-users proves superior to, "hoarding vital data - for too long - viewed only by, "insider eyes!""

    There's the choice to, "Hide Weaknesses" or, "Parade Weaknesses."  No one expects perfection - these devices are highly complex.  Yet - allowing "known issues" to "stockpile @ HQ" clearly fails your clients & lessens the (rightful) pressure upon vendor staff to resolve such issues.  (i.e. one does not "have to fix" that which is denied!)

    All vendors incur errata - goes w/the territory.  Getting (even) preliminary "fix" data out to your users - sooner rather than later - seems more motivating both to your client-users and to heralded, "fix staff."  (they may actually have to better apply themselves - gain larger budgets - and - more than once - client-users may suggest solutions and/or valid work-arounds - which never could occur if "insider data" remains (as is the case now) essentially restricted/hidden!)

    May I share an "outsider" secret - we (know) that your firm (and similar others) are imperfect!  Placing known issues - quickly - in a searchable, central repository will not cause you to "lose face" in the eyes of most here.  Hiding or restricting those issues - sharing only "upon demand" (as just happened here) - is not famed for building trust or good client-user relations...

    Our past success - taking small tech firm public - provided many of the methods/madness I (on occasion) attempt to share here - for the betterment of your forum...

  • Hello cb1,

    While I agree with your post to almost 100%, the issue had been identified by another forum post and closed as well on the forum (some time in Dec). Yes, the search may not have got it, but a little more search-persistence would have (tried it this morning).

    For the forum: I have update the "Diagnosing Common Development Problems and Tips for TM4C Devices" thread

    Regards
    Amit
  • Amit Ashara said:
    have updated the "Diagnosing Common Development Problems and Tips for TM4C Devices" thread

    Indeed - but (we suspect) for only that SINGLE issue!

    How many (more) "known fixes or issues" remain "locked away" - @ HQ - thus unavailable to the becalmed/frustrated masses?  That's the "REAL" issue - is it not?   This clearly is not a "single issue" - instead it's much more a caring/alerting PROCESS!

    Would be useful to learn which of the earlier post assertions "miss" your 100% agreement...  Love to know why "secrecy and/or critical data hoarding" (appear) to trump, "User Saving" quick/full disclosure.

  • Hello cb1,

    Following post match the 100% agreement (by meaning) but may miss the chance of being interpreted the same way

    http://e2e.ti.com/support/microcontrollers/tiva_arm/f/908/t/384242

    Regards
    Amit
  • My original issue with the 1294 only running with the debugger remains. I mentioned the issue with the LM Flash Programmer because I thought it may be related.

    When I apply power to board and then attached the debugger to the running target it is stuck in the FaultISR.
    I discovered that the NVIC_FAULT_STAT register indicates there has been an Imprecise Data Bus Error.

    One of the causes I found for an error like this is the access of an invalid register.

    I am using CCS version 5.5.0.00077. I am using a 1294KCPDT micro. The only option in Project Properties - CCS General for the device variant is a 1294NCPDT. I believe the only difference between the two is the amount of Flash memory, but could the bus error be related to this?

    Thanks,
    Paul.
  • Paul B said:
    I am using a 1294KCPDT micro. The only option in Project Properties - CCS General for the device variant is a 1294NCPDT. I believe the only difference between the two is the amount of Flash memory, but could the bus error be related to this?

    The TM4C1294KCPDT kas 512KB of flash, whereas the TM4C1294NCPDT has 1024KB of flash. If the CCS linker command file (for the  TM4C1294NCPDT) has more flash available than the actual device, this may cause the linker to use flash addresses which aren't available. However, don't understand why that would only cause a failure when the debugger isn't connected.

    To set the correct amount of flash for the TM4C1294KCPDT change the linker command file to:

    MEMORY
    {
        FLASH (RX) : origin = 0x00000000, length = 0x00080000
        SRAM (RWX) : origin = 0x20000000, length = 0x00040000
    }
    

    [I checked CCS 6.01 and that has the TM4C1294KCPDT  and TM4C1294NCPDT devices available when creating a new project - not sure why the TM4C1294KCPDT  is missing from CCS  5.5]

  • Paul B said:
    When I apply power to board and then attached the debugger to the running target it is stuck in the FaultISR.
    I discovered that the NVIC_FAULT_STAT register indicates there has been an Imprecise Data Bus Error.

    One of the causes I found for an error like this is the access of an invalid register.

    See http://www.ti.com/lit/pdf/spma043 to understand how to analyze the reason for a FaultISR.

    Debugging a ARM Cortex-M Hard Fault contains a hard-fault handler which can be used to save registers at the point of a hard fault to help determine the state of the program. The hard fault handler in that referenced freetos web site using GCC syntrax - there is an example for the TI compiler in 0257.TIVA_flash_write_bug.zip

  • Thanks Chester for the link.

    When the NVIC_FAULT_STAT register is 0x0000.0400 the Stack Pointer is 0x2000.1FE0.
    In the Memory Browser address 0x2000.1FE0 + 6 contains 0x0100.1510.
    This appears to be a location in ROM?

    Paul.
  • Paul B said:
    This appears to be a location in ROM?

    Yes, the program counter address 0x0100.1510 is in ROM.

    Given that an Imprecise Bus Fault has occurred (NVIC_FAULT_STAT register is 0x0000.0400) I think you are going to have to disassemble the ROM around that address to determine the cause (as suggested by the Diagnosing Software Faults in Stellaris® Microcontrollers Application Report).

    Also, according to Exception Dump Decoding Using the CCS Register View if you copy the  PC, SP and LR values from the exception stack frame into the corresponding registers in the CCS register view, CCS will usually provide a very useful call stack back trace in the debug window. If you can get a valid call stack back trace, will give a clue about the location in your code which triggered the problem. [I haven't tried this myself]

  • Hello Paul,

    Please confirm the following

    1. The power on reset is done with the Flash all erased or is there some code in the Flash?
    2. If there is some code in the Flash that may be invoking the ROM Boot Loader then is the PLL Locked?

    Regards
    Amit
  • Thanks Chester, I had made those changes to the Linker Command File. I was wondering of there were any other differences that could be causing the Imprecise Data Bus Error.
  • Hi Amit,

    The power on reset is done with the code in Flash.
    For example:
    1. I imported the "Hello" example project and removed the UART related statements so it only toggles an output pin.
    2. Debug the project which loads the code into Flash, and run it, the output pin toggles.
    3. Stop the debugger, turn of power to the board.
    4. Turn power back on, output does not toggle.
    5. Configure debugger to load symbols only to attach to running target, shows stuck in FaultISR. FAULT_STAT shows Imprecise Data Bus Error. Stack Pointer leads to address 0x0100.16CF in ROM.

    Loading the program into Flash with LM Flash Programmer instead of the debugger has the same effect.

    Thanks,
    Paul.
  • Hello Paul,

    It seems that the code is not at 0x0 location which is running in the Flash and neither is there a Flash based boot loader (mentioned) here.

    Regards
    Amit
  • I'm not sure I understand what you are saying. This is what is in Flash at location 0.

    Paul.

  • Hello Paul

    The location entry is fine. Can you send it the CCS code for the same? Let me try to see what it is doing.

    Regards
    Amit
  • hello_test.zip

    Hello_test.zip contains the modified hello project and a screen shot of the development environment after it is stuck in the FaultISR.


    Thanks,

    Paul.

  • Hello Paul,

    I believe you have a 16MHz crystal on the custom board. However the PLL is locked for VCO of 320MHz from which 120MHz System Clock cannot be generated. It must be VCO of 480MHz. So the following code

    g_ui32SysClock = MAP_SysCtlClockFreqSet((SYSCTL_XTAL_16MHZ |
    SYSCTL_OSC_MAIN | SYSCTL_USE_PLL |
    SYSCTL_CFG_VCO_320), 120000000);

    should look like

    g_ui32SysClock = MAP_SysCtlClockFreqSet((SYSCTL_XTAL_16MHZ |
    SYSCTL_OSC_MAIN | SYSCTL_USE_PLL |
    SYSCTL_CFG_VCO_480), 120000000);

    After making the changes for an EK-TM4C1294, the code works fine after power cycle and no-debugger connected.

    Regards
    Amit
  • Hi Amit,

    In hello.c I changed it to:
    g_ui32SysClock = MAP_SysCtlClockFreqSet((SYSCTL_XTAL_16MHZ |
    SYSCTL_OSC_MAIN | SYSCTL_USE_PLL |
    SYSCTL_CFG_VCO_480), 120000000);
    but it still does not run without the debugger.

    Also, in my main software (not the hello test) it always was:
    MAP_SysCtlClockFreqSet((SYSCTL_XTAL_16MHZ | SYSCTL_OSC_MAIN | SYSCTL_USE_PLL | SYSCTL_CFG_VCO_480), 120000000);

    Did the software not run stand-alone when it was set to 320MHz, and then started working when you changed it to 480?

    Paul.
  • Hello Paul,

    I have a 25MHz crystal, so I had to change the Crystal Definition as well. It was crashing out the debugger when set for 320MHz as the system clock would not be set correctly. After correcting the same to 480MHz, I see a 5Hz signal on PE1. Even after power cycle the 5Hz signal does come up.

    Regards
    Amit
  • This has gone on too long to capture my complete attention but perhaps (something) w/in the debug pod is (necessary) for correct operation - and is missing when that connection is pulled!

    Usual suspects would be missing or inadequate JTAG pull-ups and/or Reset pull up and cap filter or the proper power routing to each/every MCU power pin and correct value caps upon the MCU's charge pump pin(s).

    Poster would reduce wear/tear upon Amit by trying his suggested (known good, now) code upon a 2nd (ideally know good) board.  Single board "anomalies" are a "bear" to test/troubleshoot - (and this appears NOW likely suspect) and such consideration for the "lone" vendor expert seems (most) respectful and appropriate...

  • cb1,
    I agree that it may be hardware related. I have checked and rechecked everything of course...

    Couple of observations...
    1. When using the USB Boot loader in ROM the board works stand-alone without any issues. Would this be the case if there were cap or resistor issues?
    2. Even with the debugger connected (but no in debug mode) the board still does not run by itself.
    3. Maybe it is crystal frequency related? I'll test with a 25MHz crystal.

    Paul.
  • Paul B said:
    I agree that it may be hardware related. I have checked and rechecked everything

    You appear logical/methodical - yet in the effort to assist - we benefit from more specifics in your response.

    Have you installed external pull-up Rs on each/every JTAG pin - in close proximity to the MCU?  If so - what are their values?  (relying upon MCUs internal Rs often proves troublesome)

    What's the value of pull-up on MCU Reset line?  Is it close to the MCU's Reset - and accompanied w/bypass cap?  Have you ohmed out this R - to insure it's not mis-marked or misplaced?  (we've seen (somewhat) similar issues when the Reset pull-up was excessive)

    Did you produce several such boards?  (our group always builds 3-5 proto boards - so that "A-B" tests may be accommodated - seems "false economy" to build only one)  (your time/effort - and that of those here - are not free!)   Should you have additional boards - does the issue persist - across those others?

    As Amit reports using 25MHz xtal (and as that seems much more common in this vendor's Apps) urge you to make that change - and report.

    When all else fails - have you scoped each JTAG, Reset, Boot-Loader "entry pin" and "charge pump" pin(s) - both when debugging and later - w/debug pod disconnected?  Does this investigation reveal or highlight any difference?

    And for Amit - cannot tell if you employed any (or the same) boot-loader trigger pin - as poster Paul?  Believe that (all) this detail is necessary - boot-loader has great appeal (too much, we believe) yet extracts a huge price in delayed development & user frustration...  (that same variety of "boot-method" adds grave complications - very few users succeed quickly/cleanly - pointing to further detail - and more complete examples as, "next!"

  • Hello cb1, Pau;,

    The code example from Paul was based on a simple JTAG Load-Execute and does not employ and boot loader.

    May that be a clarification as well to Paul, that is the BOOTCFG programmed to execute the ROM Boot Loader?

    Regards
    Amit
  • Hi Amit,

    From poster's very first post I quote, "I have configured BOOTCFG to use a push button to enter the USB boot loader."

    There exists various "sprinklings of clarity" - but a well organized - detailed listing of fact- has not emerged to (apparently) either your/my satisfaction...

  • Hello cb1

    I may have misinterpreted the data after the first issue was resolved and the poster then referred to code execution. I also did ask if there is a custom boot loader. Only Paul can clarify the questions.

    Regards
    Amit
  • Greetings Amit,

    Even some 40 posts in - poster's issue - and full, orderly disclosure of necessary (and sought) facts - remains clouded.

    As with any boot-load scheme - great (spectacular?) attention to detail & methodical procedures must be enforced.

    Poster has provided much needed data - but it's interspersed throughout this thread - complicating your job. (and that of your (semi-qualified) assistants...)

    To my mind - this is a predictable result of the forum's failure to provide tight, methodical, post-creation (and construction) guidance.  Forum gains no advantage through your exhaustion - and doubtful that any future (similarly impaired) forum reader - will persist thru this (pardon) ramble...

  • There are 10K pull ups on the 4 JTAG lines. The JTAG connector is less than 0.25" from the chip and traces are short.

    Reset has a 10K to VCC and a 0.1uF to ground. I also tried 10K without the capacitor and 1K/0.1uF. Parts are very close to chip.

    There is a combined 3.52uF capacitance on VCC around the chip, and 3.3uF/0.1uF on the LDO pins.

    I'll test with a 25MHz crystal today.  Tested with 25MHz crystal - issue remains.

    I'm using the built-in ROM boot loader in USB mode. Pin PF3 has a 10K to VCC and a push button switch to ground.

    This is the code I use to configure BOOTCFG

    	volatile unsigned long regVal;
    	regVal = HWREG(0x400FE000 + 0x1D0);       		//BOOTCFG
    	if (regVal & 0x80000000) {                      //committed yet?
    		HWREG(0x400FD000 + 0x000) = 0x75100000;    	//FMA=BOOTCFG "address"
    		HWREG(0x400FD000 + 0x004) = 0x0000AC12;		//Port F3 low to initiate boot loader
    		HWREG(0x400FD000 + 0x008) = 0xA4420008;    	//FMC=key+commit
    		SysCtlDelay(100000);          			
    	}

    The USB boot loader with LM Flash Programmer works well, but the main software gets stuck in FaultISR after a reset or power up.

    I have two boards, and they act the same.

  • Hello Paul,

    I may have the answer (probable). When you commit the BOOTCFG register the reserved bits have been turned to 0x0 which is bound to cause a problem. Instead you must use the value 0xFFFFACFE instead of 0x0000AC12.

    Regards
    Amit
  • Amit,

    I used the debugger built into a TIVA LaunchPad and the LM Flash Programmer's Debug Port Unlock function to fully erase all memory and reset the BOOTCFG register.

    I then changed the value to 0xFFFFACFE like you suggested and programmed the board.

    Turned the power off, and back on... it lives!

    Lesson learned: when it says "Software should not rely on the value of a reserved bit", keep reading... "To provide compatibility with future products, the value of a reserved bit should be preserved across a read-modify-write operation."

    In this case making the bit high seemed to have fixed the issue, but preserving the value would probably be best.

    One thing that I will change is 0xFFFFACFE to 0x7FFFACFE to clear the NW bit to lock in the BOOTCFG value.

    The examples I found for changing the BOOTCFG register all use something like 0x0000AC12. I've used that code on other TM4C chips without any issue, so this is definitely a nugget of knowledge that needs to be preserved.

    Thank you Amit and everybody else for your help.

    Paul.
  • Great that - under Amit's guidance - Paul persisted and solved issue.   Hurray.

    That said - we too noted his, "0000.AC12" values for BOOTCFG Register.

    Paul characterizes as, "nugget of knowledge" - yet may we ask where Amit's "0xFFFF.ACFE" (fixing) value can be found.  (in the MCU literature)

    Congratulations to Amit/Paul - yet the "how & where" of that (apparently) hidden (and fixing) value deserves (some) explanation...

  • Hello cb1,

    The following post has the same issue. It will be a part of the errata and TM4C123 to TM4C129 Migration Document.

    http://e2e.ti.com/support/microcontrollers/tiva_arm/f/908/t/355294

    Regards
    Amit