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.

XDS100v2 Error code #4001, could not connect to target

Other Parts Discussed in Thread: TMS570LS3137

Hi,

 

we are currently running the TI SafeQKit v1.1.0 with the following setup:

target: TMS570LS3137

host: Win7 64-bit, ccsv5, TI Compiler 4.9.5

Out problem is that we have to run an enourmous number of tests for tool qualification on the mentioned target.

However, about 34% of all tests run into the following connection problem with the target. When we repeat these aborted tests, the usually run with PASS. Hence, it seems to be an erratic problem. The Connection to the target via XDS100v2 and loadti.bat seems not to be as robost as we expect.

Our problem is that our test runs usualy take up to 9 days of run time and finding out and repeating the aborted tests causes a lot of manual effort.

 

Here is the error message we frequently get. It would be great if someone could tell us more about
a) the FTDI error (-154) and 
b) the DSS error #4001.

 

Maybe this helps to find out the reason for the problems.

 

Example for a bad run:

 

***** DSS Generic Loader *****

START: 15:14:19 GMT+0200 (MESZ)

Configuring Debug Server for specified target... Done TARGET: Texas Instruments XDS100v2 USB Emulator Connecting to target... CortexR4: GEL Output:  Memory Map Setup for Flash @ Address 0x0 Resetting target... testEnv.outFiles: tconflict Loading tconflict Done Target running... Interrupt to abort . . . TESTING: suite/3/1/2/3/th1.c +++ stderr ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ SEVERE: IcePick: Error connecting to the target: (Error -154 @ 0xFFFFFF66) One of the FTDI driver functions used to write data returned bad status or an error. (Emulation package 5.0.569.0)

SEVERE: emulation failure occurred SEVERE: Error connecting to the target: emulation failure occurred +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ COMMAND: leash -t 5m c:/ti/ccsv5/ccs_base/scripting/examples/loadti/loadti.bat -r -c C:/SuperTest/SuperTest/TMS570LS3137_xds100v2.ccxml th1 C:\ti\ccsv5\ccs_base\scripting\examples\loadti\..\..\..\DebugServer C:\ti\ccsv5\ccs_base\scripting\examples\loadti\..\..\..\DebugServer\packages\ti\dss\java\js.jar;C:\ti\ccsv5\ccs_base\scripting\examples\loadti\..\..\..\DebugServer\packages\ti\dss\java\js.jar

***** DSS Generic Loader *****

START: 15:19:22 GMT+0200 (MESZ)

Configuring Debug Server for specified target... Done TARGET: Texas Instruments XDS100v2 USB Emulator Connecting to target... Error code #4001, could not connect to target! Aborting!

END: 15:19:26 GMT+0200 (MESZ)

 

Example for a good run:

 

TESTING: suite/3/1/2/3/th2.c COMMAND: leash -t 5m c:/ti/ccsv5/ccs_base/scripting/examples/loadti/loadti.bat -r -c C:/SuperTest/SuperTest/TMS570LS3137_xds100v2.ccxml th2 C:\ti\ccsv5\ccs_base\scripting\examples\loadti\..\..\..\DebugServer C:\ti\ccsv5\ccs_base\scripting\examples\loadti\..\..\..\DebugServer\packages\ti\dss\java\js.jar;C:\ti\ccsv5\ccs_base\scripting\examples\loadti\..\..\..\DebugServer\packages\ti\dss\java\js.jar

***** DSS Generic Loader *****

START: 15:19:29 GMT+0200 (MESZ)

Configuring Debug Server for specified target... Done TARGET: Texas Instruments XDS100v2 USB Emulator Connecting to target... CortexR4: GEL Output:  Memory Map Setup for Flash @ Address 0x0 Resetting target... testEnv.outFiles: th2 Loading th2 Done Target running... Interrupt to abort . . .  Confirming _ allowed in identifiers

RESULT: (unknown_test)                                                   PASSED

NORMAL COMPLETION: 14275 cycles

 

