2024-02-04 07:38 AM
Hi all, im using Cube IDE STM32H743ZI2 Evaluation board
im curently sampling ADC2 and storing the output at an internal array using DMA
the array size is uint16_t[100,000]
my requirements as to store much more data which means i have to use a diffrent memory sector.
i was hoping i could use flash for that matter but the examples that i tried online.
i was wondering is that kind of thing even possible?
do i need some external flash memory for that matter?
my final goal would be storing around 1M samples during about 1-2 seconds which sums up at about 1Mb
what is the right approach for that matter?
according to the reference manual i should be able to access flash memory via D2->D1 AHB BUS
Thanks! :)
Solved! Go to Solution.
2024-02-05 01:46 AM
You should / must use DMA, and thus can only use RAM for the initial data collection.
Don't forget that flash memory in general has a limited number of write cycles.
So to me it sounds that you should rather use some extra external RAM, which could be accessed directly by the DMA.
But be careful, not all STM32 work with quad / octal SPI PSRAM, so maybe you have to use the FMC with some parallel SRAM.
2024-02-04 08:01 AM
Internal Flash is impractical and slow. Might work for something you plan on recording once, and playing back hundreds of thousands of times, or on a continuous loop.
Data storage with any speed and volume, use eMMC or MicroSD card (SDMMC)
QSPI NOR Flash, designed to read fast, relatively slow to write
2024-02-05 01:24 AM
Ok, i do only need to record once and store the data so that my mcu can proccess the data once it's free.
and i was certain that this MCU can do that seeing it is able to sample and such a high rate (up to 3.6Mhz)
i may pursue the solution of an external Flash with a fast writing ability,
the problem is that i need my data to be continuous, meaning i cant let it be sent over in packs so that i dont lose anything in the data sequence or it's synchronization.
if i do only use the ADC once for about 1M samples. would the flash be able to store it effectively and on time?
do i need to first store it in RAM?
Thanks :)
2024-02-05 01:46 AM
You should / must use DMA, and thus can only use RAM for the initial data collection.
Don't forget that flash memory in general has a limited number of write cycles.
So to me it sounds that you should rather use some extra external RAM, which could be accessed directly by the DMA.
But be careful, not all STM32 work with quad / octal SPI PSRAM, so maybe you have to use the FMC with some parallel SRAM.
2024-02-05 11:31 PM
Flash memory, even external, is not writeable!!
In order to write to any flash - you need a special code: it is called "indirect mode". A flash memory could be configured to read from it ("memory mapped mode") or to execute code from it ("XIP mode"). But it is never possible to write to a flash memory (never mind if internal or external) without a special piece of code ("in indirect mode").
So, a DMA cannot work to write to a flash: there is also handshake because writing is much slower as reading: a DMA cannot do.
The only option is:
Flash is a "Read-Only" memory. Just with special procedures it can be erased and written with new content (which can be very slow). Not any DMA can do this (just your own special code with the correct procedure).
2024-02-05 11:50 PM
@tjaekel wrote:
- a long time: make sure you do not get new data to write before you have finished the previous write
This is a very big problem for my case, in that case i will not pursue the flash option but instead add RAM to my MCU
i've never tried anything like that
how can that be acheived?
and also would the additional RAM be able to connect to DMA?
Thanks! :)