This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nRF24L01+:the length of received data exceed 32

hello,we use nRF24l01+ for the communication of IoT.There are a lot of terminals work at a same channel,when the controllers send CMD,we have found:the length of reading from R_RX_PL_WID exceed 32 bytes.we donot know the reason.

so,i want to ask if we have other protection mechanism except of judging the range of length(reading from R_RX_PL_WID).

would you give some advice,thank you very much.

  • Hi,

    If a payload is received with size > 32 bytes or size == 0, the FIFO must be flushed. If you read out this payload, the state machine inside the nRF24L01+ may go into a bad state.

    This is mentioned in the PS, chapter 7.3.4:

    Note: Always check if the packet width reported is 32 bytes or shorter when using the R_RX_PL_WID command. If its width is longer than 32 bytes then the packet contains errors and must be discarded. Discard the packet by using the Flush_RX command.

    Cheers, Håkon

  • thank you!

    we have added mechanism which is same of your suggestion.

    now,i want to know why the payload length exceed 32 bytes,whether there are so much data in the air or software configuration has some mistake,please tell me the reason.

    thank you very much!

  • If your RF address includes longer sequences of bit '0' or '1', like 0xFF or 0x00, or the address starts with patterns resembling the preamble (0x55/0xAA), then you are more prone to get an address match from demodulated noise. The CRC (if enabled) will filter out most of these, but if you use only 1 byte CRC, statistics state that 1 out of 256 "noise payloads" will pass as "OK".

    Summarized:

    • We recommend to have an RF address that does not start with 00/0xFF/0xAA/0x55
    • We also recommend to use CRC, preferably 2 byte configuration.

    Cheers, Håkon

  • thank you!

    what you mean :CRC configuration and RF address configuration is very important.Actually,we use 2 byte CRC,and RF address is 0x4C、0x45、0x44、0x52、0x00,i think it fit in with your advice.

    but the project site appear a phenomenon:the length of reading from R_RX_PL_WID exceed 32 bytes. so we should found the reason. the version of software on the project site does not judge the length of R_RX_PL_WID,I do not know whether it is the reason.

    please help me to analyze the reason,thank you very much!

  • Hi, Your RF address looks be OK, and so is the CRC configuration. Using a 2 byte CRC may still give a "false payload" (noise), but the probability is not that high. It is always recommended to check the payload-width before reading out the payload.

Related