1 Reply Latest reply on Aug 7, 2017 10:43 AM by thepenguinmaster_2506896

    Psoc5 USB Question

    thepenguinmaster_2506896

      Hello, this is my first post on the forums. There have been many helpful posts, but I have run into some things that I cannot find online or in the documentation. 

         

       

         

      I am working on a USB device on the CY8CKIT-059 and it is a wonderful little device! I was able to use the example keyboard descriptor to create a small keyboard. 

         

      Now I am working on modifying the descriptor to work with a different message type. I am using a descriptior that is quite common and documented elsewhere. It also works with other controllers without issue. 

         

      Now that I have entered the descriptor in my USBFS component, and switched over to the new descriptor, as well as modified the code, I am unable to receive acknowledgment from the computer (the USB device is showing properly in the device manager in Windows using the default HID driver). 

         

      The new Descriptor should work fine with the existing default windows HID keyboard driver as well. 

         


      The question here is, that if _bGetEPAckState fails to return true, and never receives and acknowledgment, would that mean there is a problem with my descriptor or the data I sent via _LoadInEP?

         

       

         

      Here is a simplified version of the code I am using to send the structure data. I know the code is a bit rough, but I am using this currently jsut to get the concept tested before a full implementation:

         

       

         

      struct Report{
          uint8 ModKeyMap[1];     // One byte for mod keys (1 size count 8)
          uint8 LedState[1];      // One byte for LED state (size 1 count 5 padded 3) 
          uint8 bitmap[15];       // 128 keys (size 1 count 120 length)
      };

         

      struct Report keyReport;

         

      void SendCodes(){
          uint8 buf[sizeof(keyReport)];
          memcpy(buf, &keyReport, sizeof(keyReport));
          USB_LoadInEP(1,buf, sizeof(buf));
          while(!USB_bGetEPAckState(1));
      }

       

         

      Edit:

         

      Also after changing the report size, is there any other value I need to modify in PSoC Creator to tell it that the new report is a difgferent size?