This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

application stuck in rt_put_prio

/* Search for an entry in the list */
  while ((p_CB2 != NULL) && (prio <= p_CB2->prio)) {
    p_CB = (P_XCB)p_CB2;
    p_CB2 = p_CB2->p_lnk; <--- sometimes stuck here
  }
  /* Entry found, insert the task into the list */
  p_task->p_lnk = p_CB2;
  p_CB->p_lnk = p_task;
  if (sem_mbx) {
    if (p_CB2 != NULL) {
      p_CB2->p_rlnk = p_task;
    }
    p_task->p_rlnk = (P_TCB)p_CB; <----stuck here
  }
  else {
    p_task->p_rlnk = NULL;
  }
}

I have an issue where about after an 2 - 3 hours of running the CMSIS locks up in the rt_list.c
very rarely but sometimes the processor hard faults and doing a stack trace points to the same rt_list.c function rt_put_prio.

Am I encountering a deadlock?
The only other thing I can think of is one of my functions is changing the memory this function is using to manage the priority list?

This is on a cortex M0+ processor with 9 total threads
I have configured all the threads with the same priority. I am using two mailbox's
My round robin timer is 10 ticks, any other timer and the CMSIS only runs for 10 seconds and then locks up. Tried 5 ticks and 10 ticks.

Any help would be greatly appreciated.

Parents Reply Children
  • Ron Wedge thanks for the reply. I dont believe that will work as this is a Cortex M0+ processor and doesn't have the hardware or the OS level required.
    We are adding tracing code into the OS currently and also going to try a Level 1 Migration - Upgrade to RTX5 on API v1 for the OS and figure out if it can resolve the threading issue we are seeing.

  • I wanted to follow up with the solution
    So the solution to my problem was as follows. It looks like the priority for the sys tick timer was changed.
    After lowered the priority of the SysTick interrupt the OS worked correctly.

    SCB_SHPR3 = (uint32_t)((SCB_SHPR3 & (uint32_t)~(uint32_t)( SCB_SHPR3_PRI_15(0x01) )) | (uint32_t)( SCB_SHPR3_PRI_15(0x02) ));

    Commented this out and left the priority to b11 it was b10.

    Hope this helps.