How do I generate a Cyclic Redundancy Check in Eclipse based CodeWarrior for Microcontrollers v10.x?

The CodeWarrior for Microcontrollers v10.x is not installed with the crcgen.exe. To generate a Cyclic Redundancy Check (CRC) you have to install the crcgen.exe here:

<CWinstalldir>\MCU\bin\plugins\Support\crcgen.exe

where, <CWInstalldir> is the installation directory of the CodeWarrior software.

You have to create a .crc file in your project and configure the post-linker in MCUv10.x to use it. To do that:

  1. Select the desired project in the Codewarrior Projects view, and then select Project > Properties from the IDE menu bar.

    The Properties for <project_name> dialog box appears.

  2. In the left panel, expand the C/C++ Build tree-control and select Settings.

    The Settings page appears in the left panel.

  3. Click the Build Steps tab.
    Figure 1. Properties for <project_name> - Build Steps Tab

    Properties for <project_name> - Build Steps Tab

  4. In the Description textbox enter the desired description, for example Calculate CRC, and in the Post-build steps group, enter the following command in the Commands textbox:
    "${MCU_TOOLS_HOME}/bin/plugins/support/crcgen.exe" "${BuildLocation}/${BuildArtifactFileName}" -crc "${ProjDirPath}/Project_Settings/Linker_Files/calc_crc.crc" -o "${BuildLocation}/${BuildArtifactFileName}.crc.elf" 

    where,

    • ${MCU_TOOLS_HOME}: points to the MCU folder inside the CodeWarrior MCU10.x installation
    • $(BuildLocation}: points to the output folder inside your project of your build where the ELF file is located
    • ${BuildArtifactFileName}: this variable contains the file name of your ELF file
    • ${ProjDirPath}: folder name of your project
  5. Click OK.

The changes you made are saved and when you build your project, the post build step will be executed as well to calculate the CRC into your application.