drivers: disk: sdmmc_stm32: Fix bus width initialization sequence #94895
+18
−10
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix SDMMC initialization by starting with 1-bit bus mode and properly configuring wide bus operation after HAL
initialization.
The SDMMC protocol requires initialization to start in 1-bit mode before switching to wider bus widths.
Previously, the driver attempted to initialize directly with the target bus width, which could cause later read/write failures.
Changes:
Fixes potential SDMMC read/write failures issues on STM32 platforms.
before this change tested on stm32H743:
with
zephyr/tests/drivers/disk/disk_access
dts:
with 1 line bus width ( bus-width = <1>)
with 4 line bus width ( bus-width = <4>)
after this change tested on stm32H743:
with 4 line bus width ( bus-width = <4>)