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/TMDSEVM6678: C66xx_5: Encountered Illegal Op-code C66xx_5: Trouble Halting Target CPU: (Error -1139 @ 0x0) Lost debug connection to device.

Part Number: TMDSEVM6678

Tool/software: Code Composer Studio

While debugging my code I get the below error in the CCS console window:

Please let me know if you have any clue!

Regards,

C66xx_0: GEL Output: Disable all EDMA3 interrupts and events.
C66xx_5: Encountered Illegal Op-code 
C66xx_6: Encountered Illegal Op-code 
C66xx_7: Encountered Illegal Op-code 
C66xx_5: Trouble Halting Target CPU: (Error -1139 @ 0x0) Lost debug connection to 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 8.3.0.00003) 
C66xx_6: Trouble Halting Target CPU: (Error -1139 @ 0x0) Lost debug connection to 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 8.3.0.00003) 
C66xx_7: Trouble Halting Target CPU: (Error -1139 @ 0x0) Lost debug connection to 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 8.3.0.00003) 
C66xx_4: Power Failure on Target CPU 

  • Hi!

    Illegal opcode might happen if your code segment was overwritten with some other data. As that message happens after DMA, it is #1 to check.

    Loss of debug connection sometimes happen if program integrity is broken. Not sure what might cause power loss.

  • Hi,

    rrlagic gives some good points. Does this happen while code is loading and before it reaches main() or after that? This is to try and isolate the root cause to our (TI) initialization code or to your custom code.

    The invalid op codes can surely be due to the integrity of your program being affected and cause the processor to reset or halt - depending on how the device is designed, this may trigger a cold boot that resets or powers down all cores can fool the Debug Probe into believing the power was lost.  

    At any rate, if the issue happens after reaching main(), you will be looking at specific details that may cause issues, such as overrun buffers, insufficient stack and heap, calls or to un-initialized function pointers, use of non-initialized variables, etc. 

    Hope this helps,

    Rafael

  • Thanks very much for providing such valuable hints...

    I am using openmp in my project. I have been playing with stack and heap. I am sure they have right values. I have a matrix struct whose default constructor is not called apparently and causes huge memory to be allocated from heap memory since the no of rows and columns get huge values.

    But, I have no clue how to fix. Have you guys had any issue with default constructors not being called?

    Please let me know - Regards

  • Unfortunately, the OpenMP solution provided by TI does not support C++.  Please see the Introduction page of the TI OpenMP documentation.

    Thanks and regards,

    -George

  • I compile the c++ code without --openmp flag and I put no openmp pragma in the C++ files. - I have tested this and it is working fine. It is the default constructors that are giving me a hard time though.

    Regards

  • The default constructors are called during system startup, before main is called.  The OpenMP startup code presumes no C++ code is present, and does not call any default constructors for instances of global C++ objects.  

    Even though you adhere to this constraint ...

    Mike ITGeek said:
    I compile the c++ code without --openmp flag and I put no openmp pragma in the C++ files.

    ... you have crossed into a combination we do not support.  

    Speaking more generally ... None of our tests combine C++ and OpenMP, in any way.  I long suspected the combination you use had flaws, but I was never sure what those flaws were.  Unfortunately, we have found one of those flaws.  I'm sorry I didn't see it before now.

    Thanks and regards,

    -George

  • George Mock said:

    ... you have crossed into a combination we do not support.  

    Speaking more generally ... None of our tests combine C++ and OpenMP, in any way.  I long suspected the combination you use had flaws, but I was never sure what those flaws were.  Unfortunately, we have found one of those flaws.  I'm sorry I didn't see it before now.

    so what you are saying is that whatever c++ compiled using "-p ti.runtime.openmp.platforms.evm6678" even without --openmp may not call the default constructor of EVEN STACK object variables ??? What if I use "-p ti.targets.elf.C66" for c++ files only? Would I be able to link ti.targets.elf.C66 and ti.runtime.openmp.platforms.evm6678 together ? (I believe the answer is no. sorry just checking ... )

    But we tested this with small examples and it worked pretty perfectly .... (I believe it is supported to some extent but not fully guaranteed to work as of now! ;) )

    Also, I would appreciate if you can share the example you tested ...

    Regards,

    M

  • The only problem you experienced is is invoking the constructor for a global instance of an object.  That constructor must run before main starts.  Thus, it is part of the system startup code.  The system startup code for OpenMP ignores C++.  

    As for your other questions ... I'm sorry I cannot be more specific.  We do not test any combination of OpenMP and C++.  Even though you got it to work in a limited sense, it is risky to rely on that.  Because we do not test for it, we are unable to say what limited combinations may work, and which do not.

    Mike ITGeek said:
    I would appreciate if you can share the example you tested ...

    At present, I do not have system on which I can execute OpenMP code.  I  contacted the development team, and they told me the startup code for OpenMP does not handle invoking the constructor for any global instance of an object.

    Thanks and regards,

    -George