cablecoder wrote on Friday, February 24, 2017:
I am using FreeRTOS on a Cortex M4 platform (specifically an EFM32 from Silicon Labs). I’m doing a bunch of setup prior to starting the operating system; allocating things, creating the semaphores I’ll need, etc. These make calls to things like pvPortMalloc and xSemaphoreCreateBinary. I’ve noticed that these calls will alter the BASEPRI register to a value of 0xA000. This masks off a bunch of interrupts, and essentially makes it so that the system won’t trigger interrupts that aren’t the highest priority until freeRTOS has started the scheduler.
I can get by with calling malloc instead of pvPortMalloc when freeRTOS isn’t running, but I need to call xSemaphoreCreateBinary. Can someone tell me how to properly allow this call to be made prior to the scheduler being started, such that I can still have interrupts working? I’ve tried just calling “set_BASEPRIO(0)”, but this causes me to hit an Assert once the scheduler is running and an interrupt fires. Even if I manually call “set_BASEPRIO(191)” before starting the scheduler.