16 explicit Bootloader(
bool sikRadio, QObject *parent = 0);
20 bool open (
const QString portName);
21 void close (
void) { _port.close(); }
22 bool getBoardInfo (uint32_t& bootloaderVersion, uint32_t& boardID, uint32_t& flashSize);
43 bool _syncWorker (
void);
46 bool _write (
const uint8_t* data, qint64 maxSize);
47 bool _write (
const uint8_t
byte);
48 bool _write (
const char* data);
49 bool _read (uint8_t* data, qint64 cBytesExpected,
int readTimeout = _readTimout);
50 bool _sendCommand (uint8_t cmd,
int responseTimeout = _responseTimeout);
51 bool _getCommandResponse (
const int responseTimeout = _responseTimeout);
52 bool _protoGetDevice (uint8_t param, uint32_t& value);
56 bool _verifyCRC (
void);
57 QString _getNextLine (
int timeoutMsecs);
58 bool _get3DRRadioBoardId (uint32_t& boardID);
63 PROTO_BAD_SILICON_REV = 0x14,
72 PROTO_GET_SYNC = 0x21,
73 PROTO_GET_DEVICE = 0x22,
74 PROTO_CHIP_ERASE = 0x23,
75 PROTO_LOAD_ADDRESS = 0x24,
76 PROTO_PROG_MULTI = 0x27,
81 PROTO_CHIP_VERIFY = 0x24,
82 PROTO_READ_MULTI = 0x28,
96 bool _sikRadio =
false;
97 bool _inBootloaderMode =
false;
98 uint32_t _boardID = 0;
99 uint32_t _boardFlashSize = 0;
100 uint32_t _bootloaderVersion = 0;
101 uint32_t _imageCRC = 0;
102 QString _firmwareFilename;
103 QString _errorString;
105 static const int _eraseTimeout = 20000;
106 static const int _rebootTimeout = 10000;
107 static const int _verifyTimeout = 5000;
108 static const int _readTimout = 2000;
109 static const int _responseTimeout = 2000;
110 static const int _flashSizeSmall = 1032192;
111 static const int _bootloaderVersionV2CorrectFlash = 5;