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.

CCS/CC2640: CCS Debugger can't program the CC2640, but the SmartRF Flash programmer can.

Part Number: CC2640
Other Parts Discussed in Thread: CCSTUDIO

Tool/software: Code Composer Studio

I'm trying to set up CCS to match a co-worker.  He has no issue with the debugger's ability to program the CC2640, but I do.  Swapping hardware with my co-worker indicates this isn't a HW problem, but CCS shows it can verify the connection to the part and the Flash programmer works, pointing to a software/configuration problem.   I detail the testing done below and hope someone can give me a reason to further pursue the HW vs SW path.

Using an XDS-100-V3 debugger. 

The programming error (target time out) that occur in CCS appears in 3 variants, all ending with “Load failed”   The first variant is the rarest and includes a pop-up window with “cable break that is near-to itself” message as well as a “cable break” message in the console.  The second variant has no popup window, but still has a “cable break” message in the console.  The 1st and 2nd variants have only been observed on the first connection (upon starting CCS or after power cycling the uC)   The 3rd variant has no cable break message and is the most common. The "cable break" message make this seem to be a HW issue, but since I can take the hardware (debugger, my PCB with CC2640 and all the cables) can move to my co-worker's cube and it always works, while his never works for me, it  may not be a HW issue.

 Variant 1:    The error rarely includes a popup window.  When the popup window occurs, I can click “retry” and the debugging process continues until the target flashloader had not returned any stats error is printed (same error messages appear in the console as with variants 2 & 3).

 

Variant 2:

Cortex_M3_0: GEL Output: Memory Map Initialization Complete.
Cortex_M3_0: Failed Board Reset: (Error -182 @ 0x0) The controller has detected a cable break that is near-to itself. The user must connect the cable/pod to the controller. (Emulation package 7.0.48.0) 
Cortex_M3_0: GEL Output: Board Reset Complete.
Cortex_M3_0: Target timed out! (Block 1)Cortex_M3_0: Status 0x18146464: Target flashloader has not returned any status. Unknown error!
Cortex_M3_0: File Loader: Memory write failed: Timed out waiting for target flashloader to execute command.
Cortex_M3_0: GEL: File: C:\Users\bakers2\workspace_v7\Solace\Debug\Solace.out: Load failed.

 

Variant 3 appears on subsequent debug attempt

Cortex_M3_0: GEL Output: Memory Map Initialization Complete.
Cortex_M3_0: GEL Output: Board Reset Complete.
Cortex_M3_0: Target timed out! (Block 1)
Cortex_M3_0: Status 0x77F04273: Target flashloader has not returned any status. Unknown error!
Cortex_M3_0: File Loader: Memory write failed: Timed out waiting for target flashloader to execute command.
Cortex_M3_0: GEL: File: C:\Users\bakers2\workspace_v7\Solace\Debug\Solace.out: Load failed.

 

