PaulStoffregen / SD

70 stars 41 forks source link

Fix cardPresent for SDIO on T3.5/T3.6 #36

Closed KurtE closed 2 years ago

KurtE commented 2 years ago

@PaulStoffregen @mjs513

Was running into issues, where some commands to SDIO may leave the SD bit CDIHB on and new commands will be rejected, such as our call here, which I called as the next thing after SD.begin() or restart...

There is function transferStop: This fix allows CDIHB to be cleared in Tennsy 3.x without a reset.

The sync call makes sure any pending transfers complete and then cancels either multi sector read mode or mult sector write mode...

This appears to help.

Will next integrate this with code that hopefully speeds up the T4.x

More on the integration thread.,

KurtE commented 2 years ago

@PaulStoffregen @mjs513 @defragster

I also now added the looking at DAT3 pin on T4.x to quickly detect that an sdcard has not been inserted yet... So far testing on T4.1. Will check micromod and T4 soon.

Did not update the T3.5/6 part yet as they were not consistently working when I tried it yesterday, although that was before I figured out about the sync stuff...