Skip to content

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

Open
cathiele wants to merge 1 commit intopelrun:mainfrom
cathiele:windowssdcard
Open

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

Conversation

@cathiele
Copy link

@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

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.

1 participant