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

Pin(Enum) __repr__ recursion when trying to report error in board pins. #947

Open
embedded-dev opened this issue Feb 26, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@embedded-dev
Copy link

embedded-dev commented Feb 26, 2025

Board Name

Raspberry Pico W

Steps

1 ) Install adafruit_blinka
2) mpremote
3) >>> import board
4) >>> import bus
5) >>y=busio(board.GP16, board.GP17)

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "lib/busio.py", line 28, in __init__
  File "lib/busio.py", line 36, in init
  File "lib/microcontroller/rp2040/i2c.py", line 26, in __init__
  File "lib/microcontroller/generic_micropython/__init__.py", line 25, in __repr__
  File "lib/microcontroller/generic_micropython/__init__.py", line 25, in __repr__
  File "lib/microcontroller/generic_micropython/__init__.py", line 25, in __repr__
  File "lib/microcontroller/generic_micropython/__init__.py", line 25, in __repr__
  File "lib/microcontroller/generic_micropython/__init__.py", line 25, in __repr__
  File "lib/microcontroller/generic_micropython/__init__.py", line 25, in __repr__
  File "lib/microcontroller/generic_micropython/__init__.py", line 25, in __repr__
  File "lib/microcontroller/generic_micropython/__init__.py", line 25, in __repr__
  File "lib/microcontroller/generic_micropython/__init__.py", line 25, in __repr__
  File "lib/microcontroller/generic_micropython/__init__.py", line 25, in __repr__
RuntimeError: maximum recursion depth exceeded

Description

In the above, the busio.I2C call the clock and data pins are reversed. Since there was no match in i2cPorts, the rp2040/I2C.__init__() is trying to use Pin(Enum).__repr__() to report the arguments. The Pin(Enum).__repr__() does not detect a match.

I looked into trying to provide a fix but I guess I don't understand how it is supposed to work.

Additional information

No response

@embedded-dev embedded-dev added the bug Something isn't working label Feb 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant