STM32H747i-disco board: DMA mode causes littleFS failure when using SD card driver. #64092
Replies: 3 comments 14 replies
-
@coran21, as you introduced idma, is this something that you've came across? |
Beta Was this translation helpful? Give feedback.
-
@coran21 cc: @erwango Yes that explains why it works. @erwango when you get a chance, could you please check if changes I did to the SD card driver is doing the cache maintenance operation correctly? Perhaps the cache maintenance operations are not implemented on STM32H747? |
Beta Was this translation helpful? Give feedback.
-
@erwango @coran21 I could implement a fix for the issue using correct cache maintenance API which SCB* APIs not the one I used earlier. With this the littleFS is happy. Please review this and potentially test it if you can. I am new to the process here as to what is needed to send an official PR. I will read through the procedure on contribution. There are lots of steps discussed there. For this change could you please suggest the minimal set of checklist send a PR. Here is the commit on my github repo. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello Experts,
I am new to this community and I was directed to discuss the issue I am seeing in this forum. So please bear with me if something not done right. Your suggestion to do this right welcome!
I was able to get SD Card driver work successfully in Interrupt mode on STM32H747i-disco board that I have. The recent v3.4.0 release have idma property added to enable the driver to use internal DMA. When I try to enable idma in the DT node for sdmmc and booted the image on STM32H747i-disco board, I get the below error message. I have tried with 2 different SD card and the same results. Without idma, this works fine. That log for this is also provided below for your information. On STM32H745i-disco, with eMMC device also, I get similar results. Looks like there is some issue with the sdmmc driver using internal dma.
DT node overlay for littleFS attached below
With idma property set in the sdmmc dt node
I: FS at SDMMC: is 31116288 0x200-byte blocks with 512 cycle I: sizes: rd 512 ; pr 512 ; ca 512 ; la 2048 ~$ E: WEST_TOPDIR/modules/fs/littlefs/lfs.c:1234: Corrupted dir pair at {0x0, 0x1} W: can't mount (LFS -84); formatting W: WEST_TOPDIR/modules/fs/littlefs/lfs.c:1897: Superblock 0x0 has become unwritable E: format failed (LFS -28) E: fs mount error (-28)
Without idma property (Interrupt)
`
*** Booting Zephyr OS build v3.4.0-rc1-540-g5f216aeedf55 ***
Sample program to r/w files on littlefs
I: LittleFS version 2.5, disk version 2.0
uart:I: FS at SDMMC: is 31116288 0x200-byte blocks with 512 cycle
I: sizes: rd 512 ; pr 512 ; ca 512 ; la 2048
~$ E: WEST_TOPDIR/modules/fs/littlefs/lfs.c:1234: Corrupted dir pair at {0x0, 0x1}
W: can't mount (LFS -84); formatting
I: /SDMMC: mounted
/SDMMC:: bsize = 512 ; frsize = 512 ; blocks = 31116288 ; bfree = 31116286
Listing dir /SDMMC: ...
/SDMMC:/boot_count read count:0 (bytes: 0)
/SDMMC:/boot_count write new boot count 1: [wr:1]
I: Test file: /SDMMC:/pattern.bin not found, create one!
------ FILE: /SDMMC:/pattern.bin ------
01 55 55 55 55 55 55 55 02 55 55 55 55 55 55 55
03 55 55 55 55 55 55 55 04 55 55 55 55 55 55 55
05 55 55 55 55 55 55 55 06 55 55 55 55 55 55 55
07 55 55 55 55 55 55 55
08 55 55 55 55 55 55 55
09 55 55 55 55 55 55 55 0a 55 55 55 55 55 55 55
0b 55 55 55 55 55 55 55 0c 55 55 55 55 55 55 55
0d 55 55 55 55 55 55 55 0e 55 55 55 55 55 55 55
0f 55 55 55 55 55 55 55 10 55 55 55 55 55 55 55
11 55 55 55 55 55 55 55 12 55 55 55 55 55 55 55
13 55 55 55 55 55 55 55 14 55 55 55 55 55 55 55
15 55 55 55 55 55 55 55 16 55 55 55 55 55 55 55
17 55 55 55 55 55 55 55 18 55 55 55 55 55 55 55
19 55 55 55 55 55 55 55 1a 55 55 55 55 55 55 55
1b 55 55 55 55 55 55 55 1c 55 55 55 55 55 55 55
1d 55 55 55 55 55 55 55 1e 55 55 55 55 55 55 55
1f 55 55 55 55 55 55 55 20 55 55 55 55 55 55 55
21 55 55 55 55 55 55 55 22 55 55 55 55 55 55 55
23 55 55 55 55 55 55 55 24 55 55 55 55 55 55 55
25 55 55 55 55 55 55 55 26 55 55 55 55 55 55 55
27 55 55 55 55 55 55 55 28 55 55 55 55 55 55 55
29 55 55 55 55 55 55 55 2a 55 55 55 55 55 55 55
2b 55 55 55 55 55 55 55 2c 55 55 55 55 55 55 55
2d 55 55 55 55 55 55 55 2e 55 55 55 55 55 55 55
2f 55 55 55 55 55 55 55 30 55 55 55 55 55 55 55
31 55 55 55 55 55 55 55 32 55 55 55 55 55 55 55
33 55 55 55 55 55 55 55 34 55 55 55 55 55 55 55
35 55 55 55 55 55 55 55 36 55 55 55 55 55 55 55
37 55 55 55 55 55 55 55 38 55 55 55 55 55 55 55
39 55 55 55 55 55 55 55 3a 55 55 55 55 55 55 55
3b 55 55 55 55 55 55 55 3c 55 55 55 55 55 55 55
3d 55 55 55 55 55 55 55 3e 55 55 55 55 55 55 55
3f 55 55 55 55 55 55 55 40 55 55 55 55 55 55 55
41 55 55 55 55 55 55 55 42 55 55 55 55 55 55 55
43 55 55 55 55 55 55 55 44 55 55 55 55 55 55 55
45 55 aa
`
Beta Was this translation helpful? Give feedback.
All reactions