Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: CC2538 uses length byte before checking CRC #20955

Closed
HavingaThijs opened this issue Nov 6, 2024 · 0 comments · Fixed by #20956
Closed

Bug: CC2538 uses length byte before checking CRC #20955

HavingaThijs opened this issue Nov 6, 2024 · 0 comments · Fixed by #20956

Comments

@HavingaThijs
Copy link
Contributor

Description

The CC2538 is reading the length byte from a received packet to determine the location of the CRC result:

uint8_t pkt_len = rfcore_peek_rx_fifo(0);

However, the length byte itself might be corrupted as well.

Steps to reproduce the issue

Ping between two CC2528 devices under heavy interference (e.g., using Wi-Fi in an overlapping channel).

Expected results

Th receiver should read the correct CRC result from the RX FIFO, and not read outside of it.

Actual results

In some cases, the reported length will be greater than the FIFO size and it will then try to read the CRC bit from there:

RFCORE_ASSERT(idx >= 0 && idx < CC2538_RF_FIFO_SIZE) failed at line 79 in rfcore_peek_rx_fifo()!
RFCORE_SFR_RFERRF = 0x00

I found another reference to this error here: #13997 (comment)

In fact, it looks like the number of bytes in the RX FIFO as reported by the radio is just a mask of the length byte with 0x7F, e.g., with a reported packet length of 236, there are actually only 108 bytes in the receiving buffer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants