133 #include "hal_types.h" 135 #ifdef MCUBOOT_ENABLE 136 #define OAD_SW_VER_LEN 4 //taken from oad_image_header.h 137 #define OAD_IMG_TYPE_APP 1 //taken from oad_image_header.h 139 #include <common/cc26xx/oad/oad_image_header.h> 140 #endif // MCUBOOT_ENABLE 150 #ifdef OAD_BLE_SECURITY 151 #define OAD_WRITE_PERMIT GATT_PERMIT_AUTHEN_WRITE 153 #define OAD_WRITE_PERMIT GATT_PERMIT_WRITE 154 #endif //OAD_SECURITY 159 #define OAD_IMG_ID_RETRIES 3 172 #define OAD_QUEUE_EVT (0x2) 179 #define OAD_DL_COMPLETE_EVT (0x4) 186 #define OAD_OUT_OF_MEM_EVT (0x8) 201 #define OAD_SERVICE_UUID 0xFFC0 206 #define OAD_IMG_IDENTIFY_UUID 0xFFC1 211 #define OAD_IMG_BLOCK_UUID 0xFFC2 217 #define OAD_IMG_COUNT_UUID 0xFFC3 224 #define OAD_IMG_STATUS_UUID 0xFFC4 229 #define OAD_EXT_CTRL_UUID 0xFFC5 241 #define OAD_IDX_IMG_IDENTIFY 0 246 #define OAD_IDX_IMG_BLOCK 1 251 #define OAD_IDX_EXT_CTRL 2 259 #define OAD_ATT_OVERHEAD 3 264 #define OAD_BLK_NUM_HDR_SZ 4 271 #define OAD_DEFAULT_BLOCK_SIZE 20 278 #define OAD_MAX_BLOCK_SIZE 244 283 #define OAD_IMAGE_ID_RSP_LEN 0x01 295 #define OAD_EXT_CTRL_GET_BLK_SZ 0x01 302 #define OAD_EXT_CTRL_IMG_CNT 0x02 309 #define OAD_EXT_CTRL_START_OAD 0x03 316 #define OAD_EXT_CTRL_ENABLE_IMG 0x04 322 #define OAD_EXT_CTRL_CANCEL_OAD 0x05 328 #define OAD_EXT_CTRL_DISABLE_BLK_NOTIF 0x06 334 #define OAD_EXT_CTRL_GET_SW_VER 0x07 340 #define OAD_EXT_CTRL_GET_IMG_STAT 0x08 346 #define OAD_EXT_CTRL_GET_PROF_VER 0x09 352 #define OAD_EXT_CTRL_GET_DEV_TYPE 0x10 359 #define OAD_EXT_CTRL_GET_IMG_INFO 0x11 365 #define OAD_EXT_CTRL_BLK_RSP_NOTIF 0x12 371 #define OAD_EXT_CTRL_ERASE_BONDS 0x13 380 #define OAD_EXT_CTRL_CMD_NOT_SUPPORTED 0xFF 388 #define OAD_IMG_INFO_ONCHIP 0x01 396 #define OAD_DEFAULT_INACTIVITY_TIME 10000 402 #define OAD_MIN_INACTIVITY_TIME 4000 407 #define OAD_CHAR_CNT 3 412 #define OAD_CCCD_CNT OAD_CHAR_CNT 419 #define OAD_SUCCESS 0 420 #define OAD_CRC_ERR 1 421 #define OAD_FLASH_ERR 2 422 #define OAD_BUFFER_OFL 3 423 #define OAD_ALREADY_STARTED 4 424 #define OAD_NOT_STARTED 5 425 #define OAD_DL_NOT_COMPLETE 6 426 #define OAD_NO_RESOURCES 7 427 #define OAD_IMAGE_TOO_BIG 8 428 #define OAD_INCOMPATIBLE_IMAGE 9 429 #define OAD_INVALID_FILE 10 430 #define OAD_INCOMPATIBLE_FILE 11 431 #define OAD_AUTH_FAIL 12 432 #define OAD_EXT_NOT_SUPPORTED 13 433 #define OAD_DL_COMPLETE 14 434 #define OAD_CCCD_NOT_ENABLED 15 435 #define OAD_IMG_ID_TIMEOUT 16 439 #if defined(DeviceFamily_CC26X2) || defined(DeviceFamily_CC13X2) || defined(DeviceFamily_CC26X1) 441 #define BIM_START 0x56000 442 #elif defined(DeviceFamily_CC26X2X7) || defined(DeviceFamily_CC13X2X7) 443 #define BIM_START 0xAE000 445 #define BIM_START 0x1F000 452 #define OAD_IMG_PG_INVALID 0xFF 455 #define OAD_SEC_ECDSA_P256 0x01 456 #define OAD_SEC_AES_128_CBC 0x02 462 #define OAD_EFL_MAX_META 4 471 #define EXT_CTRL_OP_CODE(pData)(pData[0]) 480 PACKED_TYPEDEF_STRUCT
496 PACKED_TYPEDEF_STRUCT
507 PACKED_TYPEDEF_STRUCT
515 PACKED_TYPEDEF_STRUCT
517 uint8_t securityVersion;
556 PACKED_TYPEDEF_STRUCT
565 PACKED_TYPEDEF_STRUCT
574 PACKED_TYPEDEF_STRUCT
583 PACKED_TYPEDEF_STRUCT
586 uint8_t swVer[OAD_SW_VER_LEN];
595 PACKED_TYPEDEF_STRUCT
607 PACKED_TYPEDEF_STRUCT
622 PACKED_TYPEDEF_STRUCT
680 extern uint8_t
OAD_open(uint32_t oadTimeout);
767 extern void OAD_getProgressInfo(imgProgressInfo_t* pImgInfo);
uint8_t imgCpStat
Image copy status bytes.
Definition: oad.h:485
uint8_t oadCreateFactoryImageBackup(void)
uint8_t crcStat
Image CRC status flag.
Definition: oad.h:510
uint8_t cmdID
External control op-code.
Definition: oad.h:498
External Control Command received.
Definition: oad.h:529
uint8_t imgCpStat
Image copy flag.
Definition: oad.h:509
uint8_t imgType
Image Type.
Definition: oad.h:613
OAD peer timed out.
Definition: oad.h:530
uint8_t imgCpStat
Image copy status.
Definition: oad.h:611
uint32_t requestedBlk
Requested block number.
Definition: oad.h:500
uint8_t profVer
OAD profile version.
Definition: oad.h:568
uint8_t hardwareRev
Hardware revision Field from ChipInfo module.
Definition: oad.h:600
uint8_t cmdID
Ext Ctrl Op-code.
Definition: oad.h:567
uint8_t crcStat
CRC status.
Definition: oad.h:486
uint8_t bimVer
BIM version.
Definition: oad.h:483
uint8_t imgNo
Image number flag.
Definition: oad.h:512
uint8_t imgType
Image Type.
Definition: oad.h:487
uint16_t OAD_getBlockSize(void)
bool OAD_getSWVersion(uint8_t *swVer, uint8_t len)
uint8_t imgType
Image type flag.
Definition: oad.h:511
uint8_t OAD_processQueue(void)
uint8_t OAD_open(uint32_t oadTimeout)
uint8_t imgNo
Image Number.
Definition: oad.h:626
uint8_t chipType
Chip Type Field from ChipInfo module.
Definition: oad.h:598
Image block request/response event.
Definition: oad.h:527
uint32_t len
Image length in octets.
Definition: oad.h:489
uint16_t techType
Wireless technology type.
Definition: oad.h:627
oadState_e
Definition: oad.h:537
uint8_t imgType
Image Type.
Definition: oad.h:625
uint8_t prevBlkStat
Status of previous block write.
Definition: oad.h:499
OAD module is configuring for a download.
Definition: oad.h:541
void OAD_register(oadTargetCBs_t *pfnOadCBs)
uint8_t OAD_setBlockSize(uint16_t mtuSize)
OAD module is not performing any action.
Definition: oad.h:539
OAD module is validating an received image.
Definition: oad.h:543
uint8_t cmdID
Ext Ctrl Op-code.
Definition: oad.h:576
oadWriteCB_t pfnOadWrite
The peer has written to the OAD service.
Definition: oad.h:663
uint8_t rsvd
RFU.
Definition: oad.h:601
uint16_t oadBlkSz
OAD block size.
Definition: oad.h:577
uint8_t imgNo
Image number of 'image type'.
Definition: oad.h:488
uint8_t cmdID
Ext Ctrl Op-code.
Definition: oad.h:585
OAD module is receiving an image.
Definition: oad.h:542
OAD module is checking an image.
Definition: oad.h:540
uint8_t chipFamily
Chip Family Field from ChipInfo module.
Definition: oad.h:599
uint8_t cmdID
Ext Ctrl Op-code.
Definition: oad.h:558
uint8_t crcStat
Image CRC status.
Definition: oad.h:612
uint16_t OAD_getactiveCxnHandle()
void(* oadWriteCB_t)(uint8_t event, uint16_t arg)
Definition: oad.h:656
bool OAD_isUsrAppValid(void)
uint8_t cmdID
Ext Ctrl Op-code.
Definition: oad.h:609
uint8_t status
Status of command.
Definition: oad.h:559
Image identify received.
Definition: oad.h:526
uint8_t metaVer
Metadata version.
Definition: oad.h:484
uint8_t cmdID
Ext Ctrl Op-code.
Definition: oad.h:624
oadEvent_e
Definition: oad.h:524
uint8_t numImages
Number of images.
Definition: oad.h:610
OAD complete.
Definition: oad.h:528
uint8_t imgNo
Image Number.
Definition: oad.h:614
OAD module has completed a download.
Definition: oad.h:544
uint8_t cmdID
Ext Ctrl Op-code.
Definition: oad.h:597
bool OAD_evenBitCount(uint32_t value)