STM32H747: Cortex-M4 core starting without waiting for semaphore #86494
Labels
bug
The issue is a bug, or the PR is fixing a bug
platform: STM32
ST Micro STM32
priority: low
Low impact/importance bug
Describe the bug
At the boot time, the CM4 core is supposed to wait for the CM7 to initialize the system before starting the application. To do this synchronization, the CM7 locks one of the hardware semaphores HSEM once it is ready to start the CM4.
However, the CM4 doesn't wait properly for the semaphore before starting. It can even start with
CONFIG_STM32H7_DUAL_CORE=n
.To Reproduce
CONFIG_STM32H7_DUAL_CORE=n
The CM4 will boot anyway.
Expected behavior
The CM4 should only start when the CM7 locks the semaphore.
Impact
Can potentially crash the system depending on what is done on each core.
Logs and console output
N/A
Environment:
Additional context
N/A
Possible fix
The semaphore is read from the CM4 side by polling the
HSEM->RLR
register.If I understood this correctly, this will read and lock the semaphore if the access is authorized.
Therefore, the CM4 will think the CM7 finished the system initialization and will start booting.
The semaphore should be checked by using the
HSEM->R
register, which will not affect the value of the semaphore when accessing it. If I use the modifications below, the CM4 will behave as expected.The text was updated successfully, but these errors were encountered: