Thursday, February 12, 2015

Intel Atom WEC7 BSP SDCard driver not compiling

Hi Folks,

If you are using the Intel Atom BSP, available for download from Adeneo Embedded website (http://www.adeneo-embedded.com/Products/Board-Support-Packages/Intel) with the Windows Embedded Compact 7 updates higher than March 2014, you will experiment build issue for the SDCard.

Microsoft folks have change the signature of the pSDIODisconnectInterrupt field of the SDCARD_API_FUNCTIONS structure. So function pointer to SDIODisconnectInterrupt__X is expected to be SD_API_STATUS SDIODisconnectInterrupt__X(SD_DEVICE_HANDLE hDevice) instead of  VOID SDIODisconnectInterrupt__X(SD_DEVICE_HANDLE hDevice)

This results in having the following error :
BUILD: [00:0000000028:PROGC ] Building COMPILE Pass in C:\WINCE700\platform\Intel_CS\SRC\DRIVERS\sdcard30\sdbus\ directory.
BUILD: [01:0000000039:PROGC ] Compiling .\sdbus.cpp
BUILD: [01:0000000042:ERRORE] Error(s) in directory "C:\WINCE700\platform\Intel_CS\SRC\DRIVERS\sdcard30\sdbus\". {log="C:\WINCE700\platform\Intel_CS\src\drivers\sdcard30\SDBus\bldsys.log(29)"}
BUILD: [01:0000000043:ERRORE] c:\wince700\platform\intel_cs\src\drivers\sdcard30\sdbus\sdbus.cpp(1896) : error C2440: '=' : cannot convert from 'void (__cdecl *)(SD_DEVICE_HANDLE)' to 'PSD_IO_DISCONNECT_INTERRUPT' {log="C:\WINCE700\platform\Intel_CS\src\drivers\sdcard30\SDBus\bldsys.log(30)"}


To fix this modify the block of code loacted at line 1805 in WINCE700\platform\Intel_CS\SRC\DRIVERS\sdcard30\sdbus\sdbus.cpp

// Fix link to Microsoft Update
// VOID SDIODisconnectInterrupt__X(SD_DEVICE_HANDLE hDevice)
SD_API_STATUS SDIODisconnectInterrupt__X(SD_DEVICE_HANDLE hDevice)
{
    SD_API_STATUS   status = SD_API_STATUS_INVALID_PARAMETER;  // intermediate status
    CSDDevice *     pDevice = CSDHostContainer::GetDeviceByDevice((HANDLE)hDevice);
    if (pDevice) {
        __try {
            status = pDevice->SDIOConnectDisconnectInterrupt( NULL,FALSE);
        }
        __except (SDProcessException(GetExceptionInformation())) {
            status = SD_API_STATUS_ACCESS_VIOLATION;
        }
        pDevice->DeRef();
    }
    DEBUGMSG(SDCARD_ZONE_ERROR && !SD_API_SUCCESS(status), (TEXT("SDIODisconnectInterrupt__X: Failed status 0x%08X \n"),status));

return status;
}

Then rebuild the SDCard driver to check the correctness of the modification.

Enjoy
-Nicolas

No comments:

Post a Comment