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




Loading

Interrupts enabled during system init

Posted by jdabbs003 on September 4, 2009
Hello. Our system boots, sets up the hardware, creates FreeRTOS tasks and queues, then starts the scheduler. The intent is that interrupts are disabled until the tasks start. However, FreeRTOS is enabling interrupts almost immediately because of the way critical sections work.

There are several ways to fix this. But, is there a "right" way?

RE: Interrupts enabled during system init

Posted by Richard on September 4, 2009
See my answer to the last time you posted the exact same question.

Regards.

RE: Interrupts enabled during system init

Posted by jdabbs003 on September 4, 2009
I have no idea how I managed to post this twice. This is a port, but I used the MSP430 as a starting point. The way that critical section works, it disables interrupts, then increments a counter when you enter it. When you leave it, it decrements the counter and re-enables interrupts when it gets to zero. The end result is that if you enter the critical section with interrupts disabled, you leave the critical section with interrupts enabled. During system boot, this is exactly what happens when I create the 1st message queue.

RE: Interrupts enabled during system init

Posted by Richard on September 4, 2009
The critical nesting count in the official MSP430 ports is stored in a variable called usCriticalNesting which is initialised in port.c to 10. This means during initialisation critical sections will never see the nesting count reach zero, and once interrupts have been disabled they will remain disabled until the scheduler is started (at which point usCriticalNesting is set to 0).

Regards.


[ 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