2020-10-15 11:25 AM
Hello,
is there any documentation regarding the startup on both cores as I see there are several possibilitiess to gate the other core or to let them run directly in parallel. Nevertheless, CubeMx generates a common startup file which is shared I assume. Does ST provide more information on this topic? Where can I find some reference material, e.g. ARM for a dual core approach?
Solved! Go to Solution.
2020-10-15 12:00 PM
There are many ways to do this. The startup code generated by CubeMX is worth a look. It lets the CM7 initialize some stuff while the CM4 waits to be notified. The startup file is the same but it is not shared--there is a copy for each core and they can be modified independently according to your needs.
/* USER CODE BEGIN Boot_Mode_Sequence_1 */
/*HW semaphore Clock enable*/
__HAL_RCC_HSEM_CLK_ENABLE();
/* Activate HSEM notification for Cortex-M4*/
HAL_HSEM_ActivateNotification(__HAL_HSEM_SEMID_TO_MASK(HSEM_ID_0));
/*
Domain D2 goes to STOP mode (Cortex-M4 in deep-sleep) waiting for Cortex-M7 to
perform system initialization (system clock config, external memory configuration.. )
*/
HAL_PWREx_ClearPendingEvent();
HAL_PWREx_EnterSTOPMode(PWR_MAINREGULATOR_ON, PWR_STOPENTRY_WFE, PWR_D2_DOMAIN);
/* Clear HSEM flag */
__HAL_HSEM_CLEAR_FLAG(__HAL_HSEM_SEMID_TO_MASK(HSEM_ID_0));
/* USER CODE END Boot_Mode_Sequence_1 */
There is also this but I think looking at the code is more useful:
2020-10-15 12:00 PM
There are many ways to do this. The startup code generated by CubeMX is worth a look. It lets the CM7 initialize some stuff while the CM4 waits to be notified. The startup file is the same but it is not shared--there is a copy for each core and they can be modified independently according to your needs.
/* USER CODE BEGIN Boot_Mode_Sequence_1 */
/*HW semaphore Clock enable*/
__HAL_RCC_HSEM_CLK_ENABLE();
/* Activate HSEM notification for Cortex-M4*/
HAL_HSEM_ActivateNotification(__HAL_HSEM_SEMID_TO_MASK(HSEM_ID_0));
/*
Domain D2 goes to STOP mode (Cortex-M4 in deep-sleep) waiting for Cortex-M7 to
perform system initialization (system clock config, external memory configuration.. )
*/
HAL_PWREx_ClearPendingEvent();
HAL_PWREx_EnterSTOPMode(PWR_MAINREGULATOR_ON, PWR_STOPENTRY_WFE, PWR_D2_DOMAIN);
/* Clear HSEM flag */
__HAL_HSEM_CLEAR_FLAG(__HAL_HSEM_SEMID_TO_MASK(HSEM_ID_0));
/* USER CODE END Boot_Mode_Sequence_1 */
There is also this but I think looking at the code is more useful:
2024-07-24 04:39 AM
Hello. All the examples I've found are so, that CM7 starts first and then runs CM4.
But I need the other way: run first the CM4 from 0x08000000, make the peripherals init
and then run CM7 from 0x08100000.
How should i do that ?
2024-07-24 05:49 AM
Opened a dedicated thread for your question: https://community.st.com/t5/stm32-mcus-products/changing-boot-address-of-cm4-and-cm7-in-stm32h745-dual-core/td-p/701335