2020-02-20 07:21 AM
Using custom board with l462re, sdcard connected directly to mcu without external pullups.
SDMMC clockdiv set to 10, SDMMC freq set to 48MHz.
When ever I'm trying to use f_write or f_mkfs they return FR_DISK_ERR.
Sometimes sdcard is corrupts(file is created but files size is 4gb).
Tried 5-6 sdcards from 1gb to 32gb.
Same code but on f767 is working fine.
2020-02-20 08:19 AM
To understand why the top-level code fails you'll need to look at the DISKIO layer, and validate that.
I wouldn't use f_mkfs() until you have the read/write sector(s) stuff working flawlessly.
Do you have a UART you can output debug/telemetry data on? Which UART/pins ?
2020-02-20 08:32 AM
I can use stlink for debug(breakpoints)
2020-02-21 09:40 AM
Today I checked connection between stm and sd card, all acording to cubemx configuration. Also I managed to write small test file, but when Im trying to write big file by blocks(log some data from adc to sdcard) f_write returns FR_DISK_ERR. Also I noticed that f_open is also returning FR_DISK_ERR if file doesnt exists. Sometimes stm get stuck in SDMMC_GetCmdResp1 or SDMMC_GetCmdResp3.
Noticed that cubemx generating code with sdmmc in 1bit width mode, is this normal?
Tried everything in both 1 and 4 bit modes.