Reading and Writing from SD Card (Binary files)

Поделиться
HTML-код
  • Опубликовано: 3 дек 2024

Комментарии • 34

  • @logicprojects
    @logicprojects 4 года назад +5

    Thank you so much for these videos. It is so helpful to be able to see someone click through the gui and explain what each step is. The source code is wonderful as well.

  • @sswang9815
    @sswang9815 4 года назад +2

    Thanks man! learn a lot from your video and it really helps me a lot!

  • @isaackumba2688
    @isaackumba2688 3 года назад +1

    Respect Vipin

  • @haseenmultimedia3103
    @haseenmultimedia3103 2 года назад

    sir, hello . I have about 6 unreliable hex dumps from an sd card where some bit and hex data change, some hex values are consistent. For comparison and combining into one reliable hexdump do i use the 1 or the 0? Many thanks

  • @davee.j.8670
    @davee.j.8670 4 года назад

    Vipin, appreciate the help so much as it helped me to code the Zynq PS to read and write text files on my boot partition. Do you have a similar example for reading and writing a second data partition. I have tried to tweak the .h and .c files made available by Vitis 2019.2, but to no avail.

  • @ashwinsundar8229
    @ashwinsundar8229 3 года назад

    Dear
    Vipin Kizheppatt,
    I am getting the error "undefined reference to f_mount" inside the SD_Init() funtion.
    But the thing is, when I right click f_mount and click on Open Declaration it is opening ff.h to the line where f_mount is declared.
    I am not sure what to do now. My SDK version is 2018.3
    Ashwin

  • @912anindya
    @912anindya 3 года назад

    I am using FPGA board with a two-channel external ADC as input. I want to store sampled data to DDR and then transfer them to an SD card so that I could use them in MATLAB. Kindly give your insight on this

  • @thalsharif
    @thalsharif 3 года назад

    I faced problem and I can't solve it till now. I followed same instructions in video but still got FR_NOT_READY error code. This error rise when f_open is exceuted. I used my own bit file and also the one provided in git and still got same problem. I tried different SD cards including Zedboard SD card and that didn't solve the issue. Please advice me.

  • @Jocjabes
    @Jocjabes 4 года назад

    Your ff.h is different than mine for some reason. FIL structure in mine has no fsize member like the one shown in @7:39. Different version?

    • @Vipinkmenon
      @Vipinkmenon  4 года назад +1

      What is your sdk version?

    • @Jocjabes
      @Jocjabes 4 года назад

      @@Vipinkmenon It's v2019.1.

    • @Vipinkmenon
      @Vipinkmenon  4 года назад +2

      If the code is not workin in 2019 version, you can uncheck the include library option from BSP settings. I have added the xilfs library I used in git (github.com/vipinkmenon/sdReadWrite/tree/master/imageCopy). Just import all source code in the folder into your SDK src folder.

    • @ithierry007
      @ithierry007 4 года назад +7

      I had the same problem too but we are using a newer version of the library ( mine SDK 2018)but if you look at the file ff.h fsize is now a function not a struct attribute.
      replace this code " file_size = fil.fsize; " with this "file_size = f_size(&fil); "
      also in the function for unmounting replace the 1 with a zero
      rc = f_mount(0,Path,0);.
      I hope that helps

    • @Vipinkmenon
      @Vipinkmenon  4 года назад +2

      Yes. If you look the change history of this file, seems they have been changing it almost every year. I had my previous code from 2014 which was not working in 2017 because they have increased the parameters for initializing fat system

  • @ithierry007
    @ithierry007 4 года назад

    Very helpful video! I was looking for an example like this :). I have a question, is it only restricted to reading and writing .BIN files or can it also read .txt files as well?

    • @Vipinkmenon
      @Vipinkmenon  4 года назад

      Any file you can do. But when it is transferred to memory, it is transferred as a character array. So if you have number 55 in your txt file in memory it will be stored as '5' and '5', and the binary of 55 in case of txt file. So to get the data in int form you will have to use sscanf() with the buffer were data is stored. If you want to store some thing in txt format in SD card, first will have to store it in the buffer using sprintf() and use the write function for SD card

    • @ithierry007
      @ithierry007 4 года назад

      @@Vipinkmenon I tried your example on one of our ZYNQ FPGAs (which uses the ZYNQ processor) with an exported hardware from Vivado, and it worked. I tried the design on the Virtex 7 FPGA (Which uses the Microblaze processor) after generating a new BSP package, which includes the Xillfs library. It outputs errors stating that I have undefined references to f_mount, f_open, f_read, etc... Do you have any idea how I can use those functions?

  • @manuelaguilar7833
    @manuelaguilar7833 2 года назад

    How can I display this project in to a Genesys 2 Xilinx FPGA can someone help me please ?

  • @reveszkari
    @reveszkari 3 года назад

    Thank you. Problem // file_size = fil.fsize; // resolved. Last: ERROR: f_mount returned 13
    file system init failed. I can't find the error. // Vivado 2018.3 //

  • @prasadkmv9109
    @prasadkmv9109 4 года назад

    Hi sir
    i have gone through many of your videos regarding DMA data transfer, interrupts etc.,
    I am working on a project which generates stream data from PL, through DMA i am able to transfer those samples to DDR.
    I have checked the authenticity of the data in DDR, it is good and no missing data samples.
    Now i would like to store those samples coming to DDR into SD card, may be in .bin file. I have gone through this video but not able to link DDR data to SD. Provide your valuable insights to work on it.
    I am using ZC7020 Eval board for this.

    • @Vipinkmenon
      @Vipinkmenon  4 года назад

      What error are you getting?

    • @prasadkmv9109
      @prasadkmv9109 4 года назад

      @@Vipinkmenon getting ERROR: f_open returned 10 indicates the physical drive is write protected.

    • @prasadkmv9109
      @prasadkmv9109 4 года назад

      I have cleared this error. i have unchecked write protect in ZYNQ PS HW. Now data is stored in sd card as expected.
      Kindly help me on other issue.
      Actually i got data from PL to PS through DMA and stored in DDR. What i am doing is, i read ddr data to a buffer and after that doing sd card write during which there is no data transfer from PL.
      Now i would like to do it like a parallel task i.e., PL will push the data to DDR and i am writing the code in such a way that after say 10 MB of data i would like to write to the same memory locations. For this i have to read ddr data once it started getting data and i will be like a loop.
      Is this approach possible as C is kind of sequential execution.
      Provide your valuable insights to work on it.

    • @Vipinkmenon
      @Vipinkmenon  4 года назад

      For best performance for systems where data gets transferred to main memory and from there to a secondary memory, we will have to use ping-pong buffers. Instead of interrupt, for your application it will be better to use poling mode (read DMA status register). Configure the DMA to transfer to first buffer. Then poll to see whether the DMA is completed. Once DMA is completed, configure the DMA for the second buffer. Then transfer data from first buffer to SD card. Only after that poll for the second DMA completion. Once that is done (it might be most probably over since DMA is faster) configure DMA to first buffer and start transfer to SD card from DDR and after that poll for the DMA completion. Run this in a loop. Ideally for best performance we will have to use multi-threading, but standalone OS doesn't support it. Anyway your performance will be limited by transfer to SD card. You don't need a separate buffer to transfer to SD card. Transfer it from the same memory location where DMA puts data (zero copying). The buffer used to transfer to SD card is also allocated in DDR. So no point in having a separate buffer.

    • @prasadkmv9109
      @prasadkmv9109 4 года назад

      @@Vipinkmenon Thank You for the valuable inputs. But as i am new to this concept is there any tutorial kind of thing explaining simple transfer like you explained before?. It will be very much helpful to get better understanding from my side.