Skip to content

Commit

Permalink
Add support for 2 cheap ($2) STM32 Dev. boards called blue pill and r…
Browse files Browse the repository at this point in the history
…ed 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 <[email protected]>
  • Loading branch information
Ntemis committed Jul 2, 2016
1 parent 7751ed9 commit a1e062d
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
22 changes: 22 additions & 0 deletions boards/stm32-bluepill.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#ifndef __BOARD_H__
#define __BOARD_H__

#include <stdbool.h>
#include <libopencm3/stm32/rcc.h>
#include <libopencm3/stm32/gpio.h>

#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__ */
4 changes: 4 additions & 0 deletions boards/stm32-bluepill.mk
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit a1e062d

Please sign in to comment.