cancel
Showing results for 
Search instead for 
Did you mean: 

SD-card not working with Azure/Filex - anybody got it working ?

AScha.3
Chief III

i tried to build a simple audio player , data from SD-card to USB audio host.

audio host is a big mystery , only (in STM world) one (!) example now, with Azure rtos + USBx .

(CubeIDE 1.13.1 , H563zit-nucleo board )

ok, seem to work now, but SD-card reading with Filex not working - what a surprise. 

tried to debug, but i cannot find the problem...debug shows access to read low level sectors work, 

but after ...> 100 sectors reading, first "logical" sector access, then hard fault. always.

but i cannot find out, whats wrong here. 

last sector read seem ok, can see data (FAT32 etc.) , but next read to "first logical sector" gives hard fault...

AScha3_0-1696796640862.png

 

If you feel a post has answered your question, please click "Accept as Solution".
1 ACCEPTED SOLUTION

Accepted Solutions

Update: now with short wires (about 25mm lenght) to sd-card-holder also 4-bit mode working with all cards i tested;

Speed is 100Mbit ( 4 x 25Mbit ) with "good" cards:   Transcend, Kingston canvas select plus 32GB.

Speed is 200Mbit ( 4 x 50Mbit ) with SanDisk extreme 32GB; about 22MB/s .

Just the port pin setting i have different from "what STM Cube forces you" : 

GPIO_PULLUP; + GPIO_SPEED_FREQ_MEDIUM;

Without pullups its not working, so i think STM should change this setting in Cube. 

If you feel a post has answered your question, please click "Accept as Solution".

View solution in original post

13 REPLIES 13
AScha.3
Chief III

and: sd-card mount most times working (with 2GB card , FAT16 ; not good with 8GB FAT32 :(

AScha3_0-1696833534967.png

so hardware access (4 bit mode, 50Mbit max) seems ok.

If you feel a post has answered your question, please click "Accept as Solution".

so- nobody using Filex (on SD-card) ???

If you feel a post has answered your question, please click "Accept as Solution".
Haithem Rahmani
ST Employee

Hi @AScha.3 ,

from the screenshot, you seem to have enabled the fault tolerance in FileX  is that the case?
is there any reason to enable it?

regards
Haithem.

Hi @Haithem Rahmani  , 

this was my last idea, what could help this MS**bleep** to get it working.

But first, thx to look+write here , i already was thinking, STM no more has much interest in any problems of customers or users...

But anyway, i kicked out this MS excrement. not working at all...imagine : the company , that was "creator" of fatfs, makes program (or STM spoils it ? ) that cannot work with fatfs systems... tragedy. or almost comedy level. 

Now , after debugging 5 days this nonsense, i just copied in Mr. Changs fatfs ( Generic FAT Filesystem module R0.15 , not the 6 year old version, that STM still has in Cube) and it worked instantly . So i will try to use this.

But still i would like to know, is this Filex running with success anywhere ?

response on forum shows --- not much. (nothing...) so nobody using/trying it at all ?

STM should think about their bad idea, to rule out fatfs from Cube , only Azure/Filex is to be selected now.

If going on on this road, my way will be another in future.

 

If you feel a post has answered your question, please click "Accept as Solution".

so really nobody using Azure/Filex ?

If you feel a post has answered your question, please click "Accept as Solution".

Hi @AScha.3 ,

the FileX is already deployed on STM32H5 and works correctly on STM32H573I-DK board.

you can find in the link below the list of all applications developed, tested and validated on that board. https://github.com/STMicroelectronics/STM32CubeH5/tree/main/Projects/STM32H573I-DK/Applications/FileX

for your use case, would it be possible to share code snippet in particular how you are using the FileX and the fx_sd_driver?

regards

Haithem.

 

 

Hi @Haithem Rahmani  ,

code ... just the test project

(i gave up on this, because filex could read only 2GB FAT32 card with 2 files on it, but all (!) other sd-cards, with boot partition in FAT16, or exfat 64GB card it not read - hard fault. useless...)

just make top folder H563-test , expand zip there. ( is all, except debug folder.)

regards

Alfred

 

If you feel a post has answered your question, please click "Accept as Solution".

Hi  @AScha.3 ,

we'll look at it and get back to you.

regards

Haithem.

AScha.3
Chief III

after working some time with (actual version of ) FatFS , i got similar problems with some sd-cards.

so maybe the hardware/interface is the reason -- and give Azure/Filex another chance...

after some hours of reading/learning , i got Filex now reading directories with files , as it should .

the "examples" from STM helping not much, because i found only one (!!!) example : open/write a small string to a file,

close, open and read it. only in root/main directory. and this in many copies on some boards/cpus , but this is just one super primitive example , helping nothing for searching a file through directories and subdirs etc.

https://github.com/STMicroelectronics/STM32CubeH5/blob/main/Projects/STM32H573I-DK/Applications/FileX/Fx_uSD_File_Edit/FileX/App/app_filex.c#L145

 

With little help from MS i got it ... https://learn.microsoft.com/en-us/azure/rtos/filex/chapter4#fx_directory_first_full_entry_find

but still only 1-bit sdmmc is reading all cards , 4-bit only working with one card (in my tests , so far).

If you feel a post has answered your question, please click "Accept as Solution".