Back To Basics: MISRA Guidelines

I recently learned about the MISRA guideline and I am digging in. Thought I will share what I learned about it.

MISRA (Motor Industry Software Reliability Association) is a consortium formed in the UK automotive sector to publish best-practice coding guidelines for safety/security-critical software. It publishes coding rules that define a safe subset of the language so code behaves the same on every build and is easier to review and test.

It’s applicable for functional safety systems. Functional safety means a system stays safe even when parts fail. We design software so a single fault does not create danger. In cars, this aligns with ISO 26262. Other domains use similar safety norms.

MISRA helps by cutting out parts of the C or C++ language that are risky. These tricky parts can cause hidden bugs, memory problems, or code that’s hard to understand and test. This is a good fit for embedded systems that run for years. It makes reviews and tests sharper and gives auditors solid evidence.

It contains things for example, things like Use nullptr, not 0 or NULL. Avoid tricky casts like reinterpret_cast. Prefer smart pointers and RAII over new and delete. Do not return a pointer or reference to a local variable. Make destructors noexcept. Keep macros and globals small and controlled etc. Some 200 odd guidelines.

Current state for C++is MISRA C++ 2023 based on C++17 and influenced by AUTOSAR C++14. MISRA C 2025 exists for C. Official guideline is paid and for purchase(but cheap). The process guide MISRA Compliance 2020 is free and explains how to claim compliance, deviations, and reports. Also, AUTOSAR C++14 is free and still worth a read. Search around, you will find links talking about the guidelines in detail if you are tight on budget and not buying.

From what I understood, MISRA is not about creating zero violations. It is more about defining a clear coding process with justified deviations. I think I will start to use this more in firmware development from now on.

If you liked the post, Share it with your friends!

Tech News: Arduino & Qualcomm

Unless you have been living under a rock, you would have heard this week that Qualcomm announced it will acquire Arduino. I have mixed feelings about it. Probably one of the most celebrated Open source companies gets bought by one of the most closed source hardware chip company ever!

It says Arduino keeps its brand, tools, and open-source mission. But knowing Qualcomm, I don’t have high hopes. They technically have been one of the worst offenders when it comes to putting detailed specs of devices out there. Their documentation is poor, it is always under NDAs, and they have this unspoken rule of not responding to folks who have a non-business ID when you reach out via mails. I desperately hope they prove me wrong this time with Arduino.
Along with this news, they also shipped an Arduino UNO form factor board “UNO Q”. It has a Debian-running Qualcomm Dragonwing QRB2210 application processor with an STM32U585 microcontroller for doing the low level IO. You get 2 GB RAM, 16 GB eMMC, Wi-Fi 5, Bluetooth 5.1(WCBN3536A – Qualcomm Chip), and video output over USB-C. Processor-wise, performance seems to be in the RPi-3 range of things. It’s supposed to be in the “AI for Edge” specific applications. QRB2210 has quad-core 2.0 GHz A53 CPU, Adreno GPU and Dual Camera ISP so can be good for Robotics and Vision IoT stuff. But not sure if it’s a right move when RPi already dominates this range.

It seems to have a new software IDE called Arduino AppLab which is a hybrid for doing Python development for the DragonWing and Arduino sketches for the STM32. Will need to try it out once the board arrives. Anyway, I checked the website documentation, schematic of the board is available (Layout Gerber is available but not the design files). As usual, nothing on the Qualcomm chip used on the board. Hopefully they make this chip atleast available to the public.
 
I just long for a day when I can read up and buy a single unit Qualcomm chip from a reseller without signing an NDA or reaching out to a sales rep. Then I will believe that this acquisition was different!  

If you liked the post, Share it with your friends!
1 7 8 9 10 11 99