Skip to content

Open-CMSIS-Pack/Zephyr-ST

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Zephyr-ST (Work in Progress)

Zephyr examples for STMicroelectronics STM32 based boards. The debug launch.json file has been adapted to load the ELF image built by the Zephyr West tool debugged by the CMSIS-Debugger extension.

Examples Description

Example name Description
blinky A standard Zephyr basic example that blinks an LED forever using the Zephyr GPIO API by configuring a pin as output and toggling it in a loop.
threads A standard Zephyr basic example that spawns multiple compile-time threads that blink LEDs with different periods and report status via a FIFO to a print thread.

For more information about each example, please see the official Zephyr example repository.

Steps to setup the required tools for Zephyr

  1. Install dependencies to your PC:
    • python3
    • python3-pip
  2. Install west and pyelftools with this command:
    python3 -m pip install west pyelftools jsonschema
  3. Verify the west installation by running:
    west --version
    • In case you see the error west: command not found, add the west.exe in PATH if reqired.

More details can be found in Zephyr Getting Started Guide.

Steps to build and debug the Zephyr example

  1. Open the folder ./Zephyr-ST in VS code.

  2. In Terminal, initialize and update the Zephyr workspace, if none exists:

    mkdir -p zephyrproject
    west init ./zephyrproject
    cd ./zephyrproject
    west update 
  3. To use the west tools for projects located in different folders, set the ZEPHYR_BASE environment variable to the ./Zephyr-ST/zephyrproject/zephyr folder:

    For Ubuntu:

    (echo; echo 'export ZEPHYR_BASE="/home/.../zephyrproject/zephyr"') >> ~/.bashrc
    source ~/.bashrc
    • Make sure to restart the VS Code.

    For MacOS:

    (echo; echo 'export ZEPHYR_BASE="/usr/.../zephyrproject/zephyr"') >> ~/.zshrc
    source ~/.zshrc
    • Make sure to fully quit VS Code, not just close the window. Otherwise, the changes won’t be applied.

    For Windows:

    • Set ZEPHYR_BASE to C:/.../Zephyr-Workspace/zephyr in Environment Variables, and restart the VS Code.
  4. Press the "Select Active Solution from workspace" button to choose the project you want to work on.

  5. Press the "Build solution" button to build the example.

  6. Start the CMSIS Debugger.

About

Zephyr examples for STMicroelectronics STM32 based boards

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •