cancel
Showing results for 
Search instead for 
Did you mean: 

SD lossless data storing from GPIO.

simo zz
Senior

Hello,

I am thinking to use an STM32H7 to write external data incoming from 16 GPIOs to an SD using the internal SD 4.1 Host controller. The data clock rate is 12 MHz.

The STM32H742xI/G STM32H743xI/G DS (https://www.st.com/resource/en/datasheet/stm32h743bi.pdf) specifies, for GPIOs, frequencies up to 220 MHz..

So the flow would be: capture GPIOs state and store into SD using SD controller, that's it. The MCU would be running at maximum frequencies. I think that the delay for capturing data and storing into SD controller register, at maximum MCU frecuency, could be small enought to don't lose any other incoming data.

As far as I understand I could achieve easily this kind of lossless data storing.

Is there something I am not bearing in mind that could turn my idea to be a bad one ?

Thanks.

s.

5 REPLIES 5

Coding to get a 24 MBps data stream to a card might be a bit of a challenge​

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..

Hello @Community member​ , could you please argue better what kind of problems I could face with this appraoch ?

Thanks.

s.

You are free to give the best argument with all the useful information you can, straight to the point, in response to my question.

Actually I still don't have any SD card.

The FPGA logic can run at 500 MHz. 

The data rate is given on the first message (16 bits at 12 MSPS = 24 MBps), same as my idea on a perhaps possible solution to my problem. 

Thanks. 

s. 

Danish1
Lead II

I think what Clive (user Avagadro's number) is trying to say is that the 24MBps data rate is extremely high - much higher than one would expect for even stm32h7.

Normal SD cards - driven in the best way possible - cannot sustain that data rate.

There are special SD cards capable of storing 4k high-definition video that can average such a high data rate, but only when paired with sufficiently high-performance (read full-blown computer, not microcontroller) hardware.

But there's another key word in there: average. You can pump data into the card at a faster rate when it is ready. But, when the card decides, it will go "busy" and not accept any more data until it decides it is ready again. So even with a 4k-capable SD card you need a substantial amount of RAM storage to buffer your incoming data, or just accept that it will be lost. How much? Megabytes? Much more than is built-into stm32h7.

That's the $100 argument.

If you pay the $500 (in advance) one of us volunteers might be willing to do the necessary experiments to find out what the actual sustainable data rate for a given memory-card might be. Or you could do the tests yourself - which would be much better as you'll have a better understanding of the necessary tricks and compromises.

Hello@Danish,
Thank you for your helpful answer.
I am reading more in detail the SD card documentation, where are mentioned these kind of delays. 
Simon