-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Add non-standard nvm to QSPI for external flash support #2754
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
add standard SPI support to QSPI for external flash
|
@maholli We did have single-channel |
|
@dhalbert I started with My initial tests were using |
|
I looked at why standard SPI would not work, and it's because the QSPI MOSI/MISO, and SCK pins cannot share a common SERCOM, per the datasheet pin mapping table. So you have to use the QSPI peripheral, which is fine, though more work. Thanks, proceeding on to review. |
dhalbert
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding this feature!
My comments are pretty much about whether you are special-casing your particular chip in the SINGLE case. The SINGLE flag should be able to work with any flash chip. If you need special handling for the MRAM chip, then there should be flag bits set in the chip description struct that say what to do.
Have you tested these changes against regular dual and quad QSPI boards? It would be good to make sure there isn't a regression.
|
Thank you @dhalbert for the review!
|
merge from upstream
|
@dhalbert All requested changes have been implemented. Thank you for the guidance. Comments
Let me know if there's any syntax or semantic changes that should be made. |
ko build is a little too big.
tannewt
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few small concerns. In general this is super interesting! 🚀
dhalbert
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! I also tested this on a Metro M4 with regular QSPI configuration, and also EXTERNAL_FLASH_QSPI_SINGLE and _DUAL, and it worked fine.
@tannewt Any further comments?
tannewt
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me! Thanks!
These additions/changes allow single-SPI (as opposed to dual or quad SPI) storage devices to act as external flash memory on the SAMD51 QSPI bus. Also adds a pycubed_mram board.
Guidance needed
Build size was preserved, but I could use help making the
#ifdefmore succinct and readable for users. Currently, it assumes anything with a#define EXTERNAL_FLASH_QSPI_SINGLEwill operate like my NVMRAM, but that isn't realistic (SD cards will still need the sector erase, for example). The changes to ports/atmel-samd/supervisor/qspi_flash.c are a good example of where guidance is needed:Another good example is in supervisor/shared/external_flash/external_flash.c: