This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

USB DFU only work in main clock 48Mhz

HI All,

I modify the USB DFU sample code from ST and it works when the main clock is set to 48Mhz. The following is the system settings.


SCU_MCLKSourceConfig(SCU_MCLK_OSC);
//  FMI_Config(FMI_READ_WAIT_STATE_2,FMI_WRITE_WAIT_STATE_0, FMI_PWD_ENABLE, FMI_LVD_ENABLE,FMI_FREQ_HIGH);
  SCU_PLLFactorsConfig(192, 25, 3);
  SCU_PLLCmd(ENABLE);
  SCU_MCLKSourceConfig(SCU_MCLK_PLL);

  SCU_AHBPeriphClockConfig(__VIC, ENABLE);
  SCU_AHBPeriphReset(__VIC, DISABLE);
  /*USB clock = MCLK= 48MHz*/
  SCU_USBCLKConfig(SCU_USBCLK_MCLK);
  /*Enable USB clock*/
  SCU_AHBPeriphClockConfig(__USB, ENABLE);
  SCU_AHBPeriphReset(__USB, DISABLE);

  SCU_AHBPeriphClockConfig(__USB48M, ENABLE);

If I change the main clock to 96Mhz as below, then DFU doesn't work anymore.

SCU_PLLFactorsConfig(192, 25, 2);
SCU_USBCLKConfig(SCU_USBCLK_MCLK2);

I greatly appreciate any helps to point me out the reason and what I need to do to fix the issue.

Best Regards,

Lillian