cancel
Showing results for 
Search instead for 
Did you mean: 

LoRa packet with CRC error treated as valid

HugoL
Associate II

A packet with CRC error has both SUBGHZ_IT_RX_CPLT and SUBGHZ_IT_CRC_ERROR flag set.

In stm32wlxx_hal_subghz.c, this leads to both RxCpltCallback() and CRCErrorCallback() being called.

https://github.com/STMicroelectronics/STM32CubeWL/blob/main/Drivers/STM32WLxx_HAL_Driver/Src/stm32wlxx_hal_subghz.c#L1244

I believe that only CRCErrorCallback() should be called. That is what is done in the drivers provided by semtech for the sx126x:

https://github.com/Lora-net/LoRaMac-node/blob/master/src/radio/sx126x/radio.c#L1282

1 ACCEPTED SOLUTION

Accepted Solutions
Louis AUDOLY
ST Employee

Hello @HugoL​ ,

Thank you for your message. You are right, you have to add a condition on the packet received interrupt to process the packet only if the CRC is valid :

if ((SUBGHZ_CHECK_IT_SOURCE(itsource, SUBGHZ_IT_RX_CPLT) != RESET) && (SUBGHZ_CHECK_IT_SOURCE(itsource, SUBGHZ_IT_CRC_ERROR) == RESET))

We will modify this on our side.

I hope this helped you.

Best regards

Louis

When your question is answered, you can close this topic by choosing Select as Best.

View solution in original post

1 REPLY 1
Louis AUDOLY
ST Employee

Hello @HugoL​ ,

Thank you for your message. You are right, you have to add a condition on the packet received interrupt to process the packet only if the CRC is valid :

if ((SUBGHZ_CHECK_IT_SOURCE(itsource, SUBGHZ_IT_RX_CPLT) != RESET) && (SUBGHZ_CHECK_IT_SOURCE(itsource, SUBGHZ_IT_CRC_ERROR) == RESET))

We will modify this on our side.

I hope this helped you.

Best regards

Louis

When your question is answered, you can close this topic by choosing Select as Best.