cancel
Showing results for 
Search instead for 
Did you mean: 

Persistent data

MatthGyver
Associate II

Hi,

I am developing a small application on a STM32f746-disco, some parameters of which can be modified. I would like to store the modified parameters of this in memory in order to retrieve them on restart.

As a maker beginner I am a bit confused on how to do this.

Can you give me advice please?

Thank you

4 REPLIES 4
Romain DIELEMAN
ST Employee

Hi,

If you wish to store data/variables for your next start up, you need to save it in non-volatile memory, so for example you could use the flash memory in your f746 disco board if there are some free space. Writing on-chip FLASH can have a performance impact so I would only interact with it at startup and with maybe a "save" button in your GUI or something. Try to look online for "saving variables in non-volatile memory" there are tutorials explaining the procedure in detail better than I would.

After that in order to interact between this data and your GUI, have a look at the Backend communication article to understand how to work with data. You can also download some of the examples on that webpage and get some inspiration from the code.

Have a try and keep us updated on your progress :smiling_face_with_smiling_eyes: . Feel free to ask if you need more help or advice, this may be useful to other users

/Romain

MatthGyver
Associate II

Thank you @Romain

I've take a look on EEPROM Emulation

If I understand, it's one "simple" way to have persistent data.

Silly question: does the simulator emulate flash memory and allow testing?

Would an external eeprom be very more efficient ?

The road will be long but I will not fail to give feedback

MatthGyver
Associate II

Hi,

My project will not consume all the space of quadSPI flash STM32f746-disco.

Is it possible to reserve some space for storing data ?

How can I read / write into this memory please ?

As I'm newbie, all informations about that will be helpfull.

Thank's

Martin KJELDSEN
Chief III

It's possible to reserve space in your memory through the linker script so that the linker will know not to put data there.

How to write to the memory depends on your MCU and project but through ST interfaces it could be HAL_QSPI_Write() or something similar, but you need to take the flash out of memory mapped mode first and make sure that TouchGFX is not trying to access it (DMA2D reads data from there).

The simulator does not emulate anything other than external events (key presses). It just runs on top of SDL2.

/Martin