2023-03-05 01:25 AM
Hello, I'm using stm32h750b-dk and I created an user interface with TouchGFX. This UI gets some user inputs and evaluting some results with that inputs. Here is my question is how can I save this user inputs and some config variables to qspi flash memory ?, and is the auto-generated touchgfx stm32 project already creates the qspi interface and driver?
This variables must be non-volatile if there is another method to do that I can go with that, I'm very open the suggestions.
Thanks
Solved! Go to Solution.
2023-03-05 11:10 AM
Recommended reading is AN4760:
The erase and write example is here (if you wanna download the entire project go up some URL levels):
Hope this helps. Good luck.
2023-03-05 04:45 AM
Hello,
you should find somewhere in the project source code that the QSPI Flash is configured in memory mapped mode. In this way Touchgfx can read the image data taking them from an address/pointer instead of interacting with peripheral registers. It is not complex to reserve a few pages at the end of the QSPI Flash space for saving data, but to do so you must revert to block mode by disabling memory mapped mode, write to flash and then re-enable memory mapped mode before returning to the loop where Touchgfx is polled.
For more details about memory mapped/block mode:
Another method is to use the MCU's internal flash, but you should be sure not to wearout the pages you reserved for this purpose (see datasheet about flash endurance). The limited number of erase/write cycles can be overcome with eeprom emulation technique, see AN4894.
2023-03-05 05:32 AM
Hello,
Thank you for your clear explanation. As you said, I removed the memory mapped mode part for qspi, but while doing this, I saw that there are 2 flash instances for this card. I wonder if this part is completely separate flash from touchgfx?
Actually my data is really small I just want to save 10 uint16_t variables, when user power off and power on the device, the numbers and choices must be saved.
And for the eeprom emulation, there is no another sector in the flash.
Thank you again
2023-03-05 05:49 AM
Check the stm32h750b-dk board schematic, Page 11, you will see U2 and U1, each chip over it's own bus.
So, the QSPI is in dual bank mode. The data are fetched 8bits at a time to double the speed. You shoud disable dual flash mode and than write/read using only one chip.
2023-03-05 06:12 AM
Can you provide me some example or at least kinda psuedo code something?, I'm really far from the qspi theory.
Thank you very much for your explanations, I learned a lot today
2023-03-05 11:10 AM
Recommended reading is AN4760:
The erase and write example is here (if you wanna download the entire project go up some URL levels):
Hope this helps. Good luck.