Skip to content

Commit f819928

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 c737d80 commit f819928

File tree

3 files changed

+1068
-63
lines changed

3 files changed

+1068
-63
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
@@ -2577,7 +2577,6 @@ The following configuration has been tested on the PSoC CY8CKIT-62S2-43012:
25772577

25782578
```
25792579
make TARGET=psoc6 \
2580-
NVM_FLASH_WRITEONCE=1 \
25812580
CYPRESS_PDL=./lib/psoc6pdl \
25822581
CYPRESS_TARGET_LIB=./lib/TARGET_CY8CKIT-062S2-43012 \
25832582
CYPRESS_CORE_LIB=./lib/core-lib \
@@ -2594,6 +2593,34 @@ To compile with hardware acceleration disabled, use the option
25942593

25952594
in your wolfBoot configuration.
25962595

2596+
#### External Flash Support
2597+
2598+
PSoC6 supports external QSPI flash for firmware storage. To enable:
2599+
2600+
```
2601+
make TARGET=psoc6 \
2602+
EXT_FLASH=1 \
2603+
CYPRESS_PDL=./lib/psoc6pdl \
2604+
CYPRESS_TARGET_LIB=./lib/TARGET_CY8CKIT-062S2-43012 \
2605+
CYPRESS_CORE_LIB=./lib/core-lib \
2606+
WOLFBOOT_SECTOR_SIZE=4096
2607+
```
2608+
2609+
External flash uses a temporary sector backup mechanism to handle the larger erase size (for example, 0x40000-byte sectors on an S25FL512S device) compared to internal flash rows. The backup sector is automatically managed in external flash beyond the update partition.
2610+
2611+
#### Dual-Bank Flash Swap
2612+
2613+
PSoC6 supports hardware-assisted bank swapping for faster and more reliable firmware updates:
2614+
2615+
```
2616+
make TARGET=psoc6 \
2617+
DUALBANK_SWAP=1 \
2618+
CYPRESS_PDL=./lib/psoc6pdl \
2619+
CYPRESS_TARGET_LIB=./lib/TARGET_CY8CKIT-062S2-43012 \
2620+
CYPRESS_CORE_LIB=./lib/core-lib \
2621+
WOLFBOOT_SECTOR_SIZE=4096
2622+
```
2623+
25972624
#### OpenOCD installation
25982625

25992626
Compile and install the customized OpenOCD.

0 commit comments

Comments
 (0)