diff --git a/examples/stm32/f1/Makefile.include b/examples/stm32/f1/Makefile.include index 503e154..c14fe17 100644 --- a/examples/stm32/f1/Makefile.include +++ b/examples/stm32/f1/Makefile.include @@ -28,7 +28,7 @@ ARCH_FLAGS = -mthumb -mcpu=cortex-m3 $(FP_FLAGS) -mfix-cortex-m3-ldrd # OpenOCD specific variables OOCD ?= openocd -OOCD_INTERFACE ?= flossjtag +OOCD_INTERFACE ?= stlink OOCD_TARGET ?= stm32f1x ################################################################################ diff --git a/examples/stm32/f1/other/systick/systick.c b/examples/stm32/f1/other/systick/systick.c index 174abcd..7b79e9b 100644 --- a/examples/stm32/f1/other/systick/systick.c +++ b/examples/stm32/f1/other/systick/systick.c @@ -27,14 +27,12 @@ uint32_t temp32; static void gpio_setup(void) { - /* Enable GPIOB clock. */ - rcc_periph_clock_enable(RCC_GPIOB); + /* Enable GPIOC clock. */ + rcc_periph_clock_enable(RCC_GPIOC); /* Set GPIO6/7 (in GPIO port B) to 'output push-pull' for the LEDs. */ - gpio_set_mode(GPIOB, GPIO_MODE_OUTPUT_2_MHZ, - GPIO_CNF_OUTPUT_PUSHPULL, GPIO6); - gpio_set_mode(GPIOB, GPIO_MODE_OUTPUT_2_MHZ, - GPIO_CNF_OUTPUT_PUSHPULL, GPIO7); + gpio_set_mode(GPIOC, GPIO_MODE_OUTPUT_2_MHZ, + GPIO_CNF_OUTPUT_PUSHPULL, GPIO13); } void sys_tick_handler(void) @@ -43,7 +41,7 @@ void sys_tick_handler(void) /* We call this handler every 1ms so 1000ms = 1s on/off. */ if (temp32 == 1000) { - gpio_toggle(GPIOB, GPIO6); /* LED2 on/off */ + gpio_toggle(GPIOC , GPIO13); /* LED2 on/off */ temp32 = 0; } } @@ -53,8 +51,7 @@ int main(void) rcc_clock_setup_pll(&rcc_hse_configs[RCC_CLOCK_HSE16_72MHZ]); gpio_setup(); - gpio_clear(GPIOB, GPIO7); /* LED1 on */ - gpio_set(GPIOB, GPIO6); /* LED2 off */ + gpio_set(GPIOC, GPIO13); /* LED2 off */ temp32 = 0;