Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 86e6ad7

Browse filesBrowse files
thinkl33tdpgeorge
authored andcommitted
stmhal: Add support for STM32F411 Discovery Board (STM32F411E-DISCO).
1 parent 58d9b10 commit 86e6ad7
Copy full SHA for 86e6ad7

4 files changed

+559Lines changed: 559 additions & 0 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file
+64Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
#define MICROPY_HW_BOARD_NAME "F411DISC"
2+
#define MICROPY_HW_MCU_NAME "STM32F411"
3+
#define MICROPY_PY_SYS_PLATFORM "pyboard"
4+
5+
#define MICROPY_HW_HAS_SWITCH (1)
6+
#define MICROPY_HW_HAS_SDCARD (0)
7+
#define MICROPY_HW_HAS_MMA7660 (0)
8+
#define MICROPY_HW_HAS_LIS3DSH (0)
9+
#define MICROPY_HW_HAS_LCD (0)
10+
#define MICROPY_HW_ENABLE_RNG (0)
11+
#define MICROPY_HW_ENABLE_RTC (1)
12+
#define MICROPY_HW_ENABLE_TIMER (1)
13+
#define MICROPY_HW_ENABLE_SERVO (1)
14+
#define MICROPY_HW_ENABLE_DAC (0)
15+
#define MICROPY_HW_ENABLE_SPI1 (1)
16+
#define MICROPY_HW_ENABLE_SPI2 (1)
17+
#define MICROPY_HW_ENABLE_SPI3 (0)
18+
#define MICROPY_HW_ENABLE_CAN (0)
19+
20+
// HSE is 8MHz
21+
#define MICROPY_HW_CLK_PLLM (5)
22+
#define MICROPY_HW_CLK_PLLN (210)
23+
#define MICROPY_HW_CLK_PLLP (RCC_PLLP_DIV4)
24+
#define MICROPY_HW_CLK_PLLQ (7)
25+
26+
// does not have a 32kHz crystal
27+
#define MICROPY_HW_RTC_USE_LSE (0)
28+
29+
// UART config
30+
#define MICROPY_HW_UART1_PORT (GPIOA)
31+
#define MICROPY_HW_UART1_PINS (GPIO_PIN_9 | GPIO_PIN_10)
32+
#define MICROPY_HW_UART2_PORT (GPIOA)
33+
#define MICROPY_HW_UART2_PINS (GPIO_PIN_2 | GPIO_PIN_3)
34+
#define MICROPY_HW_UART2_RTS (GPIO_PIN_1)
35+
#define MICROPY_HW_UART2_CTS (GPIO_PIN_0)
36+
#define MICROPY_HW_UART6_PORT (GPIOC)
37+
#define MICROPY_HW_UART6_PINS (GPIO_PIN_6 | GPIO_PIN_7)
38+
39+
// I2C busses
40+
#define MICROPY_HW_I2C1_SCL (pin_B6)
41+
#define MICROPY_HW_I2C1_SDA (pin_B7)
42+
//#define MICROPY_HW_I2C2_SCL (pin_B10)
43+
//#define MICROPY_HW_I2C2_SDA (pin_B11)
44+
#define MICROPY_HW_I2C3_SCL (pin_A8)
45+
#define MICROPY_HW_I2C3_SDA (pin_A9)
46+
47+
// USRSW is pulled low. Pressing the button makes the input go high.
48+
#define MICROPY_HW_USRSW_PIN (pin_A0)
49+
#define MICROPY_HW_USRSW_PULL (GPIO_NOPULL)
50+
#define MICROPY_HW_USRSW_EXTI_MODE (GPIO_MODE_IT_RISING)
51+
#define MICROPY_HW_USRSW_PRESSED (1)
52+
53+
// LEDs
54+
#define MICROPY_HW_LED1 (pin_D14) // red
55+
#define MICROPY_HW_LED2 (pin_D12) // green
56+
#define MICROPY_HW_LED3 (pin_D13) // orange
57+
#define MICROPY_HW_LED4 (pin_D15) // blue
58+
#define MICROPY_HW_LED_OTYPE (GPIO_MODE_OUTPUT_PP)
59+
#define MICROPY_HW_LED_ON(pin) (pin->gpio->BSRRL = pin->pin_mask)
60+
#define MICROPY_HW_LED_OFF(pin) (pin->gpio->BSRRH = pin->pin_mask)
61+
62+
// USB config
63+
#define MICROPY_HW_USB_VBUS_DETECT_PIN (pin_A9)
64+
#define MICROPY_HW_USB_OTG_ID_PIN (pin_A10)
Collapse file
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
MCU_SERIES = f4
2+
CMSIS_MCU = STM32F411xE
3+
AF_FILE = boards/stm32f411_af.csv
4+
LD_FILE = boards/stm32f411.ld
Collapse file
+84Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
PC0,PC0
2+
PC1,PC1
3+
PC2,PC2
4+
PC3,PC3
5+
PA0,PA0
6+
PA1,PA1
7+
PA2,PA2
8+
PA3,PA3
9+
PA4,PA4
10+
PA5,PA5
11+
PA6,PA6
12+
PA7,PA7
13+
PC4,PC4
14+
PC5,PC5
15+
PB0,PB0
16+
PB1,PB1
17+
PB2,PB2
18+
PE7,PE7
19+
PE8,PE8
20+
PE9,PE9
21+
PE10,PE10
22+
PE11,PE11
23+
PE12,PE12
24+
PE13,PE13
25+
PE14,PE14
26+
PE15,PE15
27+
PB10,PB10
28+
PB11,PB11
29+
PB12,PB12
30+
PB13,PB13
31+
PB14,PB14
32+
PB15,PB15
33+
PD8,PD8
34+
PD9,PD9
35+
PD10,PD10
36+
PD11,PD11
37+
PD12,PD12
38+
PD13,PD13
39+
PD14,PD14
40+
PD15,PD15
41+
PC6,PC6
42+
PC7,PC7
43+
PC8,PC8
44+
PC9,PC9
45+
PA8,PA8
46+
PA9,PA9
47+
PA10,PA10
48+
PA13,PA13
49+
PA14,PA14
50+
PA15,PA15
51+
PC10,PC10
52+
PC11,PC11
53+
PC12,PC12
54+
PD0,PD0
55+
PD1,PD1
56+
PD2,PD2
57+
PD3,PD3
58+
PD4,PD4
59+
PD5,PD5
60+
PD6,PD6
61+
PD7,PD7
62+
PB4,PB4
63+
PB5,PB5
64+
PB6,PB6
65+
PB7,PB7
66+
PB8,PB8
67+
PB9,PB9
68+
PE0,PE0
69+
PE1,PE1
70+
PE2,PE2
71+
PE3,PE3
72+
PE4,PE4
73+
PE5,PE5
74+
PE6,PE6
75+
PC13,PC13
76+
PC14,PC14
77+
PC15,PC15
78+
PH0,PH0
79+
PH1,PH1
80+
LED_GREEN,PD12
81+
LED_ORANGE,PD13
82+
LED_RED,PD14
83+
LED_BLUE,PD15
84+
SW,PA0

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.