Skip to content

stm32: Implement sdioio, enable for feather stm32f405 express #3191

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

Merged
merged 14 commits into from
Aug 10, 2020

Conversation

jepler
Copy link

@jepler jepler commented Jul 23, 2020

No description provided.

@jepler jepler changed the title stm32: Implement sdioio, enable for feather stm32f405 exprewss stm32: Implement sdioio, enable for feather stm32f405 express Jul 23, 2020
@tannewt tannewt requested a review from hierophect July 23, 2020 17:38
Copy link
Collaborator

@hierophect hierophect left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like a good start! Found some debugging stuff that looks left behind, and I had some comments about the peripheral declaration - I don't think that having everything be an array is essential to the periph/ API when they're all just single index like that.

Beyond that, I'd like to understand better how the user actually declares SDIO in python, do you have an example sketch I can toy around with? I'm imagining it might be more practical to have everything constructed like board.I2C and board.SPI are, but maybe I'm off base with that.

@jepler
Copy link
Author

jepler commented Jul 23, 2020

Example usage:

import os
import board
import sdioio
import storage

sd = sdioio.SDCard(
    clock=board.SDIO_CLOCK,
    command=board.SDIO_COMMAND,
    data=board.SDIO_DATA,
    frequency=25000000)
vfs = storage.VfsFat(sd)
storage.mount(vfs, '/sd')
os.listdir('/sd')"""

@hierophect hierophect self-requested a review July 24, 2020 01:01
hierophect
hierophect previously approved these changes Jul 24, 2020
Copy link
Collaborator

@hierophect hierophect left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fixes. I've tested this on my Feather F405 and it's working great. I'm still a little iffy on the tuple in boards/pins.c just because it isn't a technique shared by other ports. @dhalbert or @tannewt, maybe you could give us a second opinion? If they have no objections then this looks good to me.

@jepler
Copy link
Author

jepler commented Jul 24, 2020

The data pins tuple is used in two places in atmel-samd: https://github.com/adafruit/circuitpython/blob/main/ports/atmel-samd/boards/same54_xplained/pins.c#L4

@jerryneedell
Copy link
Collaborator

jerryneedell commented Jul 24, 2020

Tested on my feather_stm32f405_express -- works!!
Successfully executed python script from an SDCard.

@ladyada
Copy link
Member

ladyada commented Jul 24, 2020

rad! thanks for testing :)

@hierophect
Copy link
Collaborator

The data pins tuple is used in two places in atmel-samd: https://github.com/adafruit/circuitpython/blob/main/ports/atmel-samd/boards/same54_xplained/pins.c#L4

Now why didn't that come up when I grepped for it? In that case I've got no issues.

jepler added 12 commits July 30, 2020 07:18
Currently, only the bus specs of the stm32f405xx have been coded.
Other stm-family chips need (at a minimum) the specs added in their
periph.[ch] files.
.. this probably came from the examples that I studied at the beginning
of implementation.

The card detection feature is unused.  As a "detect pin" is not
sent from the shared-bindings, there is no way to get the correct pin
anyway.  Instead, if code needs to detect the insertion state it can
directly use the pin as GPIO in Python code.
@jepler jepler requested review from hierophect and tannewt August 10, 2020 19:45
@jepler
Copy link
Author

jepler commented Aug 10, 2020

Can we get this merged quick while it isn't stuck on CI failures or translation conflicts?

@hierophect hierophect merged commit 78f90db into adafruit:main Aug 10, 2020
@hierophect
Copy link
Collaborator

Looks good to me, I don't see anything that should hold it up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants