Help K64FN1MDVLL12 BASEPRI Register Function does not work

cancel
Showing results for 
Search instead for 
Did you mean: 

Help K64FN1MDVLL12 BASEPRI Register Function does not work

238 Views
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 Kudos
2 Replies

157 Views
ErichStyger
Senior Contributor IV

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

182 Views
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 Kudos