Showing results for 
Search instead for 
Did you mean: 


Dilbert K


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

But the code failed at HAL_Init() - 



status = HAL_ERROR;



Anyone has any idea ?



I loaded up the other FreeRTOS example and works OK.


Pavel A.
Evangelist III

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 K

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.

Pavel A.
Evangelist III

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

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.


Pavel A.
Evangelist III

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 ??

Pavel A.
Evangelist III

 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.