Home
Softono
zephyr-app-workspace

zephyr-app-workspace

Open source Apache-2.0 C++
11
Stars
4
Forks
0
Issues
3
Watchers
2 years
Last Commit

About zephyr-app-workspace

πŸš€ Template for a standalone πŸ”₯ Zephyr application ⚑ for STM32

Platforms

Web Self-hosted Cloud Docker

Languages

C++

Links

Standalone Zephyr application template

GitHub Build workflow status GitHub release GitHub issues GitHub top language License

This repo can be used as a template and a playground for experimenting with a standalone Zephyr application.

πŸš€ Getting started

# Create a directory for zephyr projects and switch to it
$ mkdir zephyr-projects
$ cd zephyr-projects

# Create python virtual environment there
$ python3 -m venv zephyr-venv

# Activate it
$ source zephyr-venv/bin/activate

# Install west
(zephyr-venv) $ pip install west

# Initialize workspace for the app (main branch)
(zephyr-venv) $ west init -m https://github.com/kaizoku-oh/zephyr-app-workspace --mr main app-workspace
(zephyr-venv) $ cd app-workspace

# Update Zephyr modules
(zephyr-venv) $ west update

# Install python dependencies for zephyr and mcuboot
(zephyr-venv) $ python -m pip install -r deps/zephyr/scripts/requirements.txt
(zephyr-venv) $ python -m pip install -r deps/bootloader/mcuboot/scripts/requirements.txt

# Build the bootloader (mcuboot)
(zephyr-venv) $ west build deps/bootloader/mcuboot/boot/zephyr -d deps/bootloader/mcuboot/boot/zephyr/build -b nucleo_f767zi

# Flash the bootloader (mcuboot)
(zephyr-venv) $ west flash -d deps/bootloader/mcuboot/boot/zephyr/build

# Build the app
(zephyr-venv) $ west build app -d app/build -b nucleo_f767zi

# Flash the app
(zephyr-venv) $ west flash -d app/build

# Copy vscode workspace file from the app to the outer workspace directory
(zephyr-venv) $ cp app/linux.code-workspace .

# Open vscode workspace
(zephyr-venv) $ code linux.code-workspace

Once vscode is open you can run your workspace tasks.

πŸ”¨ Application footprint for NUCLEO-F767ZI

Memory region Used Size Region Size %age Used
FLASH 186206 B 768 KB 23.68%
RAM 57120 B 384 KB 14.53%
QSPI 0 GB 256 MB 0.00%
DTCM 12544 B 128 KB 9.57%
IDT_LIST 0 GB 2 KB 0.00%

πŸ”¨ Bootloader footprint for NUCLEO-F767ZI

Memory region Used Size Region Size %age Used
FLASH 32706 B 64 KB 49.91%
RAM 24320 B 384 KB 6.18%
QSPI 0 GB 256 MB 0.00%
DTCM 0 B 128 KB 0.00%
IDT_LIST 0 GB 2 KB 0.00%

βœ… ToDo

  • [x] Blink board LED

  • [x] Shell over UART

  • [x] Fix vscode launch with cortex-debug

  • [x] Add multithreading code

  • [x] Add die temp sensor class

  • [x] Add Github CI workflow

  • [x] Add GitHub badges to readme

  • [x] Enable C++20

  • [x] Add lambda callback to Serial class

  • [x] Add a simple Network manager class

  • [x] Add NVS Storage class

  • [x] Add HTTP client class

  • [x] Add an IoT app that reads die temperature, store it in NVS, retrieve it, format it then send it

  • [x] Add vscode dev container environment

  • [x] Build project with MCUBoot

  • [ ] Run app in Renode

  • [ ] Add configurable vscode tasks

  • [ ] Integrate Renode + robot in the CI workflow

  • [ ] Solve the Shared Callback Registration problem in the Network class

  • [ ] Add native simulator to vscode build task

  • [ ] Add a script to download and setup the project (intellisense, structure, venv...)

  • [ ] Add static code analysis with CodeChecker

  • [ ] Add coverage testing with gcov

  • [ ] Add unit tests using Ztest and run them using Twister

  • [ ] Add integration tests

  • [ ] Add HIL tests using GitHub local runner

  • [ ] Add application events manager using zbus

  • [ ] Automate updating the README.md Build footprint table automatically by running a post build

  • [ ] Add debouncing mechanism to Button class

  • [ ] Add OTA update example

  • [ ] Add lambda callback to Button class

  • [ ] Use the active object design pattern

  • [ ] Use an event driven state machine using the SMF OS service and the message queue kernel object

  • [ ] Add Local class for managing local time and geo-location

  • [ ] Add MQTT client class

  • [ ] Add TCP class

  • [ ] Add an out-of-tree driver

πŸ’³ Credits

This project is generated from the zephyr-vscode-example template by Jonathan Beri.

It is following the Golioth recommended way to structure a zephyr app using manifest files, more on this in this blog post.