Skip to content
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

stm32f405 has sdioio module as sdio #5344

Closed
jerryneedell opened this issue Sep 14, 2021 · 7 comments · Fixed by #5345
Closed

stm32f405 has sdioio module as sdio #5344

jerryneedell opened this issue Sep 14, 2021 · 7 comments · Fixed by #5345
Assignees
Milestone

Comments

@jerryneedell
Copy link
Collaborator

jerryneedell commented Sep 14, 2021

Was the name of sdioio changed to sdio recently? the docs still refer to it as sdioio but in the rc.1 build for the STM32F405, it shows up (and works) as sdio instead of sdioio.

Is this correct?

Adafruit CircuitPython 7.0.0-rc.1-72-g9b2d8ade2 on 2021-09-14; Adafruit Feather STM32F405 Express with STM32F405RG
>>> 
>>> help('modules')
__main__          board             math              sharpdisplay
_bleio            builtins          microcontroller   storage
adafruit_bus_device                 busio             micropython       struct
adafruit_pixelbuf canio             msgpack           supervisor
aesio             collections       neopixel_write    synthio
alarm             digitalio         onewireio         sys
analogio          displayio         os                terminalio
array             errno             pulseio           time
atexit            fontio            pwmio             touchio
audiocore         framebufferio     rainbowio         traceback
audiomp3          gc                random            ulab
audiopwmio        getpass           re                usb_cdc
binascii          io                rgbmatrix         usb_hid
bitbangio         json              sdcardio          usb_midi
bitmaptools       keypad            sdio              vectorio
Plus any modules on the filesystem
>>> 

this example works on the STM32F405

import os
import board
import sdio
import storage
import sys
sd = sdio.SDCard(clock=board.SDIO_CLOCK,command=board.SDIO_COMMAND,data=board.SDIO_DATA,frequency=25000000)
vfs = storage.VfsFat(sd)
storage.mount(vfs, '/sd')
sys.path.append("/sd")
sys.path.append("/sd/lib")
@jerryneedell jerryneedell added this to the 7.0.0 milestone Sep 14, 2021
@microdev1
Copy link
Collaborator

Good catch @jerryneedell. This change was introduced in 9002f35, it is probably a mistake.

@jerryneedell
Copy link
Collaborator Author

Good catch @jerryneedell. This change was introduced in 9002f35, it is probably a mistake.

Ah -- good -- I've been trying to find another port that has it enabled to compare, but have not found one yet. IT is in the "common-hal" for atmel-samd but it appears to be disabled in the build.

@jerryneedell
Copy link
Collaborator Author

jerryneedell commented Sep 14, 2021

Is it just this line

MP_REGISTER_MODULE(MP_QSTR_sdio, sdioio_module, CIRCUITPY_SDIOIO);

missing the "io" in the MP_QSTR_sdio

@microdev1
Copy link
Collaborator

Yup, that is the only line that needs to be changed.

- MP_REGISTER_MODULE(MP_QSTR_sdio, sdioio_module, CIRCUITPY_SDIOIO);
+ MP_REGISTER_MODULE(MP_QSTR_sdioio, sdioio_module, CIRCUITPY_SDIOIO);

@jerryneedell
Copy link
Collaborator Author

I can do a PR later today, but it may be a lot quicker for someone else to do it.

@jerryneedell jerryneedell self-assigned this Sep 14, 2021
@dhalbert dhalbert self-assigned this Sep 14, 2021
@dhalbert
Copy link
Collaborator

I just did a quick PR.

@jerryneedell
Copy link
Collaborator Author

Thanks -- it works!

dhalbert pushed a commit that referenced this issue Oct 16, 2021
Call MICROPY_EVENT_POLL_HOOK even on very short delays so that busy loops
that call sleep_ms still yield to events and other threads.

See related issue #5344.
dhalbert pushed a commit that referenced this issue Oct 16, 2021
So that other threads get a chance to run when taskYIELD() is called.

See issue #5344.

Signed-off-by: Damien George <damien@micropython.org>
dhalbert pushed a commit that referenced this issue Oct 16, 2021
This helps the OS switch to and give other threads processing time during
the sleep.  It also ensures that pending events are handled, even when
sleeping for 0ms.

Fixes issue #5344.

Signed-off-by: Damien George <damien@micropython.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants