cancel
Showing results for 
Search instead for 
Did you mean: 

lora tx problem using hal lib

avinashkumar
Associate

I am working on stm32wl5moc controller and lora tx is not working

every  time radio status i am getting back is 5 instead of 6, below is the code snipet, and also check the full code attached with this post

if (HAL_SUBGHZ_ExecGetCmd(&hsubghz, RADIO_GET_STATUS, &RadioResult, 1) != HAL_OK)
{
  Error_Handler();
}

/* Format Mode and Status receive from SUBGHZ Radio */
RadioMode = ((RadioResult & RADIO_MODE_BITFIELD) >> 4);
RadioStatus = ((RadioResult & RADIO_STATUS_BITFIELD) >> 1);
if(RadioMode == RADIO_MODE_TX)
{
  /* Wait end of transfer. SUBGHZ Radio go in Standby Mode */
  do
  {
    /* Reset RadioResult */
    RadioResult = 0x00;

    /* Retrieve Status from SUBGHZ Radio */
    if (HAL_SUBGHZ_ExecGetCmd(&hsubghz, RADIO_GET_STATUS, &RadioResult, 1) != HAL_OK)
    {
      Error_Handler();
    }

    /* Format Mode and Status receive from SUBGHZ Radio */
    RadioMode = ((RadioResult & RADIO_MODE_BITFIELD) >> 4);
    RadioStatus = ((RadioResult & RADIO_STATUS_BITFIELD) >> 1);
  }
  while (RadioMode != RADIO_MODE_STANDBY_RC);
}
else
{
  /* Call Error Handler; LED1 blinking */
  Error_Handler();
}

Edited to apply source code formatting - please see How to insert source code for future reference.

0 REPLIES 0