Move .wav file from a SD card to the flash memory of Arduino DUE

Hello everyone,

I am developing a project that aims to send audio signals synchronized with a GPS signal. Time precision is a requirement for this project. My idea is to make the Arduino DUE reads the SD card and send the file to its flash memory. So, I would execute the file from the flash memory synchronized with the GPS signal. My audio signal would have about 50KB to 100KB with a .wav format.

Is it possible to do this process?

Would it be faster than reading the SD card every time?



yes, having the file directly in the SAM chip will always be faster than reading the SD over SPI. But both the Flash and the RAM of the SAM3X are rather limited for such a usage.

Now, I see a possible issue with your project. Are you going to read the SD and store in Flash everytime? Don't forget that Flash have a limited number of write cycles, so you shall not keep writing in the Flash.

What is your timing requirement between the triggering and the file being played? The Due is rather fast and can read the SD very quickly, so maybe it will fit your needs in terms of latency.


Thanks for replying Benoit,

About the first question. I did not know about this restrictions about saving in the Flash memory. My idea is read the SD card and send the data in Flash once. Then I would execute the sound using this value stored in the flash. The Arduino would save the data again, just when I restart the board. I believe that this is not so efficiency.

About the second question. I would like to spend no more than 1ms between the triggering and the file being played. Do you believe that is possible to achieve this goal?


Check that you can write to the flash from code in a Due, this is something I know you can't do on any of the 8 bit Arduinos. Also it seems a bit of a silly thing to do. What do you gain from it?