FreeRtos function vPortEnterCritical Assert stuck，
FreeRTOSConfig.h configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY Set 1
BASEPRI Register VALUE
this moment VECTACTIVE Register Value 3
freeRtos critical Function does not work
Tell me what should i do？
Hi @runningostrich ,
I highly recommend to get familiar with the ARM Cortex interrupt system in combination with FreeRTOS, an article series I wrote a while back:
The assertion you hit is because you are calling vPortEnterCritical() from an interrupt context which is not allowed, hence the assertion. You need to check the call chain in the debugger to see from where this is coming from. BASEPRI/configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY is used for something different: separating the interrupts into 'RTOS-ones' from 'non-RTOS' ones. I would question why you would set the BASEPRI to 1 as this does not leave you much moving space for interrupt prioritites, but this is yet another discussion. For the complete picture, see above articles.
I hope this helps,
Hi @runningostrich :
Please note that the BASEPRI will be configured to configMAX_SYSCALL_INTERRUPT_PRIORITY only if task enter into critical section. and BASEPRI will be reconfigured to 0 if task exit critical section.
You can trace the BASEPRI register after below line is hit.