This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

WEC7 - SPI .dll not working/loading (am33x_mcspi.dll)

Other Parts Discussed in Thread: AM3354

Dear Sir

I'm working on the Compulab CM-T335 (TI AM3354) module using WEC7 and the Adeneo BSP

When I run the following C++ code for SPI1 the handle hSPI returns INVALID_HANDLE_VALUE.

If I then call GetLastError() I get 55 = ERROR_DEV_NOT_EXIST55 (0x37) = The specified network resource or device is no longer available.

hSPI = CreateFile(_T("SPI1:"), GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, NULL, 0); 
//hSPI = CreateFile(_T("GIO1:"), GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, NULL, 0); 
if (hSPI == INVALID_HANDLE_VALUE)
{
    errorCode = GetLastError();
}

if (hSPI != NULL)
{
    CloseHandle(hSPI);
}

If I call the GIO1 version of this code instead hSPI is a valid handle.

Checking the Registry HKEY_LOCAL_MACHINE\Drivers\builtin contains SPI1 and SPI2 with am33x_mcspi.dll
When I check HKEY_LOCAL_MACHINE\Drivers\Active there is no sign in the 65 entries of SPI1 or SPI2 being loaded. It does not appear in Windows Remote Process Viewer either

am33x_mcspi.dll is included in the Flat Release directory for OS and appears in the Windows directory on the Dev Board.

Can you think of any reason why SPI1 and SPI2 do not appear in HKEY\Drivers\Active (which is why I presume CreateFile() fails)

Cheers

Terry

  • Terry,

    Sounds like the registry is set up correctly and the driver dll is included in the image.

    As a next step I would put a breakpoint in the driver's SPI_Init function and step through to see if the driver fails its initialisation. If the breakpoint is never hit and you don't see the dll loading, examine the debug output for clues as to why.

    Best regards,
    Carsten

  • Hi Carsten

    Thanks for the reply I will have a dig deeper.

    Hopefully Compulab will be able to reproduce this problem and sort it out a lot quicker than me.

    Regards

    Terry

  • Hi Terry

    I have the same problem, Do you have any advice to solve it?

    Best Regards
    Leonardo
  • Hi Leonardo

    Yes, got it working in the end

    There were a few issues

    The files below needed modification (the latest Image from Compulab (31st Dec 2014) has these changes

    \\WINCE700\platform\common\src\soc\COMMON_TI_V1\COMMON_TI_AMXX\SPI\spi.c
    \\WINCE700\platform\common\src\soc\COMMON_TI_V1\AM33X\SOCCFG\devicemap.c


    Also if your board has the WB option fitted as in CM-T335 D256-C600G-N512-E-A-U1-WB  then SPI0 is not available 

    http://www.compulab.co.il/workspace/mediawiki/index.php5/CM-T335:_WEC7:_Known_issues


    Was also told -  For SPI0 you need remove U25 and be sure RN16 0ohm assembled.

    Hope this helps

     

    Terry