first commit
This commit is contained in:
+14
@@ -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/
|
||||||
@@ -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.
|
||||||
@@ -0,0 +1,74 @@
|
|||||||
|
### STM32F407VET6 Dev Board
|
||||||
|
|
||||||
|
STM32F407VET6 (LQFP100)
|
||||||
|
- CPU: 168MHz
|
||||||
|
- Flash: 512KB
|
||||||
|
- SRAM: 192KB
|
||||||
|
|
||||||
|
<a href="url"><img src="./images/stm32vet6_board.png" width="400"></a>
|
||||||
|
|
||||||
|
### STM32F4DISCOVERY Discovery Board
|
||||||
|
|
||||||
|
STM32F407VGT6 (LQFP100)
|
||||||
|
- CPU: 168MHz
|
||||||
|
- Flash: 1MB
|
||||||
|
- SRAM: 192KB
|
||||||
|
|
||||||
|
<a href="url"><img src="./images/stm32f4_disco.png" width="600"></a>
|
||||||
|
|
||||||
|
## 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
|
||||||
|
```
|
||||||
@@ -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)
|
||||||
@@ -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 ---#
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
#include <zephyr/kernel.h>
|
||||||
|
#include <zephyr/sys/printk.h>
|
||||||
|
|
||||||
|
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;
|
||||||
|
}
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 1.9 MiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.1 MiB |
Reference in New Issue
Block a user