I guess one feature is missed in SD API - ability to format it
I tried to use peace of code from IDF (esp_vfs_fat_sdmmc_mount function):
Code: Select all
void *workbuf = malloc(4096);
DWORD plist[] = {100, 0, 0, 0};
int ret = f_fdisk(0, plist, workbuf);
ret = f_mkfs("/sdcard", FM_ANY | FM_FAT32, 16*1024, workbuf, 4096);
free(workbuf);
Are there any good ideas how to format SD with latest IDF?