Interrupts enabled during system init

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?

Interrupts enabled during system init

See my answer to the last time you posted the exact same question. Regards.

Interrupts enabled during system init

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.

Interrupts enabled during system init

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.