Skip to content

Commit 7c8e1e5

Browse files
committed
change bootloader family id to random generated value of 0xd663823c
1 parent 0e4995c commit 7c8e1e5

File tree

4 files changed

+9
-11
lines changed

4 files changed

+9
-11
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ $(BUILD)/$(OUT_FILE)-nosd.hex: $(BUILD)/$(OUT_FILE).hex
355355
# Bootolader only uf2
356356
$(BUILD)/$(OUT_FILE)-nosd.uf2: $(BUILD)/$(OUT_FILE)-nosd.hex
357357
@echo CR $(notdir $@)
358-
python lib/uf2/utils/uf2conv.py -f 0x239A0029 -c -o $@ $^
358+
python lib/uf2/utils/uf2conv.py -f 0xd663823c -c -o $@ $^
359359

360360
# merge bootloader and sd hex together
361361
$(BUILD)/$(MERGED_FILE).hex: $(BUILD)/$(OUT_FILE).hex

src/usb/uf2/configkeys.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
#define CFG_PIN_NAME_MSK 0xffff
88
#define CFG_PIN_CONFIG_MSK 0xffff0000
99
#define CFG_PIN_CONFIG_ACTIVE_LO 0x10000
10-
#define CFG_MAGIC0 0x1e9e10f1
11-
#define CFG_MAGIC1 0x20227a79
1210
#define CFG_PIN_ACCELEROMETER_INT 1
1311
#define CFG_PIN_ACCELEROMETER_SCL 2
1412
#define CFG_PIN_ACCELEROMETER_SDA 3

src/usb/uf2/ghostfat.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ void read_block(uint32_t block_no, uint8_t *data) {
279279
bl->targetAddr = addr;
280280
bl->payloadSize = 256;
281281
bl->flags = UF2_FLAG_FAMILYID;
282-
bl->familyID = CFG_UF2_FAMILY_ID;
282+
bl->familyID = CFG_UF2_FAMILY_APP_ID;
283283
memcpy(bl->data, (void *)addr, bl->payloadSize);
284284
}
285285
}
@@ -305,7 +305,7 @@ int write_block (uint32_t block_no, uint8_t *data, WriteState *state)
305305

306306
switch ( bl->familyID )
307307
{
308-
case CFG_UF2_FAMILY_ID:
308+
case CFG_UF2_FAMILY_APP_ID:
309309
/* Upgrading Application
310310
*
311311
* SoftDevice is considered as part of application and can be (or not) included in uf2.
@@ -339,7 +339,7 @@ int write_block (uint32_t block_no, uint8_t *data, WriteState *state)
339339
}
340340
break;
341341

342-
case CFG_UF2_BOOTLOADER_ID:
342+
case CFG_UF2_FAMILY_BOOT_ID:
343343
/* Upgrading Bootloader
344344
*
345345
* - For simplicity, the Bootloader Start Address is fixed for now.

src/usb/uf2/uf2cfg.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
#include "boards.h"
22
#include "dfu_types.h"
33

4-
#define CFG_UF2_FAMILY_ID 0xADA52840
5-
#define CFG_UF2_BOOTLOADER_ID ((USB_DESC_VID << 16) | USB_DESC_UF2_PID)
4+
// Family ID for updating Application
5+
#define CFG_UF2_FAMILY_APP_ID 0xADA52840
6+
7+
// Family ID for updating Bootloader
8+
#define CFG_UF2_FAMILY_BOOT_ID 0xd663823c
69

710
#define CFG_UF2_NUM_BLOCKS 8000 // at least 4,1 MB for FAT16
811
#define CFG_UF2_FLASH_SIZE (1024*1024) // 1 MB
@@ -11,9 +14,6 @@
1114
#define USER_FLASH_START MBR_SIZE // skip MBR included in SD hex
1215
#define USER_FLASH_END 0xAD000
1316

14-
// Due to SD_MBR_COMMAND_COPY_BL, bootloader start address cannot
15-
// be changed with DFU, and only done with a debugger
16-
1717
// Bootloader start address
1818
#define BOOTLOADER_ADDR_START BOOTLOADER_REGION_START
1919

0 commit comments

Comments
 (0)