cancel
Showing results for 
Search instead for 
Did you mean: 

STM32G0B0 USB Interrupt Error Issue

Kimjunho
Associate II

MCU---STM32G0B0CET6

CUBEIDE Setting

x-tal 16MHz

USB CLOCK---48MHz

USB_DRD_FS---Host_Only_FS,
USB_HOST---Mass Storage Host Class,
FATFS---USB Disk

USB Interrupt---Enable

[Probrem]

If you set it to the above mode and operate it, the USB is recognized only once when you first turn on the power, and the USB Mount/Unmount function does not work at all after that.
Even if you insert the USB after turning on the power, the interrupter function does not work after the first paper is recognized.

It works fine on STM32F404 with the same configuration.
What causes this error only on STM32G0B0?
We ask for help from experts.

3 REPLIES 3
Kimjunho
Associate II

I asked the same question a while ago, but I pressed the wrong button and it was marked as "solved" so I'm asking again.

Kimjunho
Associate II

The "USBH_UserProcess" routine in usb_host.c controls the LED to determine whether a USB has been inserted.
When I checked with the debugger, I found that the interrupter was caught in this routine only once initially.
Below is the USB insertion/removal confirmation CODE for "USBH_UserProcess".

/* 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 */
}

Click on the arrow on the top right of the post and select the option to unmark the reply as solved.

If you feel a post has answered your question, please click "Accept as Solution".