Skip to content

About

This repository hosts example code for Embedded Proto, the embedded implementation of Google Protocol Buffers. It is a simple example showing how a microcontroller can use Embedded Proto to be able to communicate between devices using NFC in a structured way.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

40 Commits

Folders and files

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/nfc-example-with-embedded-proto/

Introduction

This repository hosts example code for Embedded Proto, the embedded implementation of Google Protocol Buffers. It is a simple example showing how a microcontroller can use Embedded Proto to be able to communicate between devices using NFC in a structured way.

This example uses NFC to read and write a protobuf message from/to a NFC tag.

alt text

This example makes use of a NUCLEO-F446RE, a X-NUCLEO-NFC05A1 nfc evaluation board and ST25TA tags, all made by ST Microelectronics. The microcontroller is based on an ARM Cortex-M4 processor. To build the source code and program the hardware STM32CubeIDE has been used.

The microcontroller uses a serial port to print information to a terminal such as PuTTY.

Installation

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

The setup script runs the install script of Embedded Proto, which creates a virtual environment in the submodule folder, and generates the source code with the embeddedproto command. You can regenerate the source code using the python setup.py --generate parameter. This is required when you have changed the *.proto file.

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.

Running the code

First connect the NFC evaluation board, X-NUCLEO-NFC05A1, to the NUCLEO. Then connect the NUCLEO via the usb programmer and use STM32CubeIDE to build and program the microcontroller on it. Next open a terminal such as PuTTY and setup a serial connection (baudrate 115200) using the comport that is used by the NUCLEO. You should see something like this:

alt text

For more information about what the code does and how to control the application, please visit: An NFC example with Embedded Proto

Have fun!

About

This repository hosts example code for Embedded Proto, the embedded implementation of Google Protocol Buffers. It is a simple example showing how a microcontroller can use Embedded Proto to be able to communicate between devices using NFC in a structured way.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Contributors

Languages