stanford-ssi / pycubed-software

Example code demonstrating routine cubesat functions
0 stars 0 forks source link

SD card initialization error #1

Open polygnomial opened 3 years ago

polygnomial commented 3 years ago

Summary

Seeing weird devious when initializing an SDCard object. I've observed this on CP 6.2 and 7.0 Alpha 1 on PyCubed boards with J19 + MRAM and J20 + Flash.

spi = busio.SPI(board.SCK, board.MOSI, board.MISO)
cs = digitalio.DigitalInOut(board.xSDCS)
sdcard = adafruit_sdcard.SDCard(spi, cs)

produces this output:

Adafruit CircuitPython 6.2.0-dirty on 2021-05-03; PyCubedv04 with samd51j20
>>> from pycubed import cubesat
[(0, 0, 0, 0)]
[ERROR][SD Card] 'SPIDevice' object has no attribute 'spi'
[ERROR][RADIO 1] Failed to find rfm9x with expected version -- check wiring
[ERROR][RADIO 2] Failed to find rfm9x with expected version -- check wiring
>>> 

I've switched to using the pure python version of the adafruit_sdcard library and the adafruit_bus_device library for debugging. Weirdly, I cannot seem to change the behavior of either module by adding print statements (or junk code).

polygnomial commented 3 years ago

This issue might be helpful: https://github.com/adafruit/circuitpython/issues/4108