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/
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.
- Install the GNU Arm Embedded Toolchain (
arm-none-eabi-gcc) and make if you have not already. - Install Python 3.11 or newer, the only dependency of Embedded Proto. See the installation instructions.
- Checkout this example repository including the submodule of Embedded Proto:
git clone --recursive https://github.com/Embedded-AMS/EmbeddedProto_Example_Makefile.git. - Next setup the virtual environment for Embedded Proto by entering the
embeddedprotofolder and running thepython install.pyscript. - Run
makein the root of the example. It generates the message headers with theembeddedprotocommand from the virtual environment and builds the project.
The library is header only and requires C++17.
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
The main.cpp holds a very simple infinte loop which over and over sets a new value in the protobuf message.
