2.5 Component Configuration
Microchip MPLAB Code Configurator (MCC) tool provides Diagnostic and Safe-PLIB components for the MPLAB X IDE development environment. Refer to the Device Resources panel and expand Diagnostics and Safe Peripherals to observe the list of installed components. At configuration, any component selection will automatically include Core, Flash, and SRAM components by default into the Project Graph. It is possible to deselect these components as needed.
To modify the settings on an individual component, use the Project Graph window to select the component and then modify its available settings. Refer the details of diagnostics of specific peripheral to see a list of its configurable settings.
The ISO 26262 SAM C21 Diagnostic Library is distributed as a prebuilt binary format (.a file). Source code for diag_periph_samc21j18a.a is not provided and there are limited user configuration settings available. The binary library is used for both the SAMC21J18 and the SAMC21E18A part variants.
Three libraries are needed:
diag_periph_samc21j18a.a, located in the directory diag_periph_c20_c21\lib\peripheral_diagnostic in the diagnostic distribution.safe plibsa set of user visible code located in the repodiag_csp_samc2x.
diag_core_m0p.a, located in the directory diag_core_m0p_src\lib in the core distribution.
Diagnostic applications will use MCC to configure the required diagnostic components, the associated Safe-PLIB and then generate the code. At link time, the compiler/linker will include all library code associated with a function call into the application firmware. All unused functions in the library, not called by the application, will be removed.
Loading some diagnostic modules may also auto-load dependent modules, if are not already on the project graph. In addition, adding a diagnostic module will also automatically include one or more dependent Safe PLIB(s).
