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

Separate 2 problems' answers in COMMON_ISSUES.md #984

Merged
merged 1 commit into from
Jul 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions COMMON_ISSUES.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ Example issues: [#264](https://github.com/nRF24/RF24/issues/264)
For reliability, please use Electrolytic or Tantalum capacitors. Ceramic
capacitors may not be good enough (depending on the manufacturing source).

### Payloads received/sent are inaccurate or printDetails() outputs the unexpected value(s)
### printDetails() outputs the unexpected value(s)

This is likely due to the SPI speed being set up to 10MHz by default. We recommend:

Expand All @@ -141,7 +141,11 @@ This is likely due to the SPI speed being set up to 10MHz by default. We recomme

In the RF24 library's beginnings, the default value was (prior to 2014) set to 4MHz.

Inaccurate payloads can also happen because of differences in how 8-bit, 32-bit and 64-bit systems store data in memory. The easiest way to ensure your data aligns between devices is to specify the size of variables in code. For example, use `uint32_t` instead of `unsigned long`, and use `__attribute__((__packed__))` for data structures if you don't align your data manually per the linked blog posts (see below).
### Payloads received/sent are inaccurate

If lowering the SPI speed (as noted above) does not fix this problem, then it is likely data misalignment.

Inaccurate payloads can also happen because of differences in how certain systems store data in memory. The easiest way to ensure your data aligns between devices is to specify the size of variables in code. For example, use `uint32_t` instead of `unsigned long`, and use `__attribute__((__packed__))` for data structures if you don't align your data manually per the linked blog posts (see below).

Newer users can use the `sizeof()` function to verify the size of different variables or data structures as well.

Expand Down