FreeRTOS Support Archive

The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.

This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the "Live FreeRTOS Forum" link to reply to a post, or start a new support thread.

FreeRTOS No Tasks Running - Only OS Timer

We are using a Renesas RX631 MCU and after varying amounts of time our application codes stops running. When the application code stops running, we have verified that none of the tasks get serviced and it appears as though the software is “stuck somewhere” within the freeRTOS source.

Interestingly enough, we do have an OS Timer running as well which does get serviced even though the tasks are not. We have verified that the HW timer used for the OS Tick is still functioning properly when the code stops running. We are currently using freeRTOS version 7.0.1.

Has anyone experienced this issue or have any clues?

Thanks in advance! Stan

RE: FreeRTOS No Tasks Running - Only OS Timer

That is often a symptom of interrupt priorities being wrong. Are you calling any FreeRTOS API functions from interrupts that have a priority above configMAX_SYSCALL_INTERRUPT_PRIORITY (defined in FreeRTOSConfig.h)? Are you calling any FreeRTOS API functions that don't end in "FromISR" from any interrupt?

Also check for the normal stack overflow issues using configCHECK_FOR_STACK_OVERFLOW.

See http://www.freertos.org/FAQHelp.html for more common sources of problems.

Software timers are themselves executed from the timer daemon task - so tasks are still being scheduled.

Regards.

RE: FreeRTOS No Tasks Running - Only OS Timer

Our code currently utilizes 24 interrupts. Of which, the only two that make calls into freeRTOS are the USBI0_INTERRUPT_HANDLER (which only gets called when a USB drive is inserted) and the vTickISR interrupt which is part of the sample source code provided in the freeRTOS package for the RX600. The code for vTickISR is as follows:

RE: FreeRTOS No Tasks Running - Only OS Timer

RE: FreeRTOS No Tasks Running - Only OS Timer

“When the application code stops running, we have verified that none of the tasks get serviced”

How have you verified that? Have you put break points in the tasks, or looked at which tasks are being selected by the scheduler, or something else?

“and it appears as though the software is “stuck somewhere” within the freeRTOS source.”

When it stops running, and you break the debugger, which line of code is being executed? Is it always the same line? Are interrupts enabled (look in the registers in the debugger)? Is the scheduler suspended (what is the value of uxSchedulerSuspended in tasks.c)?

“Interestingly enough, we do have an OS Timer running as well which does get serviced even though the tasks are not.”

I presume you mean a software timer? If so, that is actually running in a task. What is the priority of the timer service task (what value does configTIMER_TASK_PRIORITY have in FreeRTOSConfig.h) compared to the other tasks in the system?

Regards.

RE: FreeRTOS No Tasks Running - Only OS Timer

2. We don't remember which line of code was being executed by the RTOS - I will let you know if I get this failure mode again. I will also check to see if the interrupts are enabled and if the scheduler is suspended.

/* The interrupt priority used by the kernel itself for the tick interrupt and the pended interrupt. This would normally be the lowest priority. */#define configKERNEL_INTERRUPT_PRIORITY 1

/* The maximum interrupt priority from which FreeRTOS API calls can be made.Interrupts that use a priority above this will not be effected by anything the kernel is doing. */#define configMAX_SYSCALL_INTERRUPT_PRIORITY 4

RE: FreeRTOS No Tasks Running - Only OS Timer

So your timer task priority is the highest possible priority. If the timer task is still running, as you say, then it could be that one of the lower priority tasks has got into a mode where it never blocks and is starving all tasks that have a lower priority than it from ever running but it itself is still preempted by higher priority tasks such as the timer task.

40 is a really big number for the number of priorities. Just commenting, maybe you need that, but most of my code has maybe 10 at most. Remember that tasks can share the same priority.

Copyright (C) 2004-2010 Richard Barry. Copyright (C) 2010-2015 Real Time Engineers Ltd.
Any and all data, files, source code, html content and documentation included in the FreeRTOSTM distribution or available on this site are the exclusive property of Real Time Engineers Ltd..
See the files license.txt (included in the distribution) and this copyright notice for more information. FreeRTOSTM and FreeRTOS.orgTM are trade marks of Real Time Engineers Ltd.