|
24 | 24 | _CMD_GET_ERROR = const(0x17)
|
25 | 25 | _CMD_GET_IRQ_STATUS = const(0x12) # args: (r) Status, IrqStatus
|
26 | 26 | _CMD_GET_RX_BUFFER_STATUS = const(0x13) # args: (r) Status, RxPayloadLength, RxBufferPointer
|
| 27 | +# NOTE: _CMD_GET_STATUS seems to have an issue, see _get_status() function below. |
27 | 28 | _CMD_GET_STATUS = const(0xC0) # args: (r) Status
|
28 | 29 | _CMD_GET_PACKET_STATUS = const(0x14)
|
29 | 30 | _CMD_READ_REGISTER = const(0x1D) # args: addr (2b), status, (r) Data0 ... DataN
|
@@ -296,8 +297,21 @@ def _decode_status(self, raw_status, check_errors=True):
|
296 | 297 | return (mode, cmd)
|
297 | 298 |
|
298 | 299 | def _get_status(self):
|
299 |
| - # Issue the GetStatus command and return the decoded status of (mode value, command status) |
300 |
| - res = self._cmd("B", _CMD_GET_STATUS, n_read=1)[0] |
| 300 | + # Issue the GetStatus command and return the decoded status of (mode |
| 301 | + # value, command status) |
| 302 | + # |
| 303 | + # Due to what appears to be a silicon bug, we send GetIrqStatus here |
| 304 | + # instead of GetStatus. It seems that there is some specific sequence |
| 305 | + # where sending command GetStatus to the chip immediately after SetRX |
| 306 | + # (mode 5) will trip it it into an endless TX (mode 6) for no apparent |
| 307 | + # reason! |
| 308 | + # |
| 309 | + # It doesn't seem to be timing dependent, all that's needed is that |
| 310 | + # ordering (and the modem works fine otherwise). |
| 311 | + # |
| 312 | + # As a workaround we send the GetIrqStatus command and read an extra two |
| 313 | + # bytes that are then ignored... |
| 314 | + res = self._cmd("B", _CMD_GET_IRQ_STATUS, n_read=3)[0] |
301 | 315 | return self._decode_status(res)
|
302 | 316 |
|
303 | 317 | def _check_error(self):
|
|
0 commit comments