Thanks for your support.
New to MicroPython and building the software in general, so please excuse my ignorance.
I'm trying to build MicroPython to add support on my STM32F4DISC (new blue version) for Adafruit's newer SDIO breakout ( https://www.adafruit.com/product/4682 ).
I'm following this gentlemen's blog on how to add the definitions to enable SDcard support for the discovery board.
http://www.kaltpost.de/?p=2199
Specifically, he calls for making the following definitions:
#define MICROPY_HW_HAS_SDCARD (1)
// SD card detect switch
#define MICROPY_HW_SDCARD_DETECT_PIN (pin_A8)
#define MICROPY_HW_SDCARD_DETECT_PULL (GPIO_PULLUP)
#define MICROPY_HW_SDCARD_DETECT_PRESENT (GPIO_PIN_RESET)
And then with respect to wiring, the following:
SD-Card STM32F4-Discovery
-------------------------------
1 SDIO_D3 PC11
2 SDIO_CMD PD2
3 VSS GND
4 VDD 3V
5 SDIO_CLK PC12
6 SDIO_SW PA8
7 SDIO_D0 PC8
8 SDIO_D1 PC9
9 SDIO_D2 PC10
Unfortunately, after defining the changes, building and flashing the .DFU, I'm unable to perform any I/O to the SDCARD. Getting:
Code: Select all
>>> f = open("/sd/tryagain.txt", "w")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OSError: [Errno 19] ENODEV
https://learn.adafruit.com/adafruit-mic ... io/pinouts
The other thing that caught my attention is the following taken from the pinout page:
Based on the above, I wondered if the following was causing me issues:Common Logic Pins
DET - Detect whether a microSD card is inserted. This pin is connected to GND internally when there's no card, but when one is inserted it is pulled up to 3V with a 4.7kΩ resistor. That means that when the pin's logic level is False there's no card and when it's True there is.
#define MICROPY_HW_SDCARD_DETECT_PULL (GPIO_PULLUP)
So I changed it to:
#define MICROPY_HW_SDCARD_DETECT_PULL (GPIO_NOPULL)
However, that didn't seem to help.
Does anyone have any ideas on what might be the problem?
Also, can someone tell me how I can confirm the following pin out definitions that I wired are the expected MicroPython PINs for SDIO?
SD-Card STM32F4-Discovery
-------------------------------
1 SDIO_D3 PC11
2 SDIO_CMD PD2
3 VSS GND
4 VDD 3V
5 SDIO_CLK PC12
6 SDIO_SW PA8
7 SDIO_D0 PC8
8 SDIO_D1 PC9
9 SDIO_D2 PC10
Thank you so much for reading!