I have CubeCell AB01 and AB02 running with LoRa - not LoRaWAN. I wonder what will happen in case of a CRC error:
- are packets with CRC error discarded?
- can CRC error be detected by the application and so discarded?
I have CubeCell AB01 and AB02 running with LoRa - not LoRaWAN. I wonder what will happen in case of a CRC error:
From the SX1262 datasheet section 7.4:
“All the received data will be written to the data buffer even if the CRC is invalid, permitting user-defined post processing of
corrupted data. When receiving, if the packet size exceeds the buffer memory allocated for the Rx, it will overwrite the
transmit portion of the data buffer.”
I assume this will not be different for the SX127x.
So that entirely depends on the software you are running. I expect most stacks will discard a message if the CRC yields an error, but it may be the case that it is still available for use. You’ll have to investigate your used library/stack.
Thank you, bns, for your quick answer. For CubeCell I used the library provided by Heltec, i.e. what comes with LoRaWAN_App.h and I found nothing there. So I will switch over to RadioLib, which I already used for other processors. That one returns CRC error information.
There is a callback called RxError
in the RadioEvents_t
enum, similar to the RxDone
and TxDone
callbacks.
Looking at the source code (radio.c
) it looks like this callback is called when a CRC-error happens:
if( ( irqRegs & IRQ_CRC_ERROR ) == IRQ_CRC_ERROR )
{
if( ( RadioEvents != NULL ) && ( RadioEvents->RxError ) )
{
RadioEvents->RxError( );
}
}