aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorUwe Hermann2011-10-30 02:04:37 +0100
committerUwe Hermann2011-10-30 02:04:37 +0100
commit44715e9eca2109399cdf8a47ed47d9435b972ad0 (patch)
treed30547ac19bec726561a71dfd1ac1ffe533cfa54 /examples
parent66c24ee131ddb41e7c8520804792415c9a999381 (diff)
Olimex STM32-H103: Make the usb_dfu example work.
On this board PC11 must be low to connect the USB. Thanks Gareth McMullin <gareth@blacksphere.co.nz> for pointing this out.
Diffstat (limited to 'examples')
-rw-r--r--examples/stm32f1/stm32-h103/usb_dfu/usbdfu.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/examples/stm32f1/stm32-h103/usb_dfu/usbdfu.c b/examples/stm32f1/stm32-h103/usb_dfu/usbdfu.c
index 9d184f1..3d9ad81 100644
--- a/examples/stm32f1/stm32-h103/usb_dfu/usbdfu.c
+++ b/examples/stm32f1/stm32-h103/usb_dfu/usbdfu.c
@@ -248,11 +248,11 @@ int main(void)
rcc_clock_setup_in_hsi_out_48mhz();
- rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_IOPAEN);
- rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_AFIOEN);
+ rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_IOPCEN);
- AFIO_MAPR |= AFIO_MAPR_SWJ_CFG_JTAG_OFF_SW_ON;
- gpio_set_mode(GPIOA, GPIO_MODE_INPUT, 0, GPIO15);
+ gpio_set_mode(GPIOC, GPIO_MODE_OUTPUT_50_MHZ,
+ GPIO_CNF_OUTPUT_PUSHPULL, GPIO11);
+ gpio_set(GPIOC, GPIO11);
usbd_init(&stm32f103_usb_driver, &dev, &config, usb_strings);
usbd_set_control_buffer_size(sizeof(usbd_control_buffer));
@@ -261,9 +261,7 @@ int main(void)
USB_REQ_TYPE_TYPE | USB_REQ_TYPE_RECIPIENT,
usbdfu_control_request);
- gpio_set(GPIOA, GPIO15);
- gpio_set_mode(GPIOA, GPIO_MODE_OUTPUT_2_MHZ,
- GPIO_CNF_OUTPUT_PUSHPULL, GPIO15);
+ gpio_clear(GPIOC, GPIO11);
while (1)
usbd_poll();