Is there an English version?
Also, I couldn't be sure but it looks like there isn't a code example for the PSoC port of FatFs itself.
You can look here:
I have started porting the library two days ago. It needs more changes and testing but i think porting will be a bit slow. It´s dificult for me to stay too much time in front of my computer with a broken ankle.
thanks for the port!
I have tested the demos in github with a Sandisk Ultra microSDHC I 16Gb card and with a Qilive microSCHC I 32Gb, and the PSoC4 dev kit, and they work, but there is an issue with f_getfree() function (look issues at github).
Actually i am using the 16Gb card on a personal project without problems apart of f_getfree issue.
jesusrcc, thank you for the response and for the porting work!
I tried your application (PSoC 5LP version) on the PSoC 5LP prototyping kit with a Sandisk (normal) microSDHC 4Gb card (formatted to both FAT32 and exFAT), but I constantly keep getting the FR_NOT_READY error. I tried to figure out the root of the problem and it seems to be that the STA_NOINIT (drive not initialised) flag is thrown up.
I tried a few things:
(1) played the following constants, plugging in different values:
(2) played with the bit rate setting of the SPI master component
(3) connected SPI master component to an external clock (instead of an internal clock) and ran it off clock speeds from 4 MHz - 20 MHz
None of these worked.
What I am wondering is whether I am missing on something that I am supposed to do? For example, in the function you call:
resultF = f_mount(&fatFs, "", 1);
am I supposed to replace the "" (second parameter) with something (a logical drive number to be mounted/unmounted -- I don't know where I can find this though :/)
I am a newbie to working with SD cards so your help would be greatly appreciated! I will try to do some further debugging if you need more information.
How are you connecting the sd card to the prototyping kit? Directly? Any commercial sdcard prototyping kit or shield?
What it the 5LP prototyping kit you are using?
I am using the CY8CKIT-059 prototpying kit .I am interfacing the microSD card via a 5V breakout board - the board uses a simple voltage divider circuit to reduce voltage from 5V to 3.3V, however I just noticed that the MISO pin is 3.3V output connected directly to the PSoC. I will purchase a new breakout board with integrated logic converter chip and see what happens from there!
I will get back to you if I have any problems. Thanks!
A few days ago, i helped a person with a similar problem and it was the MISO signal and a PSOC working at 5V.
Maximun voltage in MISO for high level voltage is 3.3V while (from datasheet) the minimun voltage at a gpio pin of PSOC working at 5V is 0.7*VDDIO = 3.5
Yes that makes sense. Thank you!
Also, seeing that you got fatFs working on the CY8CKIT-042 kit, have you tested the library on the PSoC 4 BLE kit (CY8CKIT-042-BLE)? If not, are you aware of its compatibiliy?
And as a general question, would you recommend implementing the fatFs file system with a Cortex M0 mcu (CY8CKIT-042 or CY8CKIT-042-BLE?) . Most forums tend to suggest that an M0 is not really capable of implementing a file system? Or does the capability vary from mcu to mcu, depending on the amount of RAM avaiable?
I think it have to work with BLE modules too but i have not tested it. I don't have any BLE modules.
I friend of me will use it in a BLE module but until now, i don't have news from him.
I am not very experienced with the library. I have ported it and i am using it in two personal projects without problems. I have seen the same library working in a lot of other platforms, from tiny 8 bit microcontrollers to embedded systems. I can not figure out why a M0 core will no be able to manage the file system. I supose it depends on what we expect from it.
I am quite new to the PSoC community and I am trying to port your project to PSoC 6. I have modified the sdcard.c file as in attachment to use PSoC 6 macros, but I get a "sdcard not ready" error. Any idea what I am doing wrong? In attachment also my main file (still under clean up).
I also try to port the Project to PSoC6. But i get everytime the error: (FR_DISK_ERR) low level error.
Whats the reason for this? I think it's very poor from Cypres not to offer a working filesystem for PSoC6 and PSoC Creator.