Sharing a (working and implemented) idea, for what to use the Portenta H7 onboard QSPI flash device.
There is an external QSPI flash memory device on board.
Pretty huge: several MB available (but slow for code, even possible).
I use it this way:
- I have an UART shell command line interpreter (and many commands)
- I have a command as "man cmd"
- I want to get more help how to use a command, what the parameters for the commands are ...
- So, the "man cmd" reads text from the QSPI flash and displays it to me (on UART),
now I have more details about the command
You can use the QSPI flash also to store web pages (web browser running), also for help,
web pages from MCU, even for code (but a slow interface - I do not recommend to do).
I use it this way:
- QSPI flash is initialized on startup
- and configured for MemoryMappedMode
- so, I can see it at starting address 0x90000000 (and a direct access to QSPI like any memory)
- I handle 4KB sectors on QSPI: to erase a sector, to write a sector
- I have commands to access a sector via command line with argument idx where idx is a number 0..N for one of the 4K sectors
(so, I address a sector to erase, to write content (4K max), to read a sector etc.)
So, I write from SD Card a max. 4KB ASCII text file to one particular QSPI sector (idx).
Later, in my command interpreter, via "man cmd" I get the idx for the 4K sector for this cmd and display the help text (on UART).
I use also VT100 terminal attributes (colors, bold, ..., ESC codes).
So it looks like this:
You "just" need:
- initialize the QSPI
- for direct access (start address 0x90000000) - enable MemoryMappedMode (direct),
so QSPI becomes available as any other memory (for direct access) - for all other commands, like "erase a sector", "write a sector" - it must be in NOT MemoryMappedMode (as indirect)
- debugger, FW etc. will not update QSPI flash - I use SD Card and a command as "sd2qspi filename idx" in order to write to QSPI (to make my "man" pages available, to erase and write again ...)
Happy coding and have fun with the QSPI chip on Portenta H7 board.
