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

The program got struck in the forever loop of _mutex_initialize (OS_ID *mutex)

Hi all,

I am using RL-ARM with MCB1700. I hav 10 tasks running with priorities 2 to 11.
I am using file system with SD Memory.

But when I run the code it is getting stuck in the forever loop of _mutex_initialize (OS_ID *mutex) function found in RTX_lib.c as shown below.

int _mutex_initialize (OS_ID *mutex) {
  /* Allocate and initialize a system mutex. */

  if (nr_mutex >= OS_MUTEXCNT) {
    /* If you are here, you need to increase the number OS_MUTEXCNT. */
    for (;;);
  }
  *mutex = &std_libmutex[nr_mutex++];
  mutex_init (*mutex);
  return (1);
}

It is asked to increase the number OS_MUTEXCNT. But Iam not finding where OS_MUTEXCNT is defined.

Please suggest.

Withe thanks and Regards
Lingaraju

Parents Reply Children
  • Sorry for joining late.

    As I have already discussed I have 10 tasks each with different priority.

    The tasks which are using more stack are created using user stack option with seperate declared for each task.

    Before I get into this I am facing problems with interrupt.
    What the code optimization levels do with the interrupts.

    I have configured and enabled for EINT0, Timer1 and USB interrupts.
    For USB I am using the RTX_HID code. All other peripherals I hav initialised before I call the os_sys_init().
    Whatevr the optimization level selected,The USB interrupt is not working unless I call the NVIC_enalbe_irq(USB_IRq) before I call the os_sys_init(). In this way it is working but going to hard fault with Bus fault escalation from rt_get_first function.

    when optimization levels 1 or 2 is selected, The Timer1 interrupt is not working. The interrupt is coming. The control is not coming out of the IRQ handler. But with levels 0 and 3 Timer1 interrupt works properly

    Please suggest.

    regards
    Lingaraju