“We are trying to develop a USB Host HID application where using the controller STM32F4, and the USB stack library available on the ST website, we are trying to send data/command to an USB HID device. But in the library we downloaded from ST site, the host HID application has examples for mouse and keyboard application only.In case of Mouse and keyboard, Host receives but does not transmit back anything while in our application we need to also transmit data.
So do you have any particular HID host example codes or guideline documents for STM32F4xx controller which demonstrates how to transmit the data to the attached external USB device using the ST USB library? “,
Hello, Actually project was on hold.
Thanks again for help.
In my case above function(As Mr.Tsuneo suggested) is not calling by below Interrupt routine for data transmitt
I want to transmit uint8_t Disp_braille_data[20]={0x1b,0x01,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x16,0x16}; I used USBH_InterruptSendData(pdev, Disp_braille_data,//HID_Machine.buff, 20,//HID_Machine.length, HID_Machine.hc_num_out);
Above function is calling
USB_OTG_STS USB_OTG_HC_StartXfer(USB_OTG_CORE_HANDLE *pdev , uint8_t hc_num) { ...... ...... ...... ...... ...... if (pdev->cfg.dma_enable == 1) { USB_OTG_WRITE_REG32(&pdev->regs.HC_REGS[hc_num]->HCDMA, (unsigned int)pdev->host.hc[hc_num].xfer_buff); } hcchar.d32 = USB_OTG_READ_REG32(&pdev->regs.HC_REGS[hc_num]->HCCHAR); hcchar.b.oddfrm = USB_OTG_IsEvenFrame(pdev); /* Set host channel enable */ hcchar.b.chen = 1; hcchar.b.chdis = 0; USB_OTG_WRITE_REG32(&pdev->regs.HC_REGS[hc_num]->HCCHAR, hcchar.d32); ...... ...... ...... ...... ...... }
Above function is transmitting data. Sniffer: Totalphase analyser resource:\STM32_F105-07_F2xx_USB-Host-Device_Lib_V2.0.0\Project\USB_Host_Examples\HID\MDK-ARM
Sniffer log: OUT txn : 00 1B 01 03 04 05 06 07 08 09 10 11 12 13 14 15 16 16 16 - OUT Packet : E1 01 C1 - DATA0 Packet : C3 00 1B 01 03 04 05 06 07 08 09 10 11 12 13 14 15 16 16 16 9B 26 - ACK Packet : D2 (Status ok)
So again question is same why 0x00 ahead of original data frame.
I tried but unable to find solution. So please help me.
Regards, Krunal