Search by Tags

Colibri PXA SD card interface

 

Compare with Revision




Subscribe for this article updates

The SD card interface can be disabled in Registry: Disable the SDCard driver.

Changing Card Detect Pin

The card detect GPIO pin number or its polarity can be changed by adding the following values to the registry:

[HKEY_LOCAL_MACHINE\Drivers\BuiltIn\SDHC]
"CardDetectGPIO" = dword:X   ; X = the number of the GPIO. -1 means no CD pin ->fix inserted card.
"CardDetectPol" = dword:Y    ; Y = active polarity, 0: GPIO is low if card is available, 
                             ;                      1: pin is high if card is available.

Using WriteProtect GPIO

The SDCard driver supports WriteProtect feature from WinCE 5/6 V3.4Beta 2 and higher.

[HKEY_LOCAL_MACHINE\Drivers\BuiltIn\SDHC]
"WPGPIO" = dword:X           ; X = the number of the GPIO used for write-protect; Special values: 
                             ;      -1 = No write-protect, -2 = Always write-protected
"WPPol" = dword:Y            ; Y = active polarity, 0: GPIO is low if card is write-protected, 
                             ;                      1: GPIO is high if card is write-protected.

Using Power GPIO

The SDCard driver supports a Power switching feature from WinCE 5/6 V4.2 and higher. A GPIO can be used to disable the power of an SDIO device when going into suspend and enable it again when resuming from suspend.

[HKEY_LOCAL_MACHINE\Drivers\BuiltIn\SDHC]
"VddCtrlGPIO" = dword:X   ; X = number of the GPIO. Default: -1 means no power pin
"VddCtrlPol"  = dword:Y   ; Y = active polarity, 0: Power enable on level 0 
                          ;                      1: Power enable on level 1 (default)

SD Card GPIO Assignment

This is valid for Image V3.3 beta 1 and newer.

You can choose the GPIO assignment on the Colibri PXA320, PXA310, and PXA300 (XT).

[HKEY_LOCAL_MACHINE\Drivers\BuiltIn\SDHC]
"GPIOClk" = dword:GPIONumber
"GPIOCmd" = dword:GPIONumber
"GPIODat0" = dword:GPIONumber
"GPIODat1" = dword:GPIONumber
"GPIODat2" = dword:GPIONumber
"GPIODat3" = dword:GPIONumber

If you would like to use the 2nd SDIO Card interface, you must define these registry settings.

Take a look at the PXA Datasheet to find out where the GPIOs for the SDIO card interface are available.

Multiple SD Card interfaces

The Colibri PXA320, PXA300 (XT) and PXA310 support up to 2 SD Card interfaces. This feature is supported in Toradex WinCE image V3.3Beta1 and newer.

The Colibri PXA270 has only one SD Card interface but you can connect an additional SD Memory card over the SSP interface.

To activate the second SD card interface on a Colibri PXA3xx:

  1. Create a Registry Key [HKEY_LOCAL_MACHINE\Drivers\BuiltIn\SDHC_1]
  2. Copy the settings from the existing SD interface SDHC
  3. Define respectively change all GPIOs for SDHC_1 as described in the section above:
  4. Add the following registry values:
[HKEY_LOCAL_MACHINE\Drivers\BuiltIn\SDHC_1]
"Index"     = dword:1            ; Used for Toradex WinCE image version 3.4Beta1 and lower 
                                 ; (delete this value if present for 3.4Beta2 and higher!)
"SDHCIndex" = dword:1            ; Used for Toradex WinCE image version 3.4Beta2 and higher
"DLL"       = "colibri_sdhc.dll"
"Prefix"    = "SDH"

Drive Strength and Slew Rate

This is valid for Image V3.3 and newer.

You can change the drive-strength and slew-rate of the SDIO signals on the Colibri PXA320, PXA310, and PXA300 (XT).

[HKEY_LOCAL_MACHINE\Drivers\BuiltIn\SDHC]
"sdds" = dword:value
   ;Valid Values are:
   ;Value  Slew-Rate  Drive-Strength
   ;0      FAST       1mA
   ;1      FAST       2mA
   ;2      FAST       3mA
   ;3      FAST       4mA
   ;4      SLOW       6mA
   ;5      FAST       6mA
   ;6      SLOW       10mA
   ;7      FAST       10mA (default)

Clock Speed Settings

This feature is available in Images V3.4 beta 2 and newer.

SD card clock frequency can be limited to a maximum value - this can be useful for debugging purposes. The actual used frequency will be lower than MaximumClockFrequency. The minimum clock frequency is 300kHz.

Setting the ClockTolerance to any value >0 can be used to overclock SD cards. Since the PXA is only able to provide certain frequencies, it might be possible that your card is 25MHz capable but the PXA uses 19.5MHz. The next supported frequency is 26MHz so just add a ClockTolerance of 1MHz and the Colibri also allows 26MHz (SD card overclocking).

[HKEY_LOCAL_MACHINE\Drivers\BuiltIn\SDHC]
"MaximumClockFrequency" = dword:01298be0  ; Maximum SD card clock (Hz). Default is 19,500,000 for PXA270/320,
                                          ; 26,000,000 for PXA300 (XT)/310.
"ClockTolerance"        = dword:value     ; value in Hz, default is 0Hz (feature disabled)

Miscellaneous settings

Several settings to control the SD interface.

[HKEY_LOCAL_MACHINE\Drivers\BuiltIn\SDHC]
"UseDMA" = dword:1      ; 1: use DMA for data transfer (default), 0: don't use DMA.
"BusWidth" = dword:4    ; 4: Use 4 bit mode if possible , 1: Force 1 bit mode.