Closed pottendo closed 3 years ago
The pad setup code should activate pull-ups, I wonder if the registers have changed on RPi4.
Hi, I'm not the expert, but using the gpio commandline tool I found the difference between the RPi 3 B+ and the RPi 4 in seeing some inputs were not 'pulled-up' on the RPi4 in comparison. With the commands as listed above, the driver works perfectly. As I wrote, I did change the layout - so maybe there's some changed default behavior from Raspbian hidden in your default mapping - for sure there were some changes on that level, as the older tool 'gpio' (discontinued) also needed some changes and even won't allow changing the pull-up anymore -> therefore I use raspi-gpio, which does the job. thanx & stay healthy, pottendo
I made fork and changed pullup-code (and pullup disable code) to work with BCM2711: https://github.com/mcgurk/db9_gpio_rpi/blob/master/db9_gpio_rpi-1.2/db9_gpio_rpi.c
I used https://github.com/RPi-Distro/raspi-gpio/blob/master/raspi-gpio.c as example.
I didn't make pull request because I don't know how to detect BCM2711 in module. My fork assumes always BCM2711!
I made some kind of BCM detection from device tree and created pull request https://github.com/marqs85/db9_gpio_rpi/pull/10.
Pull request merged.
hi, thanx for this nice little gem. As I've now moved to a RPi 4 it took me a few hours to make db9_gpio_rpi working with my (simple) C64 Joystick.
Finally found that I need to set the pull-ups on some of the inputs, as they were not configured as such by default.
My (simple) solution: /etc/rc.local # this is needed, as automatic loading didn't work for some reason modprobe db9_gpio_rpi map=1,1
# RPi 4 needs this tweak as some inputs need explicit pullup # Joyport /dev/input/js0 raspi-gpio set 5 ip pu raspi-gpio set 6 ip pu raspi-gpio set 12 ip pu raspi-gpio set 13 ip pu raspi-gpio set 19 ip pu # Joyport /dev/input/js1 raspi-gpio set 17 ip pu raspi-gpio set 18 ip pu raspi-gpio set 27 ip pu raspi-gpio set 22 ip pu raspi-gpio set 23 ip pu [...]
You may add a note to the readme file. PS: Note that I've change the layout of the pins to be compatible with the BMC64 emulator.