Skip to main content
Visitor II
April 22, 2024
Question

FreeRTOS_MPU

  • April 22, 2024
  • 5 replies
  • 2844 views

STM32Cube_FW_L4_V1.18.0\Projects\NUCLEO-L476RG\Applications\FreeRTOS\FreeRTOS_MPU

I am trying to debug the usage of FreeRTOS_MPU using the NUCLEO-L476RG board.

But the code failed at HAL_Init() - 

if (HAL_InitTick(TICK_INT_PRIORITY) != HAL_OK)

{

status = HAL_ERROR;

}

 

Anyone has any idea ?

 

p.s.

I loaded up the other FreeRTOS example and works OK.

STM32Cube_FW_L4_V1.18.0\Projects\NUCLEO-L476RG\Applications\FreeRTOS\FreeRTOS_ThreadCreation

    This topic has been closed for replies.

    5 replies

    Super User
    April 22, 2024

    With FreeRTOS, your HAL timer is one of the STM32 TIM timers rather than systick. Which timer is it? Try to trace into HAL_InitTick and see where it fails.

     

    Dilbert KAuthor
    Visitor II
    April 25, 2024

    I have located the issue but have no idea how to fix the STM32Cube_FW code

    The global variables are not initialized in "stm32l4xx_hal.c" of project "NUCLEO-L476RG\Applications\FreeRTOS\FreeRTOS_MPU"

     

     

    /** @defgroup HAL_Exported_Variables HAL Exported Variables
     * @{
     */
    __IO uint32_t uwTick;
    uint32_t uwTickPrio = (1UL << __NVIC_PRIO_BITS); /* Invalid priority */
    HAL_TickFreqTypeDef uwTickFreq = HAL_TICK_FREQ_DEFAULT; /* 1KHz */

     

     uwTickPrio and uwTickFreq are zero.

     

    In other project "NUCLEO-L476RG\Applications\FreeRTOS\FreeRTOS_ThreadCreation",

    both variables are initialized correctly.

    Super User
    April 25, 2024

    > uwTickPrio and uwTickFreq are zero.

    This hints to a problem with RAM allocation. Like, static data collides with thread stacks, or gets clobbered by something else, or just sits in a wrong place.

    Dilbert KAuthor
    Visitor II
    April 25, 2024

    With more debug...  here is the result...

    1. "STM32Cube_FW_L4_V1.18.0\Projects\NUCLEO-L476RG\Applications\FreeRTOS\FreeRTOS_MPU"

    - Using STM32CubeIDE_1.15.0 --> does NOT work

     

    2. "STM32Cube_FW_L4_V1.17.0\Projects\NUCLEO-L476RG\Applications\FreeRTOS\FreeRTOS_MPU"

    - Using SystemWorkbench (AC6) --> working OK

     

    Hope not the issue in the new STM32CubeIDE_1.15.0.  As I want to switch over to the new STM supported tools.

     

    Super User
    April 27, 2024
    Dilbert KAuthor
    Visitor II
    April 28, 2024

    Thanks for the extra info.

    However, the "STM32Cube_FW_L4_V1.18.0" suppose to support stm32cubeide as all the projects already had converted by STM engineers.

    If this is the case, even if I follow the instruction, would the result be the same as the release ??

    Super User
    April 28, 2024

     the projects already had converted by STM engineers.

    Then unfortunately it's a bug. It looks like regression testing is missing there for CubeIDE and library package updates.