Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem


Loading

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.

Regards.


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).

Regards,

Peppe


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


Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

NXP tweet showing LPC5500 (ARMv8-M Cortex-M33) running FreeRTOS.

Meet Richard Barry and learn about running FreeRTOS on RISC-V at FOSDEM 2019

Version 10.1.1 of the FreeRTOS kernel is available for immediate download. MIT licensed.

View a recording of the "OTA Update Security and Reliability" webinar, presented by TI and AWS.


Careers

FreeRTOS and other embedded software careers at AWS.



FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Espressif ESP32

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Renesas

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

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

OpenRTOS and SafeRTOS

Xilinx Microblaze and Zynq partner