Giter VIP home page Giter VIP logo

Comments (19)

maruel avatar maruel commented on May 28, 2024 1

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.

stapelberg avatar stapelberg commented on May 28, 2024 1

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.

maruel avatar maruel commented on May 28, 2024 1

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.

maruel avatar maruel commented on May 28, 2024

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.

alethenorio avatar alethenorio commented on May 28, 2024

No worries @maruel any help is appreciated. Thank you for taking the time to comment and update the matter

from periph.

0x3333 avatar 0x3333 commented on May 28, 2024

Isn't this because the RPi 4 uses BCM2711 which has a different base address?

from periph.

bezineb5 avatar bezineb5 commented on May 28, 2024

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.

maruel avatar maruel commented on May 28, 2024

Thanks for the reference. Anyone knows of an updated datasheet?

from periph.

maruel avatar maruel commented on May 28, 2024

Yeah I should have "tried to search on my favorite search engine first":

It's cool it's everything that is needed.

from periph.

berryboy2012 avatar berryboy2012 commented on May 28, 2024

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.

stapelberg avatar stapelberg commented on May 28, 2024

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.

maruel avatar maruel commented on May 28, 2024

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.

berryboy2012 avatar berryboy2012 commented on May 28, 2024

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.

stapelberg avatar stapelberg commented on May 28, 2024

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.

stapelberg avatar stapelberg commented on May 28, 2024

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.

stapelberg avatar stapelberg commented on May 28, 2024

@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.

maruel avatar maruel commented on May 28, 2024

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.

stapelberg avatar stapelberg commented on May 28, 2024

Thanks very much! Can confirm that it works. Published https://gokrazy.org/userguide/gpio/ :)

from periph.

alethenorio avatar alethenorio commented on May 28, 2024

Thank you for the fix. You guys rock. šŸ’Ŗ

from periph.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    šŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ā¤ļø Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.