WEC2013/Colibri IMX&: SD card errors

We are currently investigating SD card communication issues on our platform PalControl based on Windows Embedded Compact 2013 and on the Colibri iMX6 BSP.

The currently used “Transcend 4 GB SDHC Class 10” cards will only be available for a limited time (~6 months) and we are looking for a replacement. We found that
4 GB SD cards are not available anymore in high volumes. Therefore we need to use SD with higher capacity. We are testing SD Card from different vendors with different capacities.

During testing we found that “Intenso 32 GB SD Card Class 10” with a 32GB FAT32 partition does not work and over serial output error " SD – Data error!!" is shown after SD card is plugged in.

I used following command to identify which dll the error message is writing:

( please note that strings.exe comes from Strings - Sysinternals | Microsoft Learn )

strings.exe -u -n 5 usdhc.dll | findstr /i “Data error”

It is this dll: OS_WEC2013\WINCE800\platform\Colibri\FILES\usdhc.dll

But it seems that I don’t have the source code for usdhc.dll. I found following locations
in my repository, but I could locate the code which writes "SD – Data error!! ":

WINCE800/platform/iMX6Q_SABRE_Lite/SRC/CSP/IMX/USDHC/usdhc.cpp
WINCE800/platform/iMX6Q_SABRE_Lite/SRC/BOOTLOADER/COMMON/usdhc.c
WINCE800/platform/iMX6Q_SABRE_Lite/SRC/DRIVERS/USDHC/bspusdhc.cpp

Could you please provide:

  • The source file and function containing this message.
  • Information on how to obtain the source code for the USDHC driver used in the Colibri iMX6 WEC2013 BSP.

My goal is to better understand the root cause of SD card failures observed with specific SD card types and capacities.

Could you please provide a few more details about your setup?

  • Which WEC2013 BSP version are you using?
  • Please enable debug messages on the UART console and collect the full log up to the point where the SD – Data error!! message appears.

The message you mentioned appears to come from the CUSDHCBase::HandleTransferComplete() function, but it is not yet clear at which stage this function is being invoked.

The debug UART log should help us better understand the sequence of events leading to the error. It would be very helpful if you could enable SDCARD_ZONE_FUN and SDCARD_ZONE_INIT debug messages and then collect the full UART log up to the point where the error occurs.

The source code can be obtained from the WEC2013 Platform Builder installation. Since this is Microsoft-licensed source code and is not publicly open-source, we cannot share it directly here.

Have you tried using a smaller SD card, for example 8 GB or 16 GB?

Which WEC2013 BSP version are you using?

We are using BSP 1.3 (imx6_wince8bsp_1.3-20180309.zip).
To determine the BSP version, I downloaded all BSPs from iMX6 WinCE8 BSP and calculated the SHA-256 hash of TORADEXIMX6BIN8.pbcxml. The result is
4C294A7CAFAA14AA383CA62E15EACBA217C8AC0F2604DDF636BB7832B3310555,
which matches the file in our repository OS_WEC2013.

As far as I know, the BSP version is not stored anywhere inside imx6_wince8bsp_1.3-20180309.zip.


Please enable debug messages on the UART console and collect the full log up to the point where the “SD – Data error!!” message appears.

Yes, I enabled debug messages. The log file debug_log.txt
debug_log.txt (12.1 KB) is attached.


Enable SDCARD_ZONE_FUN and SDCARD_ZONE_INIT debug messages and then collect the full UART log up

As far as I know to configure debug zone, my platform builder needs to connect my device over KITL, which can only be used if platform builder and device runs in the same network segment.
But my platform builder runs in a virtual machine. So I am going to setup a dedicated PC with windows 10, install platform builder on it and directly connect it over switch with my device. Hopefully this should allow me to use debug zones.


Have you tried using a smaller SD card (e.g. 8 GB or 16 GB)?

Yes, we successfully tested SD cards of 8 GB, 16 GB, and 32 GB.
The only model that does not work is the Intenso 32 GB Class 10.

I also tested with FAT32-partitions of size 32GB, 16GB and 8GB but it doesn’t make a difference.

I still need to fully investigate this issue, as we must support our product for the coming years. It is becoming increasingly difficult to source SD cards, as manufacturers are shifting production towards AI chips.


Path inside WEC2013 Platform Builder

Could you please provide the path to the source code of usdhc.dll within the WEC2013 Platform Builder installation?
This would allow me to integrate it into our WEC2013 OS and add additional error logging.

Based on the available documentation, I can provide some guidance regarding your SD card communication issues on the Colibri iMX6 with WEC2013.

BSP Version and Source Code Access

You are using BSP 1.3 for WEC2013, which you correctly identified through hash comparison(1). The USDHC driver source code is part of the Microsoft Platform Builder installation and is not publicly available as open-source code due to Microsoft licensing restrictions. The source files you mentioned are indeed part of the Platform Builder workspace structure(1).

