Skip to content

timeout waiting for v2 card since 236dec0 "shorten SDCard SPI timeouts, ..." #10954

@bablokb

Description

@bablokb

CircuitPython version and board name

10.2.0-rc
Pico2

Code/REPL

import sdcardio
import storage
import busio
SD_MOSI = board.GP19
SD_SCK  = board.GP18
SD_MISO = board.GP16
SD_CS   = board.GP17

spi0 = busio.SPI(SD_SCK,SD_MOSI,SD_MISO)
sdcard = sdcardio.SDCard(spi0,SD_CS,1_000_000)
vfs    = storage.VfsFat(sdcard)
storage.mount(vfs, "/sd")

Behavior

Fails with "timeout waiting for v2 card"

Description

Reverting the timeout CMD_TIMEOUT_MS back to 500 from 250 fixes the issue. I did not change anything else, maybe this should be investigated further.

This is a normal 16GB SanDisk Ultra. I use many of these and never had any problems.

Additional information

Diff from the PR:

- #define CMD_TIMEOUT_MS (500)
- #define TIMEOUT_MS (500)
- #define SPI_TIMEOUT_MS (10000)
+ #define CMD_TIMEOUT_MS (250)
+ #define SPI_TIMEOUT_MS (250)
+ // Init ready timeout.
+ #define READY_TIMEOUT_MS (300)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions