diff --git a/src/usb/uf2/ghostfat.c b/src/usb/uf2/ghostfat.c index 6bd5a86..bb68303 100644 --- a/src/usb/uf2/ghostfat.c +++ b/src/usb/uf2/ghostfat.c @@ -248,7 +248,7 @@ void read_block(uint32_t block_no, uint8_t *data) { } else { sectionIdx -= NUM_INFO - 1; uint32_t addr = USER_FLASH_START + sectionIdx * 256; - if (addr < FLASH_SIZE) { + if (addr < USER_FLASH_START+FLASH_SIZE) { UF2_Block *bl = (void *)data; bl->magicStart0 = UF2_MAGIC_START0; bl->magicStart1 = UF2_MAGIC_START1; diff --git a/src/usb/uf2/uf2cfg.h b/src/usb/uf2/uf2cfg.h index e3ea9b1..18efd58 100644 --- a/src/usb/uf2/uf2cfg.h +++ b/src/usb/uf2/uf2cfg.h @@ -6,10 +6,10 @@ #define UF2_NUM_BLOCKS 8000 // at least 4,1 MB for FAT16 #define VOLUME_LABEL "NRF52BOOT " -#define FLASH_SIZE (BOOTLOADER_REGION_START-USER_FLASH_START) +#define FLASH_SIZE (10*1024) //(USER_FLASH_END-USER_FLASH_START) // Only allow to write application #define USER_FLASH_START 0x26000 -#define USER_FLASH_END BOOTLOADER_REGION_START +#define USER_FLASH_END 0xAD000 // Fat Fs start here #define FLASH_PAGE_SIZE 4096