The issue occurs in RX continuous mode as well as in regular RX mode without timeout.
All interrupts are active and handled appropriately.
The settings we use:
Radio.SetRxConfig(
MODEM_LORA,
0, // BW
10, // datarate
1, // coding rate
0, // AFC Bandwidth (FSK only, not used with SX126x)
10, // preamble length
0, // timeout
false, // implicit header mode
0, // implicit header mode length
true, // CRC on
false, // no FHSS
0, // FHSS period
false, // iqInverted
true // continuous RX
);
Library function:
void RadioSetRxConfig( RadioModems_t modem, uint32_t bandwidth,
uint32_t datarate, uint8_t coderate,
uint32_t bandwidthAfc, uint16_t preambleLen,
uint16_t symbTimeout, bool fixLen,
uint8_t payloadLen,
bool crcOn, bool freqHopOn, uint8_t hopPeriod,
bool iqInverted, bool rxContinuous )
{
RxContinuous = rxContinuous;
if( rxContinuous == true )
{
symbTimeout = 0;
}
if( fixLen == true )
{
MaxPayloadLength = payloadLen;
}
else
{
MaxPayloadLength = 0xFF;
}
switch( modem )
{
case MODEM_FSK:
SX126xSetStopRxTimerOnPreambleDetect( false );
SX126x.ModulationParams.PacketType = PACKET_TYPE_GFSK;
SX126x.ModulationParams.Params.Gfsk.BitRate = datarate;
SX126x.ModulationParams.Params.Gfsk.ModulationShaping = MOD_SHAPING_G_BT_1;
SX126x.ModulationParams.Params.Gfsk.Bandwidth = RadioGetFskBandwidthRegValue( bandwidth );
SX126x.PacketParams.PacketType = PACKET_TYPE_GFSK;
SX126x.PacketParams.Params.Gfsk.PreambleLength = ( preambleLen << 3 ); // convert byte into bit
SX126x.PacketParams.Params.Gfsk.PreambleMinDetect = RADIO_PREAMBLE_DETECTOR_08_BITS;
SX126x.PacketParams.Params.Gfsk.SyncWordLength = GfskSyncWordLength << 3; // convert byte into bit
SX126x.PacketParams.Params.Gfsk.AddrComp = RADIO_ADDRESSCOMP_FILT_OFF;
SX126x.PacketParams.Params.Gfsk.HeaderType = ( fixLen == true ) ? RADIO_PACKET_FIXED_LENGTH : RADIO_PACKET_VARIABLE_LENGTH;
SX126x.PacketParams.Params.Gfsk.PayloadLength = MaxPayloadLength;
if( crcOn == true )
{
SX126x.PacketParams.Params.Gfsk.CrcLength = RADIO_CRC_2_BYTES_CCIT;
}
else
{
SX126x.PacketParams.Params.Gfsk.CrcLength = RADIO_CRC_OFF;
}
SX126x.PacketParams.Params.Gfsk.DcFree = GfskWhitening;
RadioStandby( );
RadioSetModem( MODEM_FSK );
SX126xSetModulationParams( &SX126x.ModulationParams );
SX126xSetPacketParams( &SX126x.PacketParams );
SX126xSetSyncWord( GfskSyncWord );
SX126xSetWhiteningSeed( 0x01FF );
RxTimeout = ( uint32_t )symbTimeout * 8000UL / datarate;
break;
case MODEM_LORA:
SX126xSetStopRxTimerOnPreambleDetect( false );
SX126x.ModulationParams.PacketType = PACKET_TYPE_LORA;
SX126x.ModulationParams.Params.LoRa.SpreadingFactor = ( RadioLoRaSpreadingFactors_t )datarate;
SX126x.ModulationParams.Params.LoRa.Bandwidth = Bandwidths[bandwidth];
SX126x.ModulationParams.Params.LoRa.CodingRate = ( RadioLoRaCodingRates_t )coderate;
if( ( ( bandwidth == 0 ) && ( ( datarate == 11 ) || ( datarate == 12 ) ) ) ||
( ( bandwidth == 1 ) && ( datarate == 12 ) ) )
{
SX126x.ModulationParams.Params.LoRa.LowDatarateOptimize = 0x01;
}
else
{
SX126x.ModulationParams.Params.LoRa.LowDatarateOptimize = 0x00;
}
SX126x.PacketParams.PacketType = PACKET_TYPE_LORA;
// NOTE: do not increase preamble length to 12 for SF5 and SF6 if it is below 12
SX126x.PacketParams.Params.LoRa.PreambleLength = preambleLen;
SX126x.PacketParams.Params.LoRa.HeaderType = ( RadioLoRaPacketLengthsMode_t )fixLen;
SX126x.PacketParams.Params.LoRa.PayloadLength = MaxPayloadLength;
SX126x.PacketParams.Params.LoRa.CrcMode = ( RadioLoRaCrcModes_t )crcOn;
SX126x.PacketParams.Params.LoRa.InvertIQ = ( RadioLoRaIQModes_t )iqInverted;
RadioStandby( );
RadioSetModem( MODEM_LORA );
SX126xSetModulationParams( &SX126x.ModulationParams );
SX126xSetPacketParams( &SX126x.PacketParams );
SX126xSetLoRaSymbNumTimeout( symbTimeout );
// WORKAROUND - Optimizing the Inverted IQ Operation, see DS_SX1261-2_V1.2 datasheet chapter 15.4
if( SX126x.PacketParams.Params.LoRa.InvertIQ == LORA_IQ_INVERTED )
{
// RegIqPolaritySetup = @address 0x0736
SX126xWriteRegister( 0x0736, SX126xReadRegister( 0x0736 ) & ~( 1 << 2 ) );
}
else
{
// RegIqPolaritySetup @address 0x0736
SX126xWriteRegister( 0x0736, SX126xReadRegister( 0x0736 ) | ( 1 << 2 ) );
}
// WORKAROUND END
// Timeout Max, Timeout handled directly in SetRx function
RxTimeout = 0x0;
break;
}
}