mirror of
https://github.com/oltaco/Adafruit_nRF52_Bootloader_OTAFIX.git
synced 2026-05-28 16:14:04 +00:00
Begin UF2 board-specific family ID
Per @hathach's comments, uses the USB vendorID and productID.
This commit is contained in:
@@ -363,7 +363,13 @@ void read_block(uint32_t block_no, uint8_t *data) {
|
||||
bl->targetAddr = addr;
|
||||
bl->payloadSize = UF2_FIRMWARE_BYTES_PER_SECTOR;
|
||||
bl->flags = UF2_FLAG_FAMILYID;
|
||||
bl->familyID = CFG_UF2_FAMILY_APP_ID;
|
||||
|
||||
bool useBoardId = false; // BUGBUG -- how to detect which familyID to use?
|
||||
if (useBoardId) {
|
||||
bl->familyID = CFG_UF2_BOARD_APP_ID;
|
||||
} else {
|
||||
bl->familyID = CFG_UF2_FAMILY_APP_ID;
|
||||
}
|
||||
memcpy(bl->data, (void *)addr, bl->payloadSize);
|
||||
}
|
||||
}
|
||||
@@ -390,7 +396,8 @@ int write_block (uint32_t block_no, uint8_t *data, WriteState *state)
|
||||
|
||||
switch ( bl->familyID )
|
||||
{
|
||||
case CFG_UF2_FAMILY_APP_ID:
|
||||
case CFG_UF2_BOARD_APP_ID: // board-specific app ... may not be usable on other nrf52 boards
|
||||
case CFG_UF2_FAMILY_APP_ID: // legacy, or where app uses bootloader configuration to discover pins
|
||||
/* Upgrading Application
|
||||
*
|
||||
* SoftDevice is considered as part of application and can be (or not) included in uf2.
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
#include "boards.h"
|
||||
#include "dfu_types.h"
|
||||
|
||||
// Family ID for updating Application
|
||||
// Legacy Family ID for updating Application
|
||||
#define CFG_UF2_FAMILY_APP_ID 0xADA52840
|
||||
|
||||
// Family ID for board-specific Application
|
||||
#define CFG_UF2_BOARD_APP_ID ((USB_DESC_VID << 16) | USB_DESC_UF2_PID)
|
||||
|
||||
// Family ID for updating Bootloader
|
||||
#define CFG_UF2_FAMILY_BOOT_ID 0xd663823c
|
||||
|
||||
|
||||
Reference in New Issue
Block a user