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.

CCSTUDIO: MISRA C 2012 problem

Part Number: CCSTUDIO
Other Parts Discussed in Thread: SYSCONFIG

Questions are as follows:

1.MISRA Rule 8.6 tells me that the global variable “gFlashHandle” is undefined.

2.This variable is defined in “ti_board_open_close.c”.

3.This folder will be automatically deleted and created during compilation.

4.Even if we modify the content of “ti_board_open_close.c”, once the compilation is executed. It will be set to the system settings, so MISRA Rule 8.6 cannot be solved.

Could this problem be solved??

MISRA C 2012 problem.pptx

  • Hi Wei, one option is to modify *.xdt templates to adjust to your requirements

    Example files to check and change: 

    source\board\.meta\flash\templates\flash_open_close.h.xdt
    extern Flash_Handle gFlashHandle[CONFIG_FLASH_NUM_INSTANCES];
    source\board\.meta\flash\templates\vxx\flash_open_close_config.c.xdt:
    Flash_Handle gFlashHandle[CONFIG_FLASH_NUM_INSTANCES];
    Another option is to copy all generated files from SysConfig to your project and then "exclude from build" example.sysconfig (right click on this file will show this option). In this way, you can modify "ti_board_open_close" without losing changes after rebuilding
    Example snapshot below
    Thank you,
    Paula
     
  • This is a great answer, thank you.