cancel
Showing results for 
Search instead for 
Did you mean: 

no radio Rx timeout after Radio.Rx() called

ngodoanvan
Senior

Hi,

I use STM32WLE5CBU6. I created SubGHz Phy project. Device entered stop 2 mode, exit stop 2 mode when the alarm B interrupt issue then the Radio.Rx(3000) is called to receive data.

my RTC Alarm interrupt function below,

void HAL_RTCEx_AlarmBEventCallback(RTC_HandleTypeDef *hrtc)
{
	UTIL_LPM_SetStopMode((1 << CFG_LPM_LoRa_Id), UTIL_LPM_DISABLE);
 
	DebugPuts("\rAlarm B.");
	
	/* Radio Receive */
	DebugPuts("\rRadio Receive.");
	Radio.Rx(3000);
}

my SubGhz App Init() function below,

void SubghzApp_Init(void)
{
  /* USER CODE BEGIN SubghzApp_Init_1 */
	DebugPuts("\rSMETER.");
	/* Get SubGhz-Phy APP version */
	DebugPrint("\rAPPLICATION_VERSION: V%X.%X.%X", (uint8_t)(APP_VERSION_MAIN), (uint8_t)(APP_VERSION_SUB1), (uint8_t)(APP_VERSION_SUB2));
	
	/* Get MW SubGhz-Phy info */
	DebugPrint("\rMW_RADIO_VERSION:    V%X.%X.%X", (uint8_t)(SUBGHZ_PHY_VERSION_MAIN), (uint8_t)(SUBGHZ_PHY_VERSION_SUB1), (uint8_t)(SUBGHZ_PHY_VERSION_SUB2));
  /* USER CODE END SubghzApp_Init_1 */
 
  /* Radio initialization */
  RadioEvents.TxDone = OnTxDone;
  RadioEvents.RxDone = OnRxDone;
  RadioEvents.TxTimeout = OnTxTimeout;
  RadioEvents.RxTimeout = OnRxTimeout;
  RadioEvents.RxError = OnRxError;
 
  Radio.Init(&RadioEvents);
 
  /* USER CODE BEGIN SubghzApp_Init_2 */
  /*calculate random delay for synchronization*/
  random_delay = (Radio.Random()) >> 22; /*10bits random e.g. from 0 to 1023 ms*/
 
  /* Radio Set frequency */
  Radio.SetChannel(RF_FREQUENCY);
  
  /* Radio configuration */
  DebugPuts("\r---------------");
  DebugPuts("\rLORA_MODULATION");
  DebugPrint("\rLORA_BW=%d kHz", (1 << LORA_BANDWIDTH) * 125);
  DebugPrint("\rLORA_SF=%d", LORA_SPREADING_FACTOR);
  
  Radio.SetTxConfig(MODEM_LORA, TX_OUTPUT_POWER, 0, LORA_BANDWIDTH,
                    LORA_SPREADING_FACTOR, LORA_CODINGRATE,
                    LORA_PREAMBLE_LENGTH, LORA_FIX_LENGTH_PAYLOAD_ON,
                    true, 0, 0, LORA_IQ_INVERSION_ON, TX_TIMEOUT_VALUE);
 
  Radio.SetRxConfig(MODEM_LORA, LORA_BANDWIDTH, LORA_SPREADING_FACTOR,
                    LORA_CODINGRATE, 0, LORA_PREAMBLE_LENGTH,
                    LORA_SYMBOL_TIMEOUT, LORA_FIX_LENGTH_PAYLOAD_ON,
                    0, true, 0, 0, LORA_IQ_INVERSION_ON, true);
 
  Radio.SetMaxPayloadLength(MODEM_LORA, MAX_APP_BUFFER_SIZE);
  /* USER CODE END SubghzApp_Init_2 */
}

the radio status is RF_RX_RUNNING everytime.

Please support me.

Thanks.

1 REPLY 1

https://community.st.com/s/question/0D53W00001ksu7OSAQ/no-radio-rx-timeout-after-the-radiorx-function-called

>>the radio status is RF_RX_RUNNING everytime.

The implementation has historically had bugs in this regard, but isn't this expected/anticipated behaviour for continuous mode?

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..