From 821f4a49eafcaa00962c2d29b9ff363046aa97ef Mon Sep 17 00:00:00 2001 From: Amitesh Singh Date: Sat, 26 Aug 2017 19:40:55 +0900 Subject: [PATCH] tests: gadget0: stm32f1 hack should be consistent D+ is PA12 not PA11. The reason this worked before, is because the line before made PA12 output, and without setting the GPIO_ODR register _before_ hand, this meant as soon as it was switched to output, it received the reset value of GPIO_ODR for PA12, ie, 0. (Effectively doing a "free" gpio_clear(GPIOA, GPIO12) Because GPIO11 wasn't configured to be an output, the confusing gpio_clear(GPIOA, GPIO11) was simply configuring the pullup/down value of the input, which was still ignored, as it was (out of reset) in input floating mode. Reviewed-by: Karl Palsson --- tests/gadget-zero/main-stm32f103-generic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/gadget-zero/main-stm32f103-generic.c b/tests/gadget-zero/main-stm32f103-generic.c index 27148806..5e701dea 100644 --- a/tests/gadget-zero/main-stm32f103-generic.c +++ b/tests/gadget-zero/main-stm32f103-generic.c @@ -50,7 +50,7 @@ int main(void) */ gpio_set_mode(GPIOA, GPIO_MODE_OUTPUT_2_MHZ, GPIO_CNF_OUTPUT_PUSHPULL, GPIO12); - gpio_clear(GPIOA, GPIO11); + gpio_clear(GPIOA, GPIO12); for (unsigned int i = 0; i < 800000; i++) { __asm__("nop"); }