mirror of
https://github.com/oltaco/Adafruit_nRF52_Bootloader_OTAFIX.git
synced 2026-10-23 10:53:41 +00:00
always use/define CFG_UF2_BOARD_APP_ID
This commit is contained in:
1 parent
dc90457828
commit
aa8cd83961
2 files changed
+9
-16
No files matched your search
+1
-10
@@ -363,12 +363,7 @@ 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;
|
||||
|
||||
#if defined(CFG_UF2_BOARD_APP_ID) && CFG_UF2_BOARD_APP_ID
|
||||
bl->familyID = CFG_UF2_BOARD_APP_ID;
|
||||
#else
|
||||
bl->familyID = CFG_UF2_FAMILY_APP_ID;
|
||||
#endif
|
||||
memcpy(bl->data, (void *)addr, bl->payloadSize);
|
||||
}
|
||||
}
|
||||
@@ -395,12 +390,8 @@ int write_block (uint32_t block_no, uint8_t *data, WriteState *state)
|
||||
|
||||
switch ( bl->familyID )
|
||||
{
|
||||
|
||||
#if defined(CFG_UF2_BOARD_APP_ID) && CFG_UF2_BOARD_APP_ID
|
||||
case CFG_UF2_BOARD_APP_ID: // board-specific app ... may not be usable on other nrf52 boards
|
||||
#endif
|
||||
|
||||
case CFG_UF2_FAMILY_APP_ID: // legacy, or where app uses bootloader configuration to discover pins
|
||||
case CFG_UF2_FAMILY_APP_ID: // family-specific app ... Legacy apps, or where the 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,15 +1,17 @@
|
||||
#include "boards.h"
|
||||
#include "dfu_types.h"
|
||||
|
||||
// Legacy Family ID for updating Application
|
||||
#define CFG_UF2_FAMILY_APP_ID 0xADA52840
|
||||
|
||||
// Family ID for board-specific Application
|
||||
#if defined(USB_DESC_VID) && defined(USB_DESC_UF2_PID) && USB_DESC_VID && USB_DESC_UF2_PID
|
||||
#define CFG_UF2_BOARD_APP_ID ((USB_DESC_VID << 16) | USB_DESC_UF2_PID)
|
||||
#if !defined(USB_DESC_VID) || !defined(USB_DESC_UF2_PID) || !USB_DESC_VID || !USB_DESC_UF2_PID
|
||||
#error "Per @hathach, 'This repo doesn't accept nrf52840/833 that doesn't have VID/PID'"
|
||||
#endif
|
||||
|
||||
|
||||
// Family ID for updating Application
|
||||
#define CFG_UF2_FAMILY_APP_ID 0xADA52840
|
||||
// Board 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