Skip to content

Conversation

@petejohanson-adi
Copy link
Contributor

The SPIXF peripheral allows executing code from external flash, so add example configuration to the APARD32690 board that enables the OpenOCD flash bank so code built targetting the flash can be downloaded there.

Note: This depends on some changes to OpenOCD that are actively being submitted upstream now.

The SPIXF peripheral allows executing code from external flash, so add
example configuration to the APARD32690 board that enables the OpenOCD
flash bank so code built targetting the flash can be downloaded there.

Signed-off-by: Pete Johanson <[email protected]>
@sonarqubecloud
Copy link

default y if CODE_DATA_RELOCATION
help
When using code relocation to place code into external flash accessed
with the SPIXF peripheral, ensure OpenOCD will initialize the bank
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So is SPIXF necessary for both flashing and code execution !? What about just data access?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The SPIXF peripheral on MAX32 allows both normal flash access for explicit read/write, but also provides transparent access for read/XIP from flash mapped at 0x80000000. That remapping only will happen if SPIXF is properly initialized though, it doesn't do so automatically after a reset.

The Kconfig here is for ensuring OpenOCD sets up an additional flash bank for that 0x80000000 range, so when flashing an image that includes code relocated there, it will flash that to the attached QSPI (under the hood OpenOCD is using the SPIXF peripheral to perform this flash) for you properly.

The application_development/code_relocation_nocopy sample was updated as part of the SPIXF driver work to properly demonstrate that functionality, but flashing to APARD32690 (the main kit with QSPI flash included, not found on MAX32690EVKIT) previously required various manual tweaks to set up OpenOCD "just right" to do so. I'm trying to upstream the various Zephyr changes needed so this will work OOTB, while other ADI folks work to upstream the needed OpenOCD changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants