element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Avnet Boards Forums
  • Products
  • Dev Tools
  • Avnet Boards Community
  • Avnet Boards Forums
  • More
  • Cancel
Avnet Boards Forums
ZedBoard Hardware Design SDIO for Windows 7
  • Forum
  • Documents
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Avnet Boards Forums to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Not Answered
  • Replies 9 replies
  • Subscribers 325 subscribers
  • Views 736 views
  • Users 0 members are here
Related

SDIO for Windows 7

Former Member
Former Member over 12 years ago

Good morning from Germany,
I would like to know wheter if there is any library / API for SDIO device on Zynq. We are developing a Bare Metal Software which has to log some data on SD card, through SDIO interface.
Thank you in advance,
Michel

  • Sign in to reply
  • Cancel
  • Former Member
    0 Former Member over 12 years ago

    Hi

    I have not done anything with SDIO, but have made a fully working bare metal Vivado project that allows you to work with an SD card in SPI mode. It uses the 'FatFs' libraries available here -
    http://elm-chan.org/fsw/ff/00index_e.html

    Enabling GPIO in the PS block, you can then communicate through MIO pins 40-47, which are the pins in the SD slot on the Zedboard. (I am sure this is not the best way to do this, but it works!)

    I made the modifications to the 'generic' version of the FatFs library and have stuck the C files here so you can have a look
    http://personal.strath.ac.uk/kenneth.barlee/zed_posts/fatfs_sd.zip

    Kenny

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 12 years ago

    Hi, Kenny.

    It's great!!
    Does "Enabling GPIO" means that pin40-47 should be GPIO not SD0?
    I will try.

    Thank you.
    Sam

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 12 years ago

    Hi, Kenny.

    It's working!!
    Thank you for your idea!!

    sam

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 12 years ago in reply to Former Member

    ...haha - glad I could help!

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 12 years ago in reply to Former Member

    For anyone else reading this - yes, set the MIO pins 40-47 to be GPIO

    K

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 12 years ago

    HI, Kenny.

    Could this library create a binary file and write in binary format?

    Sean

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 12 years ago in reply to Former Member

    Hi Sean,

    Yes I am sure it probably could. If you look at the main.c file though, you will see that functions have been created that allow for files + folders to be created, and char strings to be written to them.

    If you are wanting to log binary values to a file I would suggest something along the lines of

    //stackoverflow.com/questions/111928/is-there-a-printf-converter-to-print-in-binary-format
    const char *byte_to_binary(unsigned long x)
    {
    tstatic char binary[32];
    tbinary[0]='0';
    tint z;
    tfor (z = 134217728; z > 0; z >>= 1)
    t{
    ttstrcat(binary,((x & z) == z)?"1":"0");
    t}
    treturn binary;
    }

    void main(void)
    {
         ....

    t//BINARY VALUE
    tint bin = 0b010101010101;

    t//CREATE NEW FILE
    tprintf("
    create a new file (binary.txt)");
    trc = f_open(&Fil, "BINARY.TXT", FA_WRITE | FA_CREATE_ALWAYS);
    tif (rc) die(rc);

    t//WRITE TO NEW FILE
    tprintf("
    write binary data");
    tchar buffer[33];
    tsprintf(buffer,"%s
    ",byte_to_binary(bin));
    trc = f_write(&Fil, *buffer, strlen(buffer), &bw);
    tif (rc) die(rc);

    t//CLOSE NEW FILE
    tprintf("
    close the file");
    trc = f_close(&Fil);
    tif (rc) die(rc);

    t...
    }
    (note - not tested!)

    ...rather than writing binary commands. If you want to do that though, I guess you would have to manipulate some of the files in the background. Have not done it myself so could not comment!

    Kenny

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 12 years ago in reply to Former Member

    HI, Kenny.

    It does work! Thank you for answering!

    Sean

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • ttkee
    0 ttkee over 7 years ago

    Hi  

    I am getting this error  10 = FR_WRITE_PROTECTED = The physical drive is write when everytime I run the application. 

    I used diskpart to to disable write protection, but I still get the same error. 

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube