Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Real time embedded FreeRTOS mailing list 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem TCP & FAT Training


MSP430X port: suspended scheduler prevents yielding from ISRs during tickless sleep

Posted by peppet on October 31, 2013

I'm experimenting with tickless mode on IAR/MSP430X port. I configured FreeRTOS to use that mode and provided my vApplicationSleep implementation. Everything seem to work but I've noticed that tasks actions unblocked by ISRs (which always yield too) happening during tickless sleep are delayed. Looking at the FreeRTOS code, I'd say the cause is the following: the scheduler is suspended right before sleeping, so any yield is held pending during tickless sleep, unless the ISR explicitly clears LPM flags on the stacked status register before returning, which isn't needed in "ticked" sleep. Is this an intended behavior? Best Regards, Peppe

MSP430X port: suspended scheduler prevents yielding from ISRs during tickless sleep

Posted by richardbarry on November 3, 2013

Sorry not to reply before - I only noticed your post while taking the archive backup.

There is no official tickless example on the MSP430X, so I can only comment on the intended behaviour of the generic parts of the code.

The scheduler is suspended before the tickless sleep to ensure there are no race conditions when the sleep exits, and to ensure any power specific CPU context can be restored before tasks start to execute again.

The sleep mode chosen should not prevent interrupts from executing, and the interrupt should bring the CPU out of its sleep mode. The interrupt can request a context switch, but the context switch will not happen because the scheduler is suspended. When the CPU starts running again (after exiting low power mode) it will do whatever is necessary to correct the tick count, then unsuspend the scheduler. At that point any pending context switches will occur.


MSP430X port: suspended scheduler prevents yielding from ISRs during tickless sleep

Posted by peppet on November 8, 2013

Thank you for your prompt answer (and for FreeRTOS of course).

Therefore I will modify the existing application code, making sure that any give/send action from ISR and explicit yield is always followed by the exit from low power mode (which would cause an unnecessary cycle of the idle task in normal 'ticked' mode).



[ Back to the top ]    [ About FreeRTOS ]    [ Sitemap ]    [ ]

Copyright (C) 2004-2010 Richard Barry. Copyright (C) 2010-2016 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.

Latest News:

FreeRTOS V9.0.0 is now available for download.

Free TCP/IP and file system demos for the RTOS

Sponsored Links

⇓ Now With No Code Size Limit! ⇓
⇑ Free Download Without Registering ⇑

FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Renesas Electronics Gold Alliance RTOS Partner.jpg

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Atmel RTOS partner supporting ARM Cortex-M3 and AVR32 microcontrollers

STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Xilinx Microblaze and Zynq partner

Silicon Labs low power RTOS partner

Altera RTOS partner for Nios II and Cortex-A9 SoC

Freescale Alliance RTOS Member supporting ARM and ColdFire microcontrollers

Infineon ARM Cortex-M microcontrollers

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

Cypress RTOS partner supporting ARM Cortex-M3

Fujitsu RTOS partner supporting ARM Cortex-M3 and FM3

Microsemi (previously Actel) RTOS partner supporting ARM Cortex-M3

Atollic Partner

IAR Partner

Keil ARM Partner

Embedded Artists