Skip to content

Embedded-AMS/EmbeddedProto_Example_STM32CubeIDE

Repository files navigation

alt text

Copyrights 2020-2024 Embedded AMS B.V. Hoorn, www.EmbeddedAMS.nl, [email protected]

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.
  2. Install the dependencies required by Embedded Proto. They are listed here.
  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 setup.py script.

Folder layout

After generating and building the code this folder (stm32f4xx) the folling sub folders will be present:

  • Core - The sourcecode folder ** generated - This folder is created 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 will run Embedded Proto and generate 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.