file-ioarmxilinxzynqxilinx-edk

Filo I/O operations from SD card in Xilinx Zynq ZCU102


I'm using a Xilinx Zynq UltraScale+ MPSoC ZCU102 Evaluation Kit. I want to run a C++ program in the Xilink SDK tool(running on a Windows machine) that can do Filo I/O operations on a binary file stored in the SD card in the Zync board. I have the command line tool(xsct) setup. My questions are as follows:

  1. What are the commands that I have to execute in XSCT tool to mount the SD card?
  2. Once the SD card is mounted, how can I query for the SD card drive(whether C:\ or D:\ drive)?

Edit: The following Xilinx thread suggests that no mounting procedure is required. In this case, I'd like to know how the SD card drive can be identified and the information about the files contained therein can be displayed in the XCST terminal.

https://forums.xilinx.com/t5/Embedded-Development-Tools/Filo-I-O-operations-from-SD-card-in-Xilinx-Zynq-ZCU102/m-p/851582/highlight/false#M45325


Solution

  • Don't confuse two different systems.

    In simple terms, SD card when inserted in MPSoC-board is accessible to the processor running on the MPSoC-board. The code running on that board will initialize it and access its contents.

    XSCT is just a command line tool. It allows to perform the tasks using commands that are also possible using SDK GUI. Go through this link to understand what XSCK really is.

    You can accomplish what you are saying by running PetaLinux on MPSoC and accessing the card using simple open,read,write,close functions by writing a C or C++ program that will run on PetaLinux.

    A more difficult approach would be to make a bare-metal (standalone) program with SD-card driver and file-system code in it to access the SD-card