stlink: Give the NRST check more time as otherwise some L1 discovery board stayed in the bootloader.
This commit is contained in:
parent
086f3565f0
commit
5aa802969b
|
@ -40,13 +40,13 @@ static int stlink_test_nrst(void)
|
||||||
* 11 for ST-Link V1, e.g. on VL Discovery, tag as rev 0
|
* 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
|
* 10 for ST-Link V2, e.g. on F4 Discovery, tag as rev 1
|
||||||
*/
|
*/
|
||||||
|
for (i = 0; i < 0x200; i++) {
|
||||||
rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_IOPCEN);
|
rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_IOPCEN);
|
||||||
gpio_set_mode(GPIOC, GPIO_MODE_INPUT,
|
gpio_set_mode(GPIOC, GPIO_MODE_INPUT,
|
||||||
GPIO_CNF_INPUT_PULL_UPDOWN, GPIO14 | GPIO13);
|
GPIO_CNF_INPUT_PULL_UPDOWN, GPIO14 | GPIO13);
|
||||||
gpio_set(GPIOC, GPIO14 | GPIO13);
|
gpio_set(GPIOC, GPIO14 | GPIO13);
|
||||||
for (i = 0; i < 100; i++)
|
|
||||||
rev = (~(gpio_get(GPIOC, GPIO14 | GPIO13)) >> 13) & 3;
|
rev = (~(gpio_get(GPIOC, GPIO14 | GPIO13)) >> 13) & 3;
|
||||||
|
}
|
||||||
switch (rev) {
|
switch (rev) {
|
||||||
case 0:
|
case 0:
|
||||||
pin = GPIO1;
|
pin = GPIO1;
|
||||||
|
|
Loading…
Reference in New Issue