Skip to content

Commit 53d6227

Browse files
Add external flash support and dual-bank flash swap functionality for PSoC6 devices.
Removed NVM_FLASH_WRITEONCE restriction for psoc6. Update flash hal functions to support read-modify-erase-write way to perform the programming of flash.
1 parent 2277dfa commit 53d6227

File tree

3 files changed

+1063
-65
lines changed

3 files changed

+1063
-65
lines changed

config/examples/cypsoc6.config

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ SPI_FLASH?=0
1414
NO_XIP?=0
1515
UART_FLASH?=0
1616
ALLOW_DOWNGRADE?=0
17-
NVM_FLASH_WRITEONCE?=1
17+
NVM_FLASH_WRITEONCE?=0
1818
WOLFBOOT_VERSION?=0
1919
V?=0
2020
SPMATH?=1
@@ -27,4 +27,4 @@ WOLFBOOT_PARTITION_SIZE?=0x80000
2727
WOLFBOOT_SECTOR_SIZE?=512
2828
WOLFBOOT_PARTITION_BOOT_ADDRESS?=0x10080000
2929
WOLFBOOT_PARTITION_UPDATE_ADDRESS?=0x10100000
30-
WOLFBOOT_PARTITION_SWAP_ADDRESS?=10010000
30+
WOLFBOOT_PARTITION_SWAP_ADDRESS?=0x10010000

docs/Targets.md

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2377,7 +2377,6 @@ The following configuration has been tested on the PSoC CY8CKIT-62S2-43012:
23772377

23782378
```
23792379
make TARGET=psoc6 \
2380-
NVM_FLASH_WRITEONCE=1 \
23812380
CYPRESS_PDL=./lib/psoc6pdl \
23822381
CYPRESS_TARGET_LIB=./lib/TARGET_CY8CKIT-062S2-43012 \
23832382
CYPRESS_CORE_LIB=./lib/core-lib \
@@ -2394,6 +2393,34 @@ To compile with hardware acceleration disabled, use the option
23942393

23952394
in your wolfBoot configuration.
23962395

2396+
#### External Flash Support
2397+
2398+
PSoC6 supports external QSPI flash for firmware storage. To enable:
2399+
2400+
```
2401+
make TARGET=psoc6 \
2402+
EXT_FLASH=1 \
2403+
CYPRESS_PDL=./lib/psoc6pdl \
2404+
CYPRESS_TARGET_LIB=./lib/TARGET_CY8CKIT-062S2-43012 \
2405+
CYPRESS_CORE_LIB=./lib/core-lib \
2406+
WOLFBOOT_SECTOR_SIZE=4096
2407+
```
2408+
2409+
External flash uses a temporary sector backup mechanism to handle the larger erase size (0x40000 bytes) compared to internal flash rows. The backup sector is automatically managed in external flash beyond the update partition.
2410+
2411+
#### Dual-Bank Flash Swap
2412+
2413+
PSoC6 supports hardware-assisted bank swapping for faster and more reliable firmware updates:
2414+
2415+
```
2416+
make TARGET=psoc6 \
2417+
DUALBANK_SWAP=1 \
2418+
CYPRESS_PDL=./lib/psoc6pdl \
2419+
CYPRESS_TARGET_LIB=./lib/TARGET_CY8CKIT-062S2-43012 \
2420+
CYPRESS_CORE_LIB=./lib/core-lib \
2421+
WOLFBOOT_SECTOR_SIZE=4096
2422+
```
2423+
23972424
#### OpenOCD installation
23982425

23992426
Compile and install the customized OpenOCD.

0 commit comments

Comments
 (0)