Getting Started With Zephyr: Devicetrees
This blog post provides an introduction to the "Devicetree", another unique concept in The Zephyr Project. We learn about the basic syntax of a device tree and how its structure and hierarchy mirror hardware, from the SoC to the final board. We also see how hardware described in a devicetree can be referenced and controlled in the source code of a Zephyr-based application.
NULL pointer protection with ARM Cortex-M MPU
This post explains how you can set up the ARM Cortex-M MPU (Memory Protection Unit) to protect thy code from dragons, demons, core dumps, and numberless other foul creatures awaiting thee after thou dereference the NULL pointer.
Call for Bloggers!
Are you passionate about embedded systems? Do you have valuable insights, tips, or stories to share with the embedded community? Do you want to reach a large and engaged audience of embedded enthusiasts and professionals? We are currently looking at adding a few more inspired writers to our team of bloggers.
Bellegram, a wireless DIY doorbell that sends you a Telegram message
A wireless button that uses the M5 STAMP PICO and Mongoose to send a Telegram message when pressed. The code is written in C
Getting Started with (Apache) NuttX RTOS Part 2 - Looking Inside and Creating Your Customized Image
In the previous article (https://www.embeddedrelated.com/showarticle/1524.p...) we saw how to run NuttX RTOS using the SIMulator. Today we will see how NuttX's directory tree is organized and how to use the menuconfig to enable some applications, including some tricks to search and solve dependencies.
NuttX Directories organization:
If you have previously compiled the Linux kernel or the U-Boot bootloader you will see that the NuttX source tree organization is...
Moulding the Embedded Systems Engineers of Tomorrow: Adapting to a Constantly Transforming Technological Terrain
Embedded systems engineers, previously focused on device architecture, are now steering the digital era, encompassing firmware, software, complex silicon, and cloud computing. To keep pace, mastery in new areas like cybersecurity, artificial intelligence (AI), machine learning (ML), and cloud technologies is critical. In today's highly connected world, security is foundational to design, necessitating knowledge in encryption, secure coding, and data protection laws. Additionally, expertise in AI and ML is essential for managing vast global data, requiring understanding of ethical implications and effective system design for data analysis. The advent of cloud technology mandates learning about cloud architectures and data security. In this fast-paced field, continuous learning and adapting these new skills is the key to staying relevant and spearheading future advancements.
Getting Started With Zephyr: Kconfig
In this blog post, we briefly look at Kconfig, one of the core pieces of the Zephyr infrastructure. Kconfig allows embedded software developers to turn specific subsystems on or off within Zephyr efficiently and control their behavior. We also learn how we can practically use Kconfig to control the features of our application using the two most common mechanisms.
An Iterative Approach to USART HAL Design using ChatGPT
Discover how to leverage ChatGPT and an iterative process to design and generate a USART Hardware Abstraction Layer (HAL) for embedded systems, enhancing code reusability and scalability. Learn the step-by-step journey, improvements made, and the potential for generating HALs for other peripherals.
Modern C++ in Embedded Development: (Don't Fear) The ++
While C is still the language of choice for embedded development, the adoption of C++ has grown steadily. Yet, reservations about dynamic memory allocation and fears of unnecessary code bloat have kept many in the C camp. This discourse aims to explore the intricacies of employing C++ in embedded systems, negotiating the issues of dynamic memory allocation, and exploiting the benefits of C++ offerings like std::array and constexpr. Moreover, it ventures into the details of the zero-overhead principle and the nuanced distinctions between C and C++. The takeaway? Armed with the right knowledge and a careful approach, C++ can indeed serve as a powerful, safer, and more efficient tool for embedded development.
Getting Started with (Apache) NuttX RTOS - Part 1
NuttX RTOS is used in many products from companies like Sony, Xiaomi, Samsung, Google/Fitbit, WildernessLabs and many other companis. So, probably you are already using NuttX even without knowing it, like the you was using Linux on your TV, WiFi router more than 10 years ago and didn't know too! Today you will have the chance to discover a little bit of this fantastic Linux-like RTOS! Are you ready? So, let's get started!
Ten Little Algorithms, Part 1: Russian Peasant Multiplication
This blog needs some short posts to balance out the long ones, so I thought I’d cover some of the algorithms I’ve used over the years. Like the Euclidean algorithm and Extended Euclidean algorithm and Newton’s method — except those you should know already, and if not, you should be locked in a room until you do. Someday one of them may save your life. Well, you never know.
Other articles in this series:
- Part 1:
C to C++: Bridging the Gap from C Structures to Classes
In our last post, C to C++: Proven Techniques for Embedded Systems Transformation, we started to discuss the different ways that C++ can be used to write embedded software. You saw that there is no reason to be overwhelmed by trying to adopt complex topics like metaprogramming out of the gate. An important concept to understand is that you can make the transition gradually into C++ while still receiving the many benefits that C++ has to offer.
One of the first...
Here Comes The Noise!
Noise. That awful thing which nobody wants that most sadly never learn about. It's time to change that with this blog post.
Levitating Globe Teardown, Part 1
I've been kicking some ideas around for a long time for a simple and inexpensive platform I could use for control systems experimentation for the beginner. I want something that can be controlled easily in a basic fashion, yet that provides some depth: I want to be able to present ever-more challenging goals to the student, that can be attained by fancier control algorithms all on the same device.
I'm currently looking at magnetic levitation. It's fun, it has the potential to be...
Boot Sequence for an ARM based embedded system
Hello all,
Allow me to introduce myself. I am Deeksha and I come from plains of North India. My tryst with embedded technologies has been 5 years long and every single day I am amazed with the vastness and learning involved. The thing with embedded technologies is either you are into it, or you aren't. You cannot just hang around half-heartedly (I guess that holds true for every field, for that matter).You have to keep the learning and sharing process going on. And that is the reason I am...
Getting Started With Zephyr: Devicetrees
This blog post provides an introduction to the "Devicetree", another unique concept in The Zephyr Project. We learn about the basic syntax of a device tree and how its structure and hierarchy mirror hardware, from the SoC to the final board. We also see how hardware described in a devicetree can be referenced and controlled in the source code of a Zephyr-based application.
Getting Started With Zephyr: Writing Data to EEPROM
In this blog post, I show how to implement a Zephyr application to interact with EEPROM. I show how the Zephyr device driver model allows application writers to be free of the underlying implementation details. Unfortunately, the application didn't work as expected, and I'm still troubleshooting the cause.
Introduction to Microcontrollers - Hello World
Embedded Hello WorldA standard first program on an embedded platform is the blinking LED. Getting an LED to blink demonstrates that you have your toolchain set up correctly, that you are able to download your program code into the μC, and that the μC and associated circuitry (e.g. the power supply) is all working. It can even give you good evidence as to the clock rate that your microcontroller is running (something that trips up a great many people,...
Which MOSFET topology?
A recent electronics.StackExchange question brings up a good topic for discussion. Let's say you have a power supply and a 2-wire load you want to be able to switch on and off from the power supply using a MOSFET. How do you choose which circuit topology to choose? You basically have four options, shown below:
From left to right, these are:
High-side switch, N-channel MOSFET High-side switch, P-channel MOSFET Low-side switch, N-channel...Padé Delay is Okay Today
This article is going to be somewhat different in that I’m not really writing it for the typical embedded systems engineer. Rather it’s kind of a specialized topic, so don’t be surprised if you get bored and move on to something else. That’s fine by me.
Anyway, let’s just jump ahead to the punchline. Here’s a numerical simulation of a step response to a \( p=126, q=130 \) Padé approximation of a time delay:
Impressed? Maybe you should be. This...
First-Order Systems: The Happy Family
Все счастли́вые се́мьи похо́жи друг на дру́га, ка́ждая несчастли́вая семья́ несчастли́ва по-сво́ему.— Лев Николаевич Толстой, Анна Каренина
Happy families are all alike; every unhappy family is unhappy in its own way.— Lev Nicholaevich Tolstoy, Anna Karenina
I was going to write an article about second-order systems, but then realized that it would be...
Lessons Learned from Embedded Code Reviews (Including Some Surprises)
My software team recently finished a round of code reviews for some of our motor controller code. I learned a lot from the experience, most notably why you would want to have code reviews in the first place.
My background is originally from the medical device industry. In the United States, software in medical devices gets a lot of scrutiny from the Food and Drug Administration, and for good reason; it’s a place for complexity to hide latent bugs. (Can you say “
Signal Processing Contest in Python (PREVIEW): The Worst Encoder in the World
When I posted an article on estimating velocity from a position encoder, I got a number of responses. A few of them were of the form "Well, it's an interesting article, but at slow speeds why can't you just take the time between the encoder edges, and then...." My point was that there are lots of people out there which take this approach, and don't take into account that the time between encoder edges varies due to manufacturing errors in the encoder. For some reason this is a hard concept...
Using a RTLSDR dongle to validate NRF905 configuration
I am currently working on a system to monitor the garage door status from my flat. Both places are 7 floors apart, and I need to send the data wirelessly. I chose to operate on the 433MHz carrier, and I ordered 2 PTR8000 modules: http://www.electrodragon.com/w/NRF905_Transceiver_433MHz-Wireless_ModuleThe PTR8000 is based on the dual band sub 1GHz NRF905 chipset from NORDICSEMI: http://www.nordicsemi.com/eng/Products/Sub-1-GHz-RF/nRF905I...OOKLONE: a cheap RF 433.92MHz OOK frame cloner
IntroductionA few weeks ago, I bought a set of cheap wireless outlets and reimplemented the protocol for further inclusion in a domotics platform. I wrote a post about it here:
//www.embeddedrelated.com/showarticle/620.php
Following that, I had access to another outlet from a different vendor:
http://www.castorama.fr/store/Prise-telecommandee-BLYSS---Interieur-prod4470027.html
The device documentation mentions that it operates on the same frequency as the previous...
Donald Knuth Is the Root of All Premature Optimization
This article is about something profound that a brilliant young professor at Stanford wrote nearly 45 years ago, and now we’re all stuck with it.
TL;DRThe idea, basically, is that even though optimization of computer software to execute faster is a noble goal, with tangible benefits, this costs time and effort up front, and therefore the decision to do so should not be made on whims and intuition, but instead should be made after some kind of analysis to show that it has net...
C to C++: Using Abstract Interfaces to Create Hardware Abstraction Layers (HAL)
In C to C++, we've been exploring how to transition from a C developer to a C++ developer when working in embedded system. In this post, we will explore how to leverage classes to create hardware abstraction layers (HAL). You'll learn about the various inheritance mechanisms, what an virtual function is, and how to create an abstract class.
Coding - Step 0: Setting Up a Development Environment
Articles in this series:
- Coding Step 0 - Development Environments
- Coding Step 1 - Hello World and Makefiles
- Coding Step 2 - Source Control
- Coding Step 3 - High-Level Requirements
- Coding Step 4 - Design
You can easily find a million articles out there discussing compiler nuances, weighing the pros and cons of various data structures or discussing the optimization of databases. Those sorts of articles are fascinating reads for advanced programmers but...
Introduction to Microcontrollers - Adding Some Real-World Hardware
When 2 LEDs Just Don't Cut It AnymoreSo far, we've done everything in this series using two LEDs and one button. I'm guessing that the thrill of blinking an LED has worn off by now, hard as that is to imagine. What's more, we've just about reached the limits of what we can learn with such limited I/O. We have come to the point where we need to add some hardware to our setup to continue with additional concepts and microcontroller...
Bad Hash Functions and Other Stories: Trapped in a Cage of Irresponsibility and Garden Rakes
I was recently using the publish() function in MATLAB to develop some documentation, and I ran into a problem caused by a bad hash function.
In a resource-limited embedded system, you aren't likely to run into hash functions. They have three major applications: cryptography, data integrity, and data structures. In all these cases, hash functions are used to take some type of data, and deterministically boil it down to a fixed-size "fingerprint" or "hash" of the original data, such that...