Skip to content

Experimental implementation of SD-Card UHS-I for FileSystem-component.#85

Open
stullanderpeak wants to merge 2 commits into
ARM-software:mainfrom
stullanderpeak:uhs-i
Open

Experimental implementation of SD-Card UHS-I for FileSystem-component.#85
stullanderpeak wants to merge 2 commits into
ARM-software:mainfrom
stullanderpeak:uhs-i

Conversation

@stullanderpeak

Copy link
Copy Markdown

As Gunnar has communicated with Ralf, we at Peak-System Technik have made an experimental implementation of SD-Card UHS-I speed in the FileSystem-component of the MDK-Middleware.

The implementation is tested on the MIMXRT1176-EVK evaluation board. Currently, our main issue is that we don't have access to an official CMSIS-compatible MCI driver for this microcontroller. For testing, we are using a modified version of the MCI_iMXRT1064-driver. I think we could be able to share this as well, if this is of interest?

@VladimirUmek

Copy link
Copy Markdown
Collaborator

Hi,
many thanks for prividing your implementation. I'll definitively review it and check the SD/eMMC specifications to figure out how could this be integrated to better support UHS devices.

I can't quickly access documentation for IMXRT1176 - does this device use the same uSDHC controller as IMXRT1064? I assume it does and therefore the driver would be the same as for IMXRT1060 and IMXRT1050 family. The driver for these families could be updated and you can continue to use it on RT1170 as well. If you wish to share the modifications to the MCI_iMXRT1064 driver, you can do so by providing a PR to the NXP_IMXRT1050-EVKB_BSP repository (because I don't think there is one for RT1064). It will be reviewed.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds experimental SD-card UHS-I initialization support to the FileSystem component’s MCI (native-mode) path, aiming to enable higher-speed signaling (including 1.8V switching and UHS speed modes) on supported hardware/driver combinations.

Changes:

  • Adds a CMD11 (voltage switch) helper and invokes it during SD power-up when the card reports S18A.
  • Extends SD CMD6 handling to attempt UHS-I speed modes (SDR104/SDR50) ahead of SDR25, including a tuning operation hook for SDR104.
  • Selects UHS SDR25 bus speed mode when the card is UHS-I and the driver supports UHS signaling.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +1518 to +1526
int32_t stat = 0;
uint32_t arg = 0;
uint32_t r1[4];
stat = mc->Driver->SendCommand(MC_CMD_VOLTAGE_SWITCH, arg, ARM_MCI_RESPONSE_SHORT, r1);
if (stat == ARM_DRIVER_OK) {
// Wait for event
mc_wfe(MC_CMD_EVENTS, mc);
if ((mc->Event & MC_CMD_EVENTS) == ARM_MCI_EVENT_COMMAND_COMPLETE) {
stat = mc->Driver->Control(ARM_MCI_BUS_SPEED_MODE, ARM_MCI_BUS_UHS_SDR12);
}
}
}
EvrFsMcMCI_SendCommandError (mc->Instance, MC_CMD_SEND_OP_COND, arg);
Comment on lines +1837 to +1841
mc->Driver->Control(ARM_MCI_UHS_TUNING_OPERATION, 1);
while (mc->Driver->Control(ARM_MCI_UHS_TUNING_RESULT) == 1) {
// Is the middleware now responsible for feeding CMD19, or should this be handled
// automatically by the driver?
}

if (mc_switch_func (sw_arg, mc->ExtCSD, mc) == 0) {
// Check if SDR104 support bit is set
if (mc->ExtCSD[13] & (1U << CMD6_ACCESS_MODE_SDR104)) {
}
}
// Check if SDR50 support bit is set
else if (mc->ExtCSD[13] & (1U << CMD6_ACCESS_MODE_SDR50)) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

5 participants