Quality RTOS & Embedded Software

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


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 ]    [ 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