Startup failure as timers are enabled (MPU)

Hello, I have the MPU enabled (LPC1788), and just added timer.c and followed the instructions as to how to enable timers.
Unfortunately, as the scheduler tries to start the first stack, I get an immediate “unstacking error” from the MPU.
Any thoughts…? Thanks in advance

Startup failure as timers are enabled (MPU)

Can it be related to the kernel using CreateTask rather than CreateTaskRestricted…?

Startup failure as timers are enabled (MPU)

I have to admit having not tried it, but I have had a quick look now. Could you try changing the line in prvSampleTimeNow() from
static portTickType xLastTime = ( portTickType ) 0U;
to
PRIVILEGED_DATA static portTickType xLastTime = ( portTickType ) 0U;
and report back.  Thanks. Regards.

Startup failure as timers are enabled (MPU)

I added “|portPRIVILEGE_BIT” at the creation of the timers task and that seems to help!

Startup failure as timers are enabled (MPU)

You beet me to it!  I was just about to say when I read your post (that crossed with mine) that you need to set that in your definition of configTIMER_TASK_PRIORITY.  The suggested change made in my previous post should be made too. I think I will change the core code so the ORing with portPRIVILEGE_BIT is done by the kernel too – just like it is for the idle task. Regards.

Startup failure as timers are enabled (MPU)

Thanks.