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.

TMS570LS31xxUSB Error connecting to the target (Error -2062 @0x0)

Other Parts Discussed in Thread: HALCOGEN, UNIFLASH

Hi,

I have the TMS570LS31xxUSB. I have been able to load programs to MCU a few times using the demos and the demo code.  I have just generated my first code from HalCoGen and trying to load it to the MCU I get the following error.

FATAL >> CortexR4: Error connecting to the target: (Error -2062 @ 0x0) Unable to halt device. Reset the device, and retry the operation. If error persists, confirm configuration, power-cycle the board, and/or try more reliable JTAG settings (e.g. lower TCLK). (Emulation package 5.1.73.0)

I'm not really sure what could have caused this, though it did correspond with changeing the erase settings to necessary sectors only.  I have tried changing back to full erase and also updated from nowFlash to UniFlash 2.2.0, but am still getting the error message.

I am not yet very skilled with these things so please bear that in mind when giving instructions.  Changing the frequency from 140MHz to 10MHz in nowFlash did not make any difference, and neither has disconnecting and reconnecting the board.  Could you let me know what I should do in this situation.

  • Nicholas,

    It seems that the behavior is caused some error in the code you programmed into Flash. Can you connect to CPU using CCS?

    Thanks and regards,

    Zhaohong

  • No, I can't connect using CCS.  Initially CCS continued to say device connected and I thought initially it could also reconnect to the device, but now that does not seem to be the case.  The demo software detects the device, recognises that its code is not programmed into it and begins to try to reprogramme the device before giving this error message:

    nowFlash has encountered an error while programming the device.  Please ensure that the device is correctly connected and then try running the demo again.

    I can't see why my code would cause a problem.  It was just halcogen generated code with a "hello world" in main,

    Trying to erase using nowFlash gives:

    Error 199 - Unable to connect to target on port address 0x000.

  • Nicholas,

    When you are in CCS and have started your target, instead of doing a connect, try the following:


    Select "Show All Cores" than expand Non Debuggable Devices, you should get something like:

    Right click on Icepick as shown bellow.

    And click on "Connect Target". Once connected to Icepick, try the following:

    This will reset the device. Now you can right click on DAP and select "Connect Target" and finally, right click on CortexR4 and click on Connect Target.
    At this point, you should be connected to your device.
    Now go to menu Tools->On Chip Flash and in Erase Option select "Entire Flash". At the bottom of the window, the option Erase Flash is now available.
    Click on it to erase the device.
    If this is successful, disconnect CCS, cycle to board and reconnect as usual. It should work.
    If this is the case, the code that was programmed in the device was causing the problem.
    I can have a look if you provide me the full project.
    Please let me know the result of these different steps.

  • Many thanks once again! It does seem to be the code.  Following your instructions I was able to reconnect and also to run the demo programs.  The problem is also repeatable by reloading the code.  If you wouldn't mind having a look at the code I have attached the project below.  I left the halcogen settings at default other than enabling all the self tests.  I am just about to try again with only the default self tests enabled.

    8863.halcogen_example.zip

  • Nicholas,

    To debug the problem, I would suggest you to replace the sys_intvecs.asm file with the attached one. In the attached file, the instruction at reset entry "b _c_int00" is replaced by "b #-8". After you connect to target, you will see that PC is "locked " to this instruction and everything on the MCU is at default condition. Then you can use debugger to move PC to _c_int00 and check what in your code causes the issue. In the debugging process, I would suggest you to set breakpoints and run to the breakpoints. When you use stepping, CPU is in the debug mode and the issue may not be exposed.

    6082.sys_intvecs.asm

    Thanks and regards,

    Zhaohong

  • Nicholas,

    Thanks for sharing your project.

    The problem you are facing is, it is not possible to debug an application with CPU Self test or CCM Self test enable. See following screenshot:

    When these options are enable, the device has to start from power on reset and cannot be stopped (Halt) and restarted.

    Also I've noticed that all the module drivers are enable in your Halcogen configuration. I know this is the default.
    It does not hurt, it's just that during setup, all the module will be initialized even if they are not used. This is a waste of code space and execution time.

    The easy way is to click on "Mark/Unmark all drivers" in the Driver Enable tab in Halcogen and select one by one the mandatory driver for a given application.

  • At the moment everything seems to be hanging at

    168   /* Wait until Memory Hardware Initialization complete */
    169   while((systemREG1->MSTCGSTAT & 0x00000100U) != 0x00000100U)

    in sys_selftest.c

  • I'm also getting this warning during initialization loading. I don't know if its related.

    #10210-D creating ".sysmem" section with default size of 0x800; use the -heap option to change the default size.

    I think the problem that initiated the thread has been solved, so maybe I should ask about this in a new thread.  I don't know whether it is related or not.

  • Nicholas,

    The heap warning has nothing to do with this problem.
    You can avoid the warning by setting the heap size in the project linker properties as following:

    Back on your real problem, you are using a TMS570LS31xx usb stick. Is that correct?
    When did you order this kit?
    Can you give me the full device part number that you have on your board?

  • Yes, it is the TMS570LS31xxUSB.  I ordered it from Farnell June 4th 2013. The full device part number is TMX570LS3137AZWTQQIYFA-16A2QXW.  I may have mixed up 'one's and 'i' in there - as far as I can tell they look the same on the chip, unless all are 'one's

  • Nicholas,

    I've send you a friend request to discuss about your problem.