Compare commits
4 Commits
1a8aaf8f61
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| c5945e2ae6 | |||
| 54c01cc08f | |||
| 2b8b776b9e | |||
| a963ad3700 |
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,3 +1,5 @@
|
|||||||
.venv/
|
.venv/
|
||||||
.cache/
|
.cache/
|
||||||
**/.cache/
|
**/.cache/
|
||||||
|
.jlink_scripts/
|
||||||
|
**/.jlink_scripts/
|
||||||
|
|||||||
@@ -122,17 +122,16 @@ int main(void) {
|
|||||||
/* USER CODE END Boot_Mode_Sequence_2 */
|
/* USER CODE END Boot_Mode_Sequence_2 */
|
||||||
|
|
||||||
/* USER CODE BEGIN SysInit */
|
/* 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 */
|
/* USER CODE END SysInit */
|
||||||
|
|
||||||
/* Initialize all configured peripherals */
|
/* Initialize all configured peripherals */
|
||||||
MX_GPIO_Init();
|
MX_GPIO_Init();
|
||||||
/* USER CODE BEGIN 2 */
|
/* USER CODE BEGIN 2 */
|
||||||
|
if ((READ_BIT(SYSCFG->UR1, SYSCFG_UR1_BCM4))) {
|
||||||
|
LL_HSEM_1StepLock(HSEM, 4U);
|
||||||
|
} else {
|
||||||
|
LL_RCC_ForceCM4Boot();
|
||||||
|
}
|
||||||
/* USER CODE END 2 */
|
/* USER CODE END 2 */
|
||||||
|
|
||||||
/* Infinite loop */
|
/* Infinite loop */
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
CONFIG_GPIO=y
|
||||||
|
CONFIG_STM32H7_DUAL_CORE=y
|
||||||
|
CONFIG_STM32H7_BOOT_M4_AT_INIT=y
|
||||||
|
|||||||
@@ -1,11 +1,47 @@
|
|||||||
// Copyright (C) 2026 Hector van der Aa <hector@h3cx.dev>
|
/*
|
||||||
// Copyright (C) 2026 Association Exergie <association.exergie@gmail.com>
|
* Copyright (c) 2016 Intel Corporation
|
||||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
*
|
||||||
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <zephyr/drivers/gpio.h>
|
||||||
#include <zephyr/kernel.h>
|
#include <zephyr/kernel.h>
|
||||||
#include <zephyr/sys/printk.h>
|
|
||||||
|
/* 1000 msec = 1 sec */
|
||||||
|
#define SLEEP_TIME_MS 1000
|
||||||
|
|
||||||
|
/* The devicetree node identifier for the "led0" alias. */
|
||||||
|
#define LED0_NODE DT_ALIAS(led0)
|
||||||
|
|
||||||
|
/*
|
||||||
|
* A build error on this line means your board is unsupported.
|
||||||
|
* See the sample documentation for information on how to fix this.
|
||||||
|
*/
|
||||||
|
static const struct gpio_dt_spec led = GPIO_DT_SPEC_GET(LED0_NODE, gpios);
|
||||||
|
|
||||||
int main(void) {
|
int main(void) {
|
||||||
printk("Hello from my freestanding Zephyr app!\n");
|
int ret;
|
||||||
|
bool led_state = true;
|
||||||
|
|
||||||
|
if (!gpio_is_ready_dt(&led)) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
ret = gpio_pin_configure_dt(&led, GPIO_OUTPUT_ACTIVE);
|
||||||
|
if (ret < 0) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
while (1) {
|
||||||
|
ret = gpio_pin_toggle_dt(&led);
|
||||||
|
if (ret < 0) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
led_state = !led_state;
|
||||||
|
printf("LED state: %s\n", led_state ? "ON" : "OFF");
|
||||||
|
k_msleep(SLEEP_TIME_MS);
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
8
neoecu.toml
Normal file
8
neoecu.toml
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
[project]
|
||||||
|
name = "BuildDemo"
|
||||||
|
|
||||||
|
[build]
|
||||||
|
m7_type = "ST"
|
||||||
|
m7_dir = "STM32"
|
||||||
|
m4_type = "Zephyr"
|
||||||
|
m4_dir = "Zephyr"
|
||||||
Reference in New Issue
Block a user