Can someone confirm that this is correct and may have an example configuration how this has to configured?
>>The memory map suggested by you for downloading the apps looks correct. You can keep the bootloader and the current application APP0 in internal flash and the rest in external flash.
Also when building, I am not sure what target to build to load all components correctly to start my system. Do I have to build/download the components separately?
>> You will have to write different set of makefiles for downloading all the components at the correct location. As you already pointed out, the location is picked from ota2_image_defines.mk file in case of CYW943907AEVAL1F. A similar file needs to be written for your platform.
Please make a build log with VERBOSE=1 for CYW943907AEVAL1F to use as a reference and connect the dots to downoload all componets in external+ internal flash system:
let me explain the process of creating failsafe and downloading into flash
Please refer the file: /43xxx_Wi-Fi/WICED/platform/MCU/BCM4390x/BCM94390x_targets.mk
Please note I have removed the secure failsafe and JLINK checks from the makefile for simpler makefile:
ifeq (1,$(OTA2_SUPPORT)) APPS_LUT_DOWNLOAD_DEP += ota2_failsafe_download ota2_failsafe: bootloader $(QUIET)$(ECHO) Building OTA2 Failsafe $(QUIET)$(MAKE) -r -f $(SOURCE_ROOT)Makefile $(OTA2_FAILSAFE_TARGET) -I$(OUTPUT_DIR) SFLASH= EXTERNAL_WICED_GLOBAL_DEFINES=$(EXTERNAL_WICED_GLOBAL_DEFINES) SUB_BUILD=bootloader $(BOOTLOADER_REDIRECT) $(QUIET)$(ECHO) Finished Building OTA2 Failsafe $(QUIET)$(ECHO_BLANK_LINE) ota2_failsafe_download: ota2_failsafe download_bootloader $(if $(filter 1,$(XIP_SUPPORT)),download_XIP_bin) $(QUIET)$(ECHO) Downloading OTA2 Failsafe App ... $(QUIET)$(eval MAX_OTA2_FAILSAFE_IMAGE_SPACE := $(shell $(PERL) $(ABS_DIFFERENCE_SCRIPT) $(OTA2_IMAGE_DO_NOT_WRITE_AREA_END) $(OTA2_IMAGE_FAILSAFE_APP_AREA_BASE) )) $(QUIET)$(eval OTA2_FAILSAFE_IMAGE_SIZE_OVERFLOW := $(shell $(PERL) $(FILE_SIZE_OVERFLOW_SCRIPT) $(OTA2_FAILSAFE_TARGET_FILE) $(MAX_OTA2_FAILSAFE_IMAGE_SPACE) )) $(QUIET)$(eval $(if $(OTA2_FAILSAFE_IMAGE_SIZE_OVERFLOW), $(error OTA2 Failsafe $(OTA2_FAILSAFE_TARGET_FILE) size $(OTA2_FAILSAFE_IMAGE_SIZE_OVERFLOW) overflowed max_size $(MAX_OTA2_FAILSAFE_IMAGE_SPACE) !!!))) $(call CONV_SLASHES,$(OPENOCD_FULL_NAME)) -f $(OPENOCD_PATH)$(JTAG).cfg -f $(OPENOCD_PATH)$(HOST_OPENOCD).cfg -f apps/waf/sflash_write/sflash_write.tcl -c "sflash_write_file $(OTA2_FAILSAFE_TARGET_FILE) $(OTA2_FAILSAFE_APP_ADDRESS) $(SFLASH_APP_PLATFROM_BUS) 0 $(SFLASH_APP_BCM4390)" -c shutdown $(DOWNLOAD_LOG) 2>&1 $(QUIET)$(ECHO) Finished Downloading OTA2 Failsafe App endif
The ota2_failsafe_download is added as the target if OTA2_SUPPORT is enabled. This ota2_failsafe_download target calls bootloader target, downloads bootloader, compiles the failsafe app and downloads it.
You have to make sure all the components are created and downloaded to correct addresses(as defined in the ota2_image_defines.mk file) in external flash.