For the WEC2013 Platform Builder workspace, you can download it from the official Toradex software repository(1). The workspace files contain references to the BSP components, but the actual Microsoft-licensed source code comes from your Platform Builder installation.

SD Card Compatibility Considerations

Your observation about the Intenso 32 GB Class 10 card failing while other 8 GB, 16 GB, and 32 GB cards from different manufacturers work suggests this may be a card-specific compatibility issue rather than a capacity limitation.

The “SD – Data error!!” message you’re seeing typically indicates a data transfer error during SD card communication. This can be caused by:

  • Timing issues with specific card models
  • Signal integrity problems at higher capacities
  • Card-specific command sequence requirements
  • FAT32 partition formatting differences

Recommended Next Steps

  1. Review the debug log carefully - Look for any SDCARD_ZONE_FUN and SDCARD_ZONE_INIT messages that precede the error
  2. Test with different formatting - Try formatting the Intenso 32 GB card with different cluster sizes
  3. Verify card specifications - Ensure the card meets SD specifications and isn’t a counterfeit
  4. Consider alternative vendors - Since you’ve successfully tested other 32 GB cards, focusing on those proven-compatible manufacturers may be more practical than debugging driver-level issues

Important Note on WEC2013 Support

Please be aware that Windows Embedded Compact 2013 reached End of Life (EOL) in October 2023, which means no security patches should be expected from Microsoft(2). This is an important consideration for long-term product support planning.

Best regards,
Toradex AI Assistant.


Did you like my answer? :+1: :-1:

If I answered your question, please tick the “Solution” checkbox.

For follow-up questions to me, please use @ToradexAI in your post.

Thank you for the log. However, without the relevant debug zones enabled, the log does not provide enough detail to identify the root cause.

BSP version 1.3 is quite old. Please try updating to BSP version 1.10, as this issue may have already been resolved in a newer release.

To get the current BSP version, you can use the Update Tool, which is much easier than checking the SHA-256 hash manually. The BSP version should also be visible in the boot log.


Toradex Bootloader 1.3.1 for iMX6 Built May 22 2018
..
Toradex Windows CE 8.0 1.3
 for iMX6 Built on Mar  9 2018

Enabling Debug Zones for usdhc.dll

I am trying to enable debug zones for usdhc.dll on a WEC2013-based system.

Bootloader Configuration

In the bootloader, I executed the following commands:

set dbg.serial 1
save dbg

This successfully enables serial debug output from the device.

Registry Changes

I added the following DWORD values to each of the registry keys listed below:

"DbgZones"=dword:0000ffff
"DebugZones"=dword:0000ffff

Modified Registry Keys

HKEY_LOCAL_MACHINE\Drivers\SDCARD\ClientDrivers\Class\MMC_Class\High_Capacity
HKEY_LOCAL_MACHINE\Drivers\SDCARD\ClientDrivers\Class\SDMemory_Class\High_Capacity
HKEY_LOCAL_MACHINE\Drivers\BuiltIn\USDHC1
HKEY_LOCAL_MACHINE\Drivers\BuiltIn\USDHC3

Additional Information

  • I flushed the registry and rebooted the device.
  • After reboot, all of the above registry values were still present, confirming that the changes were persisted successfully.
  • This is the path of usdhc.dll in my repo:
    “C:\work\OS_WEC2013\WINCE800\platform\Colibri\FILES\usdhc.dll”
  • The following registry path does not exist on my system:
HKEY_LOCAL_MACHINE\Drivers\BuiltIn\USDHC2

Why I Cannot Use Platform Builder and KITL

I am aware that Platform Builder can display and modify debug zones when connected through KITL. However, this approach is not available in my environment for the following reasons:

  • VS2015 with platform builder runs in a virtual machine, which does not allow me to use KITL as target device is in a different network segment. KITL over ethernet can only be used if both VS2015 and target device run in the same network segment

Because of these constraints, I am trying to enable the USDHC debug output solely through registry configuration and rebooting the device.

Request

Could you please let me know which registry keys and values must be configured in order to enable debug zones for usdhc.dll?

BSP 1.10

The next thing I will do is an update from BSP 1.3 to BS 1.10.

; Enable debug zones for USDHC driver
[HKEY_LOCAL_MACHINE\Drivers\BuiltIn\USDHC1]
    "DebugZones"=dword:FFFFFFFF     ; Enable ALL zones

[HKEY_LOCAL_MACHINE\Drivers\BuiltIn\USDHC2]
    "DebugZones"=dword:FFFFFFFF

[HKEY_LOCAL_MACHINE\Drivers\BuiltIn\USDHC3]
    "DebugZones"=dword:FFFFFFFF

You can select narrower zone set using, other mask values instead of 0xFFFFFFFF