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

cpu/cc2538: use RX FIFO count to determine CRC OK location #20956

Merged
merged 1 commit into from
Nov 8, 2024

Conversation

HavingaThijs
Copy link
Contributor

Contribution description

Instead of using the length byte from a received packet (that might be corrupted), use the number of bytes in the RX FIFO to determine the location of the CRC OK bit.

Testing procedure

Flashed this change on two CC2538s, started ping while under heavy Wi-Fi interference. In the case where the old pkt_len was not equal to the new crc_loc, the error from #20955 did not appear. Also, the reported pkt_len in this case is always crc_loc + 128, indicating that the receiver actually only uses the 7 LSBs from the length byte.

Issues/PRs references

Fixes #20955.

@github-actions github-actions bot added Platform: ARM Platform: This PR/issue effects ARM-based platforms Area: cpu Area: CPU/MCU ports labels Nov 6, 2024
@benpicco benpicco requested a review from jia200x November 6, 2024 14:55
@benpicco benpicco added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Nov 6, 2024
@riot-ci
Copy link

riot-ci commented Nov 6, 2024

Murdock results

✔️ PASSED

81358aa cpu/cc2538: use RX FIFO count to determine CRC OK location

Success Failures Total Runtime
10214 0 10215 17m:38s

Artifacts

Copy link
Member

@maribu maribu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thx for fixing this and welcome to the RIOT community.

I have not tested the fix, but the code changes makes a lot of sense and match the doc:

#define RFCORE_XREG_RXFIFOCNT   0x4008866C  // Number of bytes in RX FIFO 

@maribu maribu added this pull request to the merge queue Nov 8, 2024
Merged via the queue into RIOT-OS:master with commit 1672c0e Nov 8, 2024
26 checks passed
@HavingaThijs HavingaThijs deleted the cc2538_crc_bit branch November 8, 2024 17:48
@MrKevinWeiss MrKevinWeiss added this to the Release 2025.01 milestone Jan 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: cpu Area: CPU/MCU ports CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Platform: ARM Platform: This PR/issue effects ARM-based platforms
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: CC2538 uses length byte before checking CRC
5 participants