From 38fd3a6aac48e1e94a8a86580e2a806209376179 Mon Sep 17 00:00:00 2001 From: Eduard Iten Date: Thu, 3 Jul 2025 09:15:11 +0200 Subject: [PATCH] Add hello_world Zephyr application for stm32g431_core --- software/CMakeLists.txt | 1 + software/apps/hello_world/CMakeLists.txt | 6 ++++++ software/apps/hello_world/prj.conf | 4 ++++ software/apps/hello_world/src/main.c | 9 +++++++++ 4 files changed, 20 insertions(+) create mode 100644 software/apps/hello_world/CMakeLists.txt create mode 100644 software/apps/hello_world/prj.conf create mode 100644 software/apps/hello_world/src/main.c diff --git a/software/CMakeLists.txt b/software/CMakeLists.txt index 04f0e5d..ccd0e02 100644 --- a/software/CMakeLists.txt +++ b/software/CMakeLists.txt @@ -5,3 +5,4 @@ project(software) add_subdirectory(modules/modbus_server) add_subdirectory(modules/valve) add_subdirectory(modules/fwu) +add_subdirectory(apps/hello_world) diff --git a/software/apps/hello_world/CMakeLists.txt b/software/apps/hello_world/CMakeLists.txt new file mode 100644 index 0000000..8728b9c --- /dev/null +++ b/software/apps/hello_world/CMakeLists.txt @@ -0,0 +1,6 @@ +cmake_minimum_required(VERSION 3.20) + +find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) +project(hello_world) + +target_sources(app PRIVATE src/main.c) diff --git a/software/apps/hello_world/prj.conf b/software/apps/hello_world/prj.conf new file mode 100644 index 0000000..ef1ed77 --- /dev/null +++ b/software/apps/hello_world/prj.conf @@ -0,0 +1,4 @@ +CONFIG_BOARD="stm32g431_core" +CONFIG_CONSOLE=y +CONFIG_LOG=y +CONFIG_UART_CONSOLE=y diff --git a/software/apps/hello_world/src/main.c b/software/apps/hello_world/src/main.c new file mode 100644 index 0000000..dbec9a8 --- /dev/null +++ b/software/apps/hello_world/src/main.c @@ -0,0 +1,9 @@ +#include +#include + +int main(void) +{ + printk("Hello World! %s\n", CONFIG_BOARD); + return 0; +} +