commit 94ed6fe8f653284cb116afce3eb978fc08b19342 Author: hangpersonal Date: Sun Aug 30 16:51:39 2026 -0700 first commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f50d7bc --- /dev/null +++ b/.gitignore @@ -0,0 +1,14 @@ +# Build output +/build/ + +# Python virtual environments +/.venv*/ + +# Local west workspace configuration +/.west/ + +# Repositories downloaded and managed by west +/zephyr/ +/bootloader/ +/modules/ +/tools/ diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..9886108 --- /dev/null +++ b/LICENSE @@ -0,0 +1,18 @@ +MIT License + +Copyright (c) 2025 hangpersonal + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and +associated documentation files (the "Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the +following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial +portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT +LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO +EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..0468cf7 --- /dev/null +++ b/README.md @@ -0,0 +1,74 @@ +### STM32F407VET6 Dev Board + +STM32F407VET6 (LQFP100) +- CPU: 168MHz +- Flash: 512KB +- SRAM: 192KB + + + +### STM32F4DISCOVERY Discovery Board + +STM32F407VGT6 (LQFP100) +- CPU: 168MHz +- Flash: 1MB +- SRAM: 192KB + + + +## Workspace setup + +This repository contains the STM32 applications and the west manifest. Zephyr, +its modules, bootloaders, and tools are downloaded separately by west. + +### Prerequisites + +Install Git and Python 3, then create an empty workspace directory. + +### Clone and initialize + +Run these commands from the empty workspace directory: + +```powershell +git clone ssh://git@gitea.cuihang1201.synology.me:2222/hangpersonal/STM32_Zephyr_RTOS.git + +cd STM32_Zephyr_RTOS +py -3.12 -m venv .venv +.\.venv\Scripts\Activate.ps1 +python.exe -m pip install --upgrade pip + +pip install west +west --version +west init --mr v4.4.2 . +west update +west zephyr-export +west packages pip --install +west sdk install +``` + +The resulting workspace layout is: + +```text +workspace/ +|-- .west/ +|-- .venv/ +|-- zephyr/ +|-- modules/ +|-- bootloader/ +|-- tools/ +|-- apps/ +`-- build/ +``` + +#### Project: kconfig_hello + +Run these commands from the workspace root: + +```powershell +west build -p always ` + -s apps\kconfig_hello ` + -d build\kconfig_hello ` + -b stm32f4_disco + +west flash -d build\kconfig_hello +``` diff --git a/apps/kconfig_hello/CMakeLists.txt b/apps/kconfig_hello/CMakeLists.txt new file mode 100644 index 0000000..ecb7d24 --- /dev/null +++ b/apps/kconfig_hello/CMakeLists.txt @@ -0,0 +1,8 @@ +# SPDX-License-Identifier: Apache-2.0 + +cmake_minimum_required(VERSION 3.20.0) + +find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) +project(hello_world) + +target_sources(app PRIVATE src/main.c) diff --git a/apps/kconfig_hello/prj.conf b/apps/kconfig_hello/prj.conf new file mode 100644 index 0000000..cd82ab6 --- /dev/null +++ b/apps/kconfig_hello/prj.conf @@ -0,0 +1,20 @@ +# Enable the logging framework +CONFIG_LOG=y +# Set the default logging level +CONFIG_LOG_DEFAULT_LEVEL=3 + +#--- DEBUG PRESET - BEGIN ---# +# Set to -Og +CONFIG_DEBUG_OPTIMIZATIONS=y +# Thread awareness support +CONFIG_DEBUG_THREAD_INFO=y +# Generate stack usage per-function +CONFIG_STACK_USAGE=y +# Other options in case not set by default +CONFIG_BUILD_OUTPUT_HEX=y +CONFIG_BUILD_OUTPUT_META=y +CONFIG_OUTPUT_SYMBOLS=y +CONFIG_OUTPUT_STAT=y +CONFIG_OUTPUT_DISASSEMBLY=y +CONFIG_OUTPUT_PRINT_MEMORY_USAGE=y +#--- DEBUG PRESET - END ---# \ No newline at end of file diff --git a/apps/kconfig_hello/src/main.c b/apps/kconfig_hello/src/main.c new file mode 100644 index 0000000..15c4ca9 --- /dev/null +++ b/apps/kconfig_hello/src/main.c @@ -0,0 +1,15 @@ +#include +#include + +int main(void) { + + printk("Hello World from Zephyr! %s\n", CONFIG_BOARD_TARGET); + + if (IS_ENABLED(CONFIG_LOG)) { + printk("Logging is enabled (level=%d)\n", CONFIG_LOG_DEFAULT_LEVEL); + } else { + printk("Logging is disabled\n"); + } + + return 0; +} diff --git a/images/stm32f4_disco.png b/images/stm32f4_disco.png new file mode 100644 index 0000000..fca3d1d Binary files /dev/null and b/images/stm32f4_disco.png differ diff --git a/images/stm32vet6_board.png b/images/stm32vet6_board.png new file mode 100644 index 0000000..f425bdb Binary files /dev/null and b/images/stm32vet6_board.png differ