cancel
Showing results for 
Search instead for 
Did you mean: 

STM32G0B0 USB_DRD_FS Interrupt problem

Kimjunho
Associate II

hello.
Using STM32G0B0CET6
USB_DRD_FS---Host_Only_FS,
USB_HOST---Mass Storage Host Class,
FATFS---USB Disk

USB Interrupt---Enable


If you set it to the above mode and operate it, the USB is recognized only once when the power is first turned on, and the USB Mount/Unmount function does not work at all from then on.
It seems that the interrupter is activated only at the beginning of power-on and is disabled thereafter.
It works fine with stm32f401 with same configuration. What causes it?
I ask for help from experts.

1 ACCEPTED SOLUTION

Accepted Solutions
FBL
ST Employee

Hi @Kimjunho 

Which clock is selected for host configuration? Could you share your software setup? your hardware configuraiton?

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

View solution in original post

4 REPLIES 4
Kimjunho
Associate II

Correct the typo.

STM32B0B0CET6--->STM32G0B0CET6

FBL
ST Employee

Hi @Kimjunho 

Which clock is selected for host configuration? Could you share your software setup? your hardware configuraiton?

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Kimjunho
Associate II

The USB clock is 48 MHz with an external crystal oscillator of 16 MHz.
It is recognized only once when the initial power is turned on, and the USB interrupter does not operate from then on.clock_config.png

The "USBH_UserProcess" routine in usb_host.c controls the LED to determine whether the USB is inserted.

static void USBH_UserProcess (USBH_HandleTypeDef *phost, uint8_t id)
{
/* USER CODE BEGIN CALL_BACK_1 */
switch(id)
{
case HOST_USER_SELECT_CONFIGURATION:
break;

case HOST_USER_DISCONNECTION:
Appli_state = APPLICATION_DISCONNECT;
HAL_GPIO_WritePin(USB_LED_GPIO_Port, USB_LED_Pin, RESET);
break;

case HOST_USER_CLASS_ACTIVE:
Appli_state = APPLICATION_READY;
HAL_GPIO_WritePin(USB_LED_GPIO_Port, USB_LED_Pin, SET);
break;

case HOST_USER_CONNECTION:
Appli_state = APPLICATION_START;
break;

default:
break;
}
/* USER CODE END CALL_BACK_1 */
}