2024-02-23 04:33 AM
Hello
how to save (int, float...) values, in non-volatile memory on a riverdi RVT70HSSFWCA0 screen. It has an external qspi flash. Can you give me some simple basic examples or a demo file? I think we should use HAL FLASH? and the code should be put in which part of the project (in part touchgfx or stm32 cm7 (main.c ...)), I admit that I am a little disoriented with object programming on cubeide!
2024-02-23 04:39 AM
@NicoEFI wrote:on a riverdi RVT70HSSFWCA0 screen
Have you asked Riverdi that?
They would be the ones to provide examples targetted for their particular boards:
https://riverdi.com/knowledge-base
2024-02-23 04:45 AM
Yes I sent them an email request but still no response.
2024-02-23 05:12 AM - edited 2024-02-23 05:31 PM
The Internal FLASH commands and API will be no use for QSPI
You can't interact with the memory while in Memory Mapped Mode.
Hopefully there would be BSP code to bring up the memory, or facilitate an External Loader, if not you'd need to add functions to erase and write.
You'd need to erase a sector, typically smallest being 4KB, and then write up to a page (256 bytes) at an aligned boundary.
For configuration data I'd use a structure that I can update / use in RAM, and flush to QSPI FLASH when things change.
2024-02-23 08:29 AM
@Tesla DeLorean wrote:The Internal FLASH commands and API will not use for QSPI
@NicoEFI - but maybe you could use the internal Flash instead ... ?
Then you wouldn't have any dependencies on Riverdi's external hardware ...
2024-02-23 09:05 AM
yes maybe, so I could use the standard hal flash library?
2024-02-23 05:25 PM - edited 2024-02-24 01:31 AM
The chip in the Riverdi board is STM32H757XIH6, which is close relative of STM32H747.
Look in ST examples for STM32H747 boards:
https://github.com/STMicroelectronics/STM32CubeH7/tree/master/Projects/STM32H747I-DISCO
https://github.com/STMicroelectronics/STM32CubeH7/tree/master/Projects/STM32H747I-EVAL
They have both QSPI flash examples and internal flash examples. The "standard HAL flash library" is good for the latter. Because there are so many QSPI flash memories, the "standard HAL flash library" has only the basic driver for the QSPI controller itself. Drivers for some QSPI memories are in the "BSP" branch of the Cube library package. If the Riverdi board has one of these flash chips, you're lucky.
2024-03-03 03:17 AM - edited 2024-03-03 03:27 AM
ok thank you for your answer, then I write in the internal flash and I use this code to write a variable, at the address 0x080E0000, sector 7, on an STM32H757XIH6 using the library stm32h7xx_hal_flash.h
To write a byte I have to take the place of a word if I understand correctly!
"
HAL_FLASH_Program(FLASH_TYPEPROGRAM_FLASHWORD, 0x080E0000, 0x13); // save data to flash
"
Now, if I want to erase this variable after having written it, to write another variable instead and without erasing the other variables in the sector, how do I do it ? or should I emulate as an eeprom ?
2024-03-04 02:26 AM
@NicoEFI wrote:should I emulate as an eeprom ?
That sounds like the functionality you're looking for!
BTW: use this button to properly post source code: