Skip to main content
spflanze
Associate II
Feb 26, 2016 2:02 AM UTC
Question

NVIC_PriorityGroupConfig() Undefined

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.

    4 replies

    Eqqman
    Associate III
    Mar 30, 2024 12:40 AM UTC

    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? 

     

    Pavel A.
    Mar 30, 2024 2:05 AM UTC

    Use NVIC_SetPriorityGrouping or HAL_NVIC_SetPriorityGrouping. As specified in CMSIS.

     

    Eqqman
    Associate III
    Mar 30, 2024 2:24 AM UTC

    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).

    Pavel A.
    Mar 30, 2024 7:14 PM UTC

    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.