Embedded Systems
13.3K subscribers
1.03K photos
219 videos
1 file
706 links
News, articles, guides, analytics, projects and startups from the embedded industry.

Topics of the channel:
◽️ machine learning
◽️ internet of things
◽️ embedded software
◽️ advanced electronics
◽️ new engineering ideas

⤵️ Share and subscribe!
Download Telegram
👩‍💻 Exploring printf on Cortex-M

The printf() function is a staple of embedded development. It’s a simple way to get logs or debug statements off the system and into a terminal on the host. Covering a wide array of printf methods, from UART to Semihosting, this article equips developers with essential knowledge to streamline their development processes and bolster system robustness.

More information...

#articles #programming
Please open Telegram to view this post
VIEW IN TELEGRAM
🔃 Mastering State Machines

This article explores the concept of state machines, fundamental in software design. A state machine is a computational model that defines the behavior of a system through a finite set of states, transitions between these states triggered by events, and actions associated with each transition.

The article begins with a simple example of a light switch controlled by a push button, demonstrating key components: states, events, and transitions. Progressing from implicit to explicit designs, it highlights the importance of modularity and code organization.

What You Will Learn:
➡️ Basics of state machines.
➡️ Implementing state machines in code.
➡️ Importance of modularity and code organization.
➡️ Handling state transitions and events.

Therefore, by emphasizing simplicity and good design practices, this article will show you how to effectively utilize state machines in their projects.

More information...

#articles #programming
Please open Telegram to view this post
VIEW IN TELEGRAM
🦀 Embedded Rust: where are we today?

The Rust is a perspective programming language that steadily gains its popularity but not in embedded systems. Despite the benefits that the Rust brings (such as memory safety), not many companies are using it yet. Instead, they tend to stick to C or C++, because they've already invested a lot of money on writing firmware in this languages and are hesitant to change.

Startups are more interested in Rust because they don't have any old systems to worry about, but bigger companies are taking their time to see if Rust is worth it. Learning Rust can be tough, and not many companies are offering support for it. However, as the need for safer languages grows, especially with the rise of IoT, Rust might become more popular in the future. Its role in embedded systems remains uncertain for now, but it could change over time.

More information...

#articles #programming #rust
Please open Telegram to view this post
VIEW IN TELEGRAM
The cheatsheet of modern C++ language

This 😹 GitHub repository houses a handy cheatsheet for modern C++ programmers, detailing key language features and library enhancements introduced in versions C++11, C++14, C++17, and C++20.

From fundamental concepts like move semantics and lambda expressions to advanced functionalities like coroutines and designated initializers, this resource covers a wide spectrum of topics.

Whether you're a beginner learning the ropes or an experienced developer looking to stay updated, this cheatsheet serves as a quick reference for leveraging the power of modern C++ in your projects.

More information...

#programming
Please open Telegram to view this post
VIEW IN TELEGRAM
🔃 CppUTest – unit testing and mocking framework for C/C++

CppUTest is a popular unit testing framework primarily used for Test-Driven Development (TDD) in C and C++ projects. It's specifically designed for embedded and resource-constrained systems, but it's also suitable for general software development.

CppUTest offers various features:
➡️ Support for setting up and tearing down test fixtures, allowing for the isolation of tests and the management of test environments.
➡️ Offers a wide range of assertion macros for validating expected behavior and outcomes in tests.
➡️ Capability for creating mock objects and mock-based tests.
➡️ Provides with a test runner utility for executing test cases and reporting test results.
➡️ Integration with popular build systems like CMake and Make.

In summary, CppUTest gives teams an opportunity to unlock the potential for streamlined development workflows and heightened code reliability.

More information:
🔗 The project's page
😹 The GitHub repository

#libraries #programming
Please open Telegram to view this post
VIEW IN TELEGRAM
🏍 Mastering motor control: implementation in C++

This article presents a comprehensive guide to developing real-time software for motor control systems using modern C++.

It offers detailed programming guidelines, including efficient interrupt handling, memory alignment, compiler-specific optimizations, and adherence to industry standards like MISRA C++.

The guide provides practical code examples available on 😹 GitHub, demonstrating the implementation of mentioned in article techniques in motor control applications.

More information...

