Experimental implementation of SD-Card UHS-I for FileSystem-component.#85
Experimental implementation of SD-Card UHS-I for FileSystem-component.#85stullanderpeak wants to merge 2 commits into
Conversation
|
Hi, 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. |
There was a problem hiding this comment.
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.
| 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); |
| 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)) { |
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?