Open qwx opened 4 months ago
Yes, this is something which can be improved. Right now creating more partitions on the same storage device is not trivial. Will look into this. Thank you for your comment.
Thank you for your reply. I use the code below to create more than one partition on emmc:
BYTE work[FF_MAX_SS]; /* Working buffer */
LBA_t plist[] = {90, 10, 0};
FRESULT fres = f_fdisk(0, plist, work); /* Divide the physical drive 0 */
if (fres != FR_OK)
{
printf("fdisk error");
}
fres = f_mkfs("0:", 0, work, sizeof work); /* Create FAT volume on the logical drive 0 */
if (fres != FR_OK)
{
printf("fdisk1 error");
}
fres = f_mkfs("1:", 0, work, sizeof work); /* Create FAT volume on the logical drive 1 */
if (fres != FR_OK)
{
printf("fdisk2 error");
}
I also create a pull request(#14150) to do this change. I can provide infomation if you need. Thanks a lot.
Answers checklist.
General issue report
When I want to use two partition in one emmc, I have to change the code in diskio.c like this.
change to:
Everyone coding with me have to change them too. So is there a way not change the code in esp-idf but in user code? Like make VolToPart not const or other beautiful way to do this?