update uf2 to application only

This commit is contained in:
hathach 2018-06-21 20:53:24 +07:00
parent 9847a37599
commit fb6c6eb0b7
2 changed files with 3 additions and 3 deletions

View File

@ -248,7 +248,7 @@ void read_block(uint32_t block_no, uint8_t *data) {
} else { } else {
sectionIdx -= NUM_INFO - 1; sectionIdx -= NUM_INFO - 1;
uint32_t addr = USER_FLASH_START + sectionIdx * 256; uint32_t addr = USER_FLASH_START + sectionIdx * 256;
if (addr < FLASH_SIZE) { if (addr < USER_FLASH_START+FLASH_SIZE) {
UF2_Block *bl = (void *)data; UF2_Block *bl = (void *)data;
bl->magicStart0 = UF2_MAGIC_START0; bl->magicStart0 = UF2_MAGIC_START0;
bl->magicStart1 = UF2_MAGIC_START1; bl->magicStart1 = UF2_MAGIC_START1;

View File

@ -6,10 +6,10 @@
#define UF2_NUM_BLOCKS 8000 // at least 4,1 MB for FAT16 #define UF2_NUM_BLOCKS 8000 // at least 4,1 MB for FAT16
#define VOLUME_LABEL "NRF52BOOT " #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 // Only allow to write application
#define USER_FLASH_START 0x26000 #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 #define FLASH_PAGE_SIZE 4096