2019-10-02 03:28 AM
Hello,
I'm a total beginner and I'm looking to store some user data in the QSPI Flash,, but I don't really know how to proceed can you help me ?
First, I changed the flash memory size in the .ld file from 16M to 12M so that TouchGFX won't overwrite my data. But from now, I don't know what to do...
How can I write and read to this 'allocated' space ?
Thanks
2019-10-06 08:42 AM
I'm not sure it will help but I did a video on how to include the QSPI into cubeIDE while running TouchGFX: https://www.youtube.com/watch?v=237lPdMsDZs
also, you might want to have a look at how the framebuffer is created. it's located at the start of the SDRAM memory space which should be available in the same way as the QSPI memory:
static uint32_t frameBuf0 = (uint32_t)(0xc0000000);
then you have the address of the memory and you could use that as a pointer to your data.. I hope :)
2019-10-06 02:49 PM
I'm not using TouchGFX
If in QPI mode some of the commands sent to the memory chip change, there is also 3 or 4 byte addressing modes. It may be possible to write while in memory-mapped mode (via commands, not the memory mapping), but the BSP doesn't seem to be sufficiently context sensitive.
The memory doesn't understand the mapping on the CPU side, the commands expect zero based addressing of their internal array.
2019-10-06 11:52 PM
Hi @MFOWE,
QSPI is not in memory mapped mode by default unless you use our application template. CubeMX doesn't concern itself with BSP, so additional user code is required (Specified in the CubeIDE video i made).
/Martin
2019-10-07 09:17 AM
Hello @Martin KJELDSEN ,
The thing is that I am the Touch GFX application template. So most of the programming I've done yet was using your GUI and msv. But now, I'm stuck and don't understand how can I have a variable from my view / model to get programmed to the QSPI.
2019-10-11 10:51 PM
Hi, @MFOWE ,
Since you are using the TouchGFX application Template, the QSPI flash is initialized in memory-mapped mode, so in your model class, you have to do the following to save data to QSPI flash.
But actually I don't recommend to save date in QSPI flash when using TouchGFX. It should work fine when you write to the flash in TouchGFX task. But when you write data to the flash in other tasks, you have to do some tricky to avoid system crash.
Best Regards.
2023-05-12 11:37 AM
I did not believe that here on ST forum is anyone who really helps. I would like to thank you for this, hope more people will answer like you!