William Chang

How BASEPRI and PRIMASK works(STM32F1)

Blog Post created by William Chang on May 13, 2018

1. Priority Mask Register

Let's work in KEIL.

__set_PRIMASK(1); //set PRIMASK 1

 __set_PRIMASK(0); //set PRIMASK 2

Systick is configurable exception. But PRIMASK is set to 1, It will always be pending state, It works.

 

 

2. Base priority mask register

Let's work in KEIL.

__set_BASEPRI(0x30); //Set BASEPRI 0X30

48 = 0x30; So the EXTI Line[9:5] interrupt will always be pending state. Yes, it is. It works!

Outcomes