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.

TMS320F28377D: 28377调试时板子连不上

Part Number: TMS320F28377D
Other Parts Discussed in Thread: UNIFLASH

CCS10 CCXML配置:TI XDS2XX USB Onboard debug probe

test connection正常,选中CPU1-connect target时报错:

C28xx_CPU1: Trouble Reading Register ST1: (Error -1041 @ 0x5F453) The debug probe reported an error. Confirm debug probe configuration and connections, reset the debug probe, and retry the operation. (Emulation package 9.2.0.00002)
C28xx_CPU1: GEL: Error while executing OnTargetConnect(): Target failed to read register ST1
at (ST1&~(0x0100)) [f28377d_cpu1.gel:312]
at C28x_Mode() [f28377d_cpu1.gel:88]
at OnTargetConnect()
C28xx_CPU1: Error initializing flash programming: Interface returned from dll, but flash is not available on this device.
C28xx_CPU1: Error: (Error -1135 @ 0x82BF0) The debug probe reported an error. Confirm debug probe configuration and connections, reset the debug probe, and retry the operation. (Emulation package 9.2.0.00002)
C28xx_CPU1: Unable to determine target status after 20 attempts
C28xx_CPU1: Failed to remove the debug state from the target before disconnecting. There may still be breakpoint op-codes embedded in program memory. It is recommended that you reset the emulator before you connect and reload your program before you continue debugging

此时在debug界面,点击“system reset”

会报如下错误:C28xx_CPU1: Failed System Reset: (Error -6306) Failed to connect to PRSC module. (Emulation package 9.2.0.00002) 

点击“Reset Emulator”

