cancel
Showing results for 
Search instead for 
Did you mean: 

stm32f407 group priority within RTEMS

David.Cheng
Associate II

i have enable three usarts, USART1 AND usart2 enabled tx rx idle. usart3 is just output log

if i set SCB_AIRCR = (0x05FA0000 | 0x500); // group 2 ,

(*(volatile uint8_t*)0xE000E425) = 0x00; // usart1 IPR

// set a low priority

// NVIC_IPR9 usart2

 (*(volatile uint8_t*)0xE000E426) = 0xe0; // 38

Q1: is it ok?

Q2: just need set group priority one time within one program?

6 REPLIES 6
Piranha
Chief II

As priority grouping configures interrupt processing, normally it is set once before any interrupts are enabled.

Why don't You use NVIC_SetPriorityGrouping(), NVIC_SetPriority() and other NVIC_***() functions provided by ARM in CMSIS?

I think the NVIC is well covered in CM4 TRM and supporting materials.

The problems are generally of constant re-entry if the source is not cleared or disabled. And re-entry due to late clearing of the source.

Routines need to do very little and leave. If you are doing complex processing in this or other interrupts, or by proxy the callback functions of HAL, it is very easy to lose interrupts/data.

The NVIC will schedule interrupts sharing a common pre-emption level at the tail-chaining point.

Interrupts that are important need to preempt.

Group setting is typically done once, and globally.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

im in RTEMS OS

thanks! group 2 is a common value?

The most common value is the one after reset (0b000), which sets all priorities to preemption and no subpriorities.