Skip to content

i2c is not unlocked with soft reset on 6.2.0 #4786

Closed
@kevinjwalters

Description

@kevinjwalters

On 6.2.0 on a Feather nRF52840 Express using the singleton from board.I2C():

Press any key to enter the REPL. Use CTRL-D to reload.

Adafruit CircuitPython 6.2.0 on 2021-04-05; Adafruit Feather nRF52840 Express with nRF52840
>>> import board
>>> i2c = board.I2C()
>>> i2c.try_lock()
True
>>> ["{:2x}".format(x) for x in i2c.scan()]
[' 8', '23', '76']
>>> ["{:02x}".format(x) for x in i2c.scan()]
['23', '76']
>>> ["{:02x}".format(x) for x in i2c.scan()]
['23', '76']
>>>  ### Control-D here then Control-C after that to interrupt
soft reboot

Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.

code.py output:
Traceback (most recent call last):
  File "code.py", line 40, in <module>
  File "/lib/pimoroni_pms5003/__init__.py", line 167, in <module>
  File "/lib/pimoroni_pms5003/__init__.py", line 189, in PMS5003
KeyboardInterrupt:

Code done running.

Press any key to enter the REPL. Use CTRL-D to reload.

Adafruit CircuitPython 6.2.0 on 2021-04-05; Adafruit Feather nRF52840 Express with nRF52840
>>> import board
>>> i2c = board.I2C()
>>> i2c.try_lock()
False
>>> i2c.try_lock()
False
>>> i2c.try_lock()
False
>>> i2c.unlock()
>>> i2c.try_lock()
True
>>> ["{:02x}".format(x) for x in i2c.scan()]
['23', '76']
>>> i2c.unlock()

Similar theme to #3266

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions