Lora-net / sx1302_hal

SX1302/SX1303 Hardware Abstraction Layer and Tools (packet forwarder...)
Other
219 stars 272 forks source link

Failed to set SX1250_0 in STANDBY_XOSC mode : SX1250 stays in standby mode #70

Closed AloyseTech closed 2 years ago

AloyseTech commented 2 years ago

Hi,

When I start my SX1302 based concentrator with version 2.1.0, I get the following error : ERROR: Failed to set SX1250_0 in STANDBY_XOSC mode This is happening in sx1250.c:169

Since this error is on the transition to STANDBYXOSC and not the more commonly seen error with transition to STANDBYIDLE mode, I assume my wiring is good and that the communication is working (I can read the status register as 0x22 when checking if in STANDBY_IDLE mode and I can read the SX1302 version as 0x10 reliably).

Here is an extract of my logs (with added debug print after the error is caught, checking register read value) :

Opening SPI communication interface Note: chip version is 0x10 (v1.0) ERROR: Failed to set SX1250_0 in STANDBY_XOSC mode INFO: GET_STATUS opcode result INFO: buf[0] == 0x2A, expected 0x3X INFO: TAKE_N_BITS_FROM(buff[0], 4, 3)) == 0x02 ERROR: failed to setup radio 0

It looks like the SX1250 status register value does not change, probably indicating that is stays in stand by mode.

What are the potential known/suspected root causes of this issue (software and/or hardware) ? The lower nibble of the STATUS register seems to change : when checking for STANDBY_IDLE mode the value is 0x22 and after checking for STANDBY_XOSC mode the value is 0x2A. What is the meaning of the bit 4? Where can I find the register documentation (if any) ?

The system is a custom build following the SX1302 reference design for Europe.

Best regards, Théo

AloyseTech commented 2 years ago

Closing since it was an hardware issue. The 32MHz TCXO clocking the 2 radios was not functioning properly.