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

esp32s2: spi (and other peripherals?) don't claim pins properly #3715

Closed
jepler opened this issue Nov 18, 2020 · 7 comments · Fixed by #3754
Closed

esp32s2: spi (and other peripherals?) don't claim pins properly #3715

jepler opened this issue Nov 18, 2020 · 7 comments · Fixed by #3754
Assignees
Labels
bug espressif applies to multiple Espressif chips help wanted
Milestone

Comments

@jepler
Copy link
Member

jepler commented Nov 18, 2020

I noticed that it was possible to create a DigitalIO from some pin while the pin was already in use by an SPI instance:

>>> spi = busio.SPI(board.IO0, board.IO1, board.IO2)
>>> import digitalio
>>> pin = digitalio.DigitalInOut(board.IO0)
>>> pin
<DigitalInOut>

tested on a kaluga with a 6.1-ish firmware

@jepler jepler added bug help wanted espressif applies to multiple Espressif chips labels Nov 18, 2020
@tannewt tannewt added this to the 6.1.0 milestone Nov 18, 2020
@microdev1
Copy link
Collaborator

I can confirm this bug to be present on other peripherals and not just related to spi.

@hierophect
Copy link
Collaborator

Almost certainly related to #3643

@hierophect
Copy link
Collaborator

Actually, looks like I misread - the reset problem will cause conflicts pins that have been released, but it shouldn't allow pins in the claimed array to be claimed again. This could be an issue with the bit shifting in the pin claiming system.

@hierophect
Copy link
Collaborator

@microdev1 can you point out specific modules where you have also had this problem? Turns out this was just that the SPI module didn't have pin claiming in it. The other Busio modules have it, as does DigitalIO and AnalogIO, but if you've encountered it elsewhere I can fold a fix into my PR.

@microdev1
Copy link
Collaborator

@hierophect I am able to see this on basically all of the io modules.

repl-test

@microdev1
Copy link
Collaborator

Update... Pin claiming seems to work until IO7 after which pins aren't claimed properly.

@hierophect
Copy link
Collaborator

@microdev1 found it, it was a variable size issue with in pin claiming mask operations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug espressif applies to multiple Espressif chips help wanted
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants