After enabling Tickless Idle on a NXP Kinetis M0, we are now seeing asserts from FreeRTOS when we set a breakpoint (it doesn't even have to hit it).If we don't set any breakpoints, it doesn't assert. Tickless Idle Mode. The solution to this is the ‘Tickless Idle Mode’, added in FreeRTOS V7.4.0. It calculates the idle time and re-configures the SysTick: Calculates the new timer value. So such as in my above example, instead of firing the timer every 10 ms until it reaches 1000 ms, it will try to set it up that it only fires once after.
Joseph - 2013-11-09
I am currently using atmel's atmsa4ls4a chip and using the AST instead of the SysTick for my rtos ticks. I was able to get this to run smoothly but am now having trouble with the vPortSuppressTicksAndSleep function. I use the freetos sample code as a baseline of my implementation.
In my implementation I put the system into retention mode and then let the ast wake up the system. When I try to disable the ast and enable the ast in the PortSupressTicksandSleep function the system hangs for some reason. I have stopped trying that and just set the counter value while the ast is running. This causes the system to hang after working for a little bit.
In my implementation I put the system into retention mode and then let the ast wake up the system. When I try to disable the ast and enable the ast in the PortSupressTicksandSleep function the system hangs for some reason. I have stopped trying that and just set the counter value while the ast is running. This causes the system to hang after working for a little bit.
Here is my implementation:
/ The tick interrupt handler. This is always the same other than the part that
clears the interrupt, which is specific to the clock being used to generate the
tick. /
void AST_ALARM_Handler(void)
{
/ Protect incrementing the tick with an interrupt safe critical section. /
( void ) portSET_INTERRUPT_MASK_FROM_ISR();
{
if( xTaskIncrementTick() != pdFALSE )
{
portNVIC_INT_CTRL_REG = portNVIC_PENDSVSET_BIT;
}
/ The tick interrupt handler. This is always the same other than the part that
clears the interrupt, which is specific to the clock being used to generate the
tick. /
void AST_ALARM_Handler(void)
{
/ Protect incrementing the tick with an interrupt safe critical section. /
( void ) portSET_INTERRUPT_MASK_FROM_ISR();
{
if( xTaskIncrementTick() != pdFALSE )
{
portNVIC_INT_CTRL_REG = portNVIC_PENDSVSET_BIT;
}
}
/-----------------------------------------------------------/
/-----------------------------------------------------------/
/ Override the default definition of vPortSetupTimerInterrupt() that is weakly
defined in the FreeRTOS Cortex-M3 port layer with a version that configures the
asynchronous timer (AST) to generate the tick interrupt. /
void vPortSetupTimerInterrupt( void )
{
struct ast_config ast_conf;
defined in the FreeRTOS Cortex-M3 port layer with a version that configures the
asynchronous timer (AST) to generate the tick interrupt. /
void vPortSetupTimerInterrupt( void )
{
struct ast_config ast_conf;
Freertos Tickless Idle Test
}
Freertos Tickless Idle Problems
/-----------------------------------------------------------/
/ Override the default definition of vPortSuppressTicksAndSleep() that is weakly
defined in the FreeRTOS Cortex-M3 port layet with a version that manages the
asynchronous timer (AST), as the tick is generated from the low power AST and
not the SysTick as would normally be the case on a Cortex-M. /
void vPortSuppressTicksAndSleep( portTickType xExpectedIdleTime )
{
uint32_t ulAlarmValue, ulCompleteTickPeriods;
eSleepModeStatus eSleepAction;
portTickType xModifiableIdleTime;
enum sleepmgr_mode xSleepMode;
defined in the FreeRTOS Cortex-M3 port layet with a version that manages the
asynchronous timer (AST), as the tick is generated from the low power AST and
not the SysTick as would normally be the case on a Cortex-M. /
void vPortSuppressTicksAndSleep( portTickType xExpectedIdleTime )
{
uint32_t ulAlarmValue, ulCompleteTickPeriods;
eSleepModeStatus eSleepAction;
portTickType xModifiableIdleTime;
enum sleepmgr_mode xSleepMode;
Freertos Tickless Idle Service
}