Until now I had been working with FreeRTOS with a STM32L4, now I am going to start working with an STM32L5.
My first problem has been the different implementation of Porting regarding the SystickHandler.
With the STM32L4 the Systick_Handler was used in the stm32l4xx_it.c and in it the TickCounter of the HALs could be increased with the HAL_IncTick() function and call the porting function xPortSysTickHandler() for the FreeRTOS tick increment,
but now in the porting of STM32L5 this is not possible since the Systick_Handler() is implemented directly inthe port.c file.
Why the change? Is there a way to continue using it as before without modifying the Porting?
For now what I have done has been in the port.c file, change the Systick_Handler() to xPortSysTickHandler() and inplement my Systick_Handler() in the same way as in STM32L4. But I don’t know if this could have other implications.
Mind you, some of the HAL init functions have loops with a time-out, as measured by HAL_GetTick(). As long as the kernel is not running, those loops become endless.
Thank you very much, in fact that was my problem that many HAL functions use the HAL_GetTick() before launching the scheduler, and with the redefiniton of the HAL_GetTick function I can use it, but not with the precision of the timeout.
This is what I had to do, but in order to do it I had to modify the port.c, because in the STM32L5 porting, is defined Systick_Handler() in this file, not xPortSysTickHandler()
Instead of changing port.c, you could put the HAL tick on another timer (other than systick). In fact this method is recommended by ST now. CubeMX generates a warning if you try to put the FreeRTOS tick and the HAL tick both on the systick timer.
I agree with @jefftenney that changing the HAL to use a different timer than SysTick is the right solution. The following image shows how to change HAL timer in STM32Cube IDE or CubeMX: