-
You need to first build and program the bootloader app MCUBootApp that is available in the MCUBoot GitHub repo before using an MCUBootloader based OTA application.
- MCUBootApp runs on the CM0+ CPU and starts any OTA enabled application on CM4 core in case of multicore Psoc6 devices.
- MCUBootApp runs on the CM0+ CPU and starts any OTA enabled application on CM7 core in case of multicore XMC7100 and XMC7200 devices.
- MCUBootApp runs on CM33 CPU along with the OTA enabled applications in the case of 20829 and 89829 devices.
-
Clone the MCUBoot repository onto your local machine, outside of your application directory.
-
Open a CLI terminal and run the following command:
git clone https://github.com/JuulLabs-OSS/mcuboot.git
- Navigate to the cloned mcuboot folder:
cd mcuboot
- Change the branch to get the appropriate version:
git checkout v1.9.4-cypress
- Pull in sub-modules to build mcuboot:
git submodule update --init --recursive
- Install the required Python packages mentioned in mcuboot/scripts/requirements.txt. Be sure to use the python instance in ModusToolbox/tools_XX/python:
cd mcuboot/scripts
pip install -r requirements.txt
Note:
- The CY8CKIT-064B0S2-4343W is a special kit that uses cysecureboot. See cysecuretools for PSoC™ 64, CYW20829 and CYW89829 devices information section below.
The UART Tx and Rx pins are common across most TARGET boards. However, there are exceptions. If "printf()" output are not seen on the terminal, check the UART settings. The default UART Tx and Rx can be changed for your device.
To change default UART Tx and Rx, pass the UART_RX_DEFAULT=XX
and UART_TX_DEFAULT=xx
parameters to the MCUBootApp make
command.
make clean app APP_NAME=MCUBootApp PLATFORM=XXXX FLASH_MAP=XXXX UART_TX_DEFAULT?=P10_1 UART_RX_DEFAULT?=P10_0
`UART_RX_DEFAULT` - Sets the pin number in the GPIO port used as RX of the debug serial port.
`UART_TX_DEFAULT` - Sets the pin number in the GPIO port used as TX of the debug serial port.
MCUBootApp supports using a JSON document to define the flash regions used for updating the application.
Read MCUBoot Build Commands to see the flashmaps and build command to use. This must be the same flashmap used to buid your OTA application.
Notes:
-
The JSON files use ABSOLUTE address, which indicate which flash part is to be used for the particular section. The usage in MCUBootApp and OTA Bootloader Support library defines the location by device_id and RELATIVE address. You do not need to do anything, this information is to reduce confusion.
-
Watch the MCUBootApp build output. If the python script flashmap.py detects errors in the flash layout, it will report them to stderr and stop the build.
-
Connect the board to your PC using the provided USB cable through the USB connector.
-
Erase flash area before programming MCUBootApp.
-
From the terminal, execute the make program command to program the application using the default toolchain to the default target.
make program TARGET=<BSP> TOOLCHAIN=<toolchain>
- Alternatively, the board can be programmed using CyProgrammer, OpenOCD commands or the instructions in your Customer Example Application notes.
Notes:
- For XMC7200/XMC7100 devices, once the 'status_area' of the MCUBootApp has been erased, this flash area should be filled with the value '0xFF'.
flash fillb 0x14030000 0xFF 0x2800
For CY8CKIT-062B0S2-4343W kit, CYW20829 and CYW89829 devices (SECURE), we use a procedure called "provisioning" to put the CyBootloader into the device. Please refer to the following cysecuretools documents for this procedure.
Provisioning Steps for CY8CKIT-064B0S2-4343W
Provisioning Steps for CYW20829 and CYW89829 devices
Note:
-
For 20829 and 89829 NORMAL_NO_SECURE/SECURE mode, MCUBootApp should be built and programmed separately.
-
The Windows version of ModusToolbox 3.2 does not include a Python package. Therefore, users are required to install python version 3.10 and the python module CySecureTools 6.1.0. For the mcuboot v1.9.4-cypress, CySecureTools v5.0.0 or later is necessary for the CYW920829 Non-Secure and XMC7200 platforms. Additionally, the CYW989829 platform specifically requires CySecureTools v5.1.0. Secure LCS and OTA image encryption on CYW920829 platform requires CySecureTools v6.1.0 or higher.
-
The following command can be used in the modus-shell terminal to find the current version of CySecureTools.
cysecuretools version
- If the current CySecureTools is not the required version, the following command can be used in modus-shell terminal to update it.
pip install --upgrade --force-reinstall cysecuretools
- Additionally, the following command can be used to view the supported targets and families of devices.
cysecuretools device-list