20 explicit Bootloader(
bool sikRadio, QObject *parent = 0);
24 bool open (
const QString portName);
26 bool getBoardInfo (uint32_t& bootloaderVersion, uint32_t& boardID, uint32_t& flashSize);
47 bool _syncWorker (
void);
50 bool _write (
const uint8_t* data, qint64 maxSize);
51 bool _write (
const uint8_t
byte);
52 bool _write (
const char* data);
53 bool _read (uint8_t* data, qint64 cBytesExpected,
int readTimeout = _readTimout);
54 bool _sendCommand (uint8_t cmd,
int responseTimeout = _responseTimeout);
55 bool _getCommandResponse (
const int responseTimeout = _responseTimeout);
56 bool _protoGetDevice (uint8_t param, uint32_t& value);
60 bool _verifyCRC (
void);
61 QString _getNextLine (
int timeoutMsecs);
62 bool _get3DRRadioBoardId (uint32_t& boardID);
67 PROTO_BAD_SILICON_REV = 0x14,
76 PROTO_GET_SYNC = 0x21,
77 PROTO_GET_DEVICE = 0x22,
78 PROTO_CHIP_ERASE = 0x23,
79 PROTO_LOAD_ADDRESS = 0x24,
80 PROTO_PROG_MULTI = 0x27,
85 PROTO_CHIP_VERIFY = 0x24,
86 PROTO_READ_MULTI = 0x28,
100 bool _sikRadio =
false;
101 bool _inBootloaderMode =
false;
102 uint32_t _boardID = 0;
103 uint32_t _boardFlashSize = 0;
104 uint32_t _bootloaderVersion = 0;
105 uint32_t _imageCRC = 0;
106 QString _firmwareFilename;
107 QString _errorString;
109 static const int _eraseTimeout = 20000;
110 static const int _rebootTimeout = 10000;
111 static const int _verifyTimeout = 5000;
112 static const int _readTimout = 2000;
113 static const int _responseTimeout = 2000;
114 static const int _flashSizeSmall = 1032192;
115 static const int _bootloaderVersionV2CorrectFlash = 5;