2025-05-23 5:55 AM
I'm transmitting a custom packet by the NUCLEO-WL33CC2 and I'm receiving the pachet by a different harware that use the SI4460 tranceiver from Silabs. In the receiver board I receive the pachet, but the byte are completely differents than the byte I sent. Look like as the STM32WL33 have applied a coding, but I do non have applied any coding on the transmetter.
This my init code on the trasmetter:
static void MX_MRSUBG_Init(void)
{
/* USER CODE BEGIN MRSUBG_Init 0 */
/* USER CODE END MRSUBG_Init 0 */
/* USER CODE BEGIN MRSUBG_Init 1 */
/* USER CODE END MRSUBG_Init 1 */
/** Configures the radio parameters
*/
MRSUBG_RadioInitStruct.lFrequencyBase = 433920000;
MRSUBG_RadioInitStruct.xModulationSelect = MOD_2GFSK1;
MRSUBG_RadioInitStruct.lDatarate = 40000;
MRSUBG_RadioInitStruct.lFreqDev = 25000;
MRSUBG_RadioInitStruct.lBandwidth = 100000;
MRSUBG_RadioInitStruct.dsssExp = 0;
MRSUBG_RadioInitStruct.outputPower = 14;
MRSUBG_RadioInitStruct.PADrvMode = PA_DRV_TX_HP;
HAL_MRSubG_Init(&MRSUBG_RadioInitStruct);
/** Configures the packet parameters
*/
MRSUBG_PacketSettingsStruct.PreambleLength = 64;
MRSUBG_PacketSettingsStruct.PostambleLength = 0;
MRSUBG_PacketSettingsStruct.SyncLength = 16;
MRSUBG_PacketSettingsStruct.SyncWord = 0x2DD48888;
MRSUBG_PacketSettingsStruct.FixVarLength = FIXED;
MRSUBG_PacketSettingsStruct.PreambleSequence = PRE_SEQ_1010;
MRSUBG_PacketSettingsStruct.PostambleSequence = POST_SEQ_0101;
MRSUBG_PacketSettingsStruct.CrcMode = PKT_NO_CRC;
MRSUBG_PacketSettingsStruct.Coding = CODING_NONE;
MRSUBG_PacketSettingsStruct.DataWhitening = DISABLE;
MRSUBG_PacketSettingsStruct.LengthWidth = BYTE_LEN_1;
MRSUBG_PacketSettingsStruct.SyncPresent = ENABLE;
HAL_MRSubG_PacketBasicInit(&MRSUBG_PacketSettingsStruct);
/* USER CODE BEGIN MRSUBG_Init 2 */
/* USER CODE END MRSUBG_Init 2 */
}
This my transmition instructions:
uint8_t tx_data[MSG_SIZE]={0x10, 0x40, 0x90, 0x00, 0x00, 0x35, 0x0D, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0xe1 };
__HAL_MRSUBG_STROBE_CMD(CMD_SABORT);
/* wait for SABORT... */
while ((__HAL_MRSUBG_GET_RFSEQ_IRQ_STATUS() & MR_SUBG_GLOB_STATUS_RFSEQ_IRQ_STATUS_SABORT_DONE_F) == 0) {};
__HAL_MRSUBG_CLEAR_RFSEQ_IRQ_FLAG(MR_SUBG_GLOB_STATUS_RFSEQ_IRQ_STATUS_SABORT_DONE_F);
/* Set the pointer to the data buffer */
HAL_MRSubG_PktBasicSetPayloadLength(MSG_SIZE);
__HAL_MRSUBG_SET_DATABUFFER0_POINTER((uint32_t)&tx_data);
/* Send the TX command */
__HAL_MRSUBG_STROBE_CMD(CMD_TX);
in the receiver I have these data:
How can I solve?
I have tested the NUCLEO-WL33CC2 and my receiver by the STM32CubeWiSE-RadioExplorer and I can send and receve the correct packet.
Thank you.