Psoc5 USB Question

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

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 😎
    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?

0 Likes
1 Solution
Anonymous
Not applicable

I made some progress and resolved part of my issue. Still having a problem elsewhere, but this issue has been resolved. It turned out that there is a setting to adjsut the packet size. After changing this setting, I am getting a proper response from the USB hsot. 

View solution in original post

0 Likes
1 Reply
Anonymous
Not applicable

I made some progress and resolved part of my issue. Still having a problem elsewhere, but this issue has been resolved. It turned out that there is a setting to adjsut the packet size. After changing this setting, I am getting a proper response from the USB hsot. 

0 Likes