Comments (19)
I've heard multiple reports of issues on RPi4. I'll try to find time to investigate myself but any help on this side (including a PR) is appreciated.
from periph.
Also running into this (I think) using 2020-02-13-raspbian-buster-lite.img in 64-bit mode (i.e. arm_64bit=1
in /boot/config.txt
after sudo rpi-update
).
I have tracked it down to /dev/gpiomem
not being present making the difference: after sudo mv /dev/gpiomem /dev/O.gpiomem
, I can no longer run my program as unprivileged user. When using sudo, the program starts, but prints incorrect values:
default pull = PullUp, pull = PullNoChangeLow
Low
instead of the expected:
default pull = PullUp, pull = PullNoChangeHigh
High
On the Raspberry Pi 3, the same image+program works fine. So, the issue seems to be specific to using /dev/mem (not /dev/gpiomem) on the Raspberry Pi 4.
Hope that helps in tracking it down
from periph.
I didn't get feedback but I still tagged v3.6.4 with the commit. I didn't have time to test personally but I don't want to make you wait more.
from periph.
I still haven't gotten time to setup my local installation. I haven't forgotten, just a bit time strapped at the moment. Sorry for the delay.
from periph.
No worries @maruel any help is appreciated. Thank you for taking the time to comment and update the matter
from periph.
Isn't this because the RPi 4 uses BCM2711 which has a different base address?
from periph.
I just had a look at pi-blaster which got updated for RPi4, and indeed there are differences in base addresses and DMA channels:
https://github.com/sarfata/pi-blaster/pull/110/files
I can have a look
from periph.
Thanks for the reference. Anyone knows of an updated datasheet?
from periph.
Yeah I should have "tried to search on my favorite search engine first":
- https://github.com/raspberrypi/documentation/tree/master/hardware/raspberrypi/bcm2711
- https://github.com/raspberrypi/documentation/blob/master/hardware/raspberrypi/bcm2711/rpi_DATA_2711_1p0.pdf
It's cool it's everything that is needed.
from periph.
It seems that BCM2711 uses a completely different pullup/pulldown method. I think we can use RPi.GPIO as a reference https://sourceforge.net/p/raspberry-gpio-python/tickets/168/
from periph.
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=b1d84a3d0a26c5844a22bc09a42704b9371208bb was included in Linux 5.7 (just released). Not sure if that is relevant here, or if it just makes a few more GPIO pins accessible, independent of basic GPIO functionality.
from periph.
Thanks for the reference @stapelberg . I don't think the higher ones would be usable though, as the ones over 47 for the SD card, thus accessing them is fairly dangerous. That's why bcm283x only exposes pins up to 46. Maybe the 54-57 could be safe, I dunno.
from periph.
Hi, I made a fix for rasp pi 4's bcm2711 based on that datasheet. I tried @alethenorio 's snippet and looked fine. Btw it is my first time using golang. If anything goes wrong, don't hesitate to tell me!
from periph.
Thanks very much! I can give that a shot on my pi 4 later today. If others can give it a try, too, please let us know how it goes :)
from periph.
Just had a chance to give this a try: following the instructions at gokrazy/gokrazy#33 (comment), I can confirm that GPIO starts working on my Raspberry Pi 4 when using the changes from your Pull Request.
Thank you for fixing this!
from periph.
@maruel Could you cut a new release that includes this commit, too, please?
Iād like to publish an article about using GPIOs with periph.io on top of gokrazy soon :)
from periph.
I asked on the slack channel if people can report back if nothing is broken, as the CPU detection changed significantly. I'll cut a new tag soon.
from periph.
Thanks very much! Can confirm that it works. Published https://gokrazy.org/userguide/gpio/ :)
from periph.
Thank you for the fix. You guys rock. šŖ
from periph.
Related Issues (20)
- [Question] How do I set a pin to alt0? HOT 6
- All pins are exported during bcm283x Init HOT 3
- Support for firmata HOT 2
- gpio-read: bcm283x-gpio (GPIO7): pull cannot be used when subsystem gpiomem not initialized. HOT 21
- Go get fetches v3.4.0 if using go modules HOT 3
- Support for BME680 HOT 3
- Halt() does not unblock WaitForEdge() HOT 3
- Feature SSD1322 HOT 5
- mfrc522 constantly returns "IRQ error" after first read HOT 11
- spi to slow HOT 5
- onewire didnot work HOT 9
- Omega2: declare headers HOT 3
- Experimental serial package doesn't export essential func HOT 7
- MFRC522 hang on WaitForEdge HOT 2
- HX711: unstable readings and reading before data is ready HOT 2
- spi: rename MISO/MOSI to COPI/CIPO HOT 2
- I2C documentation not clear on read/write operation HOT 2
- MFRC522 - Problem reading Tag HOT 3
- pmem example code incorrect HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
š Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ššš
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ā¤ļø Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from periph.