infineon4engineers Facebook

infineon@google+ Google+

infineon@linkedin linkedin

infineon4engi@twitter twitter

infineon@youtube youtube

+ Reply to Thread
Results 1 to 9 of 9

Thread: Still too many MISRA 2004 violation in MCAL

  1. #1
    Beginner Beginner alexshao1978 is on a distinguished road
    Join Date
    Nov 2011
    Location
    ShangHai
    Posts
    31
    Points
    51.875

    Still too many MISRA 2004 violation in MCAL

    I just make a XC2000 MCAL project with ADC,DIO,PORT,MCU,GPT,IRQ.
    I try to using MISRA2004 check tool in Tasking VX...
    I know there are some MISRA2004 violation described in MCAL files...
    But it still surprise me that MCAL still have too many MISRA2004 violation...
    In my project, at least 74 violation are found with default custom check and 390 warning with all supported check.

    Hope IFX to improve it, or the user can't check whether his code is violate MISRA2004...

  2. #2
    Moderator Moderator Markus Kroh is on a distinguished road
    Join Date
    Jul 2011
    Location
    Germany
    Posts
    21
    Points
    21.85302734375
    Dear alexshao1978,

    The MISRA violations in the MC-ISAR drivers are described within release notes which are included in the software package. Hence the MISRA violations are described and by intension.

    Which driver package and version number are you using?

    Best regards

    Markus

  3. #3
    Beginner Beginner alexshao1978 is on a distinguished road
    Join Date
    Nov 2011
    Location
    ShangHai
    Posts
    31
    Points
    51.875
    The package I using now is below, from releasenotes of MCAL:
    Product Name MC-ISAR_AS3x_XC2000_BASE_V001
    Release Version 0.0.1
    Type Of Release Alpha
    Name of the Supplier Infineon Technologies AG
    Mode of Release Infineon Security Server
    Date of Release 02 June 2011

    I kown every .c files will give explain such as in Mcu.c:
    Information on MISRA violations:
    - MISRA Rule 19.15: Repeated include file 'MemMap.h'
    This warning cannot be avoided since inclusion of the file MemMap.h is done
    for memory mapping of the code and data
    The warning for Mcureg.h is a false alarm since the contents of the file
    are not included repeatedly. This warning is not available while using
    Tasking MISRA check
    - MISRA Rule 19.1: Only preprocessor statements and comments before '#include'
    Inclusion of the file MemMap.h is done for memory mapping of the code and
    data. This violation cannot be avoided.
    - MISRA Rule 19.7: Usage of function-like macro cannot be avoided
    - MISRA Rule 11.1,11.3: cast from unsigned short to pointer
    This violation occurs since the value of the address of an SFR is
    type casted to a pointer.
    - MISRA Rule 8.1:
    Violation is for use of symbols '__int166', '_nop()', but cannot be
    avoided
    - MISRA Rule 14.7:
    Multiple exit points for a function is done during error checks to exit
    from the routine without performing any other functionality
    - MISRA Rule 10.5: Shift right of signed quantity (int)
    Violation occurs while shifting contents of SFRs, but cannot be avoided
    - MISRA Rule 17.4: Pointer arithmetic should not be used
    This rule is not considered for configuration pointers since the arithmetic
    used on these pointers is done within the valid range.
    - MISRA Rule 16.6: Too many arguments (3) for prototype 'Mcu_lCopyWords
    (unsigned short)'. This is a false alarm since the number of arguments
    passed to the function match the number of parameters.
    - MISRA Rule 1.2: Undeclared identifier
    The error is generated for compiler labels e.g., _lc_gb_mcu_code_psram_flash
    whose usage cannot be avoided

  4. #4
    Beginner Beginner alexshao1978 is on a distinguished road
    Join Date
    Nov 2011
    Location
    ShangHai
    Posts
    31
    Points
    51.875
    The version is :
    Product Name MC-ISAR_AS3x_XC2000_BASE_V001
    Release Version 0.0.1
    Type Of Release Alpha
    Name of the Supplier Infineon Technologies AG
    Mode of Release Infineon Security Server
    Date of Release 02 June 2011

  5. #5
    Beginner Beginner alexshao1978 is on a distinguished road
    Join Date
    Nov 2011
    Location
    ShangHai
    Posts
    31
    Points
    51.875
    The version is:
    Product Name MC-ISAR_AS3x_XC2000_BASE_V001
    Release Version 0.0.1
    Type Of Release Alpha
    Name of the Supplier Infineon Technologies AG
    Mode of Release Infineon Security Serve

  6. #6
    Beginner Beginner alexshao1978 is on a distinguished road
    Join Date
    Nov 2011
    Location
    ShangHai
    Posts
    31
    Points
    51.875
    The version is below:
    Product Name MC-ISAR_AS3x_XC2000_BASE_V001
    Release Version 0.0.1
    Type Of Release Alpha
    Name of the Supplier Infineon Technologies AG
    Mode of Release Infineon Security Serve

  7. #7
    Beginner Beginner alexshao1978 is on a distinguished road
    Join Date
    Nov 2011
    Location
    ShangHai
    Posts
    31
    Points
    51.875

    Version Infomation:

    Version Infomation:
    Product Name MC-ISAR_AS3x_XC2000_BASE_V001
    Release Version 0.0.1
    Type Of Release Alpha
    Name of the Supplier Infineon Technologies AG
    Mode of Release Infineon Security Serve

  8. #8
    Beginner Beginner alexshao1978 is on a distinguished road
    Join Date
    Nov 2011
    Location
    ShangHai
    Posts
    31
    Points
    51.875
    Markus Kroh : Sorry I don't know why I can't reply post last days.
    The MCAL version is like below:

    Product Name MC-ISAR_AS3x_XC2000_BASE_V001
    Release Version 0.0.1
    Type Of Release Alpha?
    Name of the Supplier Infineon Technologies AG
    Mode of Release Infineon Security Server
    Date of Release 02 June 2011

  9. #9

    Infineon Employee
    Infineon Employee
    diantn is on a distinguished road
    Join Date
    Nov 2011
    Posts
    3
    Points
    17.5
    Hi Alex,

    PC-Lint (http://www.gimpel.com/html/pcl.htm) can be used for checking the MISRA-C of MCAL.
    The Tasking doesn't support exclusion of MISRA-C of particular source code lines.
    Last edited by diantn; Feb 2nd, 2012 at 01:27 AM. Reason: more straighforward
    The views expressed here are my personal opinions, have not been reviewed or authorized by Infineon and do not necessarily represent the views of Infineon.

+ Reply to Thread

Tags for this Thread

Disclaimer

All content and materials on this site are provided “as is“. Infineon makes no warranties or representations with regard to this content and these materials of any kind, whether express or implied, including without limitation, warranties or representations of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. No license, whether express or implied, is granted by Infineon. Use of the information on this site may require a license from a third party, or a license from Infineon.


Infineon accepts no liability for the content and materials on this site being accurate, complete or up- to-date or for the contents of external links. Infineon distances itself expressly from the contents of the linked pages, over the structure of which Infineon has no control.


Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Usage Terms of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Usage Terms of this site. Infineon reserves the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.