tested all the stm32f4 board, work great

This commit is contained in:
hathach
2019-09-11 17:37:23 +07:00
parent 8a2b228c3f
commit de659be83e
7 changed files with 24 additions and 17 deletions
+7
View File
@@ -39,3 +39,10 @@ INC += \
# For TinyUSB port source
VENDOR = st
CHIP_FAMILY = synopsys
# Path to STM32 Cube Programmer CLI, should be added into system path
STM32Prog = STM32_Programmer_CLI
# flash target using on-board stlink
flash: $(BUILD)/$(BOARD)-firmware.elf
$(STM32Prog) --connect port=swd --write $< --go
+2
View File
@@ -158,6 +158,7 @@ void board_init(void)
GPIO_InitStruct.Alternate = GPIO_AF10_OTG2_HS;
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
// LED
__HAL_RCC_GPIOB_CLK_ENABLE();
GPIO_InitStruct.Pin = LED_PIN;
@@ -166,6 +167,7 @@ void board_init(void)
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
HAL_GPIO_Init(LED_PORT, &GPIO_InitStruct);
// Button
__HAL_RCC_GPIOC_CLK_ENABLE();
GPIO_InitStruct.Pin = BUTTON_PIN;
GPIO_InitStruct.Mode = GPIO_MODE_INPUT;