会报错:C28xx_CPU1: Failed to reset the emulator: An attempt to access the USCIF interface via USCIF ECOM has failed. (Emulation package 9.2.0.00002)

  • (Error -1041 @ 0x5F453) T

    关于该错误您可以看一下

    http://software-dl.ti.com/ccs/esd/documents/ccsv7_debugging_jtag_connectivity_issues.html#the-emulator-reported-an-error 

    给出的说明:

    This can be caused by several sources of errors: a problem in the FTDI chip, bad I/O pins on the debug probe, issues on the circuit between the FTDI chip and the JTAG header, or a problem with the target device.

    You can try to workaround or solve this issue by swapping the JTAG debug probe and/or target device or board. In rare cases the FTDI device on the XDS100 debug probe may be broken.

    您可以交叉测试一下:

    1 使用您现在的仿真器烧录开发板试一下

    2 使用测试成功的仿真器来测试一下您自己的板子

  • 我不确定是否是JTAG口的问题。前面test connection正常,反馈如下:

    [Start: Texas Instruments XDS2xx USB Onboard Debug Probe_0]

    Execute the command:

    %ccs_base%/common/uscif/dbgjtag -f %boarddatafile% -rv -o -S integrity

    [Result]


    -----[Print the board config pathname(s)]------------------------------------

    C:\Users\linzijie\AppData\Local\TEXASI~1\
    CCS\CCS101~1.1\0\0\BrdDat\testBoard.dat

    -----[Print the reset-command software log-file]-----------------------------

    This utility has selected a 560/2xx-class product.
    This utility will load the program 'xds2xxu.out'.
    The library build date was 'May 7 2020'.
    The library build time was '20:23:44'.
    The library package version is '9.2.0.00002'.
    The library component version is '35.35.0.0'.
    The controller does not use a programmable FPGA.
    The controller has a version number of '13' (0x0000000d).
    The controller has an insertion length of '0' (0x00000000).
    This utility will attempt to reset the controller.
    This utility has successfully reset the controller.

    -----[Print the reset-command hardware log-file]-----------------------------

    This emulator does not create a reset log-file.

    -----[Perform the Integrity scan-test on the JTAG IR]------------------------

    This test will use blocks of 64 32-bit words.
    This test will be applied just once.

    Do a test using 0xFFFFFFFF.
    Scan tests: 1, skipped: 0, failed: 0
    Do a test using 0x00000000.
    Scan tests: 2, skipped: 0, failed: 0
    Do a test using 0xFE03E0E2.
    Scan tests: 3, skipped: 0, failed: 0
    Do a test using 0x01FC1F1D.
    Scan tests: 4, skipped: 0, failed: 0
    Do a test using 0x5533CCAA.
    Scan tests: 5, skipped: 0, failed: 0
    Do a test using 0xAACC3355.
    Scan tests: 6, skipped: 0, failed: 0
    All of the values were scanned correctly.

    The JTAG IR Integrity scan-test has succeeded.

    -----[Perform the Integrity scan-test on the JTAG DR]------------------------

    This test will use blocks of 64 32-bit words.
    This test will be applied just once.

    Do a test using 0xFFFFFFFF.
    Scan tests: 1, skipped: 0, failed: 0
    Do a test using 0x00000000.
    Scan tests: 2, skipped: 0, failed: 0
    Do a test using 0xFE03E0E2.
    Scan tests: 3, skipped: 0, failed: 0
    Do a test using 0x01FC1F1D.
    Scan tests: 4, skipped: 0, failed: 0
    Do a test using 0x5533CCAA.
    Scan tests: 5, skipped: 0, failed: 0
    Do a test using 0xAACC3355.
    Scan tests: 6, skipped: 0, failed: 0
    All of the values were scanned correctly.

    The JTAG DR Integrity scan-test has succeeded.

    [End: Texas Instruments XDS2xx USB Onboard Debug Probe_0]

    是否能说明仿真器和DSP之间通过JTAG口通信是正常的?问题在别处。

  • 是否能说明仿真器和DSP之间通过JTAG口通信是正常的?

    是的,看测试结果的话,是正常的

    您是否有直接尝试使用uniflash(脱离CCS的环境)来测试是否可以成功烧录?

  • CCS连不上时,uniflash也是连不上的,uniflash报错:[ERROR] IcePick_C_0: Error initializing emulator: (Error -2083 @ 0x0) Unable to communicate with the debug probe. Confirm debug probe configuration and connections, reset the debug probe, and retry the operation. (Emulation package 9.3.0.00042)。

    当我连不上时,断电重连,硬件复位,CCS debug界面的System reset , reset emulator都试过,有时突然就连上了,然后下一次又不行了。我在想是否因为我连上时,调试结束时退出的方法不对?现在我要退出调试时,首先程序暂停(suspend),然后点击CPU Reset,最后点击Terminate,这已经是安全退出方法了吧?

  • 有时突然就连上了,然后下一次又不行了。

    能连上说明您的操作步骤没什么问题

    现在我要退出调试时,首先程序暂停(suspend),然后点击CPU Reset,最后点击Terminate,这已经是安全退出方法了吧?

    我一般都直接暂停,然后点击Terminate

    建议您换根线试试。另外您是自己设计的板子还是开发板?

  • 自己设计的板子。连线就只是仿真器自带的接USB口和JTAG口的线而已,这是没有问题的,该仿真器能稳定连上开发板。

  • 在connection中请选择 Texas Instruments XDS2xx USB Debug Probe (and not "onboard")

    除此以外,我没有发现有其他使用问题

  • onboard与否的区别是什么?

  • onboard一般是指直接集成在开发板上的

    没有onboard的话,是独立的仿真器

  • software-dl.ti.com/.../ccsv7_debugging_jtag_connectivity_issues.html

    我注意到这个建议:

     If you are unable to connect to a flash-based device, keep in mind that pre-loaded code may prevent it from properly connecting. Changing the boot mode of the device or performing a mass erase can recover from this situation, however, there are instances where the device is locked permanently and will require replacement.

    还有F28069 Flash Programming - C2000 microcontrollers forum - C2000Tm︎ microcontrollers - TI E2E support forums给出的尝试步骤。

    我想知道,在CCS和uniflash都connect target失败的情况下,如何 Configure the boot mode GPIOs to wait boot

  • 请问还是之前的问题?目前还是连接不上?

  • 请问您现在使用的boot引脚和模式是怎样的?

    若是在CCS内连接仿真器调试的话,默认是在仿真器boot模式的

    默认的话,是下面表格内那样

      

  • 这是原理图:

    EM1D12也是接GPIO72的,下面两个unload就是没有焊上电阻。这么说来,会导致GPIO72和GPIO84都是高电平,引导模式为Get。

    所以,如果在R40的地方焊一个小电阻,比如1k,拉低GPIO84,就是Wait模式了吧?

  • 我看到有的开发板是这样连的:

    也就是采用paralledl模式。能不能简单讲一下这四种模式的区别是什么?TI 推荐的模式就是Wait 吗?

  • 能不能简单讲一下这四种模式的区别是什么?TI 推荐的模式就是Wait 吗?

    这4种模式,主要是取决于您现在是想如何boot,例如若是想从SCI来boot的话,就可以使用SCI boot mode

    我们有一个专门的分享,您可以详细了解一下

    https://e2echina.ti.com/blogs_/b/the_process/posts/ti-fae-c2000 

  • 通过管脚配置为wait模式,断电重连可以连上了。看了https://e2echina.ti.com/blogs_/b/the_process/posts/ti-fae-c2000这篇博客,关于DSP上电到执行main函数之间,我有一些疑问:

    1.我看例程里用的cmd文件,如果是RAM_lnk.cmd,就是把程序加载到RAM里;如果是FLASH_lnk.cmd,就是把程序烧到flash里。使用例程的时候,都没有专门配置引导模式。

    “在带仿真器跑程序的时候,我们发现即使我们不配置引导模式,程序也能够跑到main,这主要是因为CCS的功能,在程序load到芯片的时候,或是reset > restart,CCS会自动屏蔽bootloader的过程,自动跳到main函数入口。”

    这句话是说,CCS会自动选择BOOT TO RAM或者BOOT TO FLASH(根据cmd文件是RAM_lnk.cmd还是FLASH_lnk.cmd),来到RAM或者FLASH中的main函数入口处是吗?

    2.我调试程序中途,想退出,为了安全退出,先点击CCS reset CPU,再点击terminate。但是一点击reset CPU,会报错:C28xx_CPU1: Failed CPU Reset: (Error -1138 @ 0x0) Device refused to allow debug mode. Power-cycle the board. If error persists, confirm configuration and/or try more reliable JTAG settings (e.g. lower TCLK). (Emulation package 9.3.0.00058)

    博客中这句话“如果我们只选择reset CPU,则需要配置引导模式,即对0x0d01, 0x0d00这两个单元在memory window进行写相应的值,或是在script的菜单中选择引导模式,程序才能够跑到main中。”是在memory browse中修改0x0d00的值(为其他引导模式),或者点击菜单栏script选择一个引导模式,然后再点击CPU RESET吗?

    我试着改为RAMBOOT(我的例程本来就是烧到RAM里的)再点击CPU RESET,不但报1138错误,还有下面这个错误:C28xx_CPU1: Trouble Reading Register PC: (Error -1142 @ 0x0) Device blocked debug access because it is currently executing non-debuggable code. Choose 'Rude Retry' to disable polite mode and force the operation. (Emulation package 9.3.0.00058)

    到底应该怎么改?或者,根据1138描述,如何降低TCLK呢?

    3.我想验证板子在boot之后、执行main函数之前,经历了code_start函数,_c_int00函数和_args_main函数,应该在哪个步骤后在CodeStartBranch.asmboot28.asmargs_main.c这些文件相应函数处打断点?使得程序能运行到断点处停下。

  • CCS会自动选择BOOT TO RAM或者BOOT TO FLASH(根据cmd文件是RAM_lnk.cmd还是FLASH_lnk.cmd),来到RAM或者FLASH中的main函数入口处是吗?

    是这样的,是在CCS内,默认使用的是仿真器boot模式

    是在memory browse中修改0x0d00的值(为其他引导模式),或者点击菜单栏script选择一个引导模式,然后再点击CPU RESET吗?

    这个我没有实际拿板子试过。我会在之后测试一下。

    您现在为何要使用CPU RESET呢?

    我想验证板子在boot之后、执行main函数之前,经历了code_start函数,_c_int00函数和_args_main函数,应该在哪个步骤后在CodeStartBranch.asmboot28.asmargs_main.c这些文件相应函数处打断点

    您是想查看boot的过程?那您可以将下面的勾选全部去掉,而后debug。但是理论上不能打断点的。

  • 感谢1和3的解答。关于为什么要用CPU RESET,我已经验证,如果程序运行到某处停下,还有未执行完代码,或者处于死循环中,此时点击terminate,虽然断掉了仿真器和板子的连接,板子会继续执行剩下的代码,这有时候可能导致严重后果。当然可以在terminate后马上断掉板子的电源,上电重启后自然不会执行剩下代码。但是你动作再快板子肯定执行一些代码了。所以为了确保安全退出,最好先CPU reset,使板子回到connect target成功、未load程序的状态,再点击terminate。

    我的问题是,不同的例程,在不同的地方暂停,点击CPU reset,有时成功,有时报1138错误,报错误的情况更多,找不到规律。1138错误建议“try more reliable JTAG settings (e.g. lower TCLK)” 具体要怎么做?

  • 我已经验证,如果程序运行到某处停下,还有未执行完代码,或者处于死循环中,此时点击terminate,虽然断掉了仿真器和板子的连接,板子会继续执行剩下的代码,这有时候可能导致严重后果。当然可以在terminate后马上断掉板子的电源,上电重启后自然不会执行剩下代码。但是你动作再快板子肯定执行一些代码了。所以为了确保安全退出,最好先CPU reset,使板子回到connect target成功、未load程序的状态,再点击terminate。

    谢谢您的分享,确实是这样的情况. 但我使用开发板测试,没有出现1138的错误。

    另外您也可以直接在C28上右键选择disconnect来避免执行后续的代码

    有时报1138错误,报错误的情况更多,找不到规律。1138错误建议“try more reliable JTAG settings (e.g. lower TCLK)” 具体要怎么做?

    您可以尝试下面的操作

  • 经仔细对比,如果在CPU RESET之前经历过或正处于read-time mode,会报1138错误,但是程序不会执行剩下代码,应该还是安全的。

    至于直接在C28上右键选择disconnect,这和直接点击terminate是一样的,会执行剩下代码。

    降低TCLK频率已尝试,1138错误还在,反而降低程序运行速度。

    这个问题算解决了,非常感谢。

  • 谢谢您细致的反馈。很高兴您能解决问题