What firmware does
A microcontroller does nothing until it has firmware. The firmware boots the chip, sets up the clock and the peripherals, and then runs the job the product was built for: measuring, controlling, displaying, sending. Between those jobs it puts the chip to sleep to save power.
The article on embedded software describes at length how that software is built up. This article is about having it developed.
The choices at the start
The microcontroller
The chip decides how much memory and processing power there is, which peripherals are available and which wireless protocols are supported. That choice is made during electronics development and has to be made with the firmware in mind.
Bare metal or an RTOS
Simple firmware runs without an operating system: one loop and a few interrupts. If the product has to do several things at once, such as measuring, updating a display and keeping a connection alive, a real-time operating system (RTOS) or an async framework helps keep those tasks apart.
The programming language
| Language | Strong at | Keep in mind |
|---|---|---|
| C | Supported by every chip vendor. A lot of existing code and examples. | The compiler does not stop memory bugs. Needs discipline, coding rules and static analysis. |
| C++ | More structure for larger codebases, with the same toolchains as C. | The same memory risks as C. Not every language feature fits a small chip. |
| Rust | Memory-safe by design: buffer overflows and use-after-free are stopped before the code compiles. Explicit and readable. | Younger ecosystem. Not every chip vendor ships Rust support itself. |
Testing: how you know it works
Firmware that compiles on the developer's laptop has not been tested yet. There are three levels, and they complement each other.
- Unit tests
- Single functions, tested on an ordinary computer. Fast, but they say nothing about timing or the hardware.
- Tests on the chip
- The firmware runs on the real microcontroller while a test rig simulates the parts around it. This is processor-in-the-loop (PIL) testing.
- Tests on the board
- The firmware runs on the prototype, with the real sensors and the real power supply.
Tests on the chip find faults a simulation misses: timing, interrupts that get in each other's way, a peripheral that behaves differently from what the datasheet suggests. Doing this on every build finds those faults in days instead of after the first board spin.
A good test plan covers more than normal use:
- Integration tests across all peripherals
- Timing and real-time behaviour
- Edge cases and recovery from faults, such as a watchdog that restarts the chip when the firmware hangs
- Sleep current
Updates and security
A connected product must be updatable after it is sold. That is a design decision, not an add-on: the bootloader, the memory layout and the signing of updates have to be right from the first version.
For products with digital elements on the European market, the Cyber Resilience Act (CRA) sets requirements here. The reporting obligations apply from 11 September 2026 and the remaining obligations from 11 December 2027. The article on embedded software goes into this further.
What you should get at delivery
- The source code, in a repository with its full history.
- Build and flash instructions, so another engineer can build the firmware without help.
- The test plan and the test report, with the result of each test on the real microcontroller.
- The build version the report refers to.
- Ownership, set down in writing.
Firmware without source code and a test report is not a delivery but a dependency.
How HERSMEED does it
HERSMEED writes the firmware alongside the design of the electronics. Our processor-in-the-loop test rig is wired directly to your microcontroller: it flashes every build, simulates the parts around the chip and runs the test plan you approved. A build ships only when every test passes and an engineer has reviewed the report.
You receive plain source code with build and flash instructions, and the test report. How it works shows an example of such a test run.
Frequently asked questions
What is the difference between firmware and embedded software?
The terms overlap. Firmware is the software that runs directly on the microcontroller, close to the hardware. Embedded software is broader and includes applications on, for example, embedded Linux. In a small device with one microcontroller they are the same thing.
Why Rust instead of C?
Rust stops whole categories of memory bugs, such as buffer overflows and use-after-free, before the code compiles. C has the widest support from chip vendors and the most existing code. HERSMEED writes firmware in Rust by default and delivers C or C++ on request.
How do I know the firmware works?
Through a test plan that belongs to the specification, and a report that shows for each test whether it passed on the real microcontroller. Ask for that report with every delivery.
What does it cost to have firmware written?
Freelance software developers in the Netherlands charge €94 an hour on average, specialist embedded consultancies up to €125. At HERSMEED the prototype firmware is part of the fixed €15,000, including tests on the real microcontroller.
Can firmware still be updated after the product is sold?
Yes, if the design is prepared for it from the start. An over-the-air (OTA) update needs a bootloader, enough memory for a second firmware image and a check on where the update came from.