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.

Compiler/C64XPLUSCODECS: Opcode Exception has occured

Part Number: C64XPLUSCODECS
Other Parts Discussed in Thread: DM3725, SYSBIOS

Tool/software: TI C/C++ Compiler

The above pic is for reference. While running my experiment on TI C64x+ , I am getting the above exception. Any idea what it might be?

  • Hi,

    I've notified the design team. Their feedback will be posted here.

    Best Regards,
    Yordan
  • Yunii,

    Which device are you using?
    Which software package are you using?
    What are the conditions that lead to this exception? (immediately after loading or running, after starting some external event, or such)

    You can refer to the C64x+ CPU & Instruction Set Reference Guide to find the CPU Exceptions section. This will help you interpret the error codes in the registers shown.

    NRP tells you approximately where in the code to look for the instruction that caused the exception. IRP may have meaning if you were executing an interrupt at that time. B15 is usually the stack pointer, so you can look at that location to try to back out what happened prior to the exception.

    Regards,
    RandyP
  • Hi RandyP

    Thanks for responding!

    First of all let me give you the details of the device and software packages :

    Device: DM3725 (ti- C64x+)
    SysBios: bios_6_42_03_35
    XDC: xdctools_3_30_06_67_core
    Compiler: ti-cgt-c6000_8.0.1


    Approximately, out of 10 runs my device crashes 2 times. My observations and analysis:

    1) NRP gave me the file details wherein this exception is occuring. And with the help of JTEG, I was also able to pinpoint the location of the exception (via disassembly in CCS). I got a hit on this instruction : "Log2ClipScale = 0;" . At this instruction the exception seems very unlikely. I am sending you the snippet of my code:

    Log2ClipScale = 0;
    do
    {
    TotalEnergy = Sat_fr1x16(Shr_fr1x32(TotalEnergy32,2*Log2ClipScale-modem_log2(BurstLength-2)));
    Log2ClipScale++;
    } while (TotalEnergy >= RefMetric);



    2) For the same scenario, B15 is pointing to "ti_sysbios_heaps_HeapMem_Instance_State_1_buf__A " in the MAP file.


    I will be waiting for your valuable comments.

    Regards,
    Yunii
  • Yunii,

    There is another forum for the DM3725. I am surprised it was not suggested for you when you created the forum. If this question tends toward issues specific to the DM3725 or codecs, we will ask a Moderator to move the thread to the DM37x forum.

    Which Codec are you using?

    What are the conditions that lead to this exception? (immediately after loading or running, after starting some external event, or such) Is the application correctly operating for a while and then hits the exception? Please explain what you are doing, other than 'run'.

    1) The code snippet for an exception needs to be assembly, not C code. The exception occurs in the instructions at the CPU level. Please bring up the Disassembly Window and show the code at least 8 instructions before and 8 after the exception NRP location. I could also be helpful to expand your C code snippet to include a few instructions before the NRP location.

    But it does appear that the exception is occurring in your code and not in any TI-supplied codec. Is that a correct interpretation from what you have said and shown so far?

    2) That seems very odd that the stack pointer B15 would be pointing into a heap. Please attach a copy of your map file.

    If it is correct that the exception occurs in your application code that is generated by the C compiler, it is very rare that the compiler would generate an erroneous instruction. The most likely possibility for that scenario (if correct) would be something overwriting your code, meaning an errant pointer for example.

    Regards,
    RandyP
  • Hi RandyP,

    Yes you are right, the exception occurs in my code. The exception occurs in the algorithm wherein I am trying to calculate "Total Energy".

    1) Disassembly window from CCS:

    2) The requested Map file: 

    /cfs-file/__key/communityserver-discussions-components-files/791/5153.MapFile.zip

    Thanks,

    Yunii

  • 8117.MapFile.zipuploading Map file again:

  • Yunii,

    This is going to be very difficult to debug. In addition to answers for all the questions I ask and have asked, it will help for you to add information that I have not thought to ask about.

    What are the conditions that lead to this exception? (immediately after loading or running, after starting some external event, or such) Is the application correctly operating for a while and then hits the exception? Please explain what you are doing, other than 'run'. [This is the third request for this behavioral information.]

    Is this routine called from within a task? Which OS are you using?

    Your picture shows a breakpoint symbol at the MVK.L1 0,A12 instruction. Is that for demonstration purpose only, or have you halted there? With the breakpoint set there, how often do you hit the breakpoint and stop?

    The first thing that needs to be eliminated is the question of whether or not the code is being overwritten. To do this, load the code and take a snapshot of this same Disassembly area before any running has occurred. Compare that to what this Disassembly area looks like after hitting the exception.

    The second debug path will be to use breakpoints to stop just before the failing instruction and use the assembly-step feature to step up to and past that instruction to see how it behaves.

    The third debug path will be to do things differently with the compiler to see if you can generate code that does not hit the exception.

    Nothing comes to mind about the instruction shown at the NRP address, so no easy answer is available that I can see.

    Regards,
    RandyP