blob: f3f20dacff42d0033ea3af7c393faaf0210c02f1 [file] [log] [blame] [view]
Roman Okhrimenko977b3752022-03-31 14:40:48 +03001## Blinking LED test application for MCUBootApp bootloading application
Roman Okhrimenko13f79ed2021-03-11 19:05:41 +02002
3### Description
4
Roman Okhrimenko977b3752022-03-31 14:40:48 +03005Implements a simple Blinky LED application to demonstrate the MCUBootApp bootloading application operation for the boot and upgrade processes.
Roman Okhrimenko13f79ed2021-03-11 19:05:41 +02006
Roman Okhrimenko977b3752022-03-31 14:40:48 +03007It is validated and started by MCUBootApp, which is running on the CM0p core of PSoC 6 devices, or CM33 core for the CYW20829 device.
Roman Okhrimenko13f79ed2021-03-11 19:05:41 +02008
9Functionality:
10
Roman Okhrimenko977b3752022-03-31 14:40:48 +030011* Blinks red LED with 2 different rates, depending on the image type - BOOT or UPGRADE.
12* Prints debug info and the appplication version to the terminal at baud rate 115200.
13* Manages the watchdog-timer start in MCUBootApp as one of the confirmation mechanisms.
14* Sets a special bit in flash to confirm that the image is operable (UPGRADE image).
15* Can be built for boot slot or UPGRADE slot of the bootloader.
Roman Okhrimenko13f79ed2021-03-11 19:05:41 +020016* Can be used to evaluate `swap` and `overwrite only` upgrade modes.
17
Roman Okhrimenko977b3752022-03-31 14:40:48 +030018### Hardware limitations
Roman Okhrimenko13f79ed2021-03-11 19:05:41 +020019
Roman Okhrimenko977b3752022-03-31 14:40:48 +030020This application is created to demonstrate the MCUboot library features.
Roman Okhrimenko13f79ed2021-03-11 19:05:41 +020021
Roman Okhrimenko977b3752022-03-31 14:40:48 +0300221. Port/pin `P5_0` and `P5_1` are used to configure a serial port for debug prints. These pins are the most commonly used for serial port connection among available Cypress PSoC 6 kits. To use custom hardware with this application, change the definitions of `CY_DEBUG_UART_TX` and `CY_DEBUG_UART_RX` in `main.c` of BlinkyApp to port/pin pairs corresponding to your design.
232. Port `GPIO_PRT13` pin `7U` is used to define the user connection-LED. This pin is the most commonly used for USER_LED connection among available Cypress PSoC 6 kits. To use custom hardware with this application, change the definitions of `LED_PORT` and `LED_PIN` in `main.c` of BlinkyApp to port/pin pairs corresponding to your design.
Roman Okhrimenko13f79ed2021-03-11 19:05:41 +020024
Roman Okhrimenko977b3752022-03-31 14:40:48 +030025### Pre-build action
Roman Okhrimenko13f79ed2021-03-11 19:05:41 +020026
Roman Okhrimenko977b3752022-03-31 14:40:48 +030027Pre-build action is implemented to define the start address and flash size, as well as the RAM start address and BlinkyApp size.
Roman Okhrimenko13f79ed2021-03-11 19:05:41 +020028
Roman Okhrimenko977b3752022-03-31 14:40:48 +030029`FLASH_MAP` `make` parameter is used to provide an input file for pre-build action. Refer to `MCUBootApp.md` for details.
Roman Okhrimenko13f79ed2021-03-11 19:05:41 +020030
Roman Okhrimenko977b3752022-03-31 14:40:48 +030031The result of pre-build script is auto-generated `flashmap.mk` file with a set of makefile flags:
Roman Okhrimenko13f79ed2021-03-11 19:05:41 +020032
Roman Okhrimenko977b3752022-03-31 14:40:48 +030033`PRIMARY_IMG_START` - start address of primary image in flash, this value is defined in the JSON flash map as the `"value"` field of the address section for `"application_#"`.
Roman Okhrimenko13f79ed2021-03-11 19:05:41 +020034
Roman Okhrimenko977b3752022-03-31 14:40:48 +030035`SECONDARY_IMG_START`- start address of secondary image in flash, this value is defined in the JSON flash map as the `"upgrade_address"` field of the `"address"` section for `"application_#"`.
Roman Okhrimenko13f79ed2021-03-11 19:05:41 +020036
Roman Okhrimenko977b3752022-03-31 14:40:48 +030037`SLOT_SIZE` - slot size for the primary and the secondary images, this value is taken from `"value"` field of `"size"` section of `"application_#"` from JSON file.
Roman Okhrimenko13f79ed2021-03-11 19:05:41 +020038
Roman Okhrimenko977b3752022-03-31 14:40:48 +030039`BOOTLOADER_SIZE` - size of Bootloader application, this value is defined in the JSON flash map as the `"size"` field of the address section for `"bootloader"`.
Roman Okhrimenko13f79ed2021-03-11 19:05:41 +020040
Roman Okhrimenko977b3752022-03-31 14:40:48 +030041`USE_EXTERNAL_FLASH` - is set to 1 if flash map with `_smif` suffix is chosen.
Roman Okhrimenko13f79ed2021-03-11 19:05:41 +020042
Roman Okhrimenko977b3752022-03-31 14:40:48 +030043`USE_XIP` - is set to 1 if the "external_flash" section with "mode": "XIP" is present in the flash map file.
Roman Okhrimenko13f79ed2021-03-11 19:05:41 +020044
Roman Okhrimenko977b3752022-03-31 14:40:48 +030045These values are set by specifying the following macros (default values shown):
46`SLOT_SIZE ?= 0x10000` - for slot located in internal flash of PSoC 6 chips
47`SLOT_SIZE ?= 0x40200` - for slot located in external flash of PsoC 6 kits
48`SLOT_SIZE ?= 0x20000` - for slot located in external flash of CYW20829 kits
Roman Okhrimenko13f79ed2021-03-11 19:05:41 +020049
Roman Okhrimenko977b3752022-03-31 14:40:48 +030050The pre-build action also calls the GCC preprocessor, which replaces the defines to particular values in `BlinkyApp_template.ld`.
51
52**Important (PSoC 6)**: ensure that the RAM areas of CM4-based BlinkyApp and CM0p-based MCUBootApp bootloader do not overlap.
53
54Memory (stack) corruption of the CM0p application can cause a failure if SystemCall-served operations were invoked from CM4.
55
56### Building an application
57
58The supported platforms:
Roman Okhrimenko13f79ed2021-03-11 19:05:41 +020059
60* PSOC_062_2M
61* PSOC_062_1M
62* PSOC_062_512K
Roman Okhrimenko977b3752022-03-31 14:40:48 +030063* CYW20829
Roman Okhrimenko13f79ed2021-03-11 19:05:41 +020064
Roman Okhrimenko977b3752022-03-31 14:40:48 +030065The root directory for build is **boot/cypress.**
Roman Okhrimenko13f79ed2021-03-11 19:05:41 +020066
Roman Okhrimenko977b3752022-03-31 14:40:48 +030067**Single-image**
Roman Okhrimenko13f79ed2021-03-11 19:05:41 +020068
Roman Okhrimenko977b3752022-03-31 14:40:48 +030069The following command will build BlinkyApp as a regular HEX file for the primary (BOOT) slot to be used in single image case with `swap` upgrade type of Bootloader:
Roman Okhrimenko13f79ed2021-03-11 19:05:41 +020070
Roman Okhrimenko977b3752022-03-31 14:40:48 +030071 make app APP_NAME=BlinkyApp PLATFORM=PSOC_062_2M IMG_TYPE=BOOT FLASH_MAP=cy_flash_pal/flash_psoc6/flashmap/psoc62_swap_single.json IMG_ID=1
Roman Okhrimenko13f79ed2021-03-11 19:05:41 +020072
Roman Okhrimenko977b3752022-03-31 14:40:48 +030073To build an image for the secondary (UPGRADE) slot to be used in single image case with `swap` upgrade type of Bootloader:
Roman Okhrimenko13f79ed2021-03-11 19:05:41 +020074
Roman Okhrimenko977b3752022-03-31 14:40:48 +030075 make app APP_NAME=BlinkyApp PLATFORM=PSOC_062_2M IMG_TYPE=UPGRADE FLASH_MAP=cy_flash_pal/flash_psoc6/flashmap/psoc62_swap_single.json IMG_ID=1
Roman Okhrimenko13f79ed2021-03-11 19:05:41 +020076
Roman Okhrimenko977b3752022-03-31 14:40:48 +030077To build an image for the secondary (UPGRADE) slot to be used in single image case with `overwrite` upgrade type of Bootloader:
Roman Okhrimenko13f79ed2021-03-11 19:05:41 +020078
Roman Okhrimenko977b3752022-03-31 14:40:48 +030079 make app APP_NAME=BlinkyApp PLATFORM=PSOC_062_2M IMG_TYPE=UPGRADE FLASH_MAP=cy_flash_pal/flash_psoc6/flashmap/psoc62_overwrite_single.json IMG_ID=1
Roman Okhrimenko13f79ed2021-03-11 19:05:41 +020080
Roman Okhrimenko977b3752022-03-31 14:40:48 +030081**Multi-image**
Roman Okhrimenko13f79ed2021-03-11 19:05:41 +020082
Roman Okhrimenko977b3752022-03-31 14:40:48 +030083`BlinkyApp` can be built in multi-image bootloader configuration for PSoC 6 chips only.
Roman Okhrimenko13f79ed2021-03-11 19:05:41 +020084
Roman Okhrimenko977b3752022-03-31 14:40:48 +030085To obtain the appropriate hex files to use with multi-image MCUBootApp, makefile flag `IMG_ID` is used.
Roman Okhrimenko13f79ed2021-03-11 19:05:41 +020086
Roman Okhrimenko977b3752022-03-31 14:40:48 +030087`IMG_ID` flag value should correspond to `application_#` number of JSON file used for build. For example to build `BlinkyApp` for UPGRADE slot of second image following command is used:
Roman Okhrimenko13f79ed2021-03-11 19:05:41 +020088
Roman Okhrimenko977b3752022-03-31 14:40:48 +030089 make app APP_NAME=BlinkyApp PLATFORM=PSOC_062_2M IMG_TYPE=UPGRADE FLASH_MAP=cy_flash_pal/flash_psoc6/flashmap/psoc62_overwrite_single.json IMG_ID=2
Roman Okhrimenko13f79ed2021-03-11 19:05:41 +020090
Roman Okhrimenko977b3752022-03-31 14:40:48 +030091When this option is omitted, `IMG_ID=1` is assumed.
Roman Okhrimenko13f79ed2021-03-11 19:05:41 +020092
93**Upgrade mode dependency**
94
Roman Okhrimenko977b3752022-03-31 14:40:48 +030095`MCUBootApp` can upgrade an image either by overwriting the image from a secondary slot to a primary slot or by swapping the two images.
Roman Okhrimenko13f79ed2021-03-11 19:05:41 +020096
Roman Okhrimenko977b3752022-03-31 14:40:48 +030097To build `BlinkyApp` for different upgrade mode choose flash map JSON file with the corresponding suffix - either _swap_ or _overwrite_.
Roman Okhrimenko13f79ed2021-03-11 19:05:41 +020098
Roman Okhrimenko977b3752022-03-31 14:40:48 +030099**Upgrade image for external memory (PSoC 6)**
Roman Okhrimenko13f79ed2021-03-11 19:05:41 +0200100
Roman Okhrimenko977b3752022-03-31 14:40:48 +0300101To prepare MCUBootApp for work with external memory, refer to [ExternalMemory.md](../MCUBootApp/ExternalMemory.md).
Roman Okhrimenko13f79ed2021-03-11 19:05:41 +0200102
Roman Okhrimenko977b3752022-03-31 14:40:48 +0300103To build a `BlinkyApp` upgrade image for external memory to be used in single image configuration with overwrite upgrade mode, use command:
Roman Okhrimenko13f79ed2021-03-11 19:05:41 +0200104
Roman Okhrimenko977b3752022-03-31 14:40:48 +0300105 make app APP_NAME=BlinkyApp PLATFORM=PSOC_062_2M IMG_TYPE=UPGRADE FLASH_MAP=cy_flash_pal/flash_psoc6/flashmap/psoc62_overwrite_single_smif.json IMG_ID=1
Roman Okhrimenko13f79ed2021-03-11 19:05:41 +0200106
Roman Okhrimenko977b3752022-03-31 14:40:48 +0300107`ERASED_VALUE` defines the memory cell contents in the erased state. It is `0x00` for PSoC 6 internal flash and `0xff` for S25FL512S. For `CYW20289` default value is `0xff` since it only uses an external flash.
Roman Okhrimenko13f79ed2021-03-11 19:05:41 +0200108
Roman Okhrimenko977b3752022-03-31 14:40:48 +0300109In multi-image configuration, an upgrade image for the second application is built using command:
Roman Okhrimenko13f79ed2021-03-11 19:05:41 +0200110
Roman Okhrimenko977b3752022-03-31 14:40:48 +0300111 make app APP_NAME=BlinkyApp PLATFORM=PSOC_062_2M IMG_TYPE=UPGRADE FLASH_MAP=cy_flash_pal/flash_psoc6/flashmap/psoc62_overwrite_multi_smif.json IMG_ID=2
Roman Okhrimenko13f79ed2021-03-11 19:05:41 +0200112
113**Encrypted upgrade image**
114
Roman Okhrimenko977b3752022-03-31 14:40:48 +0300115To prepare MCUBootApp for work with an encrypted upgrade image, refer to [MCUBootApp.md](../MCUBootApp/MCUBootApp.md).
Roman Okhrimenko13f79ed2021-03-11 19:05:41 +0200116
Roman Okhrimenko977b3752022-03-31 14:40:48 +0300117To obtain an encrypted upgrade image of BlinkyApp, pass extra flag `ENC_IMG=1` in the command line, for example:
Roman Okhrimenko13f79ed2021-03-11 19:05:41 +0200118
Roman Okhrimenko977b3752022-03-31 14:40:48 +0300119 make app APP_NAME=BlinkyApp PLATFORM=PSOC_062_2M IMG_TYPE=UPGRADE FLASH_MAP=cy_flash_pal/flash_psoc6/flashmap/psoc62_overwrite_single_smif.json IMG_ID=1 ENC_IMG=1
Roman Okhrimenko13f79ed2021-03-11 19:05:41 +0200120
Roman Okhrimenko977b3752022-03-31 14:40:48 +0300121This also suggests that the user has already placed a corresponding *.pem key in the \keys folder. The key variables are defined in root Makefile as SIGN_KEY_FILE and ENC_KEY_FILE
Roman Okhrimenko13f79ed2021-03-11 19:05:41 +0200122
Roman Okhrimenko977b3752022-03-31 14:40:48 +0300123Refer to [CYW20829.md](../platforms/CYW20829/CYW20829.md) for details of encrypted image build for the CYW20289 platfrom.
124
125### Complete build flags description
126- `BUILDCFG` - The configuration type
Roman Okhrimenko13f79ed2021-03-11 19:05:41 +0200127 - Release
128 - Debug
Roman Okhrimenko977b3752022-03-31 14:40:48 +0300129- `VERBOSE` - The build verbosity level
Roman Okhrimenko13f79ed2021-03-11 19:05:41 +0200130 - 0 (default) - less build info
131 - 1 - verbose output of compilation
132- `PLATFORM`
Roman Okhrimenko977b3752022-03-31 14:40:48 +0300133 - `PSOC_062_2M`
134 - `PSOC_062_1M`
135 - `PSOC_062_512K`
136 - `CYW20289`
137- `SLOT_SIZE` - The size of the primary/secondary slot of MCUBootApp. This app will be used with
Roman Okhrimenko13f79ed2021-03-11 19:05:41 +0200138 - 0x%VALUE%
Roman Okhrimenko977b3752022-03-31 14:40:48 +0300139- `IMG_TYPE` - The slot of MCUBootApp, for which the image is being built.
140 - `BOOT` (default) - A build image for the primary (BOOT) slot.
141 - `UPGRADE` - A build image for the secondary (UPGRADE) slot.
142- `ERASED_VALUE` - Define memory cell contents in the erased state.
143 - `0x0` - Internal memory.
144 - `0xff` - External memory.
145- `TOOLCHAIN_PATH` - The path to the GCC compiler to use for build.
146 - Example: TOOLCHAIN_PATH=/home/user/ModusToolbox/tools_2.4/gcc
147 - Example: TOOLCHAIN_PATH=C:/ModusToolbox/tools_2.4/gcc
Roman Okhrimenko13f79ed2021-03-11 19:05:41 +0200148
Roman Okhrimenko977b3752022-03-31 14:40:48 +0300149Flags set by pre-build action.
Roman Okhrimenko13f79ed2021-03-11 19:05:41 +0200150
Roman Okhrimenko977b3752022-03-31 14:40:48 +0300151- `USE_OVERWRITE` - Define the Upgrade mode type of `MCUBootApp` to use with this app.
152 - `1` - For Overwrite mode.
153 - `0` - (default) For Swap Upgrade mode.
154- `USE_EXTERNAL_FLASH` - Define support of external flash.
155 - `1` - external flash is present.
156 - `0` - external flash is absent.
157- `USE_XIP` - Define support of eXecute in Place mode.
158 - `0` - Not used
159 - `1` - Used
Roman Okhrimenko13f79ed2021-03-11 19:05:41 +0200160
Roman Okhrimenko977b3752022-03-31 14:40:48 +0300161### Post-build
Roman Okhrimenko13f79ed2021-03-11 19:05:41 +0200162
Roman Okhrimenko977b3752022-03-31 14:40:48 +0300163The post-build action is executed at the compile time for `BlinkyApp`. For the `PSOC_062_2M`, `PSOC_062_1M`, `PSOC_062_512K` platforms, it calls `imgtool` from `MCUboot` scripts and adds a signature to the compiled image.
Roman Okhrimenko13f79ed2021-03-11 19:05:41 +0200164
Roman Okhrimenko977b3752022-03-31 14:40:48 +0300165Flags passed to `imgtool` for a signature are defined in the `SIGN_ARGS` variable in BlinkyApp.mk.
166
167For `CYW20829`, `cysecuretools` is used for the image signing.
168
169### How to program an application
170
171BlinkyApp firmware can be programmed in different ways. The following instructions assume the usage of one of Cypress development kits, for example `CY8CPROTO_062_4343W`.
Roman Okhrimenko13f79ed2021-03-11 19:05:41 +0200172
1731. Direct usage of OpenOCD.
174
Roman Okhrimenko977b3752022-03-31 14:40:48 +0300175Connect a board to your computer. Switch Kitprog3 to DAP-BULK mode by clicking the `SW3 MODE` button until `LED2 STATUS` constantly shines.
Roman Okhrimenko13f79ed2021-03-11 19:05:41 +0200176
Roman Okhrimenko977b3752022-03-31 14:40:48 +0300177The OpenOCD package is supplied with ModusToolbox IDE and can be found in the ModusToolbox installation folder `ModusToolbox/tools_2.4/openocd`.
Roman Okhrimenko13f79ed2021-03-11 19:05:41 +0200178
Roman Okhrimenko977b3752022-03-31 14:40:48 +0300179Open the terminal application and execute the following command after substitution of the `PATH_TO_APPLICATION.hex` and `OPENOCD` paths:
Roman Okhrimenko13f79ed2021-03-11 19:05:41 +0200180
Roman Okhrimenko977b3752022-03-31 14:40:48 +0300181 export OPENOCD=/Applications/ModusToolbox/tools_2.4/openocd
Roman Okhrimenko13f79ed2021-03-11 19:05:41 +0200182
183 ${OPENOCD}/bin/openocd -s ${OPENOCD}/scripts \
184 -f ${OPENOCD}/scripts/interface/kitprog3.cfg \
185 -f ${OPENOCD}/scripts/target/psoc6_2m.cfg \
186 -c "init; reset init; program PATH_TO_APPLICATION.hex" \
187 -c "resume; reset; exit"
188
1892. Using GUI tool `Cypress Programmer`
190
191Follow [link](https://www.cypress.com/products/psoc-programming-solutions) to download.
192
Roman Okhrimenko977b3752022-03-31 14:40:48 +0300193Connect the board to your computer. Switch Kitprog3 to DAP-BULK mode by clicking the `SW3 MODE` button until `LED2 STATUS` constantly shines. Open `Cypress Programmer` and click `Connect`, then choose the hex file `MCUBootApp.hex` or `BlinkyApp.hex`, and finally click `Program`. Check the log to ensure that the programming is successful. Reset the board.
Roman Okhrimenko13f79ed2021-03-11 19:05:41 +0200194
1953. Using `DAPLINK`.
196
Roman Okhrimenko977b3752022-03-31 14:40:48 +0300197Connect the board to your computer. Switch embedded Kitprog3 to `DAPLINK` mode by clicking the `SW3 MODE` button until `LED2 STATUS` blinks fast and the USB mass storage device displays in the OS. Drag and drop the `hex` files to be programmed to the `DAPLINK` drive in your OS.
Roman Okhrimenko13f79ed2021-03-11 19:05:41 +0200198
199**Hex file names to use for programming**
200
Roman Okhrimenko977b3752022-03-31 14:40:48 +0300201`BlinkyApp` always produces build artifacts in two separate folders: `BlinkyApp/out/PSOC_062_2M/Debug/boot` and `BlinkyApp/out/PSOC_062_2M/Debug/upgrade`.
Roman Okhrimenko13f79ed2021-03-11 19:05:41 +0200202
203These files are ready to be flashed to the board:
204
Roman Okhrimenko977b3752022-03-31 14:40:48 +0300205* **BlinkyApp.hex** from the `boot` folder
206* **BlinkyApp_upgrade.hex** from the `upgrade` folder
Roman Okhrimenko13f79ed2021-03-11 19:05:41 +0200207
Roman Okhrimenko977b3752022-03-31 14:40:48 +0300208The `BlinkyApp_unsigned.hex` hex file is also preserved in both cases for possible troubleshooting.
Roman Okhrimenko13f79ed2021-03-11 19:05:41 +0200209
Roman Okhrimenko977b3752022-03-31 14:40:48 +0300210**Important: When Swap status Upgrade mode is used**
Roman Okhrimenko13f79ed2021-03-11 19:05:41 +0200211
Roman Okhrimenko977b3752022-03-31 14:40:48 +0300212 While using this application in a system with the `swap` type of upgrade, refer first to the [MCUBootApp.md](../MCUBootApp/MCUBootApp.md) section **SWAP/Expected lifecycle**.
Roman Okhrimenko13f79ed2021-03-11 19:05:41 +0200213
Roman Okhrimenko977b3752022-03-31 14:40:48 +0300214**BlinkyApp.hex** can be programmed to a device once. All firmware upgrades are delivered using the secondary (UPGRADE) slot, thus a **BlinkyApp_upgrade.hex** image.
Roman Okhrimenko13f79ed2021-03-11 19:05:41 +0200215
Roman Okhrimenko977b3752022-03-31 14:40:48 +0300216If the user tries to program **BlinkyApp.hex** to the primary slot directly for the second time - **system state should be reset**.
Roman Okhrimenko13f79ed2021-03-11 19:05:41 +0200217
Roman Okhrimenko977b3752022-03-31 14:40:48 +0300218To reset the system state, erase at least the `swap status partition` area in flash - see the addresses in the [MCUBootApp.md](../MCUBootApp/MCUBootApp.md) paragraph **Memory maps**.
Roman Okhrimenko13f79ed2021-03-11 19:05:41 +0200219
Roman Okhrimenko977b3752022-03-31 14:40:48 +0300220To erase the swap status partition area in MCUBootApp with single-image configuration with the default memory map, use the `OpenOCD` command:
Roman Okhrimenko13f79ed2021-03-11 19:05:41 +0200221
222 $OPENOCD_PATH/bin/openocd -s "$OPENOCD_PATH/scripts" -f "$OPENOCD_PATH/ scripts/interface/kitprog3.cfg" -f "$OPENOCD_PATH/scripts/target/psoc6_2m.cfg" -c "init; reset init" -c "flash erase_address 0x10038000 0x1000" -c "reset; shutdown"
223
Roman Okhrimenko977b3752022-03-31 14:40:48 +0300224To erase the swap status partition area in MCUBootApp with multi-image configuration with the default memory map, use the `OpenOCD` command:
Roman Okhrimenko13f79ed2021-03-11 19:05:41 +0200225
226 $OPENOCD_PATH/bin/openocd -s "$OPENOCD_PATH/scripts" -f "$OPENOCD_PATH/ scripts/interface/kitprog3.cfg" -f "$OPENOCD_PATH/scripts/target/psoc6_2m.cfg" -c "init; reset init" -c "flash erase_address 0x10078000 0x2000" -c "reset; shutdown"
227
Roman Okhrimenko977b3752022-03-31 14:40:48 +0300228In both cases, it is easier to erase the whole device flash or all flash after MCUBootApp. This command erases all flash after MCUBootApp, including the primary, secondary, and swap status partiton:
Roman Okhrimenko13f79ed2021-03-11 19:05:41 +0200229
Roman Okhrimenko977b3752022-03-31 14:40:48 +0300230 $OPENOCD_PATH/bin/openocd -s "$OPENOCD_PATH/scripts" -f "$OPENOCD_PATH/ scripts/interface/kitprog3.cfg" -f "$OPENOCD_PATH/scripts/target/psoc6_2m.cfg" -c "init; reset init" -c "flash erase_address 0x10018000 0x1E8000" -c "reset; shutdown"
Roman Okhrimenko13f79ed2021-03-11 19:05:41 +0200231
Roman Okhrimenko977b3752022-03-31 14:40:48 +0300232### Example terminal output
Roman Okhrimenko13f79ed2021-03-11 19:05:41 +0200233
Roman Okhrimenko977b3752022-03-31 14:40:48 +0300234When the user application is programmed in the boot slot:
Roman Okhrimenko13f79ed2021-03-11 19:05:41 +0200235
236 ===========================
237 [BlinkyApp] BlinkyApp v1.0 [CM4]
238 ===========================
239 [BlinkyApp] GPIO initialized
240 [BlinkyApp] UART initialized
241 [BlinkyApp] Retarget I/O set to 115200 baudrate
242 [BlinkyApp] Red led blinks with 1 sec period
243 [BlinkyApp] Update watchdog timer started in MCUBootApp to mark sucessful start of user app
244 [BlinkyApp] Turn off watchdog timer
245
Roman Okhrimenko977b3752022-03-31 14:40:48 +0300246When the user application is programmed in the upgrade slot and the upgrade procedure was successful:
Roman Okhrimenko13f79ed2021-03-11 19:05:41 +0200247
248 ===========================
249 [BlinkyApp] BlinkyApp v2.0 [+]
250 ===========================
251 [BlinkyApp] GPIO initialized
252 [BlinkyApp] UART initialized
253 [BlinkyApp] Retarget I/O set to 115200 baudrate
254 [BlinkyApp] Red led blinks with 0.25 sec period
255 [BlinkyApp] Update watchdog timer started in MCUBootApp to mark sucessful start of user app
256 [BlinkyApp] Turn off watchdog timer
257 [BlinkyApp] Try to set img_ok to confirm upgrade image
258 [BlinkyApp] SWAP Status : Image OK was set at 0x10027fe8.