What is embedded software?
Embedded software is software built into a device with one fixed job. A laptop runs software that has to be able to do anything and that the user installs. A device runs software that has to do one thing well, on hardware chosen for exactly that device. Often the device has no screen or keyboard, and the user only notices there is software inside when something goes wrong.
What sets embedded software apart from ordinary application software:
- Real time. The software must respond within a fixed time: correct a motor, read a sensor, close a valve. In hard real time, late is as wrong as incorrect; in soft real time, late is a nuisance but not dangerous.
- Few resources. The nRF52840, a widely used chip for Bluetooth products, has 256 kB of RAM and 1 MB of flash. A smartphone has tens of thousands of times more RAM. Every kilobyte and every milliampere counts.
- Reliability. Nobody is standing by to restart the device. The software has to catch and recover from faults itself, for example with a watchdog that restarts the device when the software hangs.
- Long life. An industrial sensor or a charging station stays in the field for ten years or more. The software has to remain maintainable and updatable all that time.
- Power. Many devices run on a battery and sleep most of the time. How efficient the device is depends on the software at least as much as on the hardware.
Embedded software, firmware and embedded systems: the difference
The three terms are often used interchangeably. This is how they relate:
| Term | What it is | Example |
|---|---|---|
| Embedded system | The whole: processor, circuit board, sensors and the software on it, built into a product. | The electronics in your product |
| Embedded software | All software that runs on that system, from the lowest layer to the application. | Control, display, app connection and updates |
| Firmware | Software that belongs to the hardware and lives in flash memory. On a microcontroller that is in practice the whole of the embedded software; in larger systems it often means the lowest layer. | The program in your product's microcontroller |
In short: the embedded system is the device, embedded software is what runs on it, and firmware is embedded software that sits directly on the hardware. For products with a microcontroller, embedded software and firmware mean practically the same thing.
Designing hardware and software together
In an embedded product, hardware and software cannot be seen apart. Which pin a sensor uses, whether a signal can raise an interrupt, whether a channel runs to the DMA controller: that is fixed on the circuit board and decides what the firmware can do. A wrong choice in the schematic later costs an extra board round, or a workaround in software that makes the product slower or less efficient.
During design you also divide the work between hardware and software. A filter, a comparator or a voltage monitor can sit in hardware or in software. Hardware is faster and takes load off the processor; software is cheaper and can still be changed later. Designing the electronics and the firmware together means making that trade-off once and well, instead of two teams having to resolve it afterwards.
Bare metal, RTOS or embedded Linux
One of the first choices is what the software runs on. There are three common approaches.
Bare metal means without an operating system. The program is a main loop plus interrupts that respond to events. It is the smallest, fastest and most predictable approach, and suits simple devices and the smallest microcontrollers.
An RTOS (real-time operating system) divides the work into tasks, each with its own priority. A scheduler makes sure the most important task always gets its turn on time. Tasks exchange data through queues, semaphores and mutexes. Well-known options are FreeRTOS, Zephyr and Eclipse ThreadX; certified commercial variants exist for safety-critical products. In Rust, Embassy and RTIC are popular: frameworks that schedule tasks on a microcontroller without a classic RTOS.
Embedded Linux runs on a more powerful application processor with external memory. You get a full operating system with networking, file systems, display support and thousands of existing software packages. You build the system with Yocto or Buildroot and describe the hardware in a device tree. Linux is not hard real time by itself; since version 6.12 the real-time extension PREEMPT_RT is in the mainline kernel, but for the strictest requirements manufacturers often put a microcontroller next to it.
| Approach | Hardware | Boot time | Real time | Suited to |
|---|---|---|---|---|
| Bare metal | Microcontroller, from a few kB of RAM | milliseconds | very predictable | Sensors, simple controllers, battery devices |
| RTOS | Microcontroller, tens to hundreds of kB of RAM | milliseconds | predictable, with priorities | Devices with several concurrent tasks: radio, sensors, display |
| Embedded Linux | Application processor with external RAM, from tens of MB | seconds | limited, better with PREEMPT_RT | Gateways, devices with a screen, a camera or many network functions |
A rule of thumb: choose the simplest approach the product can live with. More layers mean more memory, more power and more to maintain and secure.
Programming languages for embedded software: C, C++, Rust and assembly
The language decides how fast you develop, how many faults end up in the product and how easily others maintain the code later.
| Language | Strong at | Keep in mind |
|---|---|---|
| C | The standard for decades. Every chip has a C compiler, and vendors ship their example code and drivers in C. Many engineers know the language. | Memory bugs, such as buffer overflows, only show once the software runs. Coding standards such as MISRA C, now in the MISRA C:2025 edition, limit that risk. |
| C++ | Abstractions and reuse without making the product slower. Widely used in larger embedded projects. | Embedded work usually uses a restricted subset, without exceptions and dynamic memory. The language is large and complex. |
| Rust | Memory-safe by design: the compiler stops whole categories of faults before the program runs, without giving up performance. Modern tools for building, testing and flashing. | Less example code from chip vendors than in C, and fewer engineers who already know it. Support differs per chip family. |
| Assembly | Full control over the processor. | Only for small pieces: start-up code or a routine where every clock cycle counts. |
Memory safety is not a theoretical advantage. Microsoft reported that about 70 percent of the vulnerabilities it fixes each year are memory bugs: exactly the kind of fault Rust stops at compile time. Rust is also usable in regulated sectors. The Ferrocene compiler is qualified for ISO 26262 (ASIL D), IEC 61508 (SIL 4) and IEC 62304 (class C).
HERSMEED writes firmware in Rust by default. If your team works in C or C++, we deliver the firmware in that language on request.
Microcontrollers and processor architectures
Most embedded products run on a microcontroller: a chip with processor, memory and peripherals in one. The most used architecture is ARM Cortex-M, from the low-power Cortex-M0+ to the fast Cortex-M7. RISC-V, an open architecture, is gaining ground quickly; Espressif's ESP32-C3 and ESP32-C6 already use it.
Well-known families are STM32 from STMicroelectronics (a very wide range), nRF52 and nRF54 from Nordic Semiconductor (Bluetooth and Thread), ESP32 from Espressif (Wi-Fi at a low price), RP2040 and RP2350 from Raspberry Pi, and the families of NXP and Microchip. The choice depends on:
- the peripherals and radio the product needs;
- the current draw in active and sleep mode;
- availability and lead time, now and in ten years;
- support in tools and languages, including Rust;
- the unit price at the expected volumes.
Peripherals and low-level programming
Programming a microcontroller largely means driving the chip's peripherals. They are configured through registers, addresses in memory through which the software operates the hardware. A HAL (hardware abstraction layer) wraps those registers in readable functions. The main parts:
- GPIO
- Pins the software switches on or off, or reads: an LED, a button, a relay.
- Timers
- Count time precisely, for measurements, delays and periodic tasks.
- ADC
- Converts an analogue voltage into a number, for example from a temperature sensor or a battery.
- PWM
- A square wave with an adjustable duty cycle, to control a motor, LED or buzzer.
- Interrupts
- Let the processor respond at once to an event, such as an incoming message, instead of having to keep checking.
- DMA
- Moves data between peripherals and memory without the processor, leaving it free or asleep.
Communication protocols
An embedded device talks to sensors on the board, to other devices and often to the internet. Each protocol suits its own distance, speed and use.
| Protocol | What for | Typical use |
|---|---|---|
| UART | Simple serial link between two chips | GPS module, debug log |
| I²C | Slow bus with several chips on two wires | Sensors, EEPROM |
| SPI | Fast link on the board | Display, flash memory, radio chip |
| CAN and CAN FD | Robust bus between devices in vehicles and machines | Cars, agricultural machines, industry |
| USB and Ethernet | Wired connection to a PC or network | Configuration, gateways, industrial networks |
| Bluetooth Low Energy | Low-power wireless link to a phone | Wearables, smart locks, sensors |
| Wi-Fi | High-speed wireless internet | Household appliances, cameras |
| Thread and Matter | Low-power mesh network and a shared standard for smart homes | Lighting, sensors, switches |
| LoRaWAN, LTE-M, NB-IoT | Small amounts of data over kilometres | Meters, agriculture, tracking |
Memory, start-up and drivers
A microcontroller has two kinds of memory. Flash holds the code and fixed data; it is kept when power is removed. RAM holds the variables and the stack; it is fast, but small and volatile. A linker script fixes what goes where: the memory map of the program.
At power-up the start-up code runs first. It sets up the interrupt vector table, copies initial values to RAM, configures the clocks and only then starts the actual program. Often a bootloader comes before that, checking that the firmware is valid and able to install updates.
Because memory is so limited, embedded engineers reserve most memory up front instead of requesting it while running. That way memory cannot fragment, and you know in advance whether the program fits. A stack that is too small is a classic cause of faults that only occur sometimes.
The software itself is built in layers. Each layer knows only the layer below, so you can for example replace a sensor without rewriting the application:
Example: what is inside a wireless sensor
Take a temperature sensor that measures every minute, sends the value to an app over Bluetooth and runs for two years on a coin cell. This is how the parts of this article come together:
- Chip: an nRF52840 with Bluetooth on board.
- Approach: bare metal or a light scheduler; there are only a few tasks.
- Peripherals: I²C to the temperature sensor, a timer that wakes the chip every minute, the ADC for the battery voltage.
- Power: the chip sleeps more than 99 percent of the time. Average current has to be around 10 µA.
- Reliability: a watchdog restarts the chip when the software hangs, and the device reports the reason at the next connection.
- Updates: a bootloader installs new, signed firmware over Bluetooth and falls back to the previous version if it does not start.
- Testing: every build runs on the real chip, with a simulated sensor and measured sleep current.
How embedded software is developed
Developing embedded software follows the same steps as other software, but with the hardware in every step:
- Requirements. What must the product do, under which conditions, and how do you check that? A good specification names a measurable test for every requirement.
- Design. The split between hardware and software, the choice of bare metal, RTOS or Linux, and the layers and tasks of the software.
- Implementation. Writing the code, preferably in small steps that are each tested on the hardware.
- Testing. Demonstrating every requirement with a test, from single functions to the complete device. More on that below.
- Maintenance. Fixing faults and releasing security updates for as long as the product is in the field.
Tools
A toolchain turns the source code into a program for the chip: GCC or Clang for C and C++, rustc and Cargo for Rust. Around it teams use a development environment, such as VS Code, Keil MDK, IAR Embedded Workbench or the chip vendor's own. A debug probe connects to the chip over JTAG or SWD, so you can follow the code step by step; well-known probes are J-Link and ST-LINK, with GDB, OpenOCD or probe-rs as software.
Good embedded teams work like good software teams: all code in version control, a build system that gives the same result every time, and continuous integration that builds and tests on every change, on the real hardware too. Also record which firmware version belongs to which board revision.
Testing embedded software
Testing embedded software is harder than testing ordinary software, because the faults often only occur on the real chip: timing that is just off, an interrupt at the wrong moment, a current draw higher than calculated. That is why teams combine several kinds of test:
| Kind of test | What actually runs | What it finds |
|---|---|---|
| Static analysis | Nothing: the code is read | Violations of coding standards, suspicious constructs |
| Unit tests on the PC | Single functions, on the development computer | Faults in calculations and logic, quickly and often |
| Simulation | The complete application, on the PC; sensors, actuators and environment are simulated | Whether the application does functionally what the specification asks, still without hardware |
| Processor-in-the-loop (PIL) | The firmware on the real microcontroller; the environment is simulated | Timing, interrupts, peripherals, recovery from faults |
| Hardware-in-the-loop (HIL) | The complete board or device; the environment is simulated | Faults in the interplay between electronics and firmware |
| System and field tests | The complete product in its real environment | Behaviour under real conditions, long-duration problems |
Engineers also use measuring instruments: an oscilloscope for signals, a logic analyser for protocols such as I²C and SPI, and a current meter for consumption. Logging through the debug probe shows what the software does without slowing the device down.
At HERSMEED every firmware build runs on the real microcontroller, in a processor-in-the-loop test rig. It flashes the build, simulates the parts around the chip and runs the test plan the client approved beforehand. A build ships only when every test passes and an engineer has reviewed the report. Read more in how it works.
The earlier a fault shows up on the real chip, the less it costs.
Optimising: memory, speed and power
Memory. Compiler settings such as optimising for size and link-time optimisation make the program smaller. It also helps to avoid heavy libraries and to leave text and tables in flash instead of RAM.
Speed. Measure first where the time goes, then optimise only that part. DMA and interrupts often take more load off the processor than cleverer code.
Power. Most of the gain is in sleeping: the chip back in its deepest sleep mode as fast as possible, peripherals off when not needed, and the radio on as briefly as possible. A worked example: a CR2032 coin cell holds about 225 mAh. At an average draw of 10 µA that is in theory 22,500 hours, a little over 2.5 years. At 20 µA it is half that. Every microampere in sleep counts, and you measure it on the real hardware.
Security and legislation
A connected device is a target. Attackers sometimes have the device itself in their hands, read out the firmware through an open debug port, or send a forged update. The main measures:
- Secure boot: the chip only starts firmware with a valid signature.
- Signed updates: an update is installed only if the signature is correct; an older, vulnerable version is refused.
- Debug port closed in production, so the firmware and keys cannot be read out.
- Keys in hardware, in a secure element or a protected part of the chip, such as ARM TrustZone.
- Unique credentials per device, no default passwords.
- A list of all software components (SBOM) and a fixed way to report and fix vulnerabilities.
Legislation in the EU
Since 1 August 2025, cybersecurity requirements under the Radio Equipment Directive apply to wireless devices that connect to the internet, process personal data or enable payments. Manufacturers can show compliance with the standards EN 18031-1, -2 and -3.
The Cyber Resilience Act (CRA) goes further and applies to almost every product with digital elements that connects to a device or network, including hardware with embedded software. Since 11 September 2026, manufacturers must report actively exploited vulnerabilities and severe incidents: an early warning within 24 hours, a notification within 72 hours. From 11 December 2027 the remaining obligations apply, such as security by design and security updates throughout the support period.
This is a summary, not legal advice. Have someone check which requirements apply to your product.
Updates in the field (OTA)
With over-the-air (OTA) updates you update the firmware without recalling the device. That is needed for security updates, and so for the CRA as well. A good update system:
- keeps two copies of the firmware, so the device falls back to the old one if the new one does not start;
- survives a power cut in the middle of an update;
- installs only signed updates and refuses older versions;
- works over the connection the product already has: Bluetooth, Wi-Fi or a mobile network.
Build the update path in from the start. A device that reaches the market without a way to update will not get one later.
Functional safety and standards
If a fault in the software can injure someone, the product falls under a functional safety standard. That standard determines how you develop, test and document, and which tools you may use.
| Standard | Sector | Levels |
|---|---|---|
| IEC 61508 | Industry, and the basis for most sector standards | SIL 1 to 4 |
| ISO 26262 | Cars | ASIL A to D |
| IEC 62304 | Software in medical devices | Class A to C |
| DO-178C | Aviation | DAL A to E |
If your product falls under such a standard, raise it before development starts. Demonstrating safety afterwards costs many times more than building it in from the beginning.
Applications and IoT
Embedded software is in almost every sector:
- Industry and automation: sensors, motor drives, machine controllers.
- Energy: charging stations, inverters, smart meters, battery management.
- Medical devices: monitors, pumps, portable meters.
- Automotive and mobility: control units, e-bikes, scooters.
- Consumer electronics and smart homes: locks, lighting, wearables.
- Agriculture and logistics: soil sensors, trackers, cold-chain monitoring.
- Robotics and aerospace.
IoT devices add a layer: the connection to the internet. The device sends data through a gateway or straight to the cloud, often with a protocol such as MQTT, and gets settings and updates back. More and more processing happens on the device itself, known as edge computing: it saves data traffic and power, and keeps working when the connection drops.
Trends in embedded software
- AI on the microcontroller. Small neural networks recognise sound, motion or anomalies on the chip itself. New microcontrollers get a dedicated processing unit for it, such as the STM32N6.
- Rust. The language has been in the Linux kernel since 2022 and is more and more often the choice for new firmware, precisely for its memory safety.
- Matter. One standard for smart homes, so devices from different brands work together.
- RISC-V. An open processor architecture without licence fees, now in more and more microcontrollers.
- Stricter legislation. With the CRA, security and updates become a legal requirement for almost every connected product.
- AI in development. AI writes a growing share of the code. That makes testing on real hardware and review by engineers more important, not less.
Pitfalls and good habits
Embedded software gives a product its functions, makes it updatable later and is cheaper to change than hardware. The challenges are the limited resources, the dependence on the hardware and the long life in the field. These are the mistakes we see most often, with what to do about them:
- A vague specification. Record for each requirement how you test it. Vague requirements are the biggest source of extra work.
- Testing on the real hardware too late. Test on the real chip from the first build, not when the product is nearly finished.
- No recovery from faults. Use a watchdog, record the reason for a restart, and test what happens when a sensor drops out.
- No update path. Build in signed OTA updates before the first delivery.
- Leaving the debug port open. Close it in the production version.
- Parts without a future. Choose chips that are and will stay available; check lead times and the lifetime the manufacturer promises.
- All knowledge with one person. Make sure there is readable code, documentation and tests, so someone else can take over.
- Managing firmware and hardware separately. Record which firmware version belongs to which board revision.
The essentials
- Embedded software runs in a device with one job, on little memory and power, and has to respond on time and stay reliable for years.
- On a microcontroller, embedded software and firmware are practically the same.
- Choose the simplest base that fits: bare metal, an RTOS or embedded Linux.
- C is the standard; Rust stops memory bugs before the product runs.
- Test early and on every build on the real chip.
- With the CRA, security and updates are a legal requirement: build them in from the start.
Frequently asked questions
What is embedded software?
Software built into a device with one fixed job, such as a sensor or a machine controller. It runs on a microcontroller or a small processor, with little memory and often on a battery.
What is the difference between firmware and embedded software?
Firmware is embedded software that belongs to the hardware and lives in the chip's flash memory. For products with a microcontroller the two mean practically the same. In larger systems, with Linux for example, firmware often means only the lowest layer.
Which programming language is used for embedded software?
Usually C, sometimes C++, and increasingly Rust. C is supported by every chip; Rust prevents memory bugs at compile time. Assembly is used only for small, critical pieces. HERSMEED writes in Rust by default, and in C or C++ on request.
What is an RTOS?
A real-time operating system: a small operating system that divides the work into tasks with a priority, and makes sure the most important task always gets its turn on time. Well-known examples are FreeRTOS and Zephyr.
How do you test embedded software?
With a combination of static analysis, unit tests on the PC, simulation of the complete application, tests on the real microcontroller (processor-in-the-loop), tests with the complete hardware (hardware-in-the-loop) and tests in the real environment. The earlier a test runs on the real chip, the cheaper the faults it finds.
What does an embedded software engineer do?
They write and test the software in devices: drivers for the peripherals, the control and logic of the product, communication and updates. They work close to the hardware, read datasheets and schematics, and measure with an oscilloscope and a logic analyser.
What does it cost to have embedded software developed?
It depends mostly on what the product has to do and on whether you pay by the hour or a fixed price. At HERSMEED a prototype, with electronics and firmware, costs a fixed €15,000. Read what it costs to have an embedded product developed.
Glossary
- ADC
- Analog-to-digital converter: turns a voltage into a number.
- Bare metal
- Software that runs directly on the hardware without an operating system.
- Bootloader
- Small program that checks the firmware at start-up and installs updates.
- DMA
- Direct memory access: moves data without involving the processor.
- Flash
- Memory that is kept without power; this is where the firmware lives.
- GPIO
- General-purpose input/output: a pin the software drives or reads.
- HAL
- Hardware abstraction layer: readable functions on top of the chip's registers.
- HIL
- Hardware-in-the-loop: testing with the complete hardware in a simulated environment.
- I²C, SPI, UART
- Links between chips on the board.
- Interrupt
- Signal with which the hardware makes the processor respond at once.
- Microcontroller
- Chip with processor, memory and peripherals in one.
- OTA
- Over-the-air: updating firmware over the wireless link.
- PIL
- Processor-in-the-loop: testing the firmware on the real processor, with a simulated environment.
- PWM
- Pulse-width modulation: a square wave used to control power.
- RTOS
- Real-time operating system: divides the work into tasks with priorities.
- SBOM
- Software bill of materials: list of all software components in a product.
- SWD and JTAG
- Connections for programming and debugging a chip.
- Watchdog
- Timer that restarts the chip when the software hangs.
Sources
- McCann FitzGerald: Cyber Resilience Act, reporting obligations apply from 11 September 2026
- SGS: RED cybersecurity requirements mandatory on 1 August 2025
- eeNews Europe: MISRA C launches 2025 guidelines
- Ferrous Systems: Ferrocene qualified for IEC 62304, ISO 26262 and IEC 61508
- Microsoft Security Response Center: a proactive approach to more secure code