All jobs / Embedded / hardware / Firmware Architecture
Embedded / hardware interview question · 5+ years
The product has to move to a second MCU family, and the application code calls the vendor’s HAL directly everywhere.
What boundary do you set, and what do you hold the team to?
The strongest answer
One narrow interface we own — read this sensor, set this output — with the vendor HAL only behind it, so the application builds on the host and new silicon touches a single layer
Why it works
Right — the test is whether the application layer still builds with no vendor header in sight. That is also what makes host tests possible.
What a good answer covers
- Own the interface; hide the vendor behind it.
- Define it by what the app needs.
- The app builds with no vendor header.
- One layer changes when silicon changes.
Answers that fall short
- Close, but not the strongest: I would wrap the vendor HAL in our own driver layer so the application only calls our functions
That is the move; the part people skip is defining the interface by what we need, not mirroring the vendor’s API. - Weak: I would pick the vendor whose HAL is closest and port it function by function when the time comes
Porting call by call is exactly the cost you are trying to avoid, and it returns with every part change. - Red flag: I would copy the repository, port the copy to the new part, and let the two versions live side by side
Two forks means every bug fixed twice, and within a year they are two different products.
Who gets asked this
More Firmware Architecture questions
- A third-party blob must go in the image. What do you require?
- When do you stop OTA-supporting a SKU?
- An update will disable a feature people paid for. What do you do?
- A device must live ten years in a closet. What do you plan now?
- You wait for a bit in a `while (1)` with no timeout. What is wrong?
- When is `delay_ms(100)` acceptable, and when is it a smell?
- Describe how a super-loop firmware should be structured.
- Why split bootloader and application?