2020-01-16 02:08 PM
Hi,
I am trying to use the STM32F405 microcontroller to log data into an SD card using STM32CubeIDE. Specifically, this MCU from adafruit: https://www.adafruit.com/product/4382?gclid=EAIaIQobChMI3qONnpCJ5wIVD_DACh2XCQY7EAAYASAAEgL4QvD_BwE
I found a few resources online and integrated that into the my source code, which can be found in "main.zip". My SDIO and FATFS configurations are shown in the attached figures. I did not change anything under 'Set Defines'.
Regardless of whether I have an SD card in the MCU or not, the results are the same: the program doesn't go beyond the line of code that calls "f_mkfs". I would appreciate it if someone could help me troubleshoot this.
Thanks.
2020-01-23 12:39 AM
I am attaching my sd card project with you ,
2020-01-23 01:37 AM
2020-01-24 01:45 PM
Hi Dbgarasiya,
Thanks a lot for your help so far! I have also found another useful resource for this particular MCU:
I think with all the resources, we are getting close to a solution. Currently, the error I'm seeing is :'FR_NO_FILESYSTEM' whenever 'f_open' is called.
I've reformatted my sdcard multiple times to all kinds of allocation unit settings, that didn't help. Although, when I used 'f_mks', it seemed like it worked, but there was no way of confirming it because when I tried to read the sd card on my PC, the sd card was corrupted and had to be reformatted everytime.
I don't think my sd card is bad because I can actually log data to the it, following the ArduinoIDE instructions by adafruit. So, this implies that something is still wrong/missing with my configurations in STM32CubeIDE.
I have attached my latest version of project. I'd appreciate it if anyone could help troubleshoot.
Thanks.
2020-01-27 03:45 AM
just make sort as possible , i am not geting any of issue your code
confused why that is not working
2020-01-27 03:45 AM
advice to make it sort ,
2020-01-27 06:10 AM
I have the same problem does anyone have a working example?
2020-01-27 06:35 AM
Hi Dbgarasiya,
What do you mean by make it sort?
Thanks.
2020-10-26 11:38 AM
Looks like I can most effective pick to both use SDIO or SDIO RX & TX but no longer all 3 of them, in any other case I get an error say "No to be had DMA requests for this peripheral".
2021-02-20 01:45 PM
I've been struggling with similar problems with the STM32F407 and FATFS on SD card.
Firstly, to answer some of the points that have come up here and elsewhere.
Despite all this I still get a lot of random write errors. Writing a file of a few kB sometimes completes but usually gets a write error partway through, at random locations. I'm using an existing 407 board (and SD HC card) that work fine with software written under the old Standard Peripheral library, these problems (except the last one) only happen with Cube. Albeit the older software wasn't very demanding on the SD card, but it happily read and wrote small files without problem and has been released to customers for some years. No way the Cube-generated software gets anywhere near a customer yet. Incidentally, I'm using the FATFS API for I/O (f_read, f_write), haven't got around to connecting up stream I/O yet.