aboutsummaryrefslogtreecommitdiff
path: root/src/platforms
diff options
context:
space:
mode:
authorUwe Bonnes2013-10-06 14:50:39 +0200
committerGareth McMullin2013-10-22 07:18:09 +0800
commit5aa802969bbb4cf2291faa59ce31a1697ca71d2f (patch)
tree896d7f6364afa0131b71d68da3e66f0a5511003f /src/platforms
parent086f3565f0815a4ddfd926f8aa18bd5646a0f54f (diff)
stlink: Give the NRST check more time as otherwise some L1 discovery board stayed in the bootloader.
Diffstat (limited to 'src/platforms')
-rw-r--r--src/platforms/stlink/usbdfu.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/platforms/stlink/usbdfu.c b/src/platforms/stlink/usbdfu.c
index f688c1c..76a19b0 100644
--- a/src/platforms/stlink/usbdfu.c
+++ b/src/platforms/stlink/usbdfu.c
@@ -40,13 +40,13 @@ static int stlink_test_nrst(void)
* 11 for ST-Link V1, e.g. on VL Discovery, tag as rev 0
* 10 for ST-Link V2, e.g. on F4 Discovery, tag as rev 1
*/
- rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_IOPCEN);
- gpio_set_mode(GPIOC, GPIO_MODE_INPUT,
- GPIO_CNF_INPUT_PULL_UPDOWN, GPIO14 | GPIO13);
- gpio_set(GPIOC, GPIO14 | GPIO13);
- for (i = 0; i < 100; i++)
- rev = (~(gpio_get(GPIOC, GPIO14 | GPIO13)) >> 13) & 3;
-
+ for (i = 0; i < 0x200; i++) {
+ rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_IOPCEN);
+ gpio_set_mode(GPIOC, GPIO_MODE_INPUT,
+ GPIO_CNF_INPUT_PULL_UPDOWN, GPIO14 | GPIO13);
+ gpio_set(GPIOC, GPIO14 | GPIO13);
+ rev = (~(gpio_get(GPIOC, GPIO14 | GPIO13)) >> 13) & 3;
+ }
switch (rev) {
case 0:
pin = GPIO1;