#articles #programming
Please open Telegram to view this post
VIEW IN TELEGRAM
🚥 3 tips for using CMake with embedded software

CMake, an open-source and cross-platform tool, allows for efficient control over the software compilation process through platform-independent configuration files, generating native makefiles suitable for any compiler environment. This versatility makes CMake a valuable tool for managing complex build environments.

☑️Use Toolchain Files to Simplify Build Configuration:
➡️Different build types (Debug On-Target, Release On-Target, Simulation, Test, and Code Analysis) need specific configurations.
➡️Toolchain files help manage these variations, facilitating cross-compilation and implementation swaps.
➡️Typically, two toolchain files (host and on-target builds) are sufficient.

☑️Automate Build Commands with Custom Scripts:
➡️Avoid memorizing long CMake commands by encapsulating them in scripts.
➡️Custom scripts simplify the build process and reduce errors.
➡️Scripts can include parameters for toolchain files, build types, and other settings, making them useful in CI/CD systems.

☑️Pair CMake with Ninja for Faster Builds:
➡️Ninja is a high-speed build system focused on efficiency.
➡️Using Ninja with CMake can result in x4 to x6 times faster compilation times compared to traditional tools like Make.
➡️Simple setup commands integrate Ninja into the build process, significantly reducing build times and improving development efficiency.

Implementing these tips can streamline the build process for embedded software, making development faster, more efficient, and better suited to modern development practices.

More information...

#programming #cmake #software
Please open Telegram to view this post
VIEW IN TELEGRAM
💻 5 best practices for writing ISRs

Interrupt Service Routines (ISRs) are essential for embedded systems, but poorly written ISRs can cause race conditions, poor responsiveness, and high CPU usage.

To write effective ISRs, it's crucial to keep them short and fast to minimize CPU cycle consumption and avoid timing issues. Avoid calling functions within ISRs to reduce execution time and prevent system instability. Instead, use static compilation, preprocessor, and inline functions to streamline ISR code without compromising modularity.

Additionally, offload intensive processes to other threads by using flags, queues, and proper synchronization to ensure efficient and responsive ISRs. Declaring shared variables as volatile prevents compiler optimizations that might lead to unpredictable behavior. Customize default ISR handlers to set diagnostic flags instead of infinite loops to handle unexpected interrupts safely. By following these best practices, you can enhance the performance and reliability of your embedded systems.

More information...

#programming
Please open Telegram to view this post
VIEW IN TELEGRAM
©️ Strategies for Handling Padding in C Programming

In C programming, padding refers to the extra memory space added between members of a structure to align the data in a way that the CPU can access it more efficiently. Normally, the compiler adds padding to structures to align data members according to their natural boundaries. Consider the following structure in a firmware written for a 32-bit system:

struct foo {
uint32_t i;
uint8_t b;
};


In this example, the compiler adds 3 bytes of padding after "b" to ensure the structure’s total size is a multiple of 4 bytes, making it 8 bytes in total.

To address this issue the referred article proposes several strategies regarding structure padding to optimize memory layout and access efficiency, particularly focusing on packed structures.

More information...

#programming
Please open Telegram to view this post
VIEW IN TELEGRAM
Embedded Systems
🍏 Apple Intelligence: Apple’s New Generative AI Unveiled At WWDC 2024 which took place today, Apple introduced Apple Intelligence, a generative AI integrated across its ecosystem. Apple Intelligence is designed to offer highly personalized experiences while…
This media is not supported in your browser
VIEW IN TELEGRAM
🍏 New Embedded Programming Language by Apple

The last week at WWDC 2024, Apple showed its new programming language for resource-constrained systems. Embedded Swift is a specialized version of Apple's 🖥 Swift programming language designed for microcontrollers like the 🇨🇳 ESP32, 🍓 Raspberry Pi RP2040, 🦋 STM32. It enables the development of IoT and low-power devices with Swift's familiar syntax and features.

Features of the language:
➡️Supports value and reference types, closures, optionals, and error handling
➡️Designed for the constrained environments of microcontrollers
➡️Seamlessly integrates with existing C and C++ SDKs
➡️Wide range of supported microcontrollers and plenty of code examples

Embedded Swift brings the benefits of Swift's ergonomics, safety features, and ease of use to embedded development, making it accessible for both hobbyists and professional developers familiar with 🖥 Swift language.

