2018-04-19 05:35 AM
Using CubeMX is was pretty simple to make a USB host for a memory stick. When the stick is connected during power up it works.
When the stick is not connected during power up it will work afer calling MX_USB_HOST_Init again. Problem is when should i call the init as this takes a long time. So i need to know if a connection is made. There are interrupts HAL_HCD_Connect_Callback and HAL_HCD_Disconnect_Callback but they are never called. It is possible to make a hardware current detection to know if the stick is connected but how should i do this?