Forum Discussion
Writing .txt file in SD Card - DE2
Hello, I am Student from a University beginner in FPGAs, and I was doing a project with Nios II that uses a Altera DE2 Board to do some operations and save the results. The main ideia was to transmit to computer the results, but the USB take too much time to the FPGA.
Now I am seaching a way to save those results at the SD card. But I couldn't find a way to store data in SD card. My idea was to create a .txt file that could receive at the end of each operation a value in the next line. If someone knows how save values in the SD card, I really appreciate your help, if you help send me.37 Replies
- Altera_Forum
Honored Contributor
Not to get too far off topic here but does anyone know of a way to write to an SD card using SPI (low level write)? As long as you know what data is being written you could extract it using MATLAB. Any thoughts?
- Altera_Forum
Honored Contributor
Hello! I'm need a way to save data from fpga. I couldn't find a easy way to store in SD card. Does anyone have some idea to transfer data in a quicker way?
- Altera_Forum
Honored Contributor
If you always run your system with a USB cable attached, you could use the host file system software component, that will let you read/write files on the PS from the embedded application. You need to run in debug mode though.
- Altera_Forum
Honored Contributor
Found the solution to the mysteries of the SD Card!
http://www.alteraforum.com/forum/showthread.php?t=34101 - Altera_Forum
Honored Contributor
PeteCSI, thank you for your support!!!
I'm I going to try the method! After testing it, I post here my results! - Altera_Forum
Honored Contributor
Hello! It's possible to write data in a pendrive/flash device? using USB host?
PeteCSI: I'm trying to understand the FreeRTOS! When I get something I post here my results! - Altera_Forum
Honored Contributor
You'll need quite a lot of USB driver code in order to access a USB drive.
You'll also need fairly trivial (by comparison) code to access the FAT32 filesystem on the device. - Altera_Forum
Honored Contributor
On my DE2-115 it says it only accepts SD formatted on FAT16.
- Altera_Forum
Honored Contributor
Larger devices are much more likely to have FAT32 (than FAT16). The crossover point is probably abut 128MB - although FAT16 can go higher.
Nothing to stop you reformatting part of the device with FAT16 though. - Altera_Forum
Honored Contributor
PeteCSI: I'm having some trouble when creating a NIOS with the Altera_UP_SD_Card, I tested the .c example using a Nios from the Altera CD, but I get no response from SD.