3 Replies Latest reply on May 5, 2020 6:42 AM by HakanJ_21

    DFU Postbuild script merging ELF files error in MTB 2.1

    OkBa_4438736

      Hi,

       

      I am using  two APPs for DFU functionality. App0 is just used as a launcher and App1 provides the main logic.

      I would like to program the PSOC6 with an ELF file which includes both APPs.

      Therefore, I merge both ELF files after the build.

       

      Postbuild  in Makefile of APP0 :

      # Custom post-build commands to run.

      POSTBUILD= "$(CY_MCUELFTOOL_DIR)/bin/cymcuelftool.exe" --sign $(CY_CONFIG_DIR)/$(APPNAME).elf --output $(CY_CONFIG_DIR)/$(APPNAME)_signed.elf

      Postbuild  in Makefile of APP1 :

      # Custom post-build commands to run.

      POSTBUILD= "$(CY_MCUELFTOOL_DIR)/bin/cymcuelftool.exe" --sign $(CY_CONFIG_DIR)/$(APPNAME).elf --output $(CY_CONFIG_DIR)/$(APPNAME)_signed.elf  && \

      "$(CY_MCUELFTOOL_DIR)/bin/cymcuelftool.exe" --merge $(CY_CONFIG_DIR)/$(APPNAME)_signed.elf \

      $(APP0_DIR)/$(APP0NAME)_signed.elf --output $(APP0_DIR)/$(APPNAME)_merged.elf --hex $(CY_CONFIG_DIR)/$(APPNAME).hex

      Eventually when I build APP1, I get following build error

      "C:/Users/OKBA/ModusToolbox/tools_2.1/cymcuelftool-1.0/bin/cymcuelftool.exe" --sign C:/Users/OKBA/Downloads/BLE_Battery_Level_FreeRTOS_Custom_Print/BLE_Battery_Level_FreeRTOS/build/CY8CPROTO-063-BLE/Debug/DFU_App1.elf --output C:/Users/OKBA/Downloads/BLE_Battery_Level_FreeRTOS_Custom_Print/BLE_Battery_Level_FreeRTOS/build/CY8CPROTO-063-BLE/Debug/DFU_App1_signed.elf  && "C:/Users/OKBA/ModusToolbox/tools_2.1/cymcuelftool-1.0/bin/cymcuelftool.exe" --merge C:/Users/OKBA/Downloads/BLE_Battery_Level_FreeRTOS_Custom_Print/BLE_Battery_Level_FreeRTOS/build/CY8CPROTO-063-BLE/Debug/DFU_App1_signed.elf C:/Users/OKBA/mtw_2_1/DFU_App0/build/CY8CPROTO-063-BLE/Debug/DFU_App0_signed.elf --output C:/Users/OKBA/mtw_2_1/DFU_App0/build/CY8CPROTO-063-BLE/Debug/DFU_App1_merged.elf --hex C:/Users/OKBA/Downloads/BLE_Battery_Level_FreeRTOS_Custom_Print/BLE_Battery_Level_FreeRTOS/build/CY8CPROTO-063-BLE/Debug/DFU_App1.hex

      SUCCESS: calculated CRC-32C over ELF section .cy_boot_metadata and stored

      ELF section .cy_app_signature found, but no hash specified. Skipping application signature

      No ELF section .cychecksum found, creating one

      Application checksum calculated and stored in ELF section .cychecksum

      No ELF section .cymeta found, creating one

      Checksum calculated and stored in ELF section .cymeta

      C:/Users/OKBA/mtw_2_1/DFU_App0/build/CY8CPROTO-063-BLE/Debug/DFU_App0_signed.elf: Merge error: Section 0x100FFA00 at C:/Users/OKBA/mtw_2_1/DFU_App0/build/CY8CPROTO-063-BLE/Debug/DFU_App0_signed.elf overlaps section 0x100FFA00 from C:/Users/OKBA/Downloads/BLE_Battery_Level_FreeRTOS_Custom_Print/BLE_Battery_Level_FreeRTOS/build/CY8CPROTO-063-BLE/Debug/DFU_App1_signed.elf,

      but it contains different data

      The referred error is Section 0x100FFA00

      is

      flash_boot_meta   (rw)  : ORIGIN = 0x100FFA00, LENGTH = 0x400

      in the linker script file. I use the default linker scripts that come with DFU library with some small changes:

       

      defu.jpg

       

      Do you have any idea about why I get this error.

       

      Regards,