Closed jfabernathy closed 3 years ago
I also get this error on ESP32-S2 Metro using adafruit-circuitpython-adafruit_metro_esp32s2-en_US-20210203-adaf43d and latest libraries
@jfabernathy Can you set it to this and try it? (In adafruit_sdcard.py
)
self._spi.spi.configure(baudrate=250000)
Thanks for testing this!
I'm going to need a little help the adafruit_sdcard I have is the one in the bundle which is a mpy version. Where to I get the .py version?
Use the second button here : https://circuitpython.org/libraries
Or go to the actual repository https://github.com/adafruit/Adafruit_CircuitPython_SD
So I got adafruit_sdcard.py and just put that in the CIRCUITPY/lib directory on the ESP32S2 and changed to self._spi.spi.configure(baudrate=250000)
Now I'm getting another error.
File "code.py", line 18, in <module>
File "/lib/adafruit_sdcard.py", line 101, in __init__
File "/lib/adafruit_sdcard.py", line 122, in _init_card
File "/lib/adafruit_sdcard.py", line 112, in _clock_card
AttributeError: 'SPIDevice' object has no attribute 'chip_select'
@jfabernathy try commenting line 112 out. The pin should already be high
with adafruit/circuitpython#112 commented out in adafruit_sdcard.py
line 18 in demo program, sdcard = adafruit_sdcard.SDCard(spi, cs)
still give this error
File "code.py", line 18, in <module>
File "/lib/adafruit_sdcard.py", line 101, in __init__
File "/lib/adafruit_sdcard.py", line 166, in _init_card
AttributeError: 'SPIDevice' object has no attribute 'chip_select'
Ok, looks like sdcard takes in the chip select so it should just remember it.
I will work on fixing this in the library.
After adafruit/circuitpython#4114 was closed, I tested a Pico with adafruit-circuitpython-raspberry_pi_pico-en_US-20210202-9140bfb.uf2 and the latest library bundle as 20210203. I modified the pin numbers in the demo and it still draws an error:
Traceback (most recent call last): File "code.py", line 23, in <module> File "adafruit_sdcard.py", line 101, in __init__ File "adafruit_sdcard.py", line 122, in _init_card File "adafruit_sdcard.py", line 111, in _clock_card AttributeError: 'SPIDevice' object has no attribute 'baudrate'
My modified demo code is attached: code.txt