FreeRTOS kernel static analysis compliance

Hi,
Does FreeRTOS kernel claims any static analysis compliance? If yes, can the static analysis reports shared with the customers ?

See here: FreeRTOS - Free RTOS Coding Standard and Style Guide - the MISRA mentioned is 2004, as the kernel is nearly 20 years old. New libraries (coreMQTT, etc.) are checked with Coverity - you can see the release criteria at the bottom of this page: LTS Libraries - FreeRTOS

1 Like

Hi,
Here, and in other forum posts it is stated that MISRA 2004 is applied to the Kernel. The provided pc-lint configuration however is, I believe, for MISRA 1998.
Is the current configuration available? Also as asked in the original question, can the current static analysis report be shared?

Thanks
Stephen

@SteveB thanks for reaching out with your questions.

The lint configuration does seem old. I know I’ve personally used newer configurations for our Coverity MISRA checks. I’m not sure if the newer configuration and/or the current reports can be shared. It’s my understanding that the license we have is fairly explicit on what can and cannot be shared. I’ll need to circle back with a definite answer once I have more information.

After double checking…

We cannot share our Coverity reports. Unfortunately this is prohibited by the license we have.

We can share our Coverity configuration. Some of our repos (but likely not all) have the Coverity configuration within them. An example is FreeRTOS-Plus-TCP which has it’s configuration here and a specific breakdown of which violations in it here.

I hope this helps!

Hi Kody,

Thanks for looking into it.

Cheers

Steve

1 Like

Hi there, two things missing from the “FreeRTOS Coding Standard and Style Guide” regarding MISRA-C compliance:

  1. Compliance with WHAT version of MISRA-C?
    Unless I’ve missed something visually, neither the year “2004” nor the year “2012” are listed on that page.

  2. MISRA-C compliance was verified starting with WHICH FreeRTOS version?
    Did it start with FreeRTOS version 7? 8? 9? 10? LTS?

Help?

Hey @philCryoport and welcome to the FreeRTOS Forums!
The FreeRTOS-Kernel conforms to MISRA C:2012 guidelines. Compliance is checked with the Coverity Static Analysis Tool.
As part of the work to support Symmetric multiprocessing we have added a MISRA.md file to the FreeRTOS-Kernel which contains the rules and directives we deviate from.
If you have any questions after viewing the MISRA.md please let us know!

Hi @skptak ,
Thank you for replying back. That MISRA.md file appears to only have been created 3 weeks ago – and the first release for that repo was v10.4.0.

What about prior versions of the FreeRTOS-Kernel? Which of those versions were verified as MISRA-C-compliant-with-deviations – and for which version of MISRA were those versions compliant?

We’re looking at code that currently uses FreeRTOS 9 – and latest FreeRTOS provided by the chip manufacturer is FreeRTOS 10.3.1. Trying to find out what, if any, MISRA-C compliance those versions had.

As mentioned in this post, it was MISRA 2004 with prior versions of the kernel. This will include versions versions 10.3.1 and lower.
As can be expected, we would recommend use of the more recent versions of the kernel, where possible.

To my knowledge no official audit was ever done to claim specific compliance, so at best I think you should assume that the code mostly/generally adheres to the MISRA rules. There are also a list of known deviations listed in the post Richard linked above, so expect those violations at least.

If you are looking for a certified version that was validated, that is of course available commercially as SafeRTOS.

If MISRA compliance is important to your project I would recommend you just run the code through your favorite MISRA checker and get a precise answer.

What we can say is that the Kernel code is pretty stable nowadays, so the 10.3.1 code is not grossly different from the 10.6.0 code, and mostly complies to MISRA-2012. Where it deviates generally there is a deviation noted in a comment in the code to indicate this.

The intent is to manage MISRA compliance more robustly in the near future. The license restrictions imposed by commercial MISRA checkers makes this challenging on an open source project, but we are actively working on solving this problem.

About the repository itself and it’s age, I am curious to understand the relevance of your comment here. For context - we merged the SMP code into mainline 3 weeks ago, that is why the MISRA.md file was added as part of that merge. The repository itself existed since May 2, 2006 in SVN. You will see that I was the one who did the 10.4.0 Github release, which was the first release done using Github as the tool. We retained all commit history and releases back to version 4.0.1 in the repository when we transferred it though. These releases can be seen under Tags, so although they do not have Github release entries they are present in the repository. See e.g. V4.0.1 here

Sorry - late to this. For the kernel, original compliance was to MISRA 2004 as determined by PC-Lint (different tools give different results). It sounds like that may have more recently been changed to MISRA 2012 to bring it into line with the newer libraries which always used 2012.

For the kernel, being a library that doesn’t actually call the API functions itself, lint gave zero errors with the posted lint configuration file, but the “wrap up” section gave lots of warnings about functions not being used.

Thank you all for the rapid replies and for the information you provided! I’m going to ping the chip manufacturer to ask them to certify a more-current version of FreeRTOS – preferably the LTS version…

@philCryoport And thanks to you for being part of the FreeRTOS community and asking about the Kernel! Would you mind sharing what chip/board you’re working on? It may be possible to use the most recent Kernel with the MISRA compliance that was performed as part of the 10.6.0 release.