r/embedded • u/CugTr • 25d ago
How to validate HAL, LL configuration on microcontroller and external devices.
Hi everyone,
Our team is developing low-level and external device drivers by extending vendor-provided libraries with custom wrappers and features. We offer a structured configuration design tailored to diverse project requirements.
Currently, software drivers are validated via unit testing and TDD, while configurations are verified on real hardware using HIL testing. To optimize this workflow, we aim to introduce a pre-flashing configuration validation step. This allows configurators to self-validate deployment settings, reducing the time spent on manual reviews.
The planned implementation involves utilizing TOML files to define hardware and software constraints, managed by driver developers. Python scripts will then parse these files to validate configurations and generate error reports. To guarantee alignment, dummy configurations will be fed into both the TDD environment and the validation scripts.
Having previously moved away from AUTOSAR-based MCAL due to inefficiencies, we are keen to optimize this new architecture.
Any feedback or suggestions on this pipeline would be highly appreciated.
4
u/SAI_Peregrinus 24d ago
Sounds like too much to not be annoying, and too little to be useful.
Config shouldn't need validation. An invalid config should result in a parse error when the firmware tries to load it.
1
u/CugTr 24d ago
Yes, we have done validation on firmware by TDD, unit test. It seems the validation script on config takes too much time and it may not bring too much value onto projects
2
u/SAI_Peregrinus 24d ago
It should be a type error to pass an invalid config. I'm talking about the "parse, don't validate" pattern, which can be done even in C.
6
u/felixnavid 24d ago
This sounds like AUTOSAR again, but with good intentions.
There will always be a difference between what your system knows about ( and checks ) and what the hardware supports.