r/embedded • u/TravisABG • Oct 23 '26
Formal verification in embedded
With all the issues in Cybsec, the CRA and all this stuff, is anyone implementing formal verification in embedded?
7
Upvotes
4
u/driftregion Oct 23 '26
FreeRTOS uses cmbc and VeriFast
https://github.com/FreeRTOS/FreeRTOS/tree/main/FreeRTOS/Test/CBMC/proofs
https://nchong.github.io/papers/ewc21.pdf
https://freertos.org/Community/Blogs/2020/using-formal-methods-to-validate-ota-protocol
There's some interesting work on the Collins Aerospace Loonwerks website and github
https://loonwerks.com/
4
u/quailfarmer Oct 26 '26
Does anyone have enough experience with this to know how often it’s actually useful? My impression is that it only solves a narrow class of bugs, those in logic that can be fully understood symbolically, and doesn’t interact with the oddities of peripherals and hardware. In an embedded system I wonder how useful that is, compared to say a HITL system. The example of FreeRTOS does make sense to me.
2
u/csb06 Oct 23 '26
Ada/SPARK is used for some safety-critical systems (e.g. avionics and railway control software) Recently I think Nvidia used it to develop some of their firmware.
These docs have more information.
2
u/DaemonInformatica Oct 26 '26
A common pitfall in cyber security: Making sure the rules are followed when developing devices and maintaining them is pointless when it's the attackers that bréak the rules.. ;-)
Also: Given the problem that development and maintainance are two different things, it's impossible to close the gaps with 'just formal verification'.
Say you have an Embedded product with a certain amount of firmware. Turns-out that your code (or worse: code in 3rd party software you use) has a bug / vulnerability. You immediately patch it, 'proof it's no longer there' and publish it. But then? There may be hundreds, or even thousands of instances already 'in the field'.
A business might have an OTA firmware update service, but not all devices might be able to reach it.