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.#articles #programming
Please open Telegram to view this post
VIEW IN TELEGRAM
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:
Therefore, by emphasizing simplicity and good design practices, this article will show you how to effectively utilize state machines in their projects.
#articles #programming
Please open Telegram to view this post
VIEW IN TELEGRAM
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.
#articles #programming #rust
Please open Telegram to view this post
VIEW IN TELEGRAM
This
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.
#programming
Please open Telegram to view this post
VIEW IN TELEGRAM
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:
In summary, CppUTest gives teams an opportunity to unlock the potential for streamlined development workflows and heightened code reliability.
More information:
#libraries #programming
Please open Telegram to view this post
VIEW IN TELEGRAM
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
#articles #programming
Please open Telegram to view this post
VIEW IN TELEGRAM
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.
Implementing these tips can streamline the build process for embedded software, making development faster, more efficient, and better suited to modern development practices.
#programming #cmake #software
Please open Telegram to view this post
VIEW IN TELEGRAM
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.
#programming
Please open Telegram to view this post
VIEW IN TELEGRAM
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.
#programming
Please open Telegram to view this post
VIEW IN TELEGRAM
Embedded Systems
This media is not supported in your browser
VIEW IN TELEGRAM
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
Features of the language:
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
More information:
#news #swift #programming
Please open Telegram to view this post
VIEW IN TELEGRAM
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.
#articles #qt #flutter #programming
Please open Telegram to view this post
VIEW IN TELEGRAM
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
#news #crowdstrike #rust #programming #security
Please open Telegram to view this post
VIEW IN TELEGRAM
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.
#articles #programming
Please open Telegram to view this post
VIEW IN TELEGRAM
PythonRobotics is a collection of robotics algorithms implemented in
The repository includes:
This GitHub repository is perfect for robotics learners and developers who want practical, easy-to-follow implementations of widely-used algorithms.
More information:
#programming #python #robotics
Please open Telegram to view this post
VIEW IN TELEGRAM
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
#articles #programming
Please open Telegram to view this post
VIEW IN TELEGRAM
Setting up a development environment for the
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.
#articles #programming #raspberry
Please open Telegram to view this post
VIEW IN TELEGRAM
Embedded Systems
Over a month has passed since the second
In his video, they compete to program an
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.
#video #esp32 #programming #IoT
Please open Telegram to view this post
VIEW IN TELEGRAM
YouTube
Fastest ESP32 programmer? Two developers race each other against the clock!
From ESP32 Prototype to Production: https://PredictableDesigns.com/esp32/?utm_source=youtube&utm_medium=description&utm_content=esp32-guide&utm_campaign=battle4-11142024
Get my help to develop, manufacture & launch: https://predictabledesigns.com/academy…
Get my help to develop, manufacture & launch: https://predictabledesigns.com/academy…
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.
#articles #programming
Please open Telegram to view this post
VIEW IN TELEGRAM
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.
#articles #programming
Please open Telegram to view this post
VIEW IN TELEGRAM
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:
The tutorials use
#courses #programming #linux #raspberry
Please open Telegram to view this post
VIEW IN TELEGRAM