Using CRCgen on Microcontrollers

To use the CRCgen utility, perform the followings steps.

  1. Create a file calc_crc.crc in the Project/Project_Settings/Linker_Files directory.
  2. Configure the post-linker to use it.

    Listing: Command line for post build
    "${MCU_TOOLS_HOME}/bin/crcgen.exe" "${BuildLocation}/
    ${BuildArtifactFileName}" -crc "${ProjDirPath}/Project_Settings/
    Linker_Files/calc_crc.crc" -o "${BuildLocation}/
    ${BuildArtifactFileName}.crc.elf"
    Figure 1. Post-build Steps in Microcontrollers
    Post-build Steps in Microcontrollers

    This command line uses several Eclipse variables:

    • ${MCU_TOOLS_HOME} : Points to the MCU folder inside the CodeWarrior for Microcontrollers v10.x installation.
    • $(BuildLocation} : Points to the output folder inside the project of build where the ELF file is located.
    • ${BuildArtifactFileName} : Points to the variable that contains the ELF file.
    • ${ProjDirPath}:Points to the project folder.
  3. Build the project.

    The post build step is executed and CRC of the application is calculated.

Figure 2. Post Build Step in Console View
Post Build Step in Console View