RL-ARM User's Guide

Error Function

Some system error conditions can be detected during runtime. If RTX kernel detects a runtime error, it calls the os_error() runtime error function.

void os_error (U32 err_code) {
  /* This function is called when a runtime error is detected. */
  OS_TID err_task;

  switch (err_code) {
    case OS_ERR_STK_OVF:
      /* Identify the task with stack overflow. */
      err_task = isr_tsk_get();
      break;
    case OS_ERR_FIFO_OVF:
      break;
    case OS_ERR_MBX_OVF:
      break;
  }
  for (;;);
}

The error code is passed to this function as a parameter err_code:

Error CodeDescription
OS_ERR_STK_OVFThe stack checking has detected a stack overflow for the currently running task.
OS_ERR_FIFO_OVFThe ISR FIFO Queue buffer overflow is detected.
OS_ERR_MBX_OVFThe mailbox overflow is detected for isr_mbx_send() function.

The runtime error function must contain an infinite loop to prevent further program execution. You can use an emulator to step over infinite loop and trace into the code introducing a runtime error. For the overflow errors this means you need to increase the size of the object causing an overflow.