The LoRa Developer Forum is now in read-only mode and new content will not be added.
Semtech, in its commitment to enhance user experience and streamline content, has successfully integrated the LoRa Developer Portal content into Semtech.com. As a result of this consolidation effort, the LoRa® Developer Portal Forum will be discontinued on May 1st. After this date, you will be automatically redirected to Semtech.com.
For any technical support related to LoRa, please feel free to reach out to our experts here. If you have sales inquiries, please contact us here.

FORUM

SX1280 Ranging timeout

Hi,

I am testing the SX1280 ranging, the LoRa sending between two board is OK.
But the ranging, the TX will report error, and RX will not receiving anything.
I don’t know where is the configuration error? I just attach the code and logs…

void initRaning(){
SX1280SetStandby( STDBY_XOSC );
SX1280SetRegulatorMode( USE_DCDC );
SX1280SetPacketType(PACKET_TYPE_RANGING);

modulationParamsx.PacketType =PACKET_TYPE_RANGING;
modulationParamsx.Params.LoRa.SpreadingFactor = LORA_SF6;
modulationParamsx.Params.LoRa.Bandwidth       = LORA_BW_1600;
modulationParamsx.Params.LoRa.CodingRate      = LORA_CR_4_5;

SX1280SetModulationParams(&modulationParamsx);

packetParamsx.PacketType     = PACKET_TYPE_RANGING;
packetParamsx.Params.LoRa.PreambleLength = 12u;
packetParamsx.Params.LoRa.HeaderType     = LORA_PACKET_VARIABLE_LENGTH;
packetParamsx.Params.LoRa.CrcMode        = LORA_CRC_ON;
packetParamsx.Params.LoRa.InvertIQ       = LORA_IQ_NORMAL;
packetParamsx.Params.LoRa.PayloadLength  = 10;

SX1280SetPacketParams(&packetParamsx);

uint8_t addrArray[] = {0x1e };
SX1280HalWriteRegisters( 0x925, addrArray, 1 );
SX1280SetRfFrequency(2400000000);
SX1280SetTxParams(DemoSettings.TxPower,RADIO_RAMP_20_US);

SX1280SetBufferBaseAddresses( 0x00u, 0x00u );
SX1280HalWriteRegister( REG_LNA_REGIME, SX1280HalReadRegister( REG_LNA_REGIME ) & ~MASK_LNA_REGIME );

DemoSettings.RngAddress = 0x1232eeff;

}

void setRangingMaster(){

initRaning();
SX1280SetRangingRequestAddress(DemoSettings.RngAddress);

//master
SX1280SetDioIrqParams( IRQ_RADIO_ALL,
                       IRQ_RADIO_ALL,
                       IRQ_RADIO_NONE, IRQ_RADIO_NONE);

SX1280SetRangingCalibration( DemoSettings.RngCalib );
SX1280SetRangingRole(1); //Master
SX1280SetTx( ( TickTime_t ){ RADIO_TICK_SIZE_0015_US, 0xFFFF });

}

void setRangingSlave(){

initRaning();
SX1280SetDeviceRangingAddress(DemoSettings.RngAddress);
SX1280SetDeviceRangingAddressFilter(0);

SX1280SetDioIrqParams( IRQ_RADIO_ALL,
                       IRQ_RADIO_ALL,
                       IRQ_RADIO_NONE, IRQ_RADIO_NONE);
SX1280SetRangingCalibration( DemoSettings.RngCalib );
SX1280SetRangingRole(0); //Slave
SX1280SetRx( ( TickTime_t ){ RADIO_TICK_SIZE_0015_US, 0xFFFF });

}

Here is the log of master

set ranging parameters
set radio parameters
SX1280GetFirmwareVersion
19 01 53 00 00
ff 57 57 00 00
data = 00
19 01 54 00 00
55 57 57 57 b7
data = b7
Ranging Demo as Master , firmware 183

SX1280SetStandby =01
80 01

SX1280SetRegulatorMode 1
96 01

SX1280SetPacketType 2
8a 02

SX1280SetModulationParams 02
8b 60 0a 01

SX1280SetPacketParams 02
8c 0c 00 0a 20 40 00 00

SX1280HalWriteRegisters address 925 buffersize=1
18 09 25 1e

SX1280SetRfFrequency -1794967296
86 c0 4e c4

SX1280SetTxParams 13
8e 1f e0

SX1280SetBufferBaseAddresses 00 00
8f 00 00

lora_2_4g_read_reg_values 19 size=5
19 08 91 00 00
65 67 67 67 25
data = 25

SX1280HalWriteRegisters address 891 buffersize=1
18 08 91 25

SX1280SetRangingRequestAddress 1232eeff
SX1280HalWriteRegisters address 912 buffersize=4
18 09 12 12 32 ee ff

SX1280SetDioIrqParams
8d ff ff ff ff 00 00 00 00

SX1280SetRangingCalibration 00
SX1280HalWriteRegisters address 92c buffersize=1
18 09 2c 00

SX1280HalWriteRegisters address 92d buffersize=1
18 09 2d 00

SX1280SetRangingRole 01
a3 01

SX1280SetTx timeout=65535 type=0
SX1280ClearIrqStatus
97 ff ff

#######################ERROR#IRQ_RANGING_MASTER_RESULT_TIMEOUT############################
c0 00 00
45 40 43
SX1280GetStatus =43
status =43

#################SX1280ProcessIrqs pollingMode 0 ##########
clear Irq
SX1280GetIrqStatus
15 00 00 00
41 43 04 00

SX1280ClearIrqStatus
97 ff ff

packetType RANGING
#####irq IRQ_RANGING_MASTER_RESULT_TIMEOUT
OnRangingDone to 2

SX1280GetPacketStatus
1d 00 00 00 00 00 00
45 47 00 00 00 00 00
PacketType: 2
RssiPkt: 0
SnrPkt: 0
SyncError: 0
LengthError: 0
CrcError: 0
AbortError: 0
HeaderReceived: 0
PacketReceived: 0
PacketControlerBusy: 0
RxNoAck: 0
PacketSent: 0
SyncAddrStatus: 0