More information:
🔗 The main article
😹 The GitHub repository
📺 The YouTube video

#news #swift #programming
Please open Telegram to view this post
VIEW IN TELEGRAM
💻 Qt vs. Flutter: Which Framework is Right for Your Embedded Project?

Choosing between Qt and Flutter for embedded project development depends on the specific technical needs of the project.

Qt, built on C++, excels in native performance and efficiency, making it ideal for complex, high-performance applications. It offers extensive libraries and robust community support, catering to projects that require sophisticated functionalities and direct hardware access, such as medical devices and low-end hardware without GPU support.

On the other hand, Flutter focuses on rapid development and cost-effectiveness, utilizing Dart for an accessible programming experience. Key features like hot reload enable quick iteration, and a single codebase ensures consistent UI across platforms.

To sum up, Qt is suited for intricate, performance-critical applications, while Flutter is ideal for projects prioritizing speed, cost-efficiency, and cross-platform consistency.

More information...

#articles #qt #flutter #programming
Please open Telegram to view this post
VIEW IN TELEGRAM
🦠 CrowdStrike Update Highlights the Need for Safer Programming Languages

A global IT outage affecting 8.5 million Windows devices was caused by a faulty update from CrowdStrike, leading to significant disruptions. The issue stemmed from a null pointer bug in the C++ code of the update, which triggered widespread system crashes. Specifically, the program attempted to access memory at an invalid address ("0x000000000000009c"), resulting in a cascade of failures across various critical services and platforms.

Many experts argue that if the update had been written in 🦀 Rust, the compiler would have caught the null pointer bug before deployment, avoiding the widespread disruptions and ensuring safer software deployment practices.

More information...

#news #crowdstrike #rust #programming #security
Please open Telegram to view this post
VIEW IN TELEGRAM
🖥 Preparing for C++26: A Look Back at Major Features Since C++11

This article provides an overview of the major features added to C++ from C++11 through to the upcoming C++26. It explains key changes like auto type deduction, lambda expressions, and smart pointers, and covers later enhancements like concepts, ranges, and modules. You'll find examples and explanations that show how these features work and what they mean for modern C++ development.

More information...

#articles #programming
Please open Telegram to view this post
VIEW IN TELEGRAM
🤖 PythonRobotics: A Comprehensive Repository for Robotics Algorithms

PythonRobotics is a collection of robotics algorithms implemented in 🐍 Python, designed to help users understand core concepts in autonomous navigation. It's beginner-friendly and easy to use.

The repository includes:
➡️Algorithms for localization (Kalman, Particle, Histogram filters)
➡️Mapping techniques (Grid maps, Ray casting, Lidar integration)
➡️SLAM implementations (FastSLAM, ICP Matching)
➡️Path planning (A*, D*, RRT*, Dynamic Window Approach)
➡️Path tracking (Stanley control, LQR, Model Predictive Control)
➡️Minimal dependencies and intuitive animations for better learning

This GitHub repository is perfect for robotics learners and developers who want practical, easy-to-follow implementations of widely-used algorithms.

More information:
😹 The GitHub repository
📚 The main article

#programming #python #robotics
Please open Telegram to view this post
VIEW IN TELEGRAM
💻 Improving Embedded Systems with Design-by-Contract

Design-by-Contract (DbC) is a method that helps embedded software developers reduce the time spent debugging by ensuring each function has well-defined pre-conditions, post-conditions, side effects, and invariants. This approach creates "contracts" that must be followed for a function to operate properly, outlining what must be true before and after a function executes.

To enforce these contracts, developers can use assertions, which check that the conditions are met at runtime. If a condition isn't satisfied, the assertion signals a defect, making it easier to catch errors early. Assertions aren't used for error handling but for defect detection, ensuring that the system behaves as expected when calling functions or components.

// Example of DbC using assertions
void Dio_Init(DioConfig_t const* const Config)
{
assert(sizeof(Config) > 0);
assert(NUMBER_OF_CHANNELS_PER_PORT > 0);
assert(NUMBER_OF_PORTS > 0);
assert(Mcu_ClockState(GPIO) == true);

// The rest of the function
}


