cancel
Showing results for 
Search instead for 
Did you mean: 

Proper packet reception with STM32WLE5 Z

AKozarzewski
Associate II

Hello

I'm configuring reception of packets with known preamble and sync word, in 2-FSK mode, but it seems like radio is doing what it wants but not what I want. Apparently although I change sync word to some different value, packets are still catched, together with proper ones. Statically it doesn't matter what do I put there, more or less both sync words give me 50% "good" packet reception. Received packet is loaded into buffer with part of preamble and sync word, which is also not good. Besides it is catched randomly, some more or less preamble and sync word part, more or less means also shifted by 4 bits (nibble) , payload is then also shifted accordingly. I don't use CRC since mechanism for that gives only one CRC in packet on last bytes, we need few of them. I don't use variable packet lenght, since it doesn't work either. First byte that contains packet length is encoded in our packets in NRZ (3out of 6), so it would have to be decoded in HW in place to make it useful for anything, otherwise that raw data isn't any packet length. Preamble detector aparently also is not working correclty, i get any packets when i put ther 32bits, the opposite what manual from Semtech says. When set to 8 bits i get only garbage data. Isn't it like that , that these chips are designed mainly for Lora? Or maybe all my issues are related to chip version which is older Z , not newer Y? Erratas doesn't say anything regarding radio part. Any idea ? Below configuration I use, but I doubt there is anything to adjust there, I played with it already.

An update; sync bytes swap ,and 8 bit detector seems to work... Only tahta NRZ part is unclear

RxConfig.fsk.ModulationShaping = RADIO_FSK_MOD_SHAPING_OFF;
	RxConfig.fsk.Bandwidth = FSK_BANDWIDTH;
	RxConfig.fsk.BitRate = FSK_DATARATE; /*BitRate*/
//  RxConfig.fsk.PreambleLen = 4; /*in Byte*/
	RxConfig.fsk.PreambleLen = 4; /*in Byte*/
	RxConfig.fsk.SyncWordLength = sizeof(syncword); /*in Byte*/
//  RxConfig.fsk.PreambleMinDetect = RADIO_FSK_PREAMBLE_DETECTOR_08_BITS;
	RxConfig.fsk.PreambleMinDetect = RADIO_FSK_PREAMBLE_DETECTOR_32_BITS;
	RxConfig.fsk.SyncWord = syncword; /*SyncWord Buffer*/
//  RxConfig.fsk.whiteSeed = 0x01FF ; /*WhiteningSeed*/
	RxConfig.fsk.whiteSeed = 0x0000; /*WhiteningSeed*/
#if (APP_LONG_PACKET==0)
//  RxConfig.fsk.LengthMode  = RADIO_FSK_PACKET_VARIABLE_LENGTH; /* legacy: payload length field is 1 byte long*/
	RxConfig.fsk.LengthMode = RADIO_FSK_PACKET_FIXED_LENGTH; /* legacy: payload length field is 1 byte long*/
#else
  RxConfig.fsk.LengthMode  = RADIO_FSK_PACKET_2BYTES_LENGTH;  /* payload length field is 2 bytes long */
#endif /* APP_LONG_PACKET */
//  RxConfig.fsk.CrcLength = RADIO_FSK_CRC_2_BYTES_IBM;       /* Size of the CRC block in the GFSK packet*/
	RxConfig.fsk.CrcLength = RADIO_FSK_CRC_OFF; /* Size of the CRC block in the GFSK packet*/
	RxConfig.fsk.CrcPolynomial = 0x8005;
	RxConfig.fsk.CrcSeed = 0xFFFF;
//  RxConfig.fsk.Whitening = RADIO_FSK_DC_FREEWHITENING;
	RxConfig.fsk.Whitening = RADIO_FSK_DC_FREE_OFF;
	RxConfig.fsk.MaxPayloadLength = 255; //MAX_APP_BUFFER_SIZE;
//  RxConfig.fsk.StopTimerOnPreambleDetect = 0;
	RxConfig.fsk.StopTimerOnPreambleDetect = 0;
//  RxConfig.fsk.AddrComp = RADIO_FSK_ADDRESSCOMP_FILT_OFF;
	RxConfig.fsk.AddrComp = RADIO_FSK_ADDRESSCOMP_FILT_OFF;
	if (0UL != Radio.RadioSetRxGenericConfig(GENERIC_FSK, &RxConfig,

0 REPLIES 0