For interrupt priorities set using the STM32IDE CubeMX, where are the auto-code generated HAL_NVIC_SetPriority() calls located?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-03-02 8:03 AM
I could locate the HAL_NVIC_SetPriority() calls for DMA and EXT1 Interrupts in main.c as shown below.
I could not find the HAL_NVIC_SetPriority() calls for RTC, USART & Timers - TIM4, TIM5, TIM6, TIM7. Where is the interrupt priority for these peripherals set in the code by CubeMX?
The CubeMX configuration is as follows :
HAL_NVIC_SetPriority() calls found in main.c
static void MX_DMA_Init(void)
{
......
/* DMA interrupt init */
/* DMA1_Channel4_IRQn interrupt configuration */
HAL_NVIC_SetPriority(DMA1_Channel4_IRQn, 6, 0);
HAL_NVIC_EnableIRQ(DMA1_Channel4_IRQn);
/* DMA1_Channel7_IRQn interrupt configuration */
HAL_NVIC_SetPriority(DMA1_Channel7_IRQn, 4, 0);
HAL_NVIC_EnableIRQ(DMA1_Channel7_IRQn);
}
static void MX_GPIO_Init(void)
{
.....
/* EXTI interrupt init*/
HAL_NVIC_SetPriority(EXTI9_5_IRQn, 0, 0);
HAL_NVIC_EnableIRQ(EXTI9_5_IRQn);
}
I am using :
STM32CubeMX 6.2.1.202103241236
STM32CubeIDE Version: 1.6.1 Build: 9958_20210326_1446 (UTC)
Processor is STM32F105RC with STM32Cube_FW_F1_V1.8.4
- Labels:
-
DMA
-
RTC
-
TIM
-
UART-USART
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-03-02 7:46 PM
You can use Search -> File... to find all instances of HAL_NVIC_SetPriority to see if/where they exist.
It's possible they aren't set up at all if the peripheral isn't enabled.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-03-02 9:42 PM
Thanks, the HAL_NVIC_SetPriority() calls are added to the stm32f1xx_hal_msp.c file in the HAL_<Peripheral>_MspInit() functions
