2024-08-03 08:11 AM
Hello!
After it was clear, that the STM32F469I-DISC0 does not support the HDMI output feature, I purchased also the STM32F769I-DISCO to be able to evaluate the connection of a HDMI monitor to the board.
I need to connect a keyboard to the board and my assumption was, that the same applications for the STM32F469 DISC0 also exist for the STM32F769, but unfortunately the application "HID_Standallone" is not part of the "applications" folder of the F7 board.
So I thought let's go for the "MSC_Standallone" example, bring it up and then exchange it accordingliy from a MSC to HID (assumption: just exchange the folder "MSC" to "HID", should be straight forward). After some time of trying the keyboard was detected and enumerated correctly, but when reading the endpoint (polling) it never passed the following line (file "usbh_hid.c"):
case USBH_HID_POLL:
if (USBH_LL_GetURBState(phost, HID_Handle->InPipe) == USBH_URB_DONE) // <---- never "DONE", always IDLE
Later I found the following preprocessor text "USE_USB_HS" (because of the formerly MSC application). Strange enough a different USB IRQ Handler does exist for "HS" and another for "FS":
#ifdef USE_USB_FS
void OTG_FS_IRQHandler(void)
#else
void OTG_HS_IRQHandler(void)
#endif
{
HAL_HCD_IRQHandler(&hhcd);
}
Since I assume that the keyboard is a full speed device, I changed it to "USE_USB_FS" with the result, that the VBUS activation code threw errors. I had a look into the schematics...
There is this "URB"-thing circuit "USB3320 (Microchip)" that controls apart from other things also the VBUS activation. So the VBUS control in "full speed" must fail because just GPIO pins control the VBUS activation in the software, the USB3320 is not considered.
That was the moment, I was totally confused and thought, let's ask the community:
1. I understand, that the USB3320 chip is the PHY between the STM32 MCU and the high speed device. Does this mean, to connect "only" a full speed device to the STMF769I-DISC0 board is not possible? Since the keyboard was enumerated, I dont think so but who knows (for enumeration 1.5MBit speed is used...?)
2. Do I have to set the preprocessor "USB_USE_FS" for to connect a HID keyboard device to the F7 board?
3. Can I use the "USB_USE_FS" at all, because if I do, the VBUS control does not work anymore?
4. The best would be: Can someone please point me to a USB HID application example for the STM32F769I-DISC0 (like for the STM32F469I-DISC0) that works out of the box (preferably without "ux / threadx", just "HID_Standallone").
Thank you for helping!
2024-08-04 06:40 AM
> Strange enough a different USB IRQ Handler does exist for "HS" and another for "FS":
> Since I assume that the keyboard is a full speed device, I changed it to "USE_USB_FS"
The names USB_FS and USB_HS designate the two USB controllers of the STM32, one of these is HS capable, another is only FS. So USE_USB_FS defines which of the two controllers are you using. It is not related to the speed of the connected device. Both controllers support FS and low speed devices.