Support for booting from eMMC

Fusee will Look for FAT32 partition on BOOT1 (1MB offset), BOOT1, GPP, SD, in this order
If a .no_boot_storage file is found in the root directory, the partition is skipped
This commit is contained in:
Christoph Baumann
2025-05-13 13:07:25 +02:00
parent c1b5cc411e
commit 867ff62dfa
15 changed files with 264 additions and 32 deletions

View File

@@ -15,6 +15,8 @@
#include "diskio_cpp.h"
#define BOOT1_OFFSET_SCT_1MB 0x800
/*-----------------------------------------------------------------------*/
/* Get Drive Status */
/*-----------------------------------------------------------------------*/
@@ -57,6 +59,11 @@ DRESULT disk_read (
return diskio_read_sd_card(buff, count * 512, sector, count) ? RES_OK : RES_ERROR;
case DRIVE_SYS:
return diskio_read_system(buff, count * 512, sector, count) ? RES_OK : RES_ERROR;
case DRIVE_BOOT1:
return diskio_read_boot1(buff, count * 512, sector, count) ? RES_OK : RES_ERROR;
case DRIVE_BOOT1_OFF:
return diskio_read_boot1(buff, count * 512, sector + BOOT1_OFFSET_SCT_1MB, count) ? RES_OK : RES_ERROR;
default:
return RES_PARERR;
}
@@ -82,6 +89,10 @@ DRESULT disk_write (
return diskio_write_sd_card(sector, count, buff, count * 512) ? RES_OK : RES_ERROR;
case DRIVE_SYS:
return diskio_write_system(sector, count, buff, count * 512) ? RES_OK : RES_ERROR;
case DRIVE_BOOT1:
return diskio_write_boot1(sector, count, buff, count * 512) ? RES_OK : RES_ERROR;
case DRIVE_BOOT1_OFF:
return diskio_write_boot1(sector + DRIVE_BOOT1_OFF, count, buff, count * 512) ? RES_OK : RES_ERROR;
default:
return RES_PARERR;
}