Zephyr

Using STM32 HAL with Zephyr: Setting the Brown Out Reset Threshold

The Zephyr RTOS has good support for the STM32 family, but every now and again you need to access something that is not supported. In my most recent experience, I needed to set the Brown-Out Reset (BOR) thresholds on a STM32WLE5CC. Adding vendor or device specific functions can break Zephyr’s code portability between devices and should only be done as a last resort. Where possible, use Zephyr’s supported API. Documentation The STM32 HAL (Hardware Abstraction Layer) and STM32 LL (Low-Level Drivers) comes bundled as a module with Zephyr. The source can be found on Github at https://github.com/zephyrproject-rtos/hal_stm32 with some basic

Embedded Linux

Measuring DC Voltage, Current, Power, Energy & Charge with a Raspberry Pi

Do you have a requirement to measure the voltage, current and power drawn from a battery or by a device using a Raspberry Pi? Perhaps you are also seeking to measure energy consumed (watt/hours) or charge (amp/hours) to determine state of charge (SoC) like a coulomb counter? If the answer is yes, then one of the easiest ways of achieving this is via a dedicated I2C sensor wired into the Raspberry Pi. Hardware One of the more popular sensors for measuring voltage and current is the digital power monitors from Texas Instruments. At the time of writing, the portfolio included

Zephyr

DeviceTree Overlays on Zephyr RTOS: Adding I2C or SPI

After 18 months developing with the Zephyr RTOS, I’m starting to become a strong proponent. In my opinion, one of the key advantages of the Zephyr RTOS is the hardware abstraction. It allows applications to be written for Zephyr that are platform independent and can be moved between different boards including different manufacturers of microcontrollers. In a world still suffering from chip shortages, it has been a breath of fresh air. The Zephyr application (project) contains the application source code while the board files detail the hardware and GPIO assignment, or essentially, how the printed circuit board is wired. This