2 Replies Latest reply on May 8, 2017 7:47 AM by moes_2283781

    Combine USB Examples on FX3

    moes_2283781

      Hello everybody

         

      I'm trying to combine the two example projects "USBBulkLoopAuto" and "MouseDemo" but I don't get it running. It is the first time I try to do something with USB and probably struggle with some basic problems.

         

      What I did so far:

         
            
      • Copied the "USBBulkLoopAuto" Project and renamed it.
      •     
      • Changed the USB descriptor file where I added the HID (not sure if I did this the right way, file is in the appendix)
      •     
      • Changed the file names in the Makefile
      •     
      • Added a single .c and .h file for each interface (cyfx_thread_bulkloop.c, cyfx_thread_bulkloop.h, cyfx_thread_hid.c and cyfx_thread_hid.h)
      •     
      • made a thread for the bulk loop in "cyfx_thread_bulkloop.c" and a thread for the HID in "cyfx_thread_hid.c" and added the code from the examples.
      •     
      • Created a main.c file where I put everything in it where I think is shared by both interfaces.
      •     
      • Merged the functions (probably merged wrong)     
                
        • CyFxApplicationDefine calles both threads
        •       
        • CyFxApplnInit is placed in the main file to set the enumeration descriptor for both interfaces
        •       
        • CyFxApplnLPMRqtCB, CyFxApplnUSBEventCB, CyFxApplnUSBSetupCB are placed in the main.c but not sure what I have to do actually to combine the functions for both interfaces (To be honest, I don't really understand these functions).
        •      
      •    
         

      I'm able to build the project without errors, but when I load it on the FX3, I get no device in the Cypress Control Center.

         

      Could someone please help me to get this running or is there already an example with two combined interfaces? I searched but didn't find anything which gave me enough information.

         

      Thank for every hint to get closer to a working solution. 

         

      Kind regards,

         

      Dominic

        • 1. Re: Combine USB Examples on FX3
          Madhu Lakshmipathy

          Hi,

             

          Are you able to see the device on the device manager? If so how does it appear? You may have to manually bind the drivers to the device using device manager, if it appears in the "Other Devices" section.

             

          Regards,

             

          - Madhu Sudhan

          • 2. Re: Combine USB Examples on FX3
            moes_2283781

            Hi,

               

            Thank you for your help.
            I get an unknown device in the device manager. I setup the project again but still getting no device.

               

            I printed some debug messages. Looks like it had problem to set up the second DMA channel. First, I  initialize the DMA channel for the bulk loop. After that, I initialize the DMA channel for the HID.
            When calling the function "CyU3PDmaChannelCreate()" for the HID, I get an error message "CyU3PDmaChannelCreate failed, Error code = 64".

               

            How do I have to change the DMA setup so that I can use the DMA for the bulk loop, as well as for the HID?

               

            I uploaded the new version of the project.

               


            Regards,
            Dominic