Green LED flash on CM7

This commit is contained in:
2026-03-21 17:51:29 +01:00
parent 7d41473a8b
commit 1a8aaf8f61
11 changed files with 540 additions and 615 deletions

View File

@@ -5,10 +5,13 @@
/* USER CODE END Header */
/* Includes ------------------------------------------------------------------*/
#include "main.h"
#include "stm32h7xx_hal.h"
#include "stm32h7xx_hal_gpio.h"
/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
#include <stm32h7xx_ll_hsem.h>
#include <stm32h7xx_ll_rcc.h>
/* USER CODE END Includes */
/* Private typedef -----------------------------------------------------------*/
@@ -23,7 +26,7 @@
/* demonstration code based on hardware semaphore */
/* This define is present in both CM7/CM4 projects */
/* To comment when developping/debugging on a single core */
#define DUAL_CORE_BOOT_SYNC_SEQUENCE
// #define DUAL_CORE_BOOT_SYNC_SEQUENCE
#if defined(DUAL_CORE_BOOT_SYNC_SEQUENCE)
#ifndef HSEM_ID_0
@@ -119,7 +122,11 @@ int main(void) {
/* USER CODE END Boot_Mode_Sequence_2 */
/* USER CODE BEGIN SysInit */
if ((READ_BIT(SYSCFG->UR1, SYSCFG_UR1_BCM4))) {
LL_HSEM_1StepLock(HSEM, 4U);
} else {
LL_RCC_ForceCM4Boot();
}
/* USER CODE END SysInit */
/* Initialize all configured peripherals */
@@ -131,6 +138,8 @@ int main(void) {
/* Infinite loop */
/* USER CODE BEGIN WHILE */
while (1) {
HAL_GPIO_TogglePin(LED_GREEN_GPIO_Port, LED_GREEN_Pin);
HAL_Delay(1000);
/* USER CODE END WHILE */
/* USER CODE BEGIN 3 */
@@ -206,7 +215,7 @@ static void MX_GPIO_Init(void) {
/* USER CODE END MX_GPIO_Init_1 */
/* GPIO Ports Clock Enable */
__HAL_RCC_GPIOE_CLK_ENABLE();
__HAL_RCC_GPIOJ_CLK_ENABLE();
/*Configure GPIO pin Output Level */
HAL_GPIO_WritePin(LED_GREEN_GPIO_Port, LED_GREEN_Pin, GPIO_PIN_SET);