Regards

 Martin

 

  • Hello!

    At first I would recommend you this link http://processors.wiki.ti.com/index.php/XDS100#Troubleshooting.

    Regards,

    igor

  • Hi Martin,

    Before running loadti, could you enable debug server logging? When enabled, it will generate a verbose log that may explain what exactly is causing the connection issues.

    You can enable it by setting some environment variables:

    set TI_DS_ENABLE_LOGGING=1
    set TI_DS_LOGGING_OUTPUT=c:/path/file.log

    The first will enable it.

    The second allows you to choose the generated file location.

    Then when loadti starts the debugger, it will start logging all activities of the debugger until the debugger is shut down.

    A few concerns:

    1) enabling logging will slow the debugger noticeably.

    2) Generated logs can be very very large in size

    3) A new log gets generated for a new debug session (and will overwrite the existing log file of the same name)

    You'll need to determine how to generate a log for a session where the error is experienced without it getting overwritten. I suggest manually running loadti with logging on until a bad run is encountered.

    Then you can zip up the log (it compresses well) and attach it to this thread)

    Thanks

    ki

  • Hi Ki-Soo,

     

    many thanks for your help.

    I have been able to switch on the debug mode and reproduce the error (althoug for a different test case).

    Logfile is attached.

     

    TESTING: suite/2/2/4/1/tcaselbls.c +++ stderr ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ SEVERE: IcePick: Error connecting to the target: (Error -154 @ 0xFFFFFF66) One of the FTDI driver functions used to write data returned bad status or an error. (Emulation package 5.0.569.0)

    SEVERE: emulation failure occurred SEVERE: Error connecting to the target: emulation failure occurred +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ COMMAND: leash -t 5m c:/ti/ccsv5/ccs_base/scripting/examples/loadti/loadti.bat -r -c C:/SuperTest/SuperTest/TMS570LS3137_xds100v2.ccxml tcaselbls

    ***** DSS Generic Loader *****

    START: 18:20:44 GMT+0200 (MESZ)

    Configuring Debug Server for specified target... Done TARGET: Texas Instruments XDS100v2 USB Emulator Connecting to target... Error code #4001, could not connect to target! Aborting!

    END: 18:20:51 GMT+0200 (MESZ)

  • Here is the logfile.

  • Next try (attachment function is really non-intuitive in this Forum!).

  • Thanks Martin. The CCS engineers have analyzed the log and determined that the error is coming from the emulation layer. I will notify the emulation engineers to take a look.

    Thanks

    ki

  • This issue could be possible due to the following two reasons.

    - Improper FTDI driver installation or corrupted installation (this is unlikely as the installation works mostly)

    - Bad XDS100v2 hardware

    - USB hub not functioning properly on the PC

    Questions:

    1) Do you have another XDS100v2 ? If so, can you use that and see if the issue persists?

    2) Are you using any additional USB hub on the PC?

    3) Can you try running the same tests on a different PC with native USB 2.0 port?

     

  •  (Error -154 @ 0xFFFFFF66) One of the FTDI driver functions used to write data returned bad status or an error. (Emulation package 5.0.569.0)

    This error -154 happens whenever the JTAG scan manager software has sent a command to the FTDI chip in the XDS100, and the FTDI driver returned either an error code or the wrong amount of data (usually an embedded error code in the data).  This can be caused by a several problems: 1) unreliable USB connection (data is corrupted going to or from the FTDI chip, 2) defective hardware (the FTDI chip in the XDS100 is not responding properly), or 3) software bug in the scan manager software.

    Most of the time we've seen this in the past, it was something with the USB connection. There have been multiple cases where the XDS100 was plugged into a USB hub, and the problem seemed to go away when they plugged it directly to the PC or a different hub.  A few other times, replacing the USB cable seemed to help.

  • Hi Vikas, Edward,

    Thanks for taking a look. The main issue is that the failure is intermittent. Basically it fails 34% of the time. And a re-run (via loadti) will work. So Martin is simply trying to determine what he can do to improve reliability. Looks like his emulator and USB cable is ok since it eventually works.

    thanks

    ki

  • Hello,

     

    first of all thanks a lot for your help.

    I have been very busy for a while, but today I got the chance to revisit this problem.

     

    We have set up another PC with a second TMS570LS3137B board and the same Software (Win 7 64bit, ccs v5, TI Compiler 4.9.5) and rerun the same tests of the SuperTest Suite with identical configuration file.

    Result: The intermittent FTDI error -154 and the error message #4001 occurs on both machines.

     

    This means:

    1) Do you have another XDS100v2 ? If so, can you use that and see if the issue persists?

    Yes, we have another XDS100v2 (second board instance) and yes the issue persists.

    2) Are you using any additional USB hub on the PC?

    No. On one PC we have the board connected to an USB 3.0 socket on the other PC it is a USB 2.0 socket.
    Since the same error occurs on both PCs, the USB is unlikely the cause.

     

    3) Can you try running the same tests on a different PC with native USB 2.0 port?

    Yes. We have done so on the second PC.

     

    4)  A few other times, replacing the USB cable seemed to help.

    We use different USB cables on both PCs. Does not help.

     

    5) We have also tried to add a delay before the differnent loadti.bat calls (ping -n 10 -w 1000 127.0.0.1 > nul).

    The error persists despite the delay.

     

    6) We had a closer look on the Super Test source files and found out that some files make use of uninitialized global variables. In addition we have set up our linker command file lnk.cmd with the Option --zero_init=off (as requested by our customer). If we change the Option to --zero_init=on then error disappears!

    Note that we call loadti.bat with the option -r, which should reset the board before loading the program. Can you please document here what excatly this reset does. It does not seem that the entire board Memory is resetted. 

     

     

  • Hurray!

     

    we have found a workaround!

    In the readme.txt in the loadti folde we have found the following Option:

     -b,   --init-bss-section[=VALUE]       Initialize .bss section to specified value, or 0 if       value is omitted

     

    Now, if we add -b=0 to our loadti.bat call, all tests run through smoothly.

    This way we can keep the Option --zero_init=off in our LCF and can thus test the compiler/linker as used by our customer.

     

    However, to help other people and maybe us for the next project, it would be great if somebody could document here what exactly the loadti option -r (reset) does? Are only the registers resetted?

  • Good to hear you have resolved the problem!

    Martin Wildmoser said:
    However, to help other people and maybe us for the next project, it would be great if somebody could document here what exactly the loadti option -r (reset) does? Are only the registers resetted?

    the -r option for loadti will execute a CPU reset. Basically just the CPU and core registers are reset. Depending on the emulator and device being used, a system reset may be available which will also reset peripherals (what exactly it does varies from device to device)

    Thanks

    ki

  •  Hi Lee,

    I have RDK - IDM - L35 board and XDS100 v2 emulator and ccsv5  program.

    My board shows qs-keypad program.

    I' like prgram my board with Hello World program.

    Builder works without errors.

    But  when I debug "Hello World program"  and connect the target, I get in console windows message:

    CORTEX_M3_0: GEL Output:
    Memory Map Initialization Complete
    CS_DAP_0: Error connecting to the target: (Error -151 @ 0x0) One of the FTDI driver functions
    used during the connect returned bad status or an error. The cause may one or more of:
    invalid emulator serial number, blank emulator EEPROM, missing FTDI drivers, faulty USB cable.
    Use the xds100serial command-line utility in the 'common/uscif' folder to verify the emulator can be located.
    (Emulation package 0.0.0.0

    There is message in debug windows:

    0x 000002D4 (no symbols are defined for 0x000002D4.

    There is nothing in Variable windows.

    There is :

    000002d4:  EFE0F7FF in Disassembly windows.

    There is :

    CORTEX_M3_0: GEL Output:
    Memory Map Initialization Complete

    CORTEX_M3_0: GEL Output: Watchdog Timer Enabled

    CORTEX_M3_0: GEL Output: UARTs Enabled. 

    in console Windows, before  push "connect target "

    What can I do with this problem?

    The best regards.

    Andrzej M

     

     

     

     

     

  • Hello

    Andrzej Maciejewski9 said:
    CORTEX_M3_0: GEL Output:
    Memory Map Initialization Complete
    CS_DAP_0: Error connecting to the target: (Error -151 @ 0x0) One of the FTDI driver functions
    used during the connect returned bad status or an error. The cause may one or more of:
    invalid emulator serial number, blank emulator EEPROM, missing FTDI drivers, faulty USB cable.
    Use the xds100serial command-line utility in the 'common/uscif' folder to verify the emulator can be located.
    (Emulation package 0.0.0.0

    have you see this FAQ?

    http://processors.wiki.ti.com/index.php/Xds100#Q:_I_was_following_Debugging_JTAG_Connectivity_Problems_and_I_a_-151_SC_ERR_POD_OPEN_error_with_Dbgjtag.

    In the future please start new threads instead of replying to existing closed threads. This will ensure the best chance that your question will be seen.

    Thanks

    ki