cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H743@16MHz Fatfs can not work at this CPU core frequency

Yang Yang
Associate II

Hello, ST experts

STM32H743 is used on our custom design. Everything is OK when working on 64MHz and 48MHz, even at 32MHz CPU frequency. But f_write keeps on failing when working on 16MHz and lower CPU speed, the error number is FR_DISK_ERR. SDIO card is the memory device connected to STM32H7. What might be the problem?

Best Regards

Yang

2 REPLIES 2
Danish1
Lead II

It would be helpful if you could debug deeper to find where/how the error occurs.

I can think of a couple of failure modes:

1) There is a fixed (in time) timeout somewhere, and when the cpu is clocked too slowly there aren't enough processor, peripheral or bus cycles for the write process to complete.

2) The decision-process for selecting the clock frequencies has not allowed for your extremely slow AHB clock. Section 55.5.8 of the Reference Manual says the AHB must have a t least 3 times the bandwidth of the SDMMC bus. From Table 465, if the SDMMC bus width is 4 bits and it is being clocked at 48 MHz (because that's as fast as many cards will go, and no-one would run the CPU so slow as to cause problems) then the AHB must be at least 18 MHz when used in SD DS / SDR12 mode.

Is there a reason why you would choose to clock at 16 MHz? If it is to save power, you might find that running faster for short bursts and sleeping the cpu between those bursts achieves a lower overall power consumption.

Hope this helps,

Danish

As indicated by @Danish​ there are some stated ratios / expectations as the peripheral takes its own PLL clock source.

G​enerally the issues here is "Clock Inversion" where the design expects specific relationships between faster/slower clocks in a synchronous and asynchronous designs.

D​isparities in data sourcing and sinking are also bandwidth related and the depth of buffers or FIFOs to mitigate differences.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..