Add external flash support and dual-bank flash swap functionality for PSoC6 devices#700
Open
Pushyanth-Infineon wants to merge 1 commit intowolfSSL:masterfrom
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds external flash support and dual-bank flash swap functionality for PSoC6 devices, along with enhanced flash programming capabilities using a read-modify-erase-write approach.
Changes:
- Removed NVM_FLASH_WRITEONCE restriction to enable flexible flash programming
- Added external QSPI flash support with SFDP-based configuration and temporary sector management
- Implemented dual-bank flash swap for hardware-assisted firmware updates
- Enhanced internal flash operations with optimized erase size selection (sector/subsector/row)
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| hal/psoc6.c | Core implementation of external flash, dual-bank swap, and enhanced flash HAL functions |
| docs/Targets.md | Documentation for new external flash and dual-bank features |
| config/examples/cypsoc6.config | Updated default configuration with NVM_FLASH_WRITEONCE=0 and fixed swap address |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
|
Okay to test. Contributor agreement on file. Over to @danielinux to review. |
danielinux
requested changes
Mar 3, 2026
Member
danielinux
left a comment
There was a problem hiding this comment.
Thanks for this contribution! A couple of minor things:
- check the return value of
ext_flash_read()as described indocs/HAL.md - it looks like the content of the temp sector is never restored at the end of
ext_flash_write()
53d6227 to
46ed900
Compare
danielinux
requested changes
Mar 5, 2026
Member
danielinux
left a comment
There was a problem hiding this comment.
Issues solved now. Please fix build error
… 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.
46ed900 to
f819928
Compare
Author
Resolved the build errors. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Add external flash support and dual-bank flash swap functionality for PSoC6 devices.
Removed NVM_FLASH_WRITEONCE restriction for PSoC6 devices.
Update flash hal functions of PSoC6 to support read-modify-erase-write way to perform the programming of flash
Testing
Tested using CY8CPROTO-062-4343W with the project: https://github.com/Pushyanth-Infineon/mtb-example-wolfboot-tpm
Usage:
Checklist