cijay1337 wrote on Monday, October 12, 2015:
Hello,
I am an electrical engineering student and i am currently implementing an
application using FreeRTOS v8.2.2
I want to report a Bug that appears in my projects and the Demo
FreeRTOS\Demo\RL78_RL78G13_Promo_Board_IAR, when using the software
timer functionality.
Currently I use the YRDKRL78-G13 REV2.1 for testing FreeRTOS
and other applications in combination with the IAR EW v1.2 for the RL78 series.
( If a portable layer exists for IAR EW v2.1 RL78, please notify me )
I noticed an error while testing the Demo application on my YRDKRL78-G13.
I left the Demo project unchanged, just the LED used in the project changed to
P63 which is LED 3 on my board. I set the Debugger to TK. The Demo seems to be
working fine on the first impression, but if you leave the
Demo running the LED will stop to toggle after some time approx. 1 minute.
Debugging the project revealed that the software timer stops working after the
first xTickCount overflow. I set a breakpoint into the TimerTask after the
Overflow the Timertask will not be called.
Further debugging reveals that the TimerTask gets to block indefinitely and is
moved into the suspended list and remains there the entire time.
This behavior was replicable in the release version and in new Projects that
used the Software Timer and the vSuspendTask functionality.
I found a quick dirty solution by simply changeing one line in the function
vTaskPlaceOnEventListRestricted
I inserted 0 instead of the xWaitIndefinitely == pdTRUE disabling the part
with the insertion to the suspended list
#if( INCLUDE_vTaskSuspend == 1 )
{
/* xWaitIndefinitely == pdTRUE set to 0 */
if( 0 )
{
/* Add the task to the suspended task list instead of a delayed
task list to ensure the task is not woken by a timing event. It
will block indefinitely. */
traceTASK_DELAY_SUSPEND( pxCurrentTCB );
vListInsertEnd( &xSuspendedTaskList, &( pxCurrentTCB->xGenericListItem ) );
}
else
{
/* Calculate the time at which the task should be woken if the
event does not occur. This may overflow but this doesn't
matter. */
xTimeToWake = xTickCount + xTicksToWait;
traceTASK_DELAY_UNTIL();
prvAddCurrentTaskToDelayedList( xTimeToWake );
}
}
#else
The modified version works fine. The LED keeps toggling even after the first
overflow.
I hope the behavior is replicable and if someone has a clue on where the
problem might be, please inform me.
Best regards from germany,
Patrick