From 74405de4a5a1beab4023731de41c9f6e1c7f69a4 Mon Sep 17 00:00:00 2001 From: Andrey Smirnov Date: Tue, 6 Nov 2012 11:03:12 -0800 Subject: Enable OTG clock during initialization Add a call to enable USB clock, otherwise the dive will not enumerate. --- examples/stm32/f1/other/usb_dfu/usbdfu.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'examples/stm32/f1/other/usb_dfu/usbdfu.c') diff --git a/examples/stm32/f1/other/usb_dfu/usbdfu.c b/examples/stm32/f1/other/usb_dfu/usbdfu.c index 0211a47..f30783f 100644 --- a/examples/stm32/f1/other/usb_dfu/usbdfu.c +++ b/examples/stm32/f1/other/usb_dfu/usbdfu.c @@ -244,6 +244,8 @@ int main(void) AFIO_MAPR |= AFIO_MAPR_SWJ_CFG_JTAG_OFF_SW_ON; gpio_set_mode(GPIOA, GPIO_MODE_INPUT, 0, GPIO15); + rcc_peripheral_enable_clock(&RCC_AHBENR, RCC_AHBENR_OTGFSEN); + usbd_init(&stm32f107_usb_driver, &dev, &config, usb_strings); usbd_set_control_buffer_size(sizeof(usbd_control_buffer)); usbd_register_control_callback( -- cgit v1.2.3