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.

Detecting An External Exception on C6746

Hello everyone,

My application runs for a while,then I get this error message:

    [00:51:19]A0=0x1 A1=0x0
    [00:51:19]A2=0x1 A3=0xc1413d5c
    [00:51:19]A4=0xc14278f2 A5=0xc1427af0
    [00:51:19]A6=0x28cfc64 A7=0xfe5402ac
    [00:51:19]A8=0x3f A9=0xc1413ce4
    [00:51:19]A10=0x1 A11=0xc1413d5c
    [00:51:19]A12=0xc1413c60 A13=0x1
    [00:51:19]A14=0xc1427af4 A15=0x0
    [00:51:19]A16=0x0 A17=0x20
    [00:51:19]A18=0xc0a0cee8 A19=0x0
    [00:51:19]A20=0x8 A21=0x0
    [00:51:19]A22=0xfd4beb00 A23=0xf9f2be88
    [00:51:19]A24=0xfa97d600 A25=0xffffe5db
    [00:51:19]A26=0xccd46a A27=0x2e0a
    [00:51:19]A28=0xffa97d60 A29=0xfffffa98
    [00:51:19]A30=0xfee57781 A31=0x1
    [00:51:19]B0=0x0 B1=0xc13b1760
    [00:51:19]B2=0x0 B3=0xc13fc664
    [00:51:19]B4=0x2ec B5=0xc1427a8c
    [00:51:19]B6=0xc13f6300 B7=0x14000102
    [00:51:19]B8=0x0 B9=0x0
    [00:51:19]B10=0xc1413d80 B11=0x55c03dc
    [00:51:19]B12=0x55c03dc B13=0x37e71f1
    [00:51:19]B14=0xc1428ba0 B15=0xc13b1698
    [00:51:19]B16=0x7fcfbebd B17=0x5352535c
    [00:51:19]B18=0x1e13 B19=0xffffc3da
    [00:51:19]B20=0x0 B21=0xffffe530
    [00:51:19]B22=0x20f B23=0x1f
    [00:51:19]B24=0xfe718367 B25=0xff3f926e
    [00:51:19]B26=0xff7f0926 B27=0xa3848a
    [00:51:19]B28=0x12195c B29=0x0
    [00:51:19]B30=0x70 B31=0x53
    [00:51:19]NTSR=0x1820f
    [00:51:19]ITSR=0x20f
    [00:51:19]IRP=0xc13c6d94
    [00:51:19]SSR=0x1f
    [00:51:19]AMR=0x0
    [00:51:19]RILC=0x8
    [00:51:19]ILC=0x0
    [00:51:19]Exception at 0xc13f6454
    [00:51:19]EFR=0x40000000 NRP=0xc13f6454

I trace the exception addr(0xc13f6454). I found the addr point to line 329 of Clock.c(Clock_workFunc function, bios 6.45.00.20).
    285 Void Clock_workFunc(UArg arg0, UArg arg1)
    286 {
    287     Queue_Elem *elem;
    288     UInt hwiKey, count;
    289     UInt32 time, compare;
    290     Clock_Object *obj;
    291     Queue_Handle clockQ;
    292
    293     hwiKey = Hwi_disable();
    294     time = Clock_module->ticks;
    295     count = Clock_module->swiCount;
    296     Clock_module->swiCount = 0;
    297     Hwi_restore(hwiKey);
    298
    299     /* Log when count > 1, meaning Clock_swi is delayed */
    300     if (count > 1) {
    301         Log_write1(Clock_LW_delayed, (UArg)count);
    302     }
    303
    304     compare = time - count;
    305
    306     /*
    307     * Here count can be zero. When Clock_tick() runs it increments
    308     * swiCount and posts the Clock_workFunc. In Clock_workFunc we
    309     * get the value of swiCount atomically. Before we read swiCount, an
    310     * interrupt could occur, Clock_tick() will post the swi again.
    311     * That post is unnecessary as we are getting ready to process that
    312     * tick. The next time this swi runs the count will be zero.
    313     */
    314
    315     while (count) {
    316
    317         compare = compare + 1;
    318         count = count - 1;
    319
    320         /* Traverse clock queue */
    321
    322        clockQ = Clock_Module_State_clockQ();
    323        elem = Queue_head(clockQ);
    324
    325        while (elem != (Queue_Elem *)(clockQ)) {
    326               obj = (Clock_Object *)elem;
    327               elem = Queue_next(elem);
    328               /* if event has timed out */
    329               if ((obj->active == TRUE) && (obj->currTimeout == compare)) {
    330
    331                      if (obj->period == 0) { /* oneshot? */
    332                             /* mark object idle */
    333                             obj->active = FALSE;
    334                      }
    335                      else { /* periodic */
    336                             /* refresh timeout */
    337                             obj->currTimeout += obj->period;
    338                      }
    339
    340                      Log_write2(Clock_LM_begin, (UArg)obj, (UArg)obj->fxn);
    341
    342                      /* call handler */
    343                      obj->fxn(obj->arg);
    344               }
    345         }
    346     }
    347}


My question:
What can cause my exception? Cause the obj is a null pointer, is it a bug of bios? Or my unsuitable task stacks size or something else make the obj be a null pointer in certain situations?

Every suggestion will be appreciated.

Best regards

Buga

  • Hi Buga,

    In general, there are lot of possibilities for an exception to occur.

    To narrow down, just check how many times your application hits this line. At the first time, when it hits, it gives exception or when it hits repeatedly, t gives exception??

    And also, have a check whether it consistently gives exception on the same line every time your application crashes.

    And also I could see that there is a type casting occuring in the below line from type, "Queue_Elem" to "Clock_Object" . I presume both will be structures. Do a comparison too whether it gets downsized ot upsized while type casting....

    obj = (Clock_Object *)elem;

    When your application is running, just keep checking/watching what you are getting in the variable, "elem" and as well the output of "Queue_head(clockQ);"
  • Dear Buga,
    I would like to suggest to post your questions in e2e BIOS forum.
    e2e.ti.com/.../355

    Moved your post to TI RTOS forum where they handle this type of posts in much better way.

    Thank you.