Help K64FN1MDVLL12 BASEPRI Register Function does not work

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Help K64FN1MDVLL12 BASEPRI Register Function does not work

878 次查看
runningostrich
Contributor I

FreeRtos function vPortEnterCritical Assert stuck,

runningostrich_0-1631503459815.png

FreeRTOSConfig.h configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY Set 1

runningostrich_1-1631503668497.png

runningostrich_2-1631503778836.png

BASEPRI Register VALUE 

runningostrich_3-1631503879438.png

this moment VECTACTIVE Register Value 3

Why?

freeRtos critical  Function does not work

Tell me what should i do?

 

0 项奖励
2 回复数

797 次查看
ErichStyger
Senior Contributor V

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:

https://mcuoneclipse.com/2016/08/14/arm-cortex-m-interrupts-and-freertos-part-1/

https://mcuoneclipse.com/2016/08/20/arm-cortex-m-interrupts-and-freertos-part-2/

https://mcuoneclipse.com/2016/08/28/arm-cortex-m-interrupts-and-freertos-part-3/

 

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,

Erich

822 次查看
danielchen
NXP TechSupport
NXP TechSupport

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.

taskENTER_CRITICAL();

 

Regards

Daniel

 

 

0 项奖励