none
Problem in using NAND API's RRS feed

  • Question

  • Hi all,

    I am using WinCE 6 and OMAP35xx.

    I am trying to use NAND block driver API's in one of my driver as :-

    /******************************************************************/

    BOOL WriteVideo(UCHAR *pData,UINT32 size)
    {
        BOOL rc = FALSE;
        HANDLE hFMD = NULL;
        PCI_REG_INFO regInfo;

     // EBOOT configuration is placed in last sector of EBOOT image
     regInfo.MemBase.Reg[0] = 0x10000000;
     hFMD = FMD_Init(NULL, &regInfo, NULL);

        RETAILMSG(1,(L"\r\nWriting Video image to OS partition\r\n"));

     if (hFMD == INVALID_HANDLE_VALUE)
     {
            RETAILMSG(1, (L"ERROR: OS partition not found!\r\n"));
            goto cleanUp;
     }
     RETAILMSG(1, (L"Hidden OS partition Exists!\r\n"));

        RETAILMSG(1,(L"\r\nVideo data flashed\r\n"));

        // Done
        rc = TRUE;

    cleanUp:
     if (hFMD != NULL) FMD_Deinit(hFMD);
        return rc;
    }

    /*********************************************************************/

    I am getting compilation linking error for NAND API's

    I even tried to use in in OAL layer and using kernel IO control call it from driver still i am getting linking error .

    The strange thing is that i am providing the link library path as :-

    --------------------------------------------------------------------------------

    TARGETLIBS= \

    C:\WINCE600\PLATFORM\TES_OMAP3530\lib\ARMV4I\retail\tievm3530_nand.lib \

     

    What special is required to accecc NAND API's in my driver

    Please share your experience

    Tuesday, September 14, 2010 10:57 AM

All replies

  • And the linker error is?
    Bruce Eitman (eMVP)
    Senior Engineer
    Bruce.Eitman AT Eurotech DOT com
    My BLOG http://geekswithblogs.net/bruceeitman

    Eurotech Inc.
    www.Eurotech.com
    Tuesday, September 14, 2010 12:20 PM
    Moderator
  • Linker error is :-

    Error 56 BUILD: [01:0000000786:ERRORE] ov3640.lib(ov3640_pdd.obj) : error LNK2019: unresolved external symbol FMD_Deinit referenced in function "int __cdecl WriteVideo(unsigned char *,unsigned int)" (?WriteVideo@@YAHPAEI@Z)  

    Error 57 BUILD: [01:0000000787:ERRORE] ov3640.lib(ov3640_pdd.obj) : error LNK2019: unresolved external symbol FMD_Init referenced in function "int __cdecl WriteVideo(unsigned char *,unsigned int)" (?WriteVideo@@YAHPAEI@Z)  

     

    --- Misbah

    Tuesday, September 14, 2010 12:36 PM
  • That suggests that one of:

    1. You aren't linking with the correct lib file
    2. The lib file was created with C++ and therefore the functions are decorated in the lib.  This would seem odd because your source code is C++ and seems to be using a header file which tells it that the functions are C.

    Bruce Eitman (eMVP)
    Senior Engineer
    Bruce.Eitman AT Eurotech DOT com
    My BLOG http://geekswithblogs.net/bruceeitman

    Eurotech Inc.
    www.Eurotech.com
    Tuesday, September 14, 2010 1:03 PM
    Moderator
  • Another thing you can try is to use SOURCELIBS instead of TARGETLIBS for including the tievm3530_nand.lib.
    Tuesday, September 14, 2010 9:22 PM
  • Good point.  I assumed (never do that) that the OP was building a DLL.  That may not be the case, it could be a LIB that later is linked to create a DLL.
    Bruce Eitman (eMVP)
    Senior Engineer
    Bruce.Eitman AT Eurotech DOT com
    My BLOG http://geekswithblogs.net/bruceeitman

    Eurotech Inc.
    www.Eurotech.com
    Tuesday, September 14, 2010 9:38 PM
    Moderator
  • Hi Bruce & KMOS ,

    I tried with SOURCELIBS but still i am getting the same linking error.

    Next i tried this :-

    1. There are functions defined in ..\BOOT\FLASHSTORE\flashstore.c such as OALFlashStoreWrite()

    declared in ..\OAL\IOCTL\ioctlex.c  in lib "omap_boot_flashstore_lib"

     

    I tried to call this OALFlashStoreWrite() in file ..\OAL\IOCTL\ioctlex.c included the "omap_boot_flashstore_lib" and getting linking error. 

    Both library and source files were .c files 

    2.  I tried to use BP_WriteData() function and linked with the "bootpart.lib" under ..\OAL\IOCTL\ioctlex.c under OAL layer and again i am getting linking error.

    Except under BOOT directory i am getting linking error for all Flash Api's

     

    Thanks

    Misbah

    Thursday, September 16, 2010 11:34 AM
  • Hi Misbah,

    OMAP35xx BSP version that I am using is 6.13.00

    Based on your inputs I did a small experiment.

    I had created a directory with the name WriteVideo under (_TARGETPLATROOT)\SRC\DRIVERS.

    I created a c file with the name writevideo.c, and one empty writevideo.def file.

    WriteVideo.c contents are given below

    #include

     

    <windows.h>

    #include

     

    <pcireg.h>

    #include

     

    <fmd.h>

    BOOL WriteVideo(

    void)

    {

    BOOL rc = FALSE;

    HANDLE hFMD = NULL;

    PCI_REG_INFO regInfo;

     

    // EBOOT configuration is placed in last sector of EBOOT image

    regInfo.MemBase.Reg[0] = 0x10000000;

    hFMD = FMD_Init(NULL, &regInfo, NULL);

    RETAILMSG(1,(L

    "\r\nWriting Video image to OS partition\r\n"));

     

    if (hFMD == INVALID_HANDLE_VALUE)

    {

    RETAILMSG(1, (L

    "ERROR: OS partition not found!\r\n"));

     

    goto cleanUp;

    }

    RETAILMSG(1, (L

    "Hidden OS partition Exists!\r\n"));

    RETAILMSG(1,(L

    "\r\nVideo data flashed\r\n"));

     

    // Done

    rc = TRUE;

    cleanUp:

     

    if (hFMD != NULL) FMD_Deinit(hFMD);

     

    return rc;

    }

    Sources contents are below

    WINCEOEM=1

    TARGETNAME=WRITE_Video

    TARGETTYPE=DYNLINK

    SYNCHRONIZE_DRAIN=1

    DLLENTRY=_DllMainCRTStartup

    SOURCES=WriteVideo.c

    SOURCELIBS=$(_TARGETPLATLIB)\$(_CPUINDPATH)\tievm3530_nand_lib.lib \

     

    TARGETLIBS= \

    $(_PLATCOMMONLIB)\$(_CPUINDPATH)\ceddk_omap35xx_tps659xx_ti_v1.lib \

    $(_SYSGENSDKROOT)\lib\$(_CPUINDPATH)\coredll.lib

    When I build writevideo directory it created the dll with out any issues.

    Thank You & Regards,

    GSR

    Thursday, September 16, 2010 12:42 PM
  • Thanks a lot GSRID,

    I will try this now.

     

    Actually this will not solve all my problems because i need to implement this in my existing driver for camera/video. Or else i need it to be working in OAL layer so that using OalIoControl() i could write to NAND from driver.

     

    Please suggest me for point 1 and 2 of my last post.

     

    Thanks

    Misbah

    Thursday, September 16, 2010 12:55 PM