6 years, 6 months ago.

Semtech SX1276 Driver Bug

Dear Semtech team,

I have been struggling to make your SX1276 driver (as is shown in the tools section of the official web page outlining the features of the SX1276 on semtech.com) work as intended in FSK mode.

After setting the chip to Rx mode using Radio.Rx(0) (meaning that it should be in continuous RX mode) I am getting DIO0 interrupts with RegOpMode 13 (indicating that it is currently in TX mode) and IrqReg2 indicating that Fifo is empty. Note that this seems to happen at random times. But after appearance of this behavior, resetting the radio won't put the radio into defined state (register still reads the same). Note that reset signal is known to be present and is known to be implemented correctly.

Are recommended practices (like checking PLL or other internal blocks for having configured themselves after setting rx mode) followed in the official driver implementation, or does the user need to take care of it him/herself?

I am experiencing extensive problems considering the usage of the driver at packet rates above 210/second (of which 2/3 are tx and 1/3 is rx).

Radio settings are as follows:

Radio Settings

#define RF_FREQUENCY                                433000000 // Hz
#define TX_OUTPUT_POWER                             17        // dBm

#define USE_MODEM_FSK

#define FSK_FDEV                                    25e3      // Hz
#define FSK_DATARATE                                50000      // bps
#define FSK_BANDWIDTH                               50e3      // Hz
#define FSK_AFC_BANDWIDTH                           83.333e3  // Hz
#define FSK_PREAMBLE_LENGTH                         5         // Same for Tx and Rx
#define FSK_FIX_LENGTH_PAYLOAD_ON                   false

Following functions are called to set receiver and transmitter parameters:

Transmitter Receiver settings function calls

void _semtechfsk_reset() {
	SX1276CustomInit(0);
	Radio.SetChannel(RF_FREQUENCY);
	Radio.SetTxConfig(MODEM_FSK, TX_OUTPUT_POWER, FSK_FDEV, 0,
	FSK_DATARATE, 0,
	FSK_PREAMBLE_LENGTH, FSK_FIX_LENGTH_PAYLOAD_ON,
	true, 0, 0, 0, 0);

	Radio.SetRxConfig(MODEM_FSK, FSK_BANDWIDTH, FSK_DATARATE, 0,
	FSK_AFC_BANDWIDTH, FSK_PREAMBLE_LENGTH, 0,
	FSK_FIX_LENGTH_PAYLOAD_ON, 0, true, 0, 0, false, true);
}

The CustomInit function referenced in the code is as follows:

SX1276CustomInit() function

void SX1276CustomInit(uint8_t first_init) {
    uint8_t i;

	SX1276Reset( );

    RxChainCalibration( );

    SX1276SetOpMode( RF_OPMODE_SLEEP );

    if(first_init){
    	SX1276IoIrqInit( DioIrq );
    }

    for( i = 0; i < sizeof( RadioRegsInit ) / sizeof( RadioRegisters_t ); i++ ){
        SX1276SetModem( RadioRegsInit[i].Modem );
        SX1276Write( RadioRegsInit[i].Addr, RadioRegsInit[i].Value );
    }

    SX1276SetModem( MODEM_FSK );

    SX1276.Settings.State = RF_IDLE;
}

Please note that the init function has been adjusted to account for first time settings (setting event callback functions):

SX1276 init function

void SX1276Init( RadioEvents_t *events )
{
	RadioEvents = events;
	// Initialize driver timeout timers
	TimerInit( &TxTimeoutTimer, SX1276OnTimeoutIrq );
	TimerInit( &RxTimeoutTimer, SX1276OnTimeoutIrq );
	TimerInit( &RxTimeoutSyncWord, SX1276OnTimeoutIrq );
	SX1276CustomInit(1);
}

Thank you for your answer in advance.

With kind regards from Germany

Edit:

I need to correct that the radio is NOT in TX mode upon interrupt, but in RX mode. Still, DIO0mapping is set to PayloadReady and an interrupt gets generated with bits CRCok and PayloadReady (fifo state) bits in IrqReg2 are not set.

Question relating to:

Semtech's Wireless, Sensing and Timing product group
Be the first to answer this question.