Skip to content

Comments

STM32 SDMMC multiple block read/write support#3843

Merged
Dirbaio merged 1 commit intoembassy-rs:mainfrom
ost-ing:sdmmc-multiblocks
Apr 18, 2025
Merged

STM32 SDMMC multiple block read/write support#3843
Dirbaio merged 1 commit intoembassy-rs:mainfrom
ost-ing:sdmmc-multiblocks

Conversation

@ost-ing
Copy link
Contributor

@ost-ing ost-ing commented Feb 4, 2025

Hello, I have added multiple block read and write support for the STM32 SDMMC peripheral.

This essentially adds CMD18 (multiple block read), CMD25 (multiple block write) and CMD12 (stop transmission) and sets the transfer up correctly.

I've tested this on SDMMCv2 devices.

I've also updated the block_device_driver implementation so it now supports multiple block read/writes. I also believe there is a preexisting issue that the block_address does not take into consideration the partition start offset, but I'll wait for confirmation from someone before modifying that.

Please let me know what you think as this PR greatly improves the read/write speeds, I would love to see it merged asap.

Kind regards

@Dirbaio
Copy link
Member

Dirbaio commented Feb 7, 2025

can you fix CI?

@Dirbaio
Copy link
Member

Dirbaio commented Feb 23, 2025

@ost-ing if you want this merged, CI must be green.

To fix the rustfmt job, do cargo +nightly fmt.
To fix the build job, look at the output and fix the compiler errors. At the bottom of the job it tells you for which chip it's failing in case you want to reproduce it locally, in this case it's stm32f446re.

If you need help with anything please ask!

@ost-ing
Copy link
Contributor Author

ost-ing commented Feb 23, 2025 via email

@ost-ing
Copy link
Contributor Author

ost-ing commented Feb 24, 2025

@Dirbaio I've fixed the pipeline

@bluespider42
Copy link

bluespider42 commented Mar 3, 2025

I have been using almost the same code in my own project (STM32F411) for a while now (only the write_blocks function) without issue.

@ost-ing sorry for hijacking the pull request but I was hoping that some one with more knowledge than me might have some thoughts on this issue, as it's the main obstacle to sustained non-blocking SD operations.
#3540

@ost-ing
Copy link
Contributor Author

ost-ing commented Mar 18, 2025

I have been using almost the same code in my own project (STM32F411) for a while now (only the write_blocks function) without issue.

@ost-ing sorry for hijacking the pull request but I was hoping that some one with more knowledge than me might have some thoughts on this issue, as it's the main obstacle to sustained non-blocking SD operations. #3540

I've replied in the issue directly.

@Dirbaio Please let me know if there is anything else, I would like this merged soon if possible. Thanks!

@Dirbaio Dirbaio force-pushed the sdmmc-multiblocks branch from c4a2e8a to 34d647e Compare April 18, 2025 12:20
@Dirbaio
Copy link
Member

Dirbaio commented Apr 18, 2025

rebased it for you.

thanks for the PR :)

@Dirbaio Dirbaio force-pushed the sdmmc-multiblocks branch from 34d647e to eb83d04 Compare April 18, 2025 12:21
@Dirbaio Dirbaio added this pull request to the merge queue Apr 18, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Apr 18, 2025
@Dirbaio Dirbaio added this pull request to the merge queue Apr 18, 2025
Merged via the queue into embassy-rs:main with commit ca40dc7 Apr 18, 2025
7 checks passed
@ost-ing
Copy link
Contributor Author

ost-ing commented Apr 18, 2025

rebased it for you.

thanks for the PR :)

Thanks!

@ost-ing ost-ing deleted the sdmmc-multiblocks branch May 16, 2025 04:38
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.

3 participants