Skip to content

fix: sdcard-access is working from bootloader with windows and macos#20

Merged
pelrun merged 1 commit intopelrun:mainfrom
cathiele:windowssdcard
Feb 21, 2026
Merged

fix: sdcard-access is working from bootloader with windows and macos#20
pelrun merged 1 commit intopelrun:mainfrom
cathiele:windowssdcard

Conversation

@cathiele
Copy link
Copy Markdown

@cathiele cathiele commented Feb 5, 2026

I noticed that SD card access from Linux works fine, but macOS and Windows 11 do not work correctly.

This is caused by the slow read_i2c_kbd() and read_battery() implementations. The sleep_ms(16) calls in these functions result in tud_task() being called too infrequently, preventing Windows from receiving USB responses in time.
I fixed this by replacing sleep_ms(16) with a loop that calls sleep_us(500) 32 times while calling tud_task() within the loop, ensuring timely USB communication.

I only tested it on a pico2w

@pelrun
Copy link
Copy Markdown
Owner

pelrun commented Feb 11, 2026

facepalm

Thanks for chasing that down!

@pelrun pelrun merged commit a46d190 into pelrun:main Feb 21, 2026
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 this pull request may close these issues.

2 participants