Skip to content

Repository files navigation

alt text

Copyrights 2020-2026 Embedded AMS B.V. Hoorn, www.EmbeddedAMS.nl, info@EmbeddedAMS.nl

Looking for a more elaborate description of this example? Please visit: https://embeddedproto.com/how-to-set-up-a-project-with-embeddedproto-using-stm32cubeide/

Introduction

This example shows you how you can integrate Embedded Proto into your STM32CubeIDE toolchain. It has a simple code example, whenever you build this code the *.proto files will converted into source code and build aswell.

Installation

  1. Install STM32CubeIDE if you have not already. The project was last built with version 2.1.1.
  2. Install Python 3.11 or newer, the only dependency of Embedded Proto. See the installation instructions.
  3. Checkout this example repository including the submodule of Embedded Proto: git clone --recursive https://github.com/Embedded-AMS/EmbeddedProto_Example_STM32CubeIDE.git.
  4. Next setup the virtual environment for Embedded Proto by entering the folder embeddedproto and running the python install.py script. Add --installer uv when you have uv installed, it is a lot faster.

The Embedded Proto library is header only and requires C++17. The project has the C++ language standard set to GNU++17 in both build configurations.

Folder layout

After generating and building the code the following sub folders will be present:

  • Core - The sourcecode folder
    • Generated - This folder is filled during the source code generation step. It includes the code generated by the Embedded Proto plugin for the .proto files.
  • Debug - The binary output of the project
  • Drivers - This folder contains the board support code provided by ARM and ST Microelectronis.
  • embeddedproto - This is the submodule for embedded proto.
  • proto - The location where the .proto files are located

Building the code

Just open the project folder with STM32CubeIDE to import the project. As a pre-build step the IDE will call the script GenerateSrc.sh. This script runs the embeddedproto command from the virtual environment of the submodule and generates source code based upon the *.proto files.

Sourcecode

The main.cpp holds a very simple infinte loop which over and over sets a new value in the protobuf message.

Contributors

Languages