-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Potential Addressing Bug for RPI4 #774
Comments
The lib works fine on the RPi4 if using Raspberry Pi OS (aka Raspbian)
We are aware of the compiler issue on the RPi4 under Ubuntu using the handcrafted configure script (that was originally only intended for armhf toolchain). #772 has an alternative fix for that using CMake. This was brought to our attention in #642 @dylviz Are you running this lib under Ubuntu 64bit or 32bit? However, I have also experienced some weird issues running RF24 lib when compiled with 64bit compiler; see #642 (comment) as an example of my problematic output.
this is news to me. I've been able to run several examples without having problems with the addresses being incorrectly set. Or maybe I wasn't paying attention enough to that since all my payloads were exchanged (albeit somehow corrupted). |
@dylviz I'm curious. Have you tried building the library with the SPIDEV driver option
When I last tried the RPi driver (which uses the BCM2835 library) on my RPi4 under Ubuntu 64bit, the examples didn't get past the |
switched to using the python wrapper on RPi4 in ubuntu 64bit (built with RPi driver), and I get the same problem I observed when building with the SPIDEV driver. But now I'm able to inspect the payload before it is "unpacked" from a byterray form:
Still I can't reproduce the address problem. Success!I lowered the SPI speed in the example I was running radio = RF24(22, 0, 4000000) and I got the correct payloads transmitted
NOTICE: the transmission time is still faster than my trials on the RPi2 (with default SPI speed 10MHz) |
Hi @2bndy5, Sorry for slow reply, just got off work. I'm running 64-bit Ubuntu and just used the default 64 bit compiler. If I configure for SPIDEV, I get the following output:
This made me question whether the broadcom chip is being configured properly. I just noticed in ./configure, the following chips seems to be supported:
However, from the Rpi4 datasheet, here I don't want to go down a rabbit hole with the BCM2711 thing, but perhaps with your insight, you can tell me if this could be a plausible location for the error before I start digging. |
yeah the current build system generates a deprecated (via variable name) symlink called librf24-bcm.so (should be located in /usr/local/lib)... maybe its looking for that; IDK. The BCM2835 lib is compatible with the chips used on the RPi4, but the RF24 lib's traditional Makefile & configure solutions haven't been properly updated in a long time...
YES! the CMake implementation was especially written for your situation. I recommend you checkout the rp2xxx branch and follow the doc'd instructions. I don't have a problem using CMake with the SPIDEV driver. And you don't have to worry about the "unrecognized" compiler options problem with CMake.
I'm more inclined to think the SPI speed is too high by default for a 64 bit OS. |
@2bndy5 The CMake install on the rp2xxx branch works beautifully! Thank you for pointed that out. This would've driven me crazy haha. I used SPIDEV and I don't notice any corruption at the default 10MHz (for 4 byte payload) that you pointed out. I'll keep my eye on that though as I move to a more complex test setup. |
From my understanding, this library doesn't yet officially support RPI4, but I've heard of a few people being able to make it work so I'm currently going down that path. It's hard to say whether this is bug or not, but I've been digging through the code for past several evenings and can't seem to find why this would be happening.
I'm trying to communicate from Arduino to RPi4, but it's unsuccessful. Arduino->Arduino communication is working, but the problems comes in when one of the Arduinos is replaced with the RPI4.
The RPi is running Ubuntu 20.04.2 LTS.
Both use the "gettingStarted" example code and default addresses of "1Node" and "2Node":
Using printPrettyDetails, I can see the following behavior.
On the Arduino, the pipes open at the expected addresses:
However, on the RPI4 it looks like something went wrong in the memory management:
Obviously, the pipe 0 and pipe 1 address aren't what was specified (though TX address is correct). I expect pipe 0 to have the value of "0x65646f4e32" and pipe 1 to have the value of "0x65646f4e31".
My first thought was dangling pointer or perhaps some unexpected register/buff size but nothing stands out to me in the code.
On the RPI, the RF24 install was configured as follows:
I've mostly been searching in and around the read and write register functions:
I'm hoping someone may have some insight as to where this issue may stem from that I can dig into or perhaps even an idea of how to fix.
Thanks
The text was updated successfully, but these errors were encountered: