I have been working on reading a .txt file from the micro sd card on the Zybo Z7 board from the PS side. The version of Vivado I use is 2018.1 and the sd card belongs to Kingston (8 GB). I have created a block design in Vivado that just contains the Zynq PS block. I have attached the file below for the reference. In the customization, I select SD0 (40-45 pin) and the pin 47. I also select UART. Reset of the parameters are left unchanged.
After exporting the design to the sdk, I create hello world project and modify the main.c with the code for the sd card. I have attached the main.c below for the reference.
I also enabled the xilffs in the BSP for Generic fat32 file system.
However, when I run the code it seems that f_mount works correctly. But, the f_open, f_read and f_close give errors as following:
Connected to COM6 at 115200
Starting the read from SD card...
Mounting done successfully : 0
Opening Failure : 3
Reading Failure : 9
1118696
Closing Failure : 9
The mounting operation returns the value 0 means FR_OK is 0 (succeeded). Whereas, f_open returns (3) i.e. FR_NOT_READY and f_read and f_close returns (9) means FR_INVALID_OBJECT.
It does appear that the f_open failure causes the read and close functions to fail.!
Also, I am storing the read data in a buffer which prints some garbage value I suppose!
As a starting step, I have a test1.txt in the SD card which has 1 byte data : 5. That's all...
Question
fpga_123
Hello,
I have been working on reading a .txt file from the micro sd card on the Zybo Z7 board from the PS side. The version of Vivado I use is 2018.1 and the sd card belongs to Kingston (8 GB). I have created a block design in Vivado that just contains the Zynq PS block. I have attached the file below for the reference. In the customization, I select SD0 (40-45 pin) and the pin 47. I also select UART. Reset of the parameters are left unchanged.
After exporting the design to the sdk, I create hello world project and modify the main.c with the code for the sd card. I have attached the main.c below for the reference.
I also enabled the xilffs in the BSP for Generic fat32 file system.
However, when I run the code it seems that f_mount works correctly. But, the f_open, f_read and f_close give errors as following:
Connected to COM6 at 115200
Starting the read from SD card...
Mounting done successfully : 0
Opening Failure : 3
Reading Failure : 9
1118696
Closing Failure : 9
The mounting operation returns the value 0 means FR_OK is 0 (succeeded). Whereas, f_open returns (3) i.e. FR_NOT_READY and f_read and f_close returns (9) means FR_INVALID_OBJECT.
It does appear that the f_open failure causes the read and close functions to fail.!
Also, I am storing the read data in a buffer which prints some garbage value I suppose!
As a starting step, I have a test1.txt in the SD card which has 1 byte data : 5. That's all...
Can anyone help me with this?
Regards,
Shyama.
Link to comment
Share on other sites
10 answers to this question
Recommended Posts
Archived
This topic is now archived and is closed to further replies.