Skip to content

Commit

Permalink
Docs: Byte alignment/packing mismatches (#945)
Browse files Browse the repository at this point in the history
* Docs: Add info on byte alignment/packing mismatches

#847
---------

Co-authored-by: Brendan <[email protected]>
  • Loading branch information
TMRh20 and 2bndy5 authored Feb 20, 2024
1 parent ee9c017 commit fe25130
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions COMMON_ISSUES.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,12 @@ 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).
Newer users can use the `sizeof()` function to verify the size of different variables or data structures as well.
See [GNU libc doc about integers](https://www.gnu.org/software/libc/manual/html_node/Integers.html) and [TMRh20's Blog Post](https://tmrh20.blogspot.com/2020/09/transferring-data-between-systems-using.html) for more info.
### My PA/LNA module fails to transmit
You may find variants of the nRF24L01 transceiver that are marketed as “nRF24L01+PA+LNA”. These modules are distinct in the fact that they come with a detachable (SMA-type) antenna. They employ separate RFX24C01 IC with the antenna for enhanced Power Amplification (PA) and Low Noise Amplification (LNA) features. While they boast greater range with the same functionality, they are subject to a couple lesser known (and lesser advertised) drawbacks:
Expand Down

0 comments on commit fe25130

Please sign in to comment.