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


lpc23xx FreeRTOS and sleep or power down mode

Posted by Ben on August 25, 2010
I am trying to put an LPC2368 into power down or sleep mode.
I can get the chip to sleep and wakeup with out any problems, however I sometimes get data aborts after waking up.

Now I just want to check what I am doing with FreeRTOS is correct.

I have several tasks running. When it is time to sleep most of the tasks block on a semaphore.

So when going to sleep, I call taskENTER_CRITICAL(), stop the RTOS timer and put the chip into power down mode.

Upon waking I start the RTOS timer and call taskEXIT_CRITICAL().

Can anyone see any problems with this ?

Using GCC to compile.


RE: lpc23xx FreeRTOS and sleep or power down mode

Posted by Richard on August 26, 2010
Where are the ENTER/EXIT critical functions called from, and is it as part of the same sequential code?

I don't have experience of sleep modes on LPC2000's I'm sorry to say, so assistance will be limited if there is some quirk of the architecture that could cause a problem, but I would suggest writing a test program without FreeRTOS included to see if it is kernel related or not. For example, have a program that sets up a tick interrupt that does nothing much (maybe toggle an LED every 100ms), then execute code to disable interrupts and put into sleep mode - then when waking up enable interrupts and see if the LED starts flashing again.


RE: lpc23xx FreeRTOS and sleep or power down mode

Posted by Ben on August 31, 2010
the Enter- Sleep - Exit are all inside a function called from one of the running tasks.

I am re-checking all the code paths inside the Enter/Exit calls to make sure no FreeRTOS calls are made ( I don't think any are).

I think my problems are timing/interrupt based with some memory corruption, but I am not 100% sure on that. Most of the time everything resumes as normal.

Fairly sure it is not a stack issue. I have plenty of free RAM and so have increased stacks sizes quite a bit. vTaskList() reports plenty of free space for the tasks.

I am assuming stopping the RTOS timer would in effect halt the RTOS and as long as I make no api calls that would result in a task switch, I would be pretty safe.

If you had to suspend the RTOS to put a chip to sleep how would you go about it ?

[ 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