RadioLib: intermittent failure to initialise cubecell
Hi,
quite often (~75% of the time), i get a -2 return code when initialising my CubeCell V2. I have enabled the debug and verbose outputs and this is the results in one case where the module errors on begin:
Copyright @2019-2020 Heltec Automation.All rights reserved.
CMD 80
DATW 0 AA
CMD 80
DATW 0 A2
CMD C0
DATR 0 A2 0 22
CMD 1D 3 20
DATR 0 A2 0 A2 0 53 0 58 0 31 0 32 0 36 0 31 0 20 0 56 032 0 44 0 20 0 32 0 44 0 30 0 32
SX126x not found! (1 of 10 tries) RADIOLIB_SX126X_REG_VERSION_STRING:
0000320 a2 53 58 31 32 36 31 20 56 32 44 20 32 44 30 32 | .SX1261 V2D 2D02
Expected string: SX1261
CMD 80
DATW 0 AA
CMD 80
DATW 0 A2
CMD C0
DATR 0 A2 0 22
CMD 1D 3 20
DATR 0 A2 0 A2 0 53 0 58 0 31 0 32 0 36 0 31 0 20 0 56 032 0 44 0 20 0 32 0 44 0 30 0 32
SX126x not found! (2 of 10 tries) RADIOLIB_SX126X_REG_VERSION_STRING:
0000320 a2 53 58 31 32 36 31 20 56 32 44 20 32 44 30 32 | .SX1261 V2D 2D02
Expected string: SX1261
CMD 80
DATW 0 AA
CMD 80
DATW 0 A2
CMD C0
DATR 0 A2 0 22
CMD 1D 3 20
DATR 0 A2 0 A2 0 53 0 58 0 31 0 32 0 36 0 31 0 20 0 56 032 0 44 0 20 0 32 0 44 0 30 0 32
SX126x not found! (3 of 10 tries) RADIOLIB_SX126X_REG_VERSION_STRING:
0000320 a2 53 58 31 32 36 31 20 56 32 44 20 32 44 30 32 | .SX1261 V2D 2D02
Expected string: SX1261
CMD 80
DATW 0 AA
CMD 80
DATW 0 A2
CMD C0
DATR 0 A2 0 22
CMD 1D 3 20
DATR 0 A2 0 A2 0 53 0 58 0 31 0 32 0 36 0 31 0 20 0 56 032 0 44 0 20 0 32 0 44 0 30 0 32
SX126x not found! (4 of 10 tries) RADIOLIB_SX126X_REG_VERSION_STRING:
0000320 a2 53 58 31 32 36 31 20 56 32 44 20 32 44 30 32 | .SX1261 V2D 2D02
Expected string: SX1261
CMD 80
DATW 0 AA
CMD 80
DATW 0 A2
CMD C0
DATR 0 A2 0 22
CMD 1D 3 20
DATR 0 A2 0 A2 0 53 0 58 0 31 0 32 0 36 0 31 0 20 0 56 032 0 44 0 20 0 32 0 44 0 30 0 32
SX126x not found! (5 of 10 tries) RADIOLIB_SX126X_REG_VERSION_STRING:
0000320 a2 53 58 31 32 36 31 20 56 32 44 20 32 44 30 32 | .SX1261 V2D 2D02
Expected string: SX1261
CMD 80
DATW 0 AA
CMD 80
DATW 0 A2
CMD C0
DATR 0 A2 0 22
CMD 1D 3 20
DATR 0 A2 0 A2 0 53 0 58 0 31 0 32 0 36 0 31 0 20 0 56 032 0 44 0 20 0 32 0 44 0 30 0 32
SX126x not found! (6 of 10 tries) RADIOLIB_SX126X_REG_VERSION_STRING:
0000320 a2 53 58 31 32 36 31 20 56 32 44 20 32 44 30 32 | .SX1261 V2D 2D02
Expected string: SX1261
CMD 80
DATW 0 AA
CMD 80
DATW 0 A2
CMD C0
DATR 0 A2 0 22
CMD 1D 3 20
DATR 0 A2 0 A2 0 53 0 58 0 31 0 32 0 36 0 31 0 20 0 56 032 0 44 0 20 0 32 0 44 0 30 0 32
SX126x not found! (7 of 10 tries) RADIOLIB_SX126X_REG_VERSION_STRING:
0000320 a2 53 58 31 32 36 31 20 56 32 44 20 32 44 30 32 | .SX1261 V2D 2D02
Expected string: SX1261
CMD 80
DATW 0 AA
CMD 80
DATW 0 A2
CMD C0
DATR 0 A2 0 22
CMD 1D 3 20
DATR 0 A2 0 A2 0 53 0 58 0 31 0 32 0 36 0 31 0 20 0 56 032 0 44 0 20 0 32 0 44 0 30 0 32
SX126x not found! (8 of 10 tries) RADIOLIB_SX126X_REG_VERSION_STRING:
0000320 a2 53 58 31 32 36 31 20 56 32 44 20 32 44 30 32 | .SX1261 V2D 2D02
Expected string: SX1261
CMD 80
DATW 0 AA
CMD 80
DATW 0 A2
CMD C0
DATR 0 A2 0 22
CMD 1D 3 20
DATR 0 A2 0 A2 0 53 0 58 0 31 0 32 0 36 0 31 0 20 0 56 032 0 44 0 20 0 32 0 44 0 30 0 32
SX126x not found! (9 of 10 tries) RADIOLIB_SX126X_REG_VERSION_STRING:
0000320 a2 53 58 31 32 36 31 20 56 32 44 20 32 44 30 32 | .SX1261 V2D 2D02
Expected string: SX1261
CMD 80
DATW 0 AA
CMD 80
DATW 0 A2
CMD C0
DATR 0 A2 0 22
CMD 1D 3 20
DATR 0 A2 0 A2 0 53 0 58 0 31 0 32 0 36 0 31 0 20 0 56 032 0 44 0 20 0 32 0 44 0 30 0 32
SX126x not found! (10 of 10 tries) RADIOLIB_SX126X_REG_VERSION_STRING:
0000320 a2 53 58 31 32 36 31 20 56 32 44 20 32 44 30 32 | .SX1261 V2D 2D02
Expected string: SX1261
No SX126x found!
It looks like the SPIreadRegisterBurst in findChip produces one extra character at the beginning of the string, so the strncmp fails.
This is on the latest master.
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 16 (16 by maintainers)
Commits related to this issue
- fix #709 — committed to gasagna/RadioLib by gasagna a year ago
- Merge pull request #714 from gasagna/master fix #709 — committed to jgromes/RadioLib by jgromes a year ago
I’m wary of this for the simple reason that version check is not the only register read that’s done. Adding this workaround would only mask the issue, not resolve it.