1 Reply Latest reply on Jul 26, 2019 4:50 AM by BrGr_4363556

    Compiling apps with CyAPI for windows IOT Core ARM

    BrGr_4363556

      Hi Guys,

       

      This is my first question here in the forum, so sorry for cross posting and such.

       

      I'm developing an application to read from the Cypress FX3 board on a RPi3.

      I downloaded the CyUSB3 universal driver from here:

      CYAPI on Universal Windows Platform

      I created a .CAB file using the instructions here:

      Install USB Peripheral Drivers - Windows IoT | Microsoft Docs

      It installed OK and the FX3 now shows as one of the available drivers.

       

      The CyAPI downloaded from here:

      https://www.cypress.com/documentation/software-and-drivers/ez-usb-fx3-software-development-kit

       

      It was compiled for ARM (not easily) and generated a CyAPI.lib file

       

      I created a sort of "Hello World" program to test it that looks like:

      int main(int argc, char* argv[])
      {
          printf("Finger Cmd program started");
          return doit();
      }
      

       

      where doit() calls the CyAPI.LIB

       

      the thing is, just by linking the executable with the CyAPI.lib, the whole program won't run.

      I may comment the call to doit() but it doesn't work either.

       

      the CyUSB3 driver seems to run. The problem seems to be the CyAPI lib.

       

      Any hints on this one?

       

      Thanks and Best Regards,

       

      Bruno Grieco

        • 1. Re: Compiling apps with CyAPI for windows IOT Core ARM
          BrGr_4363556

          Bumping this thread a little, here are a couple of things I found out:

           

          • The above program wouldn't run yielding the error "no entry point found"

          This was actually caused by a failure while dynamic linking to the user32.dll issued by the Function: RegisterDeviceNotificationA , which wasn't found.

          But the counterpart RegisterDeviceNotificationW is there.

          So compiling the CyAPI library with Character Set "Unicode" instead of "Wide char" solved this problem.

          Some other warnings and conversions had to be fixed on the way... but nothing serious.

           

          • Second problem is that SetupDiGetInterfaceDeviceDetail fails while retrieving the SP_DEVINFO_DATA structure.

          Since this structure is not used at all by the API, the best fix was to pass NULL instead of devInfoData in line 454

           

           

                          functionClassDeviceData = (PSP_INTERFACE_DEVICE_DETAIL_DATA) malloc (predictedLength);
                          functionClassDeviceData->cbSize =  sizeof (SP_INTERFACE_DEVICE_DETAIL_DATA);
                          devInfoData.cbSize = sizeof(devInfoData);
                          //Retrieve the information from Plug and Play */
                          if (SetupDiGetInterfaceDeviceDetail (hwDeviceInfo,
                              &devInterfaceData,
                              functionClassDeviceData,
                              predictedLength,
                              &requiredLength,
          #ifndef ARM
                              &devInfoData)) {
          #else
                              NULL)){ // Arm Architectures cannot retreive the devInfoData (for some reason???)
          #endif