Closed anecdata closed 3 years ago
Oh, I guess sdcardio
is the way to go now. Easy swap. Is this library deprecated, or are there advantages to using it over sdcardio
?
This is failing because CircuitPython 6.1.0-beta.2 includes https://github.com/adafruit/circuitpython/pull/3612, which moves adafruit_bus_device
to a native module. That module does not provide properties to replicate SPIDevice.spi
and similar attributes, which are set by the Python version. We should think about whether there is a lot of code that depended on those properties, and whether that code is "wrong" and should be fixed.
Looks like SD is the only bundle library with this particular construction, not sure what other patterns would break drop-in replacement of adafruit_bus_device
library with native:
$ egrep -r 'spi\.spi' adafruit-circuitpython-bundle-py-20201205
adafruit-circuitpython-bundle-py-20201205/lib/adafruit_sdcard.py: while not self._spi.spi.try_lock():
adafruit-circuitpython-bundle-py-20201205/lib/adafruit_sdcard.py: self._spi.spi.configure(baudrate=self._spi.baudrate)
adafruit-circuitpython-bundle-py-20201205/lib/adafruit_sdcard.py: self._spi.spi.write(self._single_byte)
adafruit-circuitpython-bundle-py-20201205/lib/adafruit_sdcard.py: self._spi.spi.unlock()
adafruit-circuitpython-bundle-py-20201205/lib/adafruit_sdcard.py: self._spi.spi, self._spi.chip_select, baudrate=baudrate, extra_clocks=8
We believe this was fixed in the core. Please feel free to re-open if it affects 6.1.0 or 6.2-alpha.
Adafruit PyPortal with samd51j20 6.1.0-beta.2 on 2020-12-03 adafruit-circuitpython-bundle-6.x-mpy-20201202
The SD part of my code has been stable for ages, but updating from CircuitPython 6.0.0 to 6.1.0-beta.2 triggers this error (trace shown here after running the library simpletest example):