Skip to content

STM: displayio interfering with sdio? Also sdio clock speed not settable #7404

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

Open
dhalbert opened this issue Jan 1, 2023 · 1 comment
Open
Milestone

Comments

@dhalbert
Copy link
Collaborator

dhalbert commented Jan 1, 2023

CircuitPython version

8.0.0-beta.6

Code/REPL

import board
import sdioio
import storage
import time
import displayio
import adafruit_displayio_sh1107

i2c = board.I2C()
displayio.release_displays()
display_bus = displayio.I2CDisplay(i2c, device_address=0x3C)
display = adafruit_displayio_sh1107.SH1107(display_bus, width=128, height=64)

sdcard = sdioio.SDCard(
    clock=board.SDIO_CLOCK,
    command=board.SDIO_COMMAND,
    data=board.SDIO_DATA,
    frequency=2500000)
print(f"{sdcard.frequency=}")

vfs = storage.VfsFat(sdcard)

storage.mount(vfs, "/sd")

with open( "/sd/test.txt", "w" ) as f:
    f.write( "year, month, day, batch\n" )
    f.write( "2022, 12, 30, 0\n" )

with open("/sd/test.txt", "r") as f:
    print("Printing lines in file:")
    print()
    line = f.readline()
    while line != '':
        print(line)
        line = f.readline()
        print()

Behavior

OSError: [Errno 5] Input/output error

If the display = line is commented out, it works.

Description

No response

Additional information

Reported in https://forums.adafruit.com/viewtopic.php?p=954144
Seems related to #6082, which does not use displayio.

Another odd thing is that setting frequency= seems to have no effect, as noted by the print() in the test program.

@dhalbert dhalbert added this to the 8.x.x milestone Jan 1, 2023
@dhalbert
Copy link
Collaborator Author

Maybe similar code in i.MX as well

@dhalbert dhalbert modified the milestones: 8.x.x, Long term Apr 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant