Skip to content

Commit 1c756b3

Browse files
Pushyanth-Infineondanielinux
authored andcommitted
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 756d569 commit 1c756b3

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

27822782
```
27832783
make TARGET=psoc6 \
2784-
NVM_FLASH_WRITEONCE=1 \
27852784
CYPRESS_PDL=./lib/psoc6pdl \
27862785
CYPRESS_TARGET_LIB=./lib/TARGET_CY8CKIT-062S2-43012 \
27872786
CYPRESS_CORE_LIB=./lib/core-lib \
@@ -2798,6 +2797,34 @@ To compile with hardware acceleration disabled, use the option
27982797

27992798
in your wolfBoot configuration.
28002799

2800+
#### External Flash Support
2801+
2802+
PSoC6 supports external QSPI flash for firmware storage. To enable:
2803+
2804+
```
2805+
make TARGET=psoc6 \
2806+
EXT_FLASH=1 \
2807+
CYPRESS_PDL=./lib/psoc6pdl \
2808+
CYPRESS_TARGET_LIB=./lib/TARGET_CY8CKIT-062S2-43012 \
2809+
CYPRESS_CORE_LIB=./lib/core-lib \
2810+
WOLFBOOT_SECTOR_SIZE=4096
2811+
```
2812+
2813+
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.
2814+
2815+
#### Dual-Bank Flash Swap
2816+
2817+
PSoC6 supports hardware-assisted bank swapping for faster and more reliable firmware updates:
2818+
2819+
```
2820+
make TARGET=psoc6 \
2821+
DUALBANK_SWAP=1 \
2822+
CYPRESS_PDL=./lib/psoc6pdl \
2823+
CYPRESS_TARGET_LIB=./lib/TARGET_CY8CKIT-062S2-43012 \
2824+
CYPRESS_CORE_LIB=./lib/core-lib \
2825+
WOLFBOOT_SECTOR_SIZE=4096
2826+
```
2827+
28012828
#### OpenOCD installation
28022829

28032830
Compile and install the customized OpenOCD.

0 commit comments

Comments
 (0)