Some day's ago, i worked on RT1051DVL6A with previous SDK (SDK2.3.0EVK-MIMXRT1050), configUSETICKLESSIDLE feature works. My project source code has the same phenomenon, so i verified on NXP SDK source code, unfortunately, it also has the same issue.
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.
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; }
/ 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;
/ 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;
}
Matt - 2016-05-06
Trying to get the Tickless Idle working on my project. Using a Nucleo64 l476 board, used STMCubeMx to set the project up and had it install FreeRTOS.
DiskCopy gives you fast, effective and incredibly simple ways to clone the whole disk within your system and data. So if anything unexpected happens, you can get the data back quickly. Disk to Disk copy: to copy an appointed disk. If users want to use this module, they should own 2 hard disks, and then copy data in source hard disk to target hard disk. After copy, original data on target partition will be lost (please backup important data on target disk before using this free drive copy software to copy disk). EaseUS Disk Copy software is an easy-to-use disk clone software for home user. Regardless of your operating system, this safe disk copy/clone software can safely migrate your hard disk to another one and ensure 100% identical to the original one. EaseUS Disk Copy Home is a disk/partition clone software for home users only. Regardless of your operating system, file system and partition scheme, through creating a bootable CD it can sector-by. Disk copy free software.
First problem/question: How to get the code to start. Finally decided to suspend my two tasks, then put code in the interrupt to resume the tasks. That did not work and when I stepped through the freertos.c code I discovered that it did not work because it was determining that it could only sleep for 1 tick. Why 1 tick, because of the default idle task created by Cube:
So I decided to also suspend the idle task - don't know if that's a good idea, but it works.
I have a break point in PreSleepProcessing, and I'm finding that it is always called with ulExpectedIdleTime set to 209. I don't understand why, all the tasks are suspended, shouldn't it be infinate?
Freertos Tickless Idle Mode
Also: I want to eventually put in code to change the CPU clock so I can enter stop mode. But I'm unsure how FreeRTOS is waking itself up and how changing the CPU clock would affect that.
So, how do I figure out why it is sleeping for 209 ticks? should I change the default idle task? is it ok to suspend the default idle task? could I use a vTaskSuspendAll? will changing the CPU clock mess things up?
Thanks so much - first time posting to this board! -Matt