Infineon Logo AIROC BTSDK v4.9 - Documentation
 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Groups
Utility

Data Structures

struct  BltFwuConfig_
 
struct  BleFwuState_
 
struct  FwReportHeader_
 Structure of the firmware upgrade header. More...
 

Typedefs

typedef struct BltFwuConfig_ BltFwuConfig
 
typedef struct BleFwuState_ BleFwuState
 
typedef PACKED struct
FwReportHeader_ 
FwReportHeader
 
struct {
   UINT8   commandId
 
FwCommandHeader
 

Enumerations

enum  { DEFAULT_WATCHDOG_VALUE = 10 }
 BleAppFwu implements firmware update. More...
 
enum  {
  DEFAULT_ID_ENABLE_FWU = 0x70, DEFAULT_ID_SETUP_READ = 0x71, DEFAULT_ID_READ = 0x72, DEFAULT_ID_ERASE = 0x73,
  DEFAULT_ID_WRITE = 0x74, DEFAULT_ID_LAUNCH = 0x75
}
 
enum  { RESTART_WATCHDOG_TIMER = 0, PET_WATCHDOG_ONLY }
 
enum  { INDIRECT_MEM_MAP_MASK = 0xFF000000, INDIRECT_MEM_MAP_EEPROM = 0xFF000000, INDIRECT_MEM_MAP_PF = 0xFC000000, INDIRECT_MEM_MAP_SF = 0xF8000000 }
 
enum  {
  LEFWU_SUCCESS = 0x00, LEFWU_ERR_NOT_READY = 0x01, LEFWU_ERR_INVALID_CMD = 0x02, LEFWU_ERR_UNSUPPORTED_REQ = 0x03,
  LEFWU_ERR_INVALID_PARAM = 0x04, LEFWU_ERR_UNKNOWN = 0x0E, LEFWU_ERR_FATAL = 0x0F
}
 

Functions

void bleappfwu_init (void)
 
void bleappfwu_restartWatchdog (UINT32 checkWatchDog)
 
void bleappfwu_watchdogExpired (UINT32 unused)
 
UINT8 bleappfwu_checksum (UINT8 commandId, const UINT8 *data, UINT32 len)
 
UINT32 bleappfwu_validate (UINT8 commandId, const UINT8 *payload, UINT32 payloadSize)
 
UINT32 bleappfwu_readMem (UINT8 *buf, UINT32 readFrom, int len)
 
UINT32 bleappfwu_writeMem (const UINT8 *buf, UINT32 writeTo, UINT32 len)
 
UINT32 bleappfwu_eraseMem (UINT32 eraseAddr, UINT32 len)
 
UINT32 bleappfwu_processCommand (UINT8 commandId, const void *payload, UINT16 payloadSize)
 
UINT32 bleappfwu_getData (UINT8 commandId, UINT8 **data, UINT32 *dataLen)
 

Detailed Description

Enumeration Type Documentation

anonymous enum
Enumerator
DEFAULT_ID_SETUP_READ 

"unlock" OTAFU, start the watchdog

DEFAULT_ID_READ 

setup a read

DEFAULT_ID_ERASE 

get the data

DEFAULT_ID_WRITE 

erase a sector

DEFAULT_ID_LAUNCH 

write (preferrably after erase)

anonymous enum
Enumerator
INDIRECT_MEM_MAP_EEPROM 

indirect memory map for EEPROM Read/Write acess

INDIRECT_MEM_MAP_PF 

indirect memory map for parallel flash

INDIRECT_MEM_MAP_SF 

indirect memory map for serial flash Read/Write/Erase access

anonymous enum

BleAppFwu implements firmware update.

This provides a few methods to be called from the App to implement the Firmware Upgrade protocol.

The protocol is very simple:

  • Host can Read EEPROM/ParallelFlash/SerialFlash any time by
    • Read ( SETUP_READ + READ)
  • However Write and Erase (firmware upgrade) need to enabled first by sending an ENABLE_FWU . Once enabled, the host can:
  • Read (SETUP_READ + READ) memory, including EEPROM and Flash.
  • Write (WRITE), including EEPROM at 0xFFxxxxxx
  • Launch (make a call to a given address, with the usual "bit 0 == thumb"
  • Erase (memset 0xFF, on IRAM only right now)

As soon ENABLE_FWU was enabled, a watchdog timer is started (default 10 seconds). Every accepted FWU command restarts it; if it's let expire, we reset the system to get out of any issue (e.g. the host hangs or we lose the link).

Based on these primitives, the host can perform almost any update.