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.

CC2340R5: CRC generation via IAR vs. Post-Build Actions ielftool

Part Number: CC2340R5

Tool/software:

Hello,

I am trying to understand the difference between generating a checksum in IAR via Project Options > Linker > Checksum > Generation Checksum, and the Post-Build actions that came by default with the project file. 

Setup Info:

  • Using IAR v9.60.2
  • SimpleLink Low Power F3 SDK v8.10.01.02
  • Current workspace based on "basic_ble_profiles" example project. 

Some context:

I've been developing for just under a year with this chipset, and have noticed a bothersome but non-critical (flavor of an) error as shown below, which always has to do with ielftool checksum generation. The error happens at random when rebuilding the firmware, and does not appear to be dependent on the source code, and generally when the error occurs, rebuilding the firmware again will cause the error to go away. Recently I decided to look into the matter and discovered it has to do with the Post-Build Linker actions that come standard with the project file, which are as follows:

  1. "$TOOLKIT_DIR$/bin/ielftool" --checksum "__ccfg_boot_cfg_crc32_end+1:4,crc32:1mi,0xFFFFFFFF;__ccfg_boot_cfg_crc32_begin-__ccfg_boot_cfg_crc32_end" --checksum "__ccfg_crc32_end+1:4,crc32:1mi,0xFFFFFFFF;__ccfg_crc32_begin-__ccfg_crc32_end" --checksum "__ccfg_user_record_crc32_end+1:4,crc32:1mi,0xFFFFFFFF;__ccfg_user_record_crc32_begin-__ccfg_user_record_crc32_end" --checksum "__ccfg_debug_cfg_crc32_end+1:4,crc32:1mi,0xFFFFFFFF;__ccfg_debug_cfg_crc32_begin-__ccfg_debug_cfg_crc32_end" "$TARGET_BPATH$.out" "$TARGET_BPATH$.out"
  2. "$TOOLKIT_DIR$/bin/ielftool" --ihex --checksum "__ccfg_boot_cfg_crc32_end+1:4,crc32:1mi,0xFFFFFFFF;__ccfg_boot_cfg_crc32_begin-__ccfg_boot_cfg_crc32_end" --checksum "__ccfg_crc32_end+1:4,crc32:1mi,0xFFFFFFFF;__ccfg_crc32_begin-__ccfg_crc32_end" --checksum "__ccfg_user_record_crc32_end+1:4,crc32:1mi,0xFFFFFFFF;__ccfg_user_record_crc32_begin-__ccfg_user_record_crc32_end" --checksum "__ccfg_debug_cfg_crc32_end+1:4,crc32:1mi,0xFFFFFFFF;__ccfg_debug_cfg_crc32_begin-__ccfg_debug_cfg_crc32_end" "$TARGET_BPATH$.out" "$TARGET_BPATH$.hex"
  3. ielftool --ihex --verbose $TARGET_BPATH$.out $TARGET_BPATH$.hex

I've determined that when the errors occur, the CRC is not correctly placed in the .hex file and/or corresponding .out elf file that is generated, depending on which flavor of the error has occurred. In this particular occurrence of the error, I have searched high and low for the memory size vs. file size and can't find anything like it. I have read several online articles saying that the CRC can be generated via the IAR Project configuration option as mentioned, but I want to understand:

  1. What is the intent is of having these "Post-Build Linker Actions" as part of the project?
  2. Why are the 3 crc's in the ielftool calls above only computing a CRC over a small portion of the CCFG instead of the entire portion of the image, such as the bootloader or entire image? 
  3. If my only intention for now is to generate a CRC for the firmware image, bootloader and perhaps another user image, is there a benefit to using the post-build linker actions instead of IAR's build-in CRC generator? 

I am fairly new to understanding linker scripts and CRC generation, so any guidance or input on the matter would be greatly appreciated. Our project is still in fairly early stages of development, so at this time I am intentionally not sharing any source code or output files for confidentiality reasons (and since the error appears independent of the source code itself). I would be happy to share (parts of) the project file or any other setup configurations as needed in order to understand these issues better.

The error below, which varies depending on which Post-Build Linker actions fails (0, 1, or 2):