I recently decided to experiment with Zephyr to build applications for my STM32 based EmbLynx board. I found the process of developing custom board files and setting up USB CDC functionality very cumbersome; despite having some familiarity with device trees. I worked on a simple USB CDC Zephyr project for 3-4 days straight. I did…
Category: C and C++
Redirecting printf to the serial port on the STM32 with Newlib-Nano
In this blog entry, standard printf redirection to the serial port on STM32 microcontrollers (STM32G474RE specifically) will be covered via the standard Newlib-nano. Whether you create an new STM32 project with Visual Studio Code (VSC) + STM32Cube plugin or the STM32CubeIDE, both project setups will automatically add newlib-nano and syscalls.c and sysmem.c to the project….
Why I2C buses get stuck, and how to recover them on the STM32
In this blog entry, I’d like to focus on the I2C ‘stuck bus’ problem. I first encountered this bug when trying to read data from three different I2C sensors all integrated on the SENSEVAL-SCB4XV1 DIL24 board for my smart environmental monitoring system project. I will not cover the basics of the I2C bus here. For…
Introducing EmbLynx. An STM32G474RE development board
The EmbLynx board is a development board for the STM32G474RE micro-controller. The STM32G474RE is a mainstream ARM Cortex-M4 micro-controller (running up to 170 MHz) heavily optimized as a mixed-signal system-on-chip (SoC). It integrates extensive analog infrastructure alongside math accelerators designed for digital power conversion, motor control, and advanced sensing applications. Overview of the Peripherals on…
UDPNode: A C++ class for UDP Communication
A couple of months ago, I decided to pursue few IOT project ideas that could benefit from basic UDP (User Datagram Protocol) communication. The MQTT and CoAP protocols are definitely more robust and secure. But there are some situations where the basic UDP protocol is sufficient. The POSIX C socket API built into Linux is…
Bit Manipulation in C Part II – Read Modify Write Operations
This article covers Read Modify Write (RMW) operations. These operations allow the programmer to manipulate one or more bits of interest within a variable (or register), without affecting the state of the rest of the bits in that variable (or register). In order to understand RMW operations, the reader must have a solid foundation in…
Bit Manipulation in C Part I – Bit Manipulation Basics
The topic of bit manipulation in C doesn’t seem to get as much attention in many C programming books and study guides. Perhaps because it’s a not used regularly by application developers and system programmers. Knowledge of bit manipulation is however downright critical in the fields of embedded systems, kernel space programming and device drivers…


