element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • 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 & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • 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
      • Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Vietnam
      • 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 & Tria Boards Community
  • Avnet Boards Forums
  • More
  • Cancel
Avnet Boards Forums
ZedBoard Hardware Design ZED-bare metal SD card write-using drivers-debugging
  • 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 5 replies
  • Subscribers 340 subscribers
  • Views 828 views
  • Users 0 members are here
Related

ZED-bare metal SD card write-using drivers-debugging

Former Member
Former Member over 10 years ago

Folks really need your help with this,


Basically I am attempting to write to a 16 GB sandisk microSD card. following the instructions in this link


http://zedboard.org/content/standalone-sd-card-sdio


Here's a brief of the setup:

h/w:
1) 16GB uSD (San disk), fat32 formatted, default allocation size. Zedboard


2) Vivado:
- zynqPS with SD0 and UART1 enabled. MIO 46-CD, 47-WP, and 38( power) is this necessary?, 'Fast speed' and pullups disabled (ON ALL PINS).


-None of the jumpers on my zedboard are set to boot from SD (i.e. J6 or JP7-JP11).


s/w:


Using Yaro's(from the link) C files with the xsdps drivers that it calls.


Here's my debug attempt so far- I basically stepped through the code and a status failure shows up from:


" XSdps_Get_BusWidth() "


stepping into this code I find that, an error flag is actually set in here:


if (StatusReg & XSDPS_INTR_ERR_MASK) {.....


StatusReg is being set just above this if() statement by reading from the XSDPS_NORM_INTR_STS_OFFSET and is being compared with XSDPS_INTR_ERR_MASK (x8000).

I'm wondering if the BlkCnt of 1 that is passed to the address XSdPs_BLK_SIZE_OFFSET is a problem. Because before this it's always been a value of 0.

.....


Thats about as far as I could get before really being at the end of understanding whats going on and how to fix it.


Please..any directions on how to further debug would be HUGELY appreciated.

  • Sign in to reply
  • Cancel
  • zedhed
    0 zedhed over 10 years ago

    Hi omkarpradhan,

    I don't think that using debug mode should impact what you are trying to do.

    What version of tools are you using?

    Take a look at this thread here:

    http://microzed.org/content/read-txt-matrices-sd-ddr-zedboard

    In that thread, the XILFFS was used to access the SD card.  On my end, I was at least able to use 2014.4 to build a design where I could run the example code for the XILFFS library on ZedBoard which reads and writes to the SD card.

    Regards,

    -Kevin

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

    Kevin,

    Like the title says I am using 2014.2 Are you sure the version difference causes some changes?

    I noted in the link that I had referenced there was something about disabling data chaches. Any idea how to do this?

    Also does my h/w config look correct? Do you have the same setup?

    Omkar

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

    Holy ***, it works now. Man thanks for that tip about the example.

    Also don't know if changing the h/w config a bit did it. I'm going to run around the block celebrate and then come back to figure the rest of it out.

    I was using a very similar code in another discussion on this forum.

    By the way have you been able to read/write text files? If so any experiments with how fast you can read write?

    Omkar

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

    Kevin,

    It seems like the default example is set up to write NOT in English. I can't understand the language that it is writing in. I looks to be a mix of chinese/korean script.

    Can you tell me where to change this?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • zedhed
    0 zedhed over 10 years ago

    Hi Omkar,

    I am not sure that the xilffs_polled_example.c is setup to write in any specific language.

    If I look inside of FfsSdPolledExample() for SDK 2014.4, I can see the following test pattern get setup within a buffer:

    #define TEST 7

    ...

    for(BuffCnt = 0; BuffCnt < FileSize; BuffCnt++){
       SourceAddress[BuffCnt] = TEST + BuffCnt;
    }

    That ends up being a bunch of sequential 32-bit word data so it just so happens when you open the file it appears to be NOT in English.  If you open the file with a HEX editor, you should see a data pattern starting at 0x00000007 and counting upward from there.

    Regards,

    -Kevin

    • 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