https://stackoverflow.com/questions/...32-programming
There are two common strategies that I'm aware of:
1.) Make sure you have a good SW component architecture, including a well-defined interface towards HAL/driver components that only take care of access to HW port registers. Devise a separate verification method for low-level HW-access components, which avoids unit-testing tooling. To establish such a verification concept, make sure to:
- avoid any processing logic in HAL/driver components as far as possible.
- avoid any HW dependencies and any non-portable code in the remaining parts of your SW.
Now you can take the HW-free parts of your code to some PC architecture (x86 or whatever) and do all your unit testing with conventional UT tools. Of course, your UT will miss any errors that are related to the differences between STM32 and your PC. Note that usually this is not too big a problem because HW-specific features have been "pushed" into the HAL, and in the other parts of the code, you are only looking for logical errors that have nothing to do with the HW/architecture.
I know that this part of the answer talks round your subject instead of providing the solution you were asking for. Nevertheless, this is what many projects do.
2.) Develop yourself an STM32 integration for your unit-testing framework, or buy a commercial unit-testing tool that supports your HW architecture. STM32 is very popular nowadays, so many commercial tools (Tessy, VectorCast
...Continue Reading