Troubleshooting I’ve tried:

  • Verify connection in CSS (under Project => properties => resource => general) is almost* always able to verify the connection (pass JTAG DR Integrity scan-test). 
    • *almost: in a single test, I encountered the "cable break near-to itself" message.  On retry, the test passed. 
  • Trade hardware
  • A co-worker has a CCS / CC2640 IDE that programs and debugs fine.  We traded hardware (debugger, debugger-PCB ribbon cable, and CC2640 PCBA) and the problem does not follow the hardware.  That is, both his hardware and mine debug without issue when connected to his PC and both sets of hardware fail with the same error message when connected to my PC.  He has never seen the issue on his hardware and it appear each of 3 times when connected to my PC.
    • We didn't trade out USB cables as the connection to the debugger has never been indicated as a failure.
  • Program/erase with Smart TF Flash Programmer 2 (v 1.7.5).  
  • This works without issue and it connect every time, even when CCS is first started.

  

      • Close programmer & try to debug from CCS => same error message

  • Start ccstudio.exe with -clean command line argument
  • Used a new workspace
  • Project => clean from within CCS
  • Changed versions of CCS (I was on the current release (7.2.0.00013) and downgraded to 7.10.00016
  • Copied co-worker's environm
    • He exported using CCS file-> export...->general-> preferences
    • also tried copying contents of '\.metadata\.plugins\org.eclipse.core.runtime\.settings' folder per LINK
  • EMC: Compared TDI, TDO, and TCK signals in both locations and they appear identical.  Nice, sharp clock edges with very little ringing.  

Any guidance on other areas to check and/or reasons to pursue HW issues vs SW issues are appreciated. 

Thanks,

Steve

  • Steve,

    Thanks for sending such detailed post. I can tell you have gone through pretty much all the tricks on the sleeve that I could think of.

    From your description it seems you are absolutely unable to connect. Two things come to my mind:

    - I couldn't see it in your post the problem described in the post below. I have the exact same JTAG debugger as you from Olimex, and the 20-pin cable can be connected in reverse, causing connection issues.
    e2e.ti.com/.../1492782
    - Another detail that may be getting in the way are ground loops. If your workstation or USB Hub or board power supply experiencing a ground loop you would have communication issues singled to a single workstation.
    e2e.ti.com/.../2192854

    I will keep looking for some additional details that can contribute to this.

    Hope this helps,
    Rafael
  • Hello Rafael,

    Thank you for the ideas.  

    RE: Cable reversed, I'm fairly sure this is not the issue because I took the entire system (debugger, target board, ribbon cable) to my co-worker's desk (no hardware change at all) and it worked without issue.   Also, I am able to program and read memory using the Smart RF flash programmer.

    RE: Ground loops. That could be it, but...see work-around/solution below.

    I bought a Spectrum Digital XDS200 debugger, configured CCS for the new debugger, and everything works.  

    NOTES: 

    • I plugged the new XDS200 debugger into a different USB port than the XDS100 V3 debugger was connected to.  I verified that the new XDS debugger works in the same USB port that the XDS100 V3 debugger was connected to.   I was not able to USB swap cables (USB  Micro-B vs Mini-B); however, this was unlikely the issue as I never had problems connecting to the debugger; rather to the target.  
    • On the XDS100 V3, there is a lot more noise on the TDI line (pin2 of the 14-pin TI connector).  With no debugger session, the noise looks like a sawtooth wave of period 800 microseconds and amplitude 32 millivolts.  (This was substantially the same when connected to my PC and to my co-worker's PC).  In comparison, on the XDS200, I see about 5 mV of sinusoidal noise.
    • The Smart RF flash programmer seems to program faster with the XDS200.   If we assume there is noise (source might be ground loop), but for some reason the smart RF programmer has a more robust (aka stubborn) retry mechanism than CCS, this might explain why I can program, but not use the debugger.  I did NOT test the times - just happy that I can start working on software now!

    I can't say the XDS200 is overall better, but in my environment, it is more reliable. 

  • Steve,

    Thank you for reporting back your findings and I am glad you are happy with your XDS200.

    Although I haven't put my XDS100v3 under an oscilloscope, 32mV@1250Hz should not really be enough to cause any communication faults, unless it is on top of a significant DC component.

    The XDS200 is an overall faster Debug Probe. Regarding robustness between CCS and the Smart RF, a simple flasher program tends to be the a lot less intrusive than CCS, which requires a lot more data transfer to properly populate and update its numerous views. I am not saying this is entirely applicable to your case, given you were having connectivity issues from the get go, but it explains why the flasher would be perceived as being more robust in noisier scenarios.

    All in all, I will keep this thread in mind for any possible issues in the future.

    Thank you,
    Rafael
  • Rafael,

    Thank you for the additional insight on simple programmer vs CCS and the faster overall speed of the XDS200 vs the XDS100V3.

    Best regards,
    Steve