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

Wei Song ws327 at cam.ac.uk
Wed Mar 30 10:49:08 BST 2016

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