2024-04-22 03:48 PM
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
2024-04-22 04:15 PM
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.
2024-04-25 08:40 AM
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.
2024-04-25 01:41 PM
> 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.
2024-04-25 03:15 PM - edited 2024-04-25 03:38 PM
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.
2024-04-27 04:49 PM
> Using SystemWorkbench (AC6) --> working OK
Please check: https://www.st.com/resource/en/user_manual/um2579-migration-guide-from-system-workbench-to-stm32cubeide-stmicroelectronics.pdf
2024-04-27 06:41 PM
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 ??
2024-04-28 12:34 PM
> 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.