Skip to content
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

Raspberry Pi 5 - Toggling GPIOs disables I2C addresses. python toggle_line_value.py example : #121

Open
nickFridays opened this issue Jan 5, 2025 · 6 comments

Comments

@nickFridays
Copy link

nickFridays commented Jan 5, 2025

Hello,
Raspberry Pi 5 - Toggling GPIOs with gpiod disables I2C addresses

pi@pi:~ $ pinout
Description : Raspberry Pi 5B rev 1.0
Revision : d04170
SoC : BCM2712
RAM : 8GB
Storage : MicroSD
USB ports : 4 (of which 2 USB3)
Ethernet ports : 1 (1000Mbps max. speed)

pi@pi:~ $ uname -a
Linux pi 6.6.62+rpt-rpi-2712 #1 SMP PREEMPT Debian 1:6.6.62-1+rpt1 (2024-11-25) aarch64 GNU/Linux

pi@pi:~ $ gpiodetect
gpiochip0 [pinctrl-rp1] (54 lines)
gpiochip10 [gpio-brcmstb@107d508500] (32 lines)
gpiochip11 [gpio-brcmstb@107d508520] (4 lines)
gpiochip12 [gpio-brcmstb@107d517c00] (17 lines)
gpiochip13 [gpio-brcmstb@107d517c20] (6 lines)
gpiochip0 [pinctrl-rp1] (54 lines)

pi@pi:~ $ ls /dev/i2*
/dev/i2c-1 /dev/i2c-13 /dev/i2c-14
pi@pi:~ $ sudo raspi-config nonint get_i2c
0

@brgl
Copy link
Owner

brgl commented Jan 6, 2025

I'm pretty sure this is not a problem with libgpiod but a question that should be asked to the raspberry pi community? You're not saying which pin you're toggling, I would assume it either resets the i2c device or serves as some kind of GPIO mux? I don't know RPi 5 and don't have one.

@nickFridays
Copy link
Author

nickFridays commented Jan 6, 2025

I also hope it is not a problem with libgpiod because it is practically the only lib working with Pi 5, thanks to you.

@nickFridays nickFridays changed the title python toggle_line_value.py example : Toggling GPIOs disables I2C lines. Toggling GPIOs disables I2C addresses. python toggle_line_value.py example : Jan 6, 2025
@brgl
Copy link
Owner

brgl commented Jan 6, 2025

I don't know what BCM GPIO is. I don't work with Raspberry Pi. The example code is meant to be generic and show how to use the library. I cannot know which pin you actually want to toggle and what its function is.

@nickFridays
Copy link
Author

nickFridays commented Jan 6, 2025

Ok

@brgl
Copy link
Owner

brgl commented Jan 6, 2025

It's just an example. It will be pin 5 of chip whatever chip is represented on your system by the /dev/gpiochip0 character device. You need to adjust the code for your needs. From the output of gpiodetect I'd say it will be pin 5 of gpiochip0 [pinctrl-rp1] (54 lines) but you will really have more luck talking to the people who know this platform well.

@nickFridays
Copy link
Author

nickFridays commented Jan 6, 2025

Ok, thanks anyways for you quick response.

Resolved : Raspberry Pi -5 hardware issue. gpiod lib works fine with Raspberry Pi 4.

@nickFridays nickFridays changed the title Toggling GPIOs disables I2C addresses. python toggle_line_value.py example : Raspberry Pi 5 - Toggling GPIOs disables I2C addresses. python toggle_line_value.py example : Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants