I have a project with one task consisting only of vTaskDelay(5000);
When I compile the project with medium and high optimization options it works fine. When I switch to low it goes to Hard Fault Interrupt. When I single step, it runs to vPortStartFirstTask() and gets into:
vPortSVCHandler;
ldr r3, =pxCurrentTCB
ldr r1, [r3]
ldr r0, [r1]
ldmia r0!, {r4-r11}
msr psp, r0
mov r0, #0
msr basepri, r0
orr r14, r14, #13
bx r14
On exit from it my debugger shows:**Usage fault: Attempt to use a coprocessor instruction! **
Of course I tried to vary stack and heap sizes but it did not clarify the situation.
Could anybody give a clue, what did the optimization option change?