-
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
Use BCM2835 lib's Edge Detection Status for IRQ support #969
Conversation
9c18209
to
d2525d5
Compare
This comment was marked as resolved.
This comment was marked as resolved.
This work on my RPi3 and my RPi4. 🎉 |
On my RPi4 I can't get it to work even with the basic gettingstarted example. |
I usually have to reboot my RPi when changing between drivers now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm really not sure where the problem is but the interrupts just don't trigger when I use the gateway example. Everything seems to be functional using the regular ncurses example, but interrupts just get missed with the interrupt based example. This might take some time to figure out, but in the meantime, it works at the RF24 layer, so I'll assume something is wrong at the gateway layer.
Has this happened after a long runtime (like days of uptime)? |
oops. I didn't see which thread this was. I thought it was the gateway PR (& I assumed SPIDEV). |
the bcm2xxx lib has asynch variants of the rising/falling edge detect status, but I didn't think it would be helpful as the docstring describes them as super sensitive: Lines 1538 to 1544 in b4edfbd
I was worried about debouncing again. We could switch to the async variants and try that instead... |
Same thing, works at RF24 layer, but not triggering the interrupt function at Gateway. Its slow going because I'm testing on an old RPi model B |
I found no problems running the example using the async variants on RPi3 & RPi4. I think my SD card in my RPi4 is deteriorating. 😭 Its been bricking lately; prompting me to pull the power, wait a few minutes, then power back up. 😱 |
I see the gateway curses_int example only calls pinmode(interruptPin, INPUT);
attachInterrupt(interruptPin, INT_EDGE_FALLING, intHandler); that's the only difference I noticed between the 2 layers' interrupt examples. |
Same thing with |
I'm falling asleep (finally)... The way I see it, the only real problem point might be in |
I re-tested on my RPi4 as well and I'm getting this repeating very quickly on receive, nothing on transmit with the gettingstarted example:
My RPi3 gives same results as the model B, RF24 layer works, no ISR at Gateway... |
I have to lower my SPI speed to about 6MHz on my RPi4 with the RPi driver (still using that adapter board you sent me). |
I'm also using 64 bit RPi OS bookworm. I don't have problems with example defaults on my RPi3. I've got in the habit of Nice redesign! I was thinking of getting some stacking header pins (to use for that shield), so I could get access to my I2C pins while the shield was still attached. I'm lazy though. I just use a different RPi3 (Model A+) for testing my CirquePinnacle lib (which uses both SPI & I2C). |
Yeah, I've rebooted as well, but you can also |
I was more concerned with how different drivers leave my GPIO access (sysfs state for most of them except SPIDEV and RPi) after Ctrl+C. That and there was some memory leakage when developing the newer GPIO stuff for SPIDEV. |
I have no idea what could be the problem. It is sounding hardware-specific though. |
I think we're pinned to bcm2835 lib v1.62. I see there have been some updates since, currently up to v1.75. I could try updating our copy, but I doubt it would effect the edge detection feature. About secondary SPI (a tangential note)There is a patch released in v1.75 about Line 21 in c6d05b8
Lines 1657 to 1665 in c6d05b8
I have revised the bcm2835 wrappers in my CirquePinnacle lib in an attempt to add support for secondary SPI bus, but I also neglected proper error handling. |
According to BCM2835 lib docs:
Maybe its not a good idea to make IRQ support specific to the BCM2835 lib. Still its wierd that these changes work in RF24 layer but not in Gateway layer. |
It might be time to begin looking at phasing out BCM lib support altogether, its an old driver and not being updated for the newer RPi5. I don't see the need to fully support this driver since we have so many other options, SPIDEV, PiGPIO, WiringPi, MRAA which work well. |
I'm of the opinion that all but SPIDEV should be phased out.
|
I think you're right, while keeping them is nice its a lot of extra work, but lets go a bit slowly with actually removing support tho. We can mark them deprecated and suggest users move to the SPIDEV driver. |
Removing them is definitely a v2.0 idea. I'll open an issue to track it and add it to the "v2.0 ideas" project. |
I don't expect to actually remove anything until RPi7 gets produced. We can hard-code the build systems to select SPIDEV despite the presence of other need libraries. This should be the least breaking approach we can do to dissuade users from selecting other (seemingly unreliable) drivers. For now, is this ok to merge? |
Yup |
Just does what the title says, instead of using the Linux Kernel.