cancel
Showing results for 
Search instead for 
Did you mean: 

STM32G0B1RCT6 Controller USB_DRD_FS Interrupt problem

Berlin-raj123
Associate III

hi,

i am Using STM32G0B1RCT6

USB_CLK = 48MHZ
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 and i configured PB4 as an output, which is connected to a green LED. Whenever I plug in the USB to my controller, the green light appears, and whenever I remove the USB from the controller, the green light turns off. so usb detected successfully, but the USB Mount/Unmount function does not work.
It works fine with stm32f429zit6 with same configuration. What causes it? how to solve this problem?

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(GPIOB, GPIO_PIN_4, RESET);
  Unmount_USB();
  break;

  case HOST_USER_CLASS_ACTIVE:
  Appli_state = APPLICATION_READY;
  HAL_GPIO_WritePin(GPIOB, GPIO_PIN_4, SET);
  Mount_USB();
  Check_USB_Details();//check Space Details
  Scan_USB("/");//Scan for files and Directories
  Create_File("/ROOTFILE.csv");
  char csv_data[] = "Name, Age, Salary\n\nBerlin, 27, 60000\nAlice, 28, 55000\nAlbert, 32, 55000\n";
  Write_CSV_File("ROOTFILE.csv", csv_data);
  break;

  case HOST_USER_CONNECTION:
  Appli_state = APPLICATION_START;
  break;

  default:
  break;
  }

  

0 REPLIES 0