You need to write some multiple of the sector/cluster size, writing random and short lengths via f_write will be brutal, I'm writing 32KB blocks. The erase size on the cards probably pushing 128KB. You need to employ better buffering.
There is likely other code in the library dropping the clock setting further.
Y-Step STM32H743, 50 MHz wire clock
Core=400000000, 400 MHz
CPUID 411FC271 DEVID 450 REVID 1003
Cortex M7 r1p1
STM32H7xx
C0000018 2000BCC8 00000000
10110221 12000011 00000040
FPU-D Single-precision and Double-precision
I'm not using CubeMX, custom board, ported my NUCLEO-H7 SDMMC BSP over
Decoder Wheel for clock sources, run after test
{
uint32_t ck = SDMMC1->CLKCR & 0x3FF;
uint32_t sdmmcsel = RCC->D1CCIPR & (1 << 16);
PLL1_ClocksTypeDef PLL1_Clocks;
PLL2_ClocksTypeDef PLL2_Clocks;
uint32_t sdmmc_ker_ck;
HAL_RCCEx_GetPLL1ClockFreq(&PLL1_Clocks);
HAL_RCCEx_GetPLL2ClockFreq(&PLL2_Clocks);
printf("PLL1_Q_CK=%9d, %6.2lf MHz\n", PLL1_Clocks.PLL1_Q_Frequency, (double)PLL1_Clocks.PLL1_Q_Frequency*1e-6);
printf("PLL2_R_CK=%9d, %6.2lf MHz\n", PLL2_Clocks.PLL2_R_Frequency, (double)PLL2_Clocks.PLL2_R_Frequency*1e-6);
sdmmc_ker_ck = (sdmmcsel ? PLL2_Clocks.PLL2_R_Frequency : PLL1_Clocks.PLL1_Q_Frequency);
printf("SDMMC1_CK %9d, %6.2lf MHz\n", ck, ((double)sdmmc_ker_ck * 1e-6) / (double)(2.0 * ck));
} // sourcer32@gmail.com
Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..