In recent years, domestic electronics companies and chip design companies have aggressively attacked high-reliability applications such as automotive, medical and industrial (mission-critical) fields, finding new areas for themselves to get out of the Red Sea. However, most highly reliable applications require functional safety certification, which is common or even required in many industries such as automotive, avionics, medical and industrial control. These certifications go through the necessary processes and tests to fill out the functional safety checklist, which has always been a very difficult thing to do, but there are ways to speed up your certification.
While a lot of fine-tuning can be done to the development process to speed up your certification, all modern electronic information systems start with software – code quality. But how can you ensure code quality? Fortunately, with a few simple methods, you can improve the quality of your code almost immediately and make it as painless as possible.
Get help from standards
As a provider of embedded development tools used by nearly 50,000 enterprises/organizations worldwide, IAR’s R&D engineers assessed that there were approximately 190 ambiguities in the code specification in C99. That is, in C99, there are 190 different syntactic C constructs that are not explicitly stated in the C specification. In fact, things get a little worse in C18, and even worse in C++, where the concepts of multiple inheritance and virtual inheritance need to be introduced. Of course, the compiler has to turn your source code into concrete code, so it has to choose an interpretation of what the code means and then run with it.
What this means in practice is that you can get different compilers with different interpretations of the source code. In a highly reliable system, this is a nightmare scenario; Especially since many companies, in pursuit of functional safety certification as soon as possible, cross-compile their code on multiple platforms in order to facilitate testing. As you can imagine, this can have a very bad impact on your time to certification, because you have to test around all of these situations to prove the repeatability and reliability of your code.
How can we solve this problem? The short answer is to avoid ambiguity in your code. But how to do that? Using coding standards like MISRA can solve this problem quickly, because they are designed to keep you from falling into common types of traps in your code. These standards also advocate secure coding to reduce the number of vulnerabilities in your code. But how can we ensure that we follow these standards? Fortunately, functional safety standards provide an approach.