cancel
Showing results for 
Search instead for 
Did you mean: 

USB get feature reports with HAL device library?

mk299
Associate III
Posted on August 28, 2015 at 21:03

Hello,

up to now I used the SPL USB device code and I'd like to switch to the HAL/Cube version now. Unfortunately that only supports setting feature reports. But I'd also like to get feature reports from the device.

Has someone already implemented this and is able to share the corresponding code?

Best regards,

Michael

#usb-hal-customhid-hid-cube #usb-hid-getfeature-setfeature
5 REPLIES 5
mk299
Associate III
Posted on September 02, 2015 at 18:41

The original post was too long to process during our migration. Please click on the provided URL to read the original post. https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I6iE&d=%2Fa%2F0X0000000btn%2Fj.QrC3dzBiXsENmOrbjU8zoRYOMyy.tuplCIOUskEMM&asPdf=false
istiaq2379
Associate
Posted on December 13, 2015 at 19:40

I am working with USB HID in stm32f On Get_Report Request I have to send data to Host PC through Control Transfer Endpoint. I am trying to do so. But it is sending always some wrong data. If I want to elaborate the problem, that is

 case HID_REQ_GET_REPORT: if(req->wValue==PID_POOL_BLOCK_REPORT){ buf[0] = 0x07; buf[1] = 0xFF; buf[2] = 0xFF, buf[3] = 0x0A; buf[4] = 0x02; if(USBD_LL_FlushEP (pdev, 0x00)==USBD_OK){ USBD_CtlSendData (pdev, buf, 5); } }

But the data send through is actually ''0xF6 0x3A 0x82 0x28 0x45''. I have no clue what is happening inside. I have benn trying it with flushing the endpoint too. But it seems no working. What to do really? Any clue please. Thank you.

bastien2
Associate II
Posted on June 15, 2016 at 20:23

Hi,

Sorry for bumping this thread.

Could you please send your project as an exemple ( maybe in Github) ?

Because actually in 2016 ST don't provide project with can receive report over HID

Thanks in advance

mk299
Associate III
Posted on June 23, 2016 at 07:20

Hello Smithers,

sorry for my late reply. I didn't get a notification about the answers here. Please give me another day or maybe two to have a look on the code and do some cleanup. Then I'll upload it to GitHub and post a link here.

mk299
Associate III
Posted on July 08, 2016 at 22:28

Please excuse the delay. You can find the corresponding project for F1 and L1 on

https://github.com/pikim/HIDIRT-STM32x1xx

. The host application for Windows is also there in another repository (

https://github.com/pikim/HIDIRT-host

) and uses a modified

https://github.com/pikim/GenericHid

library, which was initially written by Janet Axelson.