From a1e062de946319a82b00a3ea24899ad5a4738a80 Mon Sep 17 00:00:00 2001 From: demetris Date: Sat, 2 Jul 2016 09:07:57 +0300 Subject: [PATCH] Add support for 2 cheap ($2) STM32 Dev. boards called blue pill and red pill Since red one is no more manufactured or sold, board support name is stm32-bluepill You can build it with: make BOARD=stm32-bluepill You can find more info in these links: http://wiki.stm32duino.com/index.php?title=Blue_Pill http://wiki.stm32duino.com/index.php?title=Red_Pill SPI flash PINS: PA6 &/or PB14 = MISO PA7 &/or PB15 = MOSI PA4 &/or PB12 = SS/CS PA5 &/or PB13 = SCK PA0 = WP/ Signed-off-by: demetris --- boards/stm32-bluepill.h | 22 ++++++++++++++++++++++ boards/stm32-bluepill.mk | 4 ++++ 2 files changed, 26 insertions(+) create mode 100644 boards/stm32-bluepill.h create mode 100644 boards/stm32-bluepill.mk diff --git a/boards/stm32-bluepill.h b/boards/stm32-bluepill.h new file mode 100644 index 0000000..b592062 --- /dev/null +++ b/boards/stm32-bluepill.h @@ -0,0 +1,22 @@ +#ifndef __BOARD_H__ +#define __BOARD_H__ + +#include +#include +#include + +#define BOARD_USE_DEBUG_PINS_AS_GPIO false /* We don't have to disable SWD to access Gpio's on these boards */ + +#define BOARD_RCC_LED RCC_GPIOC +#define BOARD_PORT_LED GPIOC +#define BOARD_PIN_LED GPIO13 +#define BOARD_LED_HIGH_IS_BUSY true + +#define BOARD_RCC_USB_PULLUP RCC_GPIOA +#define BOARD_PORT_USB_PULLUP GPIOA +#define BOARD_PIN_USB_PULLUP GPIO12 +#define BOARD_USB_HIGH_IS_PULLUP true + +/* Currently you can only use SPI1, since it has highest clock. */ + +#endif /* __BOARD_H__ */ diff --git a/boards/stm32-bluepill.mk b/boards/stm32-bluepill.mk new file mode 100644 index 0000000..7c069a9 --- /dev/null +++ b/boards/stm32-bluepill.mk @@ -0,0 +1,4 @@ +ARCH_FLAGS = -DSTM32F1 -mthumb -mcpu=cortex-m3 -msoft-float -mfix-cortex-m3-ldrd +LDSCRIPT = libopencm3/lib/stm32/f1/stm32f103x8.ld +LIBOPENCM3 = libopencm3/lib/libopencm3_stm32f1.a +OPENCM3_MK = lib/stm32/f1