Skip to content

Latest commit

 

History

History
39 lines (22 loc) · 2.04 KB

README.md

File metadata and controls

39 lines (22 loc) · 2.04 KB

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-makefiles/

Introduction

This is a simple demo of a makefile toolchain for a STM 32bit ARM microcontroller. The goal of this demo is to demonstrate a possible method to generate Embedded Proto sourcecode and use it in a project.

Installation

  1. Install the GNU Arm Embedded Toolchain (arm-none-eabi-gcc) and make if you have not already.
  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_Makefile.git.
  4. Next setup the virtual environment for Embedded Proto by entering the embeddedproto folder and running the python install.py script.
  5. Run make in the root of the example. It generates the message headers with the embeddedproto command from the virtual environment and builds the project.

The library is header only and requires C++17.

Folder layout

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

  • build - The binary output of the makefiles
    • 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.
  • embeddedproto - The Embedded Proto library as a git submodule
  • proto - The location where the .proto files are located
  • src - The sourcecode folder
    • external - Sourcecode of the STM HAL and ARM CMSIS

Sourcecode

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