Skip to main content
Visitor II
February 26, 2016
Question

NVIC_PriorityGroupConfig() Undefined

  • February 26, 2016
  • 3 replies
  • 1742 views
Posted on February 26, 2016 at 03:02

The processor is an STM32F373VC using STM32CubeMX generated code with the FREERTOS option enabled.

I have attempted to add the code:

NVIC_PriorityGroupConfig( NVIC_PRIORITYGROUP_4 );

to the code in main.c as instructed in the red text on page:

http://www.freertos.org/RTOS-Cortex-M3-M4.html

(I had to figure out the argument must have all capital characters).

and as instructed in the comment in line 221 in the file ''stm32f3xx_hal_cortex.c''.

I cannot find the function NVIC_PriorityGroupConfig() defined anywhere, nor can the gcc compiler running in Ac6. Where is it?
    This topic has been closed for replies.

    3 replies

    Visitor II
    March 30, 2024

    Bumping this as we are running into this same issue 8 years later.

    Latest version of Cube, using L476 as the processor with UART, USB, and the USB interrupt enabled.  The FreeRTOS docs still call for a usage of NVIC_PriorityGroupConfig(); but this function is not generated by Cube nor is it in the core FreeRTOS kernel files.  We did find this git repo that defined the function:

    https://github.com/pichenettes/stmlib/blob/master/third_party/STM/STM32F4xx_StdPeriph_Driver/src/misc.c

    But this is a 3rd-party source (and is F4, not L4).  Where is this file actually supposed to exist? 

     

    Super User
    March 30, 2024

    Use NVIC_SetPriorityGrouping or HAL_NVIC_SetPriorityGrouping. As specified in CMSIS.

     

    Visitor II
    March 30, 2024

    We did actually try HAL_NVIC_SetPriorityGrouping guessing that it performed a similar function.  That left the code getting trapped in an assertion

    configASSERT( ucMaxSysCallPriority );

    in the port.c file, so we thought that HAL_NVIC_SetPriorityGrouping was likely incorrect (or was not the only thing required).

    Super User
    March 30, 2024

    The latter. Not the only thing required. FreeRTOS has certain requirement for the ucMaxSysCallPriority value. It is priority that must be encoded consistently with what HAL_NVIC_SetPriorityGrouping sets.

    For best result please look at FreeRTOS examples in the Cube library packages for your STM32. Take some example, build, run.