This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Dear Team,
I am working with the RM48L series microcontroller, and I have enabled MISRA C rules, treating them as errors. After compiling my code, I am encountering errors in the "errata_SSWF021_45.c" file, which was generated by Halcogen. I kindly request your guidance on how to resolve this issue
Hi Rohit,
The error is due to the below reason:
As mentioned in above thread if the any operand to the right side of the logical operators (|| or &&) are volatile then we will get this MISRA error.
As you can see, we declared our structures as volatile:
So that is the reason we are getting this error. We can eliminate them by removing volatile, but this is not the good option in my point of view because the volatile here is to prevent the compiler optimizations and if we use volatile then every time, we access these registers then CPU read from memory instead of using saved value. If we didn't use volatile here then we might face some other issues.
So, my suggestion would be, better to ignore these MISRA errors.
--
Thanks & regards,
Jagadish.