XMC7000 boot configuration description

MCUBoot application supports overwrite and swap upgrade modes for XMC7200 and XMC7100 platforms.

NOTE: In case of swap upgrade mode and when swap status partition area is located in work flash its required to fill the status partition with 0xFF before flashing the MCUBootApp.hex. As shown on the example below.

Following commands can be used as an example to build a project

  • Overwrite mode

    make clean app APP_NAME=MCUBootApp PLATFORM=XMC7200 BUILDCFG=Debug FLASH_MAP=platforms/memory/XMC7000/flashmap/xmc7000_overwrite_single.json PLATFORM_CONFIG=platforms/memory/XMC7000/flashmap/xmc7200_platform.json CORE=CM0P APP_CORE=CM7 APP_CORE_ID=0

    make clean_boot app APP_NAME=BlinkyApp PLATFORM=XMC7200 BUILDCFG=Debug FLASH_MAP=platforms/memory/XMC7000/flashmap/xmc7000_overwrite_single.json PLATFORM_CONFIG=platforms/memory/XMC7000/flashmap/xmc7200_platform.json CORE=CM7 CORE_ID=0 IMG_TYPE=BOOT IMG_ID=1

    make clean_upgrade app APP_NAME=BlinkyApp PLATFORM=XMC7200 BUILDCFG=Debug FLASH_MAP=platforms/memory/XMC7000/flashmap/xmc7000_overwrite_single.json PLATFORM_CONFIG=platforms/memory/XMC7000/flashmap/xmc7200_platform.json CORE=CM7 CORE_ID=0 IMG_TYPE=UPGRADE IMG_ID=1

  • Swap mode

    make clean app APP_NAME=MCUBootApp PLATFORM=XMC7200 BUILDCFG=Debug FLASH_MAP=platforms/memory/XMC7000/flashmap/xmc7000_swap_single.json PLATFORM_CONFIG=platforms/memory/XMC7000/flashmap/xmc7200_platform.json CORE=CM0P APP_CORE=CM7 APP_CORE_ID=0

    make clean_boot app APP_NAME=BlinkyApp PLATFORM=XMC7200 BUILDCFG=Debug FLASH_MAP=platforms/memory/XMC7000/flashmap/xmc7000_swap_single.json PLATFORM_CONFIG=platforms/memory/XMC7000/flashmap/xmc7200_platform.json CORE=CM7 CORE_ID=0 IMG_TYPE=BOOT IMG_ID=1

    make clean_upgrade app APP_NAME=BlinkyApp PLATFORM=XMC7200 BUILDCFG=Debug FLASH_MAP=platforms/memory/XMC7000/flashmap/xmc7000_swap_single.json PLATFORM_CONFIG=platforms/memory/XMC7000/flashmap/xmc7200_platform.json CORE=CM7 CORE_ID=0 IMG_TYPE=UPGRADE IMG_ID=1

Build parameters description: `

XMC7000 Secure boot configuration description

XMC7000 internal flash boot module can be used in secure configuration. A complete description and instructions for configuring a secure boot can be found in reference manual AN234802.

MCUBoot makefile supports secure image build configuration for XMC7200 and XMC7100 devices. To prepare a secure MCUBoot image, the user must configure the public key and specify the appropriate parameters for the TOC2 structure in the cy_si_config.c, cy_si_key.c files and execute the make command with the additional variables USE_SECURE_MODE=1, SECURE_MODE_KEY_NAME=<name>.

  • Step to generate custom RSA2048 keys: cysecuretools -t xmc7200 create-key --key-type RSA2048 -o ./keys/cypress-test-rsa2k.pem ./keys/cypress-test-rsa2k.pub --format PEM

  • Step to generate cy_si_key.c file: cysecuretools convert-key -k ./keys/cypress-test-rsa2k.pub -o ./platforms/utils/XMC7000/cy_si_key.c --fmt secure_boot --endian little

Previous two steps can be executed with single Makefile command. make gen_secure_cfgs PLATFORM=XMC7200 SECURE_MODE_KEY_TYPE=RSA2048 KEY_NAME=cypress-test-rsa2k

  • Step to run MCUBootApp build with secure flash boot config make clean app APP_NAME=MCUBootApp PLATFORM=XMC7200 BUILDCFG=Debug FLASH_MAP=platforms/memory/XMC7000/flashmap/xmc7000_overwrite_single.json PLATFORM_CONFIG=platforms/memory/XMC7000/flashmap/xmc7200_platform.json CORE=CM0P APP_CORE=CM7 APP_CORE_ID=0 USE_SECURE_MODE=1 SECURE_MODE_KEY_NAME=cypress-test-rsa2k

  • Example how to configure openocd script:

    set QSPI_FLASHLOADER platforms/BSP/XMC7000/CAT1C_SMIF.FLM source [find interface/kitprog3.cfg] set ENABLE_ACQUIRE 0 set ACQUIRE_TIMEOUT 2000

    transport select swd source [find target/cat1c.cfg] cat1c sflash_restrictions 1

    targets

    init; reset init;

    flash erase_address 0x17007C00 0x00000200 flash erase_address 0x17006400 0x00000C00 flash fillb 0x14030000 0xFF 0x00002800

    program ./MCUBootApp/out/XMC7200/Debug/MCUBootApp.hex

    resume; reset; shutdown