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.

dm648 NDK halted

Hi,

My project use NDK to send data to my PC. DSP always runs a few minutes and halted at UTL_halt.
The Message Log of Execution Graph Details show message below:

 

1st time:

367276   SWI: end   dynamic SWI (0xe100105c) state = done
367277   EXC_exceptionHandler: EFR=0x2
367278     NRP=0x20202020
367279     mode=supervisor
367280   Internal exception: IERR=0x1
367281     Instruction fetch exception
367282   SYS abort called with message 'Run-time exception detected, aborting ...'

B3=ED2F6854
A4=ED30B708

 

2nd time:

251529   SWI: post  KNL_swi (TSK scheduler) (0xe1001138)
251530   EXC_exceptionHandler: EFR=0x2
251531     NRP=0xed2f2c00
251532     mode=supervisor
251533   Internal exception: IERR=0x2
251534     Fetch packet exception
251535   SYS abort called with message 'Run-time exception detected, aborting ...'

B3=ED2F6854
A4=ED30B708

.map file

ed2f6820   _SYS_abort
ed2f6880   _OBJ_delete

ed30b708   LOG_A_TABBEG


If i delete the send(), the project will work well. Can you help me?

Regards,
Chen

  • I don't know why you're getting the exception, but I can offer a few tips to help you determine the problem.

    The values of B3 & A4 are meaningless at the point that you get this message.  They simply reflect the fact that SYS_abort called UTL_halt and that LOG_printf was just called to print the exception messages.

    The key piece of information here is the NRP that is printed.  The "1st time" run shows an NRP at 0x20202020, which means that is where the CPU was executing code from when the exception was detected by the CPU.  Clearly, 0x20202020 is not a valid code address, and was likely branched to due to a bad return address or function pointer, and the CPU is reporting that it can't fetch an intsruction from there.

    Since both logs show SWI processing just before the exception I'm suspecting that a SWI is doing something bad, perhaps trying to block on a semaphore, or block in some way, which is illegal for a SWI and would lead to badness.

    To get a better picture of what the system looks like at the time of the exception, place a breakpoint on the exception vector, at a label called 'hwi1'.  This should be the 2nd entry in the interrupt vector table.  When you hit this breakpoint, you will see NRP/EFR/IERR as reported in your log messages, but can also see key things such as the B3 value at the time of the exception (before it has been overwritten by exception processing function calls).  If B3 is a valid code location at this point then it might give you an idea of who called the bad code (by looking at the code at the B3 address, you might see that just before the B3 address is a branch through a register and that the register contains the bad address).  Depending on what you see, you can further investigate why that register got a bad value.

    Regards,

    - Rob

  • Rob,

    I placed a breakpoint on hwi1, and runs the porgram several times.

    I get some value from B3 register. When the value is valid, the address is above a label named as "SWI_RUNFXN", which i think should be SWI scheduler.

    I don't use any SWI, but a task, and a network task which is required by NDK. I used the DAT Module that encapsulate EDMA3 driver, which can found in C:\dvsdk_1_11_00_00_DM648\edma3_lld_1_05_00\examples\CSL2_DAT_DEMO.

    I don't use any address as return value, that is for sure.

    So what can i do?

     

    ps:there are some message log below:

    1st:

    (halted at hwi1:)
    1710741   SWI: end   KNL_swi (TSK scheduler) (0xe1001138) state = done
    1710742   SEM: post <unknown handle> (0xec0083e4) count = 0
    1710743   SWI: begin KNL_swi (TSK scheduler) (0xe1001138)
    1710744   TSK: running dynamic TSK (0xec00737c)
    1710745   SWI: end   KNL_swi (TSK scheduler) (0xe1001138) state = done
    1710746   SWI: begin KNL_swi (TSK scheduler) (0xe1001138)
    1710747   SWI: end   KNL_swi (TSK scheduler) (0xe1001138) state = done
    1710748   SWI: begin KNL_swi (TSK scheduler) (0xe1001138)
    1710749   SWI: end   KNL_swi (TSK scheduler) (0xe1001138) state = done
    1710750   SWI: begin KNL_swi (TSK scheduler) (0xe1001138)
    1710751   TSK: blocked dynamic TSK (0xec00737c) on <unknown handle> SEM
    1710752   TSK: running tskNdkStackTest (0xe1001074)
    1710753   SWI: end   KNL_swi (TSK scheduler) (0xe1001138) state = done
    1710754   SWI: begin KNL_swi (TSK scheduler) (0xe1001138)
    1710755   TSK: blocked tskNdkStackTest (0xe1001074) on <unknown handle> SEM
    1710756   TSK: running dynamic TSK (0xe100100c)
    (B3=ED2F2F00)

    (continue run,then halted at UTL_halt)
    1710757   EXC_exceptionHandler: EFR=0x2
    1710758     NRP=0xed2f2f00
    1710759     mode=supervisor
    1710760   Internal exception: IERR=0x18
    1710761     Opcode exception
    1710762     Resource conflict exception
    1710763   SYS abort called with message 'Run-time exception detected, aborting ...'
    (B3=ED2F2F00)

    related .map file content:

    ed2f2dec   SWI_RUNFXN
    ed2f3000   PRD_F_swi

     

    2nd:

    (halted at hwi1:)
    1660148   SWI: end   KNL_swi (TSK scheduler) (0xe1001138) state = done
    1660149   SWI: begin KNL_swi (TSK scheduler) (0xe1001138)
    1660150   SWI: end   KNL_swi (TSK scheduler) (0xe1001138) state = done
    1660151   SWI: begin KNL_swi (TSK scheduler) (0xe1001138)
    1660152   SWI: end   KNL_swi (TSK scheduler) (0xe1001138) state = done
    1660153   SWI: begin KNL_swi (TSK scheduler) (0xe1001138)
    1660154   TSK: blocked dynamic TSK (0xec00737c) on <unknown handle> SEM
    1660155   TSK: running tskNdkStackTest (0xe1001074)
    1660156   SWI: end   KNL_swi (TSK scheduler) (0xe1001138) state = done
    1660157   SWI: begin KNL_swi (TSK scheduler) (0xe1001138)
    1660158   TSK: blocked tskNdkStackTest (0xe1001074) on <unknown handle> SEM
    1660159   TSK: running dynamic TSK (0xe100100c)
    1660160   SWI: end   dynamic SWI (0xd0ef) state = done
    1660161   SEM: post <unknown handle> (0xec000144) count = 0
    1660162   SWI: post  KNL_swi (TSK scheduler) (0xe1001138)
    1660163   SWI: begin KNL_swi (TSK scheduler) (0xe1001138)
    (B3=ED2F2F00)

    (continue run,then halted at UTL_halt)
    1660164   EXC_exceptionHandler: EFR=0x2
    1660165     NRP=0xed2b2c74
    1660166     mode=supervisor
    1660167   Internal exception: IERR=0x12
    1660168     Fetch packet exception
    1660169     Resource conflict exception
    1660170   SYS abort called with message 'Run-time exception detected, aborting ...'

     

    3th:

    (halted at hwi1:)
    1399405   SWI: begin KNL_swi (TSK scheduler) (0xe1001138)
    1399406   SWI: end   KNL_swi (TSK scheduler) (0xe1001138) state = done
    1399407   SWI: begin KNL_swi (TSK scheduler) (0xe1001138)
    1399408   TSK: blocked TSK_data_tst (0xe10010dc) on <unknown handle> SEM
    1399409   TSK: running tskNdkStackTest (0xe1001074)
    1399410   SWI: end   KNL_swi (TSK scheduler) (0xe1001138) state = done
    1399411   SEM: post <unknown handle> (0xec0083e4) count = 0
    1399412   SWI: begin KNL_swi (TSK scheduler) (0xe1001138)
    1399413   TSK: ready dynamic TSK (0xec00737c)
    1399414   TSK: running dynamic TSK (0xec00737c)
    1399415   SWI: end   KNL_swi (TSK scheduler) (0xe1001138) state = done
    1399416   SWI: begin KNL_swi (TSK scheduler) (0xe1001138)
    1399417   SWI: end   KNL_swi (TSK scheduler) (0xe1001138) state = done
    1399418   SWI: begin KNL_swi (TSK scheduler) (0xe1001138)
    1399419   TSK: blocked dynamic TSK (0xec00737c) on <unknown handle> SEM
    1399420   TSK: running SEM Posts (0x00000000), ERROR: Invalid thread state transition
    (B3=00000000)

    (continue run,then halted at UTL_halt)
    1399421   EXC_exceptionHandler: EFR=0x2
    1399422     NRP=0xc
    1399423     mode=supervisor
    1399424   Internal exception: IERR=0x1
    1399425     Instruction fetch exception
    1399426   SYS abort called with message 'Run-time exception detected, aborting ...'

     

    Regards,

    Chen

  • Bob,

    I traced to address 0xED2F2F00, as indicated by B3, and found something stranger.

    When i load the .out file, i can see the disassembler window as below:

    ED2F2EE8          fxne:
    ED2F2EE8 00240363            B.S2          B9
    ED2F2EEC 02242266 ||         LDW.D1T2      *+A9[1],B4
    ED2F2EF0 02244264            LDW.D1T1      *+A9[2],A4
    ED2F2EF4 0197802A            MVK.S2        0x2f00,B3
    ED2F2EF8 01F697EA            MVKH.S2       0xed2f0000,B3
    ED2F2EFC 00002000            NOP           2
    ED2F2F00          fxn_ret:
    ED2F2F00 03CD1A2A            MVK.S2        0xffff9a34,B7
    ED2F2F04 03F6986A            MVKH.S2       0xed300000,B7
    ED2F2F08 C1ED                LDW.D2T1      *B7[6],A6
    ED2F2F0A 04A6                MVK.L1        0,A1
    ED2F2F0C 006000AA ||         MVK.S2        0xffffc001,B0
    ED2F2F10 009C82F5            STW.D2T1      A1,*+B7[4]
    ED2F2F14 00321029 ||         MVK.S1        0x6420,A0
    ED2F2F18 0000006A ||         MVKH.S2       0x0000,B0

    ....

    but when dsp halted, the disassembler window as below:

    ED2F2EE8          fxne:
    ED2F2EE8 00240363            B.S2          B9
    ED2F2EEC 02242266 ||         LDW.D1T2      *+A9[1],B4
    ED2F2EF0 02244264            LDW.D1T1      *+A9[2],A4
    ED2F2EF4 0197802A            MVK.S2        0x2f00,B3
    ED2F2EF8 01F697EA            MVKH.S2       0xed2f0000,B3
    ED2F2EFC 2533CE4C     [ B0]  LDH.D2T1      *+B14[13262],A10
    ED2F2F00          fxn_ret:
    ED2F2F00 03CD1A2F            LDB.D2T2      *+B14[19738],B7
    ED2F2F04 4E6C1CE3 ||  [ B1]  SHL.S2X       A27,B0,B28
    ED2F2F08 BC0E     ||         MV.S1X        B24,A5
    ED2F2F0A 27CF                MV.S2         B7,B9
    ED2F2F0C 006000AA ||         MVK.S2        0xffffc001,B0
    ED2F2F10 009C82F5            STW.D2T1      A1,*+B7[4]
    ED2F2F14 00321029 ||         MVK.S1        0x6420,A0
    ED2F2F18 0000006A ||         MVKH.S2       0x0000,B0

    the value from address  from 0xED2F2EFC to 0xED2F2F0A is changed.

    Once, i saw the disassembler explained some value as ".word".

    I think these code should be in code segment, and should not be changed.

    Is it right?

    Regards,

    Chen

  • Chen,

    You're correct, the contents of assembly code should never change.  Your application (or some component of it) has a bug somewhere, probably with a bad data pointer that ends up pointing to this area and writing to it.  What you see in the disassembly after that is just disassembler interpretation of random data, and when it prints ".word" that means that there is no valid assembly instruction opcode that matches that data.

    You will need to isolate the cause of this bad data pointer.  Hopefully the code corruption happens in the same place every time, which will make it easier to track down.  Try inspecting that code at various intervals.  If you have a chip with AET (Advanced Event Triggering) then you can use CCS to program a hardware data watchpoint to track a write to that location. 

    At a higher level, check for stack corruption, either in a TSK or in the system HWI (ISR) stack.

    Regards,

    - Rob

  • Rob,

    thank u for help, I rewrite my function, and correct the problem.

    Regards,

    Chen

  • hello Chen

    I am working on project very similar to urs .. i f you can help me with few of the things i would be highly obliged ...please do let me know

    Regrad

    waiting for a reply

  • Rasul,

    I used a edma3 function which is writen  in edma3 driver example. i rewrite the function, and my project works well.

    Chen