RAK5146 customize SyncWord

Hello,
I installed RAK5146 firmware from following RAK repo : https://github.com/RAKWireless/rak_common_for_gateway/blob/master/README.md

The PF works fine.

I wanted to change the default private SYNC WORD (0x12) of RAK5146 module.

In source code, I found the following function :

int sx1302_lora_syncword(bool public, uint8_t lora_service_sf)
{
int err = LGW_REG_SUCCESS;

/* Multi-SF modem configuration */
DEBUG_MSG("INFO: configuring LoRa (Multi-SF) SF5->SF6 with syncword PRIVATE (0x12)\n");
err |= lgw_reg_w(SX1302_REG_RX_TOP_FRAME_SYNCH0_SF5_PEAK1_POS_SF5, 2);
err |= lgw_reg_w(SX1302_REG_RX_TOP_FRAME_SYNCH1_SF5_PEAK2_POS_SF5, 4);
err |= lgw_reg_w(SX1302_REG_RX_TOP_FRAME_SYNCH0_SF6_PEAK1_POS_SF6, 2);
err |= lgw_reg_w(SX1302_REG_RX_TOP_FRAME_SYNCH1_SF6_PEAK2_POS_SF6, 4);
if (public == true)
{
    DEBUG_MSG("INFO: configuring LoRa (Multi-SF) SF7->SF12 with syncword PUBLIC (0x34)\n");
    err |= lgw_reg_w(SX1302_REG_RX_TOP_FRAME_SYNCH0_SF7TO12_PEAK1_POS_SF7TO12, 6);
    err |= lgw_reg_w(SX1302_REG_RX_TOP_FRAME_SYNCH1_SF7TO12_PEAK2_POS_SF7TO12, 8);
}
else
{
    DEBUG_MSG("INFO: configuring LoRa (Multi-SF) SF7->SF12 with syncword PRIVATE (0x12)\n");
    err |= lgw_reg_w(SX1302_REG_RX_TOP_FRAME_SYNCH0_SF7TO12_PEAK1_POS_SF7TO12, 2);
    err |= lgw_reg_w(SX1302_REG_RX_TOP_FRAME_SYNCH1_SF7TO12_PEAK2_POS_SF7TO12, 4);
}
return err;

}

The registers used in this function have defined in loragw_reg.h as follow :

#define SX1302_REG_RX_TOP_FRAME_SYNCH0_SF5_PEAK1_POS_SF5 574
#define SX1302_REG_RX_TOP_FRAME_SYNCH1_SF5_PEAK2_POS_SF5 575
#define SX1302_REG_RX_TOP_FRAME_SYNCH0_SF6_PEAK1_POS_SF6 576
#define SX1302_REG_RX_TOP_FRAME_SYNCH1_SF6_PEAK2_POS_SF6 577
#define SX1302_REG_RX_TOP_FRAME_SYNCH0_SF7TO12_PEAK1_POS_SF7TO12 578
#define SX1302_REG_RX_TOP_FRAME_SYNCH1_SF7TO12_PEAK2_POS_SF7TO12 579

How to modify the previous function to configure custom private sync into SX1303 chip ?

THX

Hello @jfgi31700 The LoRaWAN (LoRa MAC) recognized only two modes Public and Private LoRaWAN, and using the sync words 0x34 for the Public and 0x12 for the Private. If you are willing to use LoRaWAN you should use one or another. If you are willing to use the LoRa modulation and not follow the LoRaWAN specification and protocol, the sync word doesn’t matter.

As for the Semtech code, they are purposely not documenting their registers and we have only the open-source code from them to configure and work the hardware.

More info here: Relation between Sync Word, Private Network and End-Nodes - ChirpStack Community Forum

Ok i see…thanks for you reply.