Skip to content

K2-Zephyr quick start

Repo

GitHub Actions Workflow Status

Board docs: https://docs.zephyrproject.org/4.2.0/boards/st/nucleo_f767zi/doc/index.html

Required verisons

  • Python: 3.11

Installation guide

See Install Guide for installation guide.

In-depht guide: https://docs.zephyrproject.org/4.2.0/develop/getting_started/index.html

If you have installed Zephyr you can clone the K2 Zephyr repo into the zephyrproject folder:

git clone https://github.com/UiASub/K2-Zephyr.git

Remember to follow the requred versions

Build & flash

Run the build helper for your platform or run west directly from the project folder.

./build.sh
or manually inside the repo

cd ~/zephyrproject/K2-Zephyr
source ./.venv/Scipts/activate
west build -b nucleo_f767zi
west flash

./build.ps1
or manually inside PowerShell

Set-Location "$HOME\zephyrproject\K2-Zephyr"
. .\.venv\Scripts\Activate.ps1
west build -b nucleo_f767zi
west flash

If you prefer a Unix shell on Windows, run build.sh from WSL, Git Bash, or MSYS2.

Note: west flash uses STM32CubeProgrammer by default when it is available on your PATH (it's not used unless installed and found). It can be installed manually or use OpenOCD fallback.

Monitoring

Monitor serial (115200 baud):

Linux:

minicom -D /dev/ttyACM0 -b 115200

macOS:

minicom -D /dev/tty.usbmodem* -b 115200

or use screen:

screen /dev/ttyXXXX 115200

vscode config

This is so no path's errors appear in c library for zephyr in VSCode

In .vscode folder, add this and customize to your need

c_cpp_properties.json

{
    "configurations": [
        {
            "name": "Zephyr ARM",
            "includePath": [
                "${workspaceFolder}/build/zephyr/include/generated",
                "${workspaceFolder}/**",
                "~/zephyrproject/zephyr/include",
                "~/zephyrproject/zephyr/include/zephyr",
                "~/zephyrproject/zephyr/lib/libc/common/include",
                "~/zephyrproject/zephyr/lib/libc/minimal/include",
                "~/zephyr-sdk-VERSION/arm-zephyr-eabi/arm-zephyr-eabi/include",
                "~/zephyrproject/zephyr/soc/st/stm32/stm32f7x",
                "~/zephyrproject/zephyr/soc/st/stm32/common",
                "~/zephyrproject/zephyr/modules/cmsis",
                "~/zephyrproject/zephyr/modules/cmsis_6",
                "~/zephyrproject/modules/hal/stm32/stm32cube/stm32f7xx/soc",
                "~/zephyrproject/modules/hal/stm32/stm32cube/stm32f7xx/drivers/include",
                "~/zephyrproject/modules/hal/stm32/stm32cube/common_ll/include"
            ],
            "forcedInclude": [
                "${workspaceFolder}/build/zephyr/include/generated/zephyr/autoconf.h"
            ],
            "defines": [
                "CONFIG_BOARD_NUCLEO_F767ZI",
                "__ZEPHYR__=1",
                "CONFIG_ARM=1",
                "CONFIG_CPU_CORTEX_M7=1",
                "CONFIG_SOC_STM32F767XX=1",
                "CONFIG_SYS_CLOCK_TICKS_PER_SEC=10000"
            ],
            "compilerPath": "~/zephyr-sdk-VERSION/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc",
            "cStandard": "c11",
            "cppStandard": "c++17",
            "intelliSenseMode": "gcc-arm"
        }
    ],
    "version": 4
}