Streamline Zephyr

From Stm32World Wiki
Jump to navigation Jump to search


Installation

Let's see how we can easily setup a Zephyr development environment for some Streamline demos.

  sudo apt update
  sudo apt upgrade
  sudo apt install --no-install-recommends git cmake ninja-build gperf \
    ccache dfu-util device-tree-compiler wget python3-dev python3-venv python3-tk \
    xz-utils file make gcc gcc-multilib g++-multilib libsdl2-dev libmagic1 curl
  
  mkdir streamline-demos
  cd streamline-demos
  python3 -m venv .venv
  echo "export ZEPHYR_BASE=`pwd`/zephyr" >>.venv/bin/activate
  echo "export ZEPHYR_TOOLCHAIN_VARIANT=zephyr" >>.venv/bin/activate
  echo "export ZEPHYR_SDK_INSTALL_DIR=$HOME/zephyr-sdk-1.0.1" >>.venv/bin/activate
  source .venv/bin/activate
  pip install west
  mkdir demo1
  echo "
  # @copyright Copyright (c) 2026, CurrentMakers.com and the individuals that has contributed to this project.
  #
  # SPDX-License-Identifier: Apache-2.0
  
  manifest:
    projects:
      - name: zephyr
        revision: v4.4.0
        url: https://github.com/zephyrproject-rtos/zephyr
        west-commands: scripts/west-commands.yml
        import:
          name-allowlist:
            - littlefs
            - picolibc
            - hal_stm32
            - hal_st
            - hal_nordic
            - hal_rpi_pico
            - cmsis_6
      - name: zephyr-cm
        url: https://github.com/currentmakers/zephyr-cm
        revision: master 
        path: zephyr-cm
      - name: zephyr-ws2812b-pwm
        url: https://github.com/currentmakers/zephyr-ws2812b-pwm
        revision: master
        path: modules/lib/zephyr-ws2812b-pwm
    self:
      path: demo1
  ">demo1/west.yml
  cd demo1
  west init --local 
  west update
  west zephyr-export
  west packages pip --install
  west sdk install -t arm-zephyr-eabi
  west config zephyr.toolchain-variant zephyr
  west config zephyr.sdk-install-dir $HOME/zephyr-sdk-1.0.1

We also need to redirect the st-flash to use the STM32CubeIDE TCL scripts, to support the newer STM32 families, like STM32H5 and STM32C5. So

Flashing

It is really difficult to get flashing to work reliably with new STM32 families, so I suggest the following;

  1. Download the STM32CubeProgrammer.
  2. Install it "somewhere", let's say ${HOME}/st
  3. Add a symlink of ${HOME}/st/STM32CubeProgrammer-2.22.0/bin/STM32_Programmer_CLI to a location which is on the PATH, such as ${HOME}/.local/bin

When flashing with west simply do

   west flash --runner stm32cubeprogrammer

Demo 1

  west build --pristine always --board streamline_mcu_stm32f407 ../zephyr/samples/basic/blinky
  west flash --runner stm32cubeprogrammer

And any of the following boards can be substituted;

  streamline_mcu_stm32f407
  streamline_mcu_stm32h562
  streamline_mcu_stm32c551
  streamline_mcu_stm32l475