2019-01-27 09:21 AM
I am using a STM32F746NG which I am attempting to use the STM32_USB_Host_Library. I am able to initialise and start the process fine, but as soon as I connect a USB device to the port the program freezes.
I am unsure if the issue is to do with the configuration of the "STM32_USB_Host_Library" or if the issue is to do with the configuration of "STM32F7xx_HAL_Driver". I have found however that the application won't freeze if I comment out the following line from "stm32f7xx_ll_usb.c" (Although then the app won't work)
HAL_StatusTypeDef USB_EnableGlobalInt(USB_OTG_GlobalTypeDef *USBx)
{
//DISABLING THIS LINE STOPS FREEZING
USBx->GAHBCFG |= USB_OTG_GAHBCFG_GINT;
return HAL_OK;
}
Does anyone know why this may happen? Or where the kind of area to look for what happens when the USB connects to see if I can track down further what the actual issue is.
Thanks in advance
Solved! Go to Solution.
2019-01-27 10:05 AM
Look at a otg disco code example to compare, or check the reference manual... to find out for notes and warnings or bug in schematics. Maybe the ISR used to release a pending interrupt has bug
2019-01-27 10:05 AM
Look at a otg disco code example to compare, or check the reference manual... to find out for notes and warnings or bug in schematics. Maybe the ISR used to release a pending interrupt has bug
2019-01-27 10:41 AM
Hi @S.Ma
Thanks for your reply. I have a working example on the STM32F746G-DISCO board that I am attempting to copy over into my code.
By the reference manual are you referring to this?
Thanks Again
2019-01-27 11:01 AM
The sTM32 reference manual which describe the peripheral. The datasheet gives absoolute info such as pinout package memory mapping, etc... Looking at the USB Host HW registers might include extra info.
Compare your code with tested working example. Find where the labels are defined in the reference code and then compare with the second project. BSP (board specific) labels seems missing, maybe because the board define in the project compile option is missing and part of the H file is no longer included.
2019-01-27 11:07 AM
@S.Ma Okay thank you for your help, I shall continue looking.
2019-02-03 07:24 AM
@S.Ma You were absolutely correct, it was an issue where I wasn't handling the interrupt code. Thanks for all your help