cancel
Showing results for 
Search instead for 
Did you mean: 

STM32MP CubeMX Generated FreeRTOS code for M4 doesn't run as Tick is not running.

Dub Bartolec
Senior


Hi All

This has been reported in various forms since 2019:

https://community.st.com/t5/stm32-mpus-products-and-hardware/freertos-does-not-run-on-stm32mp1-m4-core/m-p/302468
and
https://community.st.com/t5/stm32-mpus-embedded-software-and/hal-tick-does-not-get-incremented-on-second-debug-session-after/m-p/259405

and apparently it was flagged as solved.
Yes it was solved in "OpenAMP_FreeRTOS_echo" project but it was never solved in STM32CubeMX code generation for STM32MP M4 processor.

Fault was in code that would enable TIMx interrupt before TIMx was initialized so it instance was NULL.

Code generated by CubeMX version 6.14.1 and "STM32Cube_FW_MP1_V1.6.0" firmware still generates the same code that ebnables TIMx before TIMx.Instance is set to any value:

DubBartolec_0-1750638686637.png

TIMx IRQ is raised somewhere before TIMx.Instance is set and that causes IRQ service routine to disable TIMx IRQ.

DubBartolec_1-1750638773561.png



We've fixed that by comparing code "OpenAMP_FreeRTOS_echo" in and STM32CubeMX generated code.
There enabling of TIMx IRQ was moved further down in code and it is started only when TIMx is initialised:

DubBartolec_2-1750638938971.png
To say that these things cause frustration with us experienced STM32 developer is understatement.

This problem has been flagged as problem 6 years ago and it still not fixed in STM32CubeMX generation code for STM32MP M4 MCU.

 




0 REPLIES 0