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.

SWI Posts but does not run

Other Parts Discussed in Thread: TMS320F2812

I am running DSP/BIOS 5.41.07.24 on a TMS320F2812.


Recently I have run into a problem where eventually my PRD_SWI no longer runs, despite being posted in the Execution Graph Log, and listed as Ready in the Kernel Object Viewer. The PRD_SWI has the highest priority level of all of the SWI's. However, SWI's of lower priority levels run successfully. Also, the PRD ticks continue to update in the Execution Graph, with the current time increasing in the Execution Graph Log. This indicates the timer interrupt driving the PRD module is still triggering successfully.

The system stack appears to be intact and has not overflowed, and all Tasks also run successfully.

Log and Execution Graph included below:

12072   CLK: current time = 70208398 (0x042f4b8e)
12073   PRD: tick count = 70208398 (0x042f4b8e)
12074   SWI: post  KNL_swi (TSK scheduler) (0x9ad2)
12075   SWI: begin KNL_swi (TSK scheduler) (0x9ad2)
12076   SWI: end   KNL_swi (TSK scheduler) (0x9ad2) state = done
12077   CLK: current time = 70208399 (0x042f4b8f)
12078   PRD: tick count = 70208399 (0x042f4b8f)
12079   SWI: post  KNL_swi (TSK scheduler) (0x9ad2)
12080   SWI: begin KNL_swi (TSK scheduler) (0x9ad2)
12081   SWI: end   KNL_swi (TSK scheduler) (0x9ad2) state = done
12082   CLK: current time = 70208400 (0x042f4b90)
12083   PRD: tick count = 70208400 (0x042f4b90)
12084   SWI: post  PRD_swi (0x9abe)
12085   SWI: post  KNL_swi (TSK scheduler) (0x9ad2)
12086   SWI: begin KNL_swi (TSK scheduler) (0x9ad2)
12087   SWI: end   KNL_swi (TSK scheduler) (0x9ad2) state = done
12088   CLK: current time = 70208401 (0x042f4b91)
12089   PRD: tick count = 70208401 (0x042f4b91)
12090   SWI: post  KNL_swi (TSK scheduler) (0x9ad2)
12091   SWI: begin KNL_swi (TSK scheduler) (0x9ad2)
12092   SWI: end   KNL_swi (TSK scheduler) (0x9ad2) state = done
12093   CLK: current time = 70208402 (0x042f4b92)
12094   PRD: tick count = 70208402 (0x042f4b92)
12095   SWI: post  KNL_swi (TSK scheduler) (0x9ad2)
12096   SWI: begin KNL_swi (TSK scheduler) (0x9ad2)
12097   SWI: end   KNL_swi (TSK scheduler) (0x9ad2) state = done
12098   CLK: current time = 70208403 (0x042f4b93)
12099   PRD: tick count = 70208403 (0x042f4b93)
12100   SWI: post  KNL_swi (TSK scheduler) (0x9ad2)
12101   SWI: begin KNL_swi (TSK scheduler) (0x9ad2)
12102   SWI: end   KNL_swi (TSK scheduler) (0x9ad2) state = done


  • Frank,
    do you have any PRD objects in your configuration? I can't get the Execution Graph Log to run in my CCS, so I can't really tell if PRD_swi shows up as getting control if there are no PRD objects. Have you seen PRD_swi in the running state in the graph for that same configuration or a different one? Do you remember changing anything since then?
  • Hi Sasha,

        I have 4 PRD objects, and the PRD_swi runs for several hours, until it suddenly stops running. I have verified the PRD_swi running, and then not running, by observing the system, as well as the Execution Graph and Log. The only change I have made has been to start using the RTA tools. Is there some negative interaction I'm not aware of?

    I also have stepped through the SWI_post routine in assembly. It seems the PRD_swi does not run since the first word in the SWI handle object is 0x0000 and not 0xFFFF. I see from the SWI_Obj structure that this is a lock. What I do not understand is how this lock eventually gets cleared, and stays cleared. The PRD_swi is the highest priority SWI in the system, and when it is not running, all of the lower priority SWI's run successfully.

    typedef struct SWI_Obj {

       Int         lock;

       Ptr         ready;

       Uns         mask;

       Ptr         link;

       Uns         initkey;

       Uns         mailbox;

       FXN_Obj     fxnobj;

       Int         stslock;

       STS_Obj     *sts;           /* pointer to STS_Obj */

    } SWI_Obj;

    3ECB44      SWI_post, SWI_F_post:

    3ECB44 8D3F8601    MOVL       XAR0,#0x3F8601

    3ECB46 28A9C001    MOV        @AL,#0xC001

    3ECB48 2DC0        MOV        T,*+XAR0[0]

    3ECB49 C0AC        AND        @T,AL

    3ECB4A 70AC        XOR        AL,@T

    3ECB4B 6003        SB         3,NEQ

    3ECB4C 767ECC5B    LCR        logPost

    3ECB4E 7608        PUSH       ST1

    3ECB4F 3B30        SETC       INTM,DBGM

    3ECB50 92C4        MOV        AL,*+XAR4[0]

    3ECB51 6127        SB         39,EQ

    3ECB52 2BC4        MOV        *+XAR4[0],#0

    3ECB53 8D0097CA    MOVL       XAR0,#0x0097CA

    3ECB55 08C00001    ADD        *+XAR0[0],#1

    3ECB57 5EC0        MOV        AR6,*+XAR0[0]

    3ECB58 2930        CLRC       INTM,DBGM

    3ECB59 8D3F8601    MOVL       XAR0,#0x3F8601

    3ECB5B 28A9C020    MOV        @AL,#0xC020

    3ECB5D 2DC0        MOV        T,*+XAR0[0]

    3ECB5E C0AC        AND        @T,AL

    3ECB5F 70AC        XOR        AL,@T

    3ECB60 6003        SB         3,NEQ

    3ECB61 767ECC78    LCR        stsPost

    3ECB63 3B30        SETC       INTM,DBGM

    3ECB64 8ED4        MOVL       XAR0,*+XAR4[2]

    3ECB65 DC06        ADDB       XAR4,#6

    3ECB66 83C0        MOVL       XAR5,*+XAR0[0]

    3ECB67 A8C5        MOVL       *+XAR5[0],XAR4

    3ECB68 A8C0        MOVL       *+XAR0[0],XAR4

    3ECB69 DC86        SUBB       XAR4,#6

    3ECB6A 8D0097C9    MOVL       XAR0,#0x0097C9

    3ECB6C 92E4        MOV        AL,*+XAR4[4]

    3ECB6D 98C0        OR         *+XAR0[0],AL

    3ECB6E 000E0007    BANZ       7,AR6--

    3ECB70 8F4097C8    MOVL       XAR5,#0x0097C8

    3ECB72 92C5        MOV        AL,*+XAR5[0]

    3ECB73 9EC0        SUB        AL,*+XAR0[0]

    3ECB74 6506        SB         6,LEQ

    3ECB75 8D0097CA    MOVL       XAR0,#0x0097CA

    3ECB77 7EC0        MOV        *+XAR0[0],AR6

    3ECB78 7600        POP        ST1

    3ECB79 0006        LRETR      

    3ECB7A FE81        SUBB       SP,#1

    Thanks,
    Frank

  • Frank,
    right after the two bolded instructions, there is another one that clears the lock. Those three statements together ensure that if the same SWI object is posted twice, and the first instance is still being processed, the second one is ignored. The lock is set to -1 by the SWI dispatcher (SWI_F_run function) right before calling the function assigned to the SWI object (PRD_F_swi in this case).
    Can you see any 'PRD_swi begin' entries in the log without matching 'PRD_swi end' entries before PRD_swi stops running? Or any subsequent 'PRD_swi post' entries? Any increase in time between 'PRD_swi post' and 'PRD_swi begin'?
    Some of the RTA related code runs in the context of the SWI dispatcher. I can't imagine that extra code would make much difference, but can you try turning off everything else other than Log?

    Anyway, I don't think I'll be able to figure this out just by staring at our code. I would probably have to look at your code and try to replicate the problem. Can you post your project, or send it to me? You can click on my name and go through the Connect link on the right to send me messages.