23 explicit Bootloader(
bool sikRadio, QObject *parent = 0);
27 bool open (
const QString portName);
29 bool getBoardInfo (uint32_t& bootloaderVersion, uint32_t& boardID, uint32_t& flashSize);
50 bool _syncWorker (
void);
53 bool _write (
const uint8_t* data, qint64 maxSize);
54 bool _write (
const uint8_t
byte);
55 bool _write (
const char* data);
56 bool _read (uint8_t* data, qint64 cBytesExpected,
int readTimeout = _readTimout);
57 bool _sendCommand (uint8_t cmd,
int responseTimeout = _responseTimeout);
58 bool _getCommandResponse (
const int responseTimeout = _responseTimeout);
59 bool _protoGetDevice (uint8_t param, uint32_t& value);
63 bool _verifyCRC (
void);
64 QString _getNextLine (
int timeoutMsecs);
65 bool _get3DRRadioBoardId (uint32_t& boardID);
70 PROTO_BAD_SILICON_REV = 0x14,
79 PROTO_GET_SYNC = 0x21,
80 PROTO_GET_DEVICE = 0x22,
81 PROTO_CHIP_ERASE = 0x23,
82 PROTO_LOAD_ADDRESS = 0x24,
83 PROTO_PROG_MULTI = 0x27,
88 PROTO_CHIP_VERIFY = 0x24,
89 PROTO_READ_MULTI = 0x28,
103 bool _sikRadio =
false;
104 bool _inBootloaderMode =
false;
105 uint32_t _boardID = 0;
106 uint32_t _boardFlashSize = 0;
107 uint32_t _bootloaderVersion = 0;
108 uint32_t _imageCRC = 0;
109 QString _firmwareFilename;
110 QString _errorString;
112 static const int _eraseTimeout = 20000;
113 static const int _rebootTimeout = 10000;
114 static const int _verifyTimeout = 5000;
115 static const int _readTimout = 2000;
116 static const int _responseTimeout = 2000;
117 static const int _flashSizeSmall = 1032192;
118 static const int _bootloaderVersionV2CorrectFlash = 5;