cancel
Showing results for 
Search instead for 
Did you mean: 

FATFS on SPI bus - FR_NOT_READY

alessandro buccato
Associate II
Posted on March 22, 2018 at 09:24

hi to everyone

I'm trying to use the library 21 sd_card demo by

https://l.facebook.com/l.php?u=http%3A%2F%2Fstm32f4-discovery.net%2F&h=ATOUXBT8q6rvTUZYyodpiuulouhtO_tRdlKijHgKlwn4SBm-gCr7eZyZCTKuEFeoVBuX3WGl-hW51PLrn94WQAEzMBInlbYe1hA2fcvEur-cra-UdZ9RSxKE5-ddsGM

but I have a problem with the write/read file on sd card. f_mount is okay (set red led) but f_opens failed with code error 0x03 FR_NOT_READ. I tried to debug, but I didn't understand where is the problem. I increased HEAP and STACK from 0x200/0x400 to 0x2000/0x4000 but without any success.

where is the problem?

thanks in advance

6 REPLIES 6
Posted on March 22, 2018 at 09:43

Check if there is any code using a GPIO as a card detect pin 

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on March 22, 2018 at 10:26

it

seems to be the same...

I attach the code generated with cubemx (fatfs-> user definied) and edit by me.

https://pastebin.com/XS9qEQXw

 

https://pastebin.com/1GtTHA4D

 

the GPIO PB6 in debug is always 64 (value) u.u

the micro sd card module has only CS, MISO, MOSI, SCK, VCC and GND

Posted on March 22, 2018 at 12:51

Doesn't that suggest you shouldn't be using it then?

♯ define FATFS_USE_DETECT_PIN    0 /* If you don't have the pin wired and its always high - DON'T USE IT */

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on March 22, 2018 at 14:07

I'm sorry, it is a misprint.

I set it to 1 only for a test... it was always set to 0

alessandro buccato
Associate II
alessandro buccato
Associate II
Posted on April 04, 2018 at 13:26

hi clive,

after a few problems, I was able to work the sd card over sdio. unfortunatelly, I am obliget to use sd card over spi, but it can't work.

can you help me? I'm not very skilled

:(

Turvey.Clive.002