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.

WinCE7 - How to create your own native TestGPIO application

Other Parts Discussed in Thread: AM3517

Hi there,

I'm working on AM3517 evaluation kit, with TIs wince 7.

My final goal should be a simple task... to control/toggle some LEDs, connected to an IOexpander, from my C#/.NET based application. That could be LED1-4 on the baseboard on the evaluation kit.

 

The test application TestGPIO shows how to do this, but my trivial problem is how to build my own application and do the same!

 

I had a similar approach to the CAN controller driver, but here I was able to create a native dll wrapper to manage my CreateFile(...) and DeviceIoControl(...) access. This mainly simplified my C# managed application, meaning simplified my use of PInvoke stuff.. By the way, I have created and installed an SDK for my device. I'm able to do some business with my C# applications, loading my dll wrapper and communicate via CAN bus. The problem just suddenly arised when I needed to toggle a LED :-)

To begin with, I would like to add to my 'DLL - Win32 Smart Device Project' dll wrapper, some more wrappers for the GPIOOpen(), GPIOSetBit(..), GPIOClrBit, etc. Its just that I believe I need to link to some library that has the GPIOxxx implementation. #include "sdk_gpio.h" is not enough. I get this classic linker error.

Error 1 error LNK2019: unresolved external symbol GPIOOpen referenced in function DllWrap_Initiate dllWrapper.obj

Well, I hope you understand my issue here.

Regards
Palson

  • Add the libs :

    ceddk.lib and coredll.lib

    --- Misbah

  • Hi Gestur,

    I could be wrong, but from what I can see GPIOOpen etc. are defined as inline functions in
        C:\WINCE700\platform\common\src\soc\OMAP35XX_TPS659XX_TI_V1\inc\gpio.h

    (adjust the path depending on the BSP you use)

    If there aren't any unmanaged dll's in the BSP that include gpio.h and export the functions, then there won't be anything to link against from your own dll.

    But maybe there's an easier way - have you tried just including gpio.h (rather than sdk_gpio.h) in your dll wrapper?
    Doesn't that give you access to the GPIOxx functions?

    Or is gpio.h missing from the SDK?

  • @Misbah - correct, I need to make sure that I have these included in my ../source file for the project:

    TARGETLIBS= \
     $(SG_OUTPUT_ROOT)\sdk\lib\$(_CPUINDPATH)\coredll.lib \
     $(SG_OUTPUT_ROOT)\platform\\AM35x_BSP\lib\$(_CPUINDPATH)\ceddk.lib

    The path for the ceddk.lib is important. Along with some ../ddk/inc, ../sdk/inc and ../oak/inc directory paths, then this is working when creating a native subproject within your OS solution.

    I'm still not able to configure my *.sln project, outside the OS solution project, using my SDK. The ceddk.lib is part of my .../lib though.

    @Carsten - gpio.h is in fact missing from the SDK, but it is somewhat different for AM3517. Your path will be .../src/soc/common_ti_v1/... and gpio.h is nowhere to find.

     

    Thanks for your responses...

    Regards
    Palsson

  • Hi Gestur,

    Good to hear you managed to build the project, and sorry for any confusion I might have caused by dragging a different BSP structure into the discussion.

    Is it still your goal to be able to maintain this outside the OS solution, using only the SDK?

    Which errors are you getting when trying to build against the SDK?

  • Hi Carsten,

    Sorry for late response.

     

    This is the error I'm getting if I use GPIOOpen in a wrapper function..

    Error 1 error LNK2019: unresolved external symbol GPIOOpen referenced in function DllWrap_Initiate  dllWrapper.obj

    In my wrapper I include sdk_gpio.h

    In my ../Lib directory for the SDK, I find the ceddk.lib but still no game...

     

    Regards

    Gestur

  • You need to make sure the ceddk.lib you link to is not the default one generated by the public part of WEC7 but rather the one built specifically for the AM3517 BSP : WINCE700\PLATFORM\AM35x_BSP\SRC\DRIVERS\CEDDK\DLL

    This one exports "GPIOOpen" such as defined in "ceddk.def".

  • You indirectly helped me solve a problem I have been looking into for days. Thank you very very very much.