DbC can be implemented simply, often through code documentation tools like 😹 Doxygen or directly within the code using assertions. While there may be a slight performance impact, developers can disable assertions before final deployment if necessary. Overall, DbC helps improve software quality, decreases debugging time, and enhances the reliability of embedded systems.

More information...

#articles #programming
Please open Telegram to view this post
VIEW IN TELEGRAM
👩‍💻 Kickstart Your Raspberry Pi Pico with VS Code

Setting up a development environment for the 🍓 Raspberry Pi Pico can be daunting, especially with the variety of languages and tools available. While MicroPython and CircuitPython simplify things for beginners, using C/C++ offers greater control and flexibility—at the cost of a more complex setup process.

Fortunately, Raspberry Pi's official extension for Microsoft Visual Studio Code is a game-changer, making it easier than ever to get started with C/C++ on the Pico. This guide will give you a quick walk though the steps needed to start embedded development with Pico on Windows environment.

More information...

#articles #programming #raspberry
Please open Telegram to view this post
VIEW IN TELEGRAM
Embedded Systems
📺 PCB Design Challenge: 3 engineers race to design a PCB in the fastest time Two months ago you might have seen a ✈️ PCB Design Duel posted on this channel. In a new episode of this show, there are three engineers racing to design the best PCB incorporating…
📺 ESP32 Software Battle: AWS IoT Core vs Blink for Cloud Control

Over a month has passed since the second ✈️ PCB Design Duel was posted on this channel. In a new episode, the format stayed the same but instead of hardware developers, the author has invited two embedded software engineers.

In his video, they compete to program an 🇨🇳 ESP32 microcontroller in just two hours, using AWS with PlatformIO and Blink with PlatformIO, respectively. The challenge highlights how cloud integrations differ between AWS IoT Core and Blink's user-friendly interface for IoT control.

Despite encountering setup and debugging obstacles, both participants successfully sync their ESP32 devices to cloud interfaces, demonstrating the unique advantages of each platform for real-time IoT applications.

https://youtu.be/-caKi39nF64

#video #esp32 #programming #IoT
Please open Telegram to view this post
VIEW IN TELEGRAM
©️ Writing a simple pool allocator in C

This article provides a detailed guide on writing a simple pool allocator in C, a memory management technique that offers faster allocation and deallocation compared to traditional malloc by using fixed-size memory chunks.

This technique is especially useful when writing embedded firmware where the RAM is limited and you need to save resources. New readers will learn how to implement a basic pool allocator, including creating, expanding, and managing memory pools, as well as optimizing performance with constant-time operations.

More information...

#articles #programming
Please open Telegram to view this post
VIEW IN TELEGRAM
©️ Fixing C strings

This article explores an alternative to traditional null-terminated C strings, which are notorious for being error-prone and unsafe.

The author introduces a safer string implementation using two structures: struct str (for immutable strings) and struct str_buf (for mutable string buffers). These structures store both the string data and its length, eliminating common issues like buffer overflows and off-by-one errors.

The article provides practical examples of how to create, manipulate, and use these strings, emphasizing readability, correctness, and safety.

More information...

#articles #programming
Please open Telegram to view this post
VIEW IN TELEGRAM
👩‍💻 Free YouTube Course: Developing a Linux Driver

This tutorial series is a practical guide to writing Linux kernel modules and drivers, with a focus on hardware access. It starts with an introduction to the Linux kernel, explaining its role as a hardware abstraction layer and its monolithic nature.

The series emphasizes Loadable Kernel Modules (LKMs), which allow dynamic driver loading to keep the kernel lightweight and flexible.

Key topics covered include:
➡️Kernel basics – Process management, resource allocation, and system calls.
➡️LKMs – How to write and load kernel modules dynamically.
➡️Essential mechanisms – Linked lists, mutexes, memory management, and logging.
➡️User-space interfaces – Working with /proc, /sys, and device files.
➡️Hardware interfacing – GPIOs, I²C, SPI, timers, and more.
➡️Device Tree – Adding and probing devices dynamically.

The tutorials use 🍓 Raspberry Pi for hands-on development due to its affordability, GPIO support, and ease of configuration. The series is continuously updated to reflect kernel API changes, making it a valuable resource for anyone looking to master Linux driver development.

More information...

#courses #programming #linux #raspberry
Please open Telegram to view this post
VIEW IN TELEGRAM