[lowrisc-dev] Can't execute SD card example on Nexys4 DDR

Alexis Ramos Amo aramosam at nebrija.es
Wed Mar 30 20:41:10 BST 2016

Hello Wei,

Thank you four your fast answer.

No, I'm trying with the original code downloaded from GitHub (branch master) and Vivado 2015.4.1.
I've also tried with another Nexys4 and another card with the same result.

Thank you for your help


-----Mensaje original-----
De: Wei Song [mailto:ws327 at cam.ac.uk] 
Enviado el: miércoles, 30 de marzo de 2016 11:49
Para: Alexis Ramos Amo <aramosam at nebrija.es>; lowrisc-dev at lists.lowrisc.org
Asunto: Re: [lowrisc-dev] Can't execute SD card example on Nexys4 DDR

Hello Alexis Ramos Amo,

microSD is supported using a SPI interface and driving the the SD using a FatFS through the SPI mode.
UART is also supported as well, both read and write (the error message is actually comes from UART).
Configuring FPGA using PROG/UART and SD has been tested, which should work out of the box.

Not sure about configuration from Flash but I think it is OK.
You can see the error message, meaning the FPGA is configured.

I do not think you need to change the f_mount().
f_mount() happens after the FPGA is configured.

Have you changed any hardware design related to the SPI interface used by the SD or any C code related to SPI and FatFS?
It feels like something conflicting with the SPI interface.


On 30/03/2016 08:43, Alexis Ramos Amo wrote:
> Hello all,
> I'm trying to run "SD card read test" (sdcard.c) on my Nexys4 DDR but I get  the following error:
> Fail to mount SD driver!
> Error! exit (0x00.1)
> The program is failing at the following line (in sdcard.c)
> if(f_mount(&FatFs, "", 1))
> I'm loading the bitstream from Quad-SPI Flash (the board is going to be re-configured several times, so I need the fastest programming procedure available). I get the same error loading it by PROG/UART, but I don't have any problem if I load the bitstream from microSD. The microSD HC is formatted on FAT32 (8GB).
> I've changed the option _FS_READONLY  to 0 in order to allow writing on the SD. Also I've tried to change the path of f_mount (like if(f_mount(&FatFs, "1:", 1)) without success.
> . How can I read/write from SDCARD, if I  load the bitstream from another different drive than the SD?
> . Also, Could I write into SPI Flash memory (instead of sdcard) if the bitstream is loaded from flash?
> Thank you for your help.
> Alexis Ramos Amo
> Researcher / PhD Student
> Electronic Design and Space Technology group Nebrija University
> Madrid
> Spain
> www.nebrija.com

More information about the lowrisc-dev mailing list