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.

MISRA support for the 430F249



Hi,

I am running the MISRA error checks for some code on the 430F249, I am finding there are a large number of issues with the the TI header files. Is there a switch so that only customer (non TI code) is checked?

I have also noticed issues such as the code below produces warnings 12.7 & 10.1 and relates to TI code, what is the best way of fixing this?

Thanks

 

{

P3SEL |= 0x11u;

// P3.0,4 USCI_A0 option select

UCA0CTL0 |= UCCKPH + UCMSB + UCMST + UCSYNC;

// 3-pin, 8-bit SPI master

UCA0CTL1 |= UCSSEL_2;

// SMCLK

UCA0BR0 |= 0x04;

UCA0BR1 = 0;

UCA0MCTL = 0;

UCA0CTL1 &= ~UCSWRST;

 

// **Initialize USCI state machine**

}

  • James Salisbury said:
    I am running the MISRA error checks for some code on the 430F249, I am finding there are a large number of issues with the the TI header files. Is there a switch so that only customer (non TI code) is checked?

    No.

    James Salisbury said:
    I have also noticed issues such as the code below produces warnings 12.7 & 10.1 and relates to TI code, what is the best way of fixing this?

    I don't know.  To work this on this issue further, I need to be able to build this code.  Please submit a test case as described in the last part of the forum welcome message.

    Thanks and regards,

    -George

  • Hi,

    I can submit some source code to you, but I don't want to submit it to the forum. Do you have an email address I could send the zip file to?

    Thanks

     

  • You can privately send me files via the forum.  Click on my icon.  Then, on the upper right, you will see a link titled Start Conversation.  Click that to bring up a message edit interface which includes, among other things, an icon for attaching a file.

    Thanks and regards,

    -George

  • Thank you for sending in a test case.  You should not see those MISRA diagnostics.  I filed SDSCM00040770 in the SDOWP system.  Feel free to monitor it with the SDOWP link in my sig below.  This SDOWP entry only applies to the compiler RTS header files.  The MSP430 specific files are supplied by a different team.  I'll let them know about their issues.  This shouldn't matter to you, except that you will probably see the fix for these issues arrive in pieces, and not all at once.

    Later edit adds the following ... There is no build switch to ignore MISRA diagnostics from TI supplied C and header files.  You can enable MISRA checks with a #pragma, and I suppose you could put that #pragma in right after including the TI files, but that doesn't seem practical to me.

    Thanks and regards,

    -George

  • Hi,

    Useing a #pragma switch wouldn't help, as some of the headers are used as #defines, a lot of the issues on the TI side are the use of // comments and also the constanst need the suffix u.

    Thanks

     

  • At this time there are no plans to update the run-time libraries to be misra compliant. You could prevent rts header file misra errors by using the CHECK_MISRA and RESET_MISRA pragmas. For example:

    #pragma CHECK_MISRA("none")
    #include <stdio.h>
    #include <stdlib.h>
    #pragma RESET_MISRA("all")

  • I think now it is possible to selectively alter build parameters of individual files/folders.

    I resolved my issue that way. Right click on the folders/files that have run-time libraries in them, select Properties and proceed to change the MISRA parameters. 

    A lock appears on the folder that has specialized build parameters. 

  • I just tried disabling MISRA checks for system header files using the pragmas as above. However this leads to another MISRA warning:

    #pragma CHECK_MISRA("none")
    #include "system.h"
    #pragma RESET_MISRA("all")

    #include "module.h"

    #1425-D (MISRA-C:2004 19.1/A) #include statements in a file should only be preceded by other preprocessor directives or comments.

    Is this a bug? I'm using ARM compiler 16.9.1
  • Thank you for letting us know about this problem.  I can reproduce it.  This does appear to be problem with the compiler.  I filed CODEGEN-3619 in the SDOWP system to have this investigated.  You are welcome to follow it with the SDOWP link below in my signature.

    Thanks and regards,

    -George