-
Notifications
You must be signed in to change notification settings - Fork 1.3k
mimxrt10xx: Implement sdioio, define pins for Teensy 4.1 #4020
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
Comments
We don't yet support sdioio on the mimxrt10xx series. We'd be happy to see someone contribute an implementation to the core. |
@jepler The pins are already defined. You'll find that in the board link I posted above for the pin definitions, already in the port for it. You have the framework already done. Sadly, the build instructions for python and adding a new board don't tell me how to include the sdioio library in the build process to have it compile with it, and since the library is in the shared-bindings list and only in cpython, there's no instructions for just building that library to test. If you'd be so kind as to provide details on the correct process to do this part I'd appreciate it. The response also doesn't address my other questions regarding the documentation and implementation of multiple data pins, or the library itself. Please review my above requests and let me know. |
An implementation of the feature is needed down in ports/mimxrt10xx/common-hal/sdioio. It would be similar in scope to this PR which added support for stm32f405: #3191 with the bulk of the code being https://github.com/adafruit/circuitpython/blob/main/ports/stm/common-hal/sdioio/SDCard.c The underlying APIs and/or hardware registers for mimxrt10xx are different than those for stm32, so while that code is a good reference for what functions need to be implemented it's not a great guide to how to implement it for this other MCU family. When I say the pins should be defined, I mean that the board's pin file needs additions similar to these two bits of code in
|
Please - somebody implement sdioio lol - I really need it for my project |
a patch for folks who don't want to wait, latest builds fix bitbangio and you can read/write the SD card with SPI!
|
Hi ladyada,
and it gives me: [Errno 5] Input/output error. What am I missing? |
I also have the exact same problem, I can't get the code to write or append, it gives me the same problem |
I was excited to find Lady Ada's 'fix' back in May, and I'm trying to implement this too! I still can't use the SD card on my Teensy 4.1. I used Lady Ada's code, copied some files to the SD card on my PC, and it works, it does print the directory of the SD card. when it gets to this code: with open("/sd/test.txt", "w") as f: Please help! |
@Ask314 @electric1236 @cpasto I'm not sure if some work has been done on the libraries or core that might have impacted this in the last year, but I built the latest 8.0.0 CP bits for the Teensy 4.1 and was able to use Lady Ada's code to write to the SD card using:
With no issues. |
On the Teensy 4.1 Version 6 circuitpython, the wrong SD card interface is built in:
https://circuitpython.org/board/teensy41/
The builtin interface is for SDcardio. However, the SDcard is actually handled by SDIOIO interface, not SPI for the onboard SDcard slot. i'd suspect given the teensy 4.0's pinout it'd work the same if the pins referenced there are tied to the same ones on the chip.
defined in the port pin map of github/circuitpython for verification of sdioio:
https://github.com/adafruit/circuitpython/blob/main/ports/mimxrt10xx/boards/teensy41/pins.c
defined on the pjrc pinout, matches the pins.c of the port/board:
https://www.pjrc.com/store/teensy41.html#pins
Following the directions here, SDIOIO when iimported states no module. I used the unaltered sample code from the directions here:
https://learn.adafruit.com/adafruit-microsd-spi-sdio/using-sdioio
I attempted to locate the library in the circuitpython 6 library file, but it's not included here:
https://circuitpython.org/libraries
Is there a way to get this fixed, or download the SDIOIO library?
As another side note, the Teensy 4.1 uses all 4 data pins for the SDcard. The "read the docs" references 4 can be used, but its not very clear as to how:
https://circuitpython.readthedocs.io/en/6.0.x/shared-bindings/sdioio/index.html?highlight=sdioio
I can't find anything on "Sequence" in the docs to explain how to properly use this. i'm assuming it's actually a tuple based on the example referenced above, so it'd need to be entered as (....,Data=[board.DAT1,board.DAT2.(etc)...)
The text was updated successfully, but these errors were encountered: