Skip to content

Commit ae3fadb

Browse files
committed
stm32/boards/WEACTV20_F411: Add support for WeAct v2.0 'blackpill' board
1 parent 96716b4 commit ae3fadb

File tree

4 files changed

+139
-0
lines changed

4 files changed

+139
-0
lines changed
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
#define MICROPY_HW_BOARD_NAME "WEACTV20_F411"
2+
#define MICROPY_HW_MCU_NAME "STM32F411CE"
3+
#define MICROPY_HW_FLASH_FS_LABEL "WEACTV20_F411"
4+
5+
#define MICROPY_PY_THREAD (1)
6+
7+
#define MICROPY_HW_HAS_SWITCH (1)
8+
#define MICROPY_HW_HAS_FLASH (0)
9+
#define MICROPY_HW_ENABLE_RTC (1)
10+
#define MICROPY_HW_ENABLE_USB (1)
11+
#define MICROPY_HW_ENABLE_SERVO (0)
12+
#define MICROPY_HW_ENABLE_SDCARD (0)
13+
#define MICROPY_HW_ENABLE_RNG (0)
14+
15+
// HSE is 25MHz, CPU freq set to 96MHz
16+
#define MICROPY_HW_CLK_PLLM (25)
17+
#define MICROPY_HW_CLK_PLLN (192)
18+
#define MICROPY_HW_CLK_PLLP (RCC_PLLP_DIV2)
19+
#define MICROPY_HW_CLK_PLLQ (4)
20+
21+
// UART config
22+
#define MICROPY_HW_UART1_TX (pin_A9)
23+
#define MICROPY_HW_UART1_RX (pin_A10)
24+
25+
#define MICROPY_HW_UART2_TX (pin_A2)
26+
#define MICROPY_HW_UART2_RX (pin_A3)
27+
28+
#define MICROPY_HW_UART_REPL PYB_UART_1
29+
#define MICROPY_HW_UART_REPL_BAUD 115200
30+
31+
// I2C busses
32+
#define MICROPY_HW_I2C1_SCL (pin_B6)
33+
#define MICROPY_HW_I2C1_SDA (pin_B7)
34+
#define MICROPY_HW_I2C2_SCL (pin_B10)
35+
#define MICROPY_HW_I2C2_SDA (pin_B9)
36+
#define MICROPY_HW_I2C3_SCL (pin_A8)
37+
#define MICROPY_HW_I2C3_SDA (pin_B8)
38+
39+
// SPI busses
40+
#define MICROPY_HW_SPI1_NSS (pin_A4)
41+
#define MICROPY_HW_SPI1_SCK (pin_A5)
42+
#define MICROPY_HW_SPI1_MISO (pin_A6)
43+
#define MICROPY_HW_SPI1_MOSI (pin_A7)
44+
45+
#define MICROPY_HW_SPI2_NSS (pin_B12)
46+
#define MICROPY_HW_SPI2_SCK (pin_B13)
47+
#define MICROPY_HW_SPI2_MISO (pin_B14)
48+
#define MICROPY_HW_SPI2_MOSI (pin_B15)
49+
50+
#define MICROPY_HW_SPI3_NSS (pin_A15)
51+
#define MICROPY_HW_SPI3_SCK (pin_B3)
52+
#define MICROPY_HW_SPI3_MISO (pin_B4)
53+
#define MICROPY_HW_SPI3_MOSI (pin_B5)
54+
55+
// Switch
56+
#define MICROPY_HW_USRSW_PIN (pin_A0)
57+
#define MICROPY_HW_USRSW_PULL (GPIO_PULLUP)
58+
#define MICROPY_HW_USRSW_EXTI_MODE (GPIO_MODE_IT_FALLING)
59+
#define MICROPY_HW_USRSW_PRESSED (0)
60+
61+
// LEDs
62+
#define MICROPY_HW_LED1 (pin_C13)
63+
#define MICROPY_HW_LED_ON(pin) (mp_hal_pin_low(pin))
64+
#define MICROPY_HW_LED_OFF(pin) (mp_hal_pin_high(pin))
65+
66+
#define MICROPY_HW_RTC_USE_LSE (1)
67+
#define MICROPY_HW_RTC_USE_US (0)
68+
#define MICROPY_HW_RTC_USE_CALOUT (1)
69+
70+
// USB config
71+
#define MICROPY_HW_USB_FS (1)
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
MCU_SERIES = f4
2+
CMSIS_MCU = STM32F411xE
3+
AF_FILE = boards/stm32f411_af.csv
4+
LD_FILES = boards/stm32f411.ld boards/common_ifs.ld
5+
TEXT0_ADDR = 0x08000000
6+
TEXT1_ADDR = 0x08020000
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
PA0,PA0
2+
PA1,PA1
3+
PA2,PA2
4+
PA3,PA3
5+
PA4,PA4
6+
PA5,PA5
7+
PA6,PA6
8+
PA7,PA7
9+
PA8,PA8
10+
PA9,PA9
11+
PA10,PA10
12+
PA11,PA11
13+
PA12,PA12
14+
PA15,PA15
15+
PB0,PB0
16+
PB1,PB1
17+
PB2,PB2
18+
PB3,PB3
19+
PB4,PB4
20+
PB5,PB5
21+
PB6,PB6
22+
PB7,PB7
23+
PB8,PB8
24+
PB9,PB9
25+
PB10,PB10
26+
PB12,PB12
27+
PB13,PB13
28+
PB14,PB14
29+
PB15,PB15
30+
PC14,PC14
31+
PC15,PC15
32+
LED_BLUE,PC13
33+
SW,PA0
34+
SWDIO,PA13
35+
SWCLK,PA14
36+
OSC32_IN,PH0
37+
OSC32_OUT,PH1
38+
USB_DM,PA11
39+
USB_DP,PA12
40+
FLASH_CS,PA4
41+
FLASH_SCK,PA5
42+
FLASH_MOSI,PA7
43+
FLASH_MISO,PA6
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/* This file is part of the MicroPython project, http://micropython.org/
2+
* The MIT License (MIT)
3+
* Copyright (c) 2019 Damien P. George
4+
*/
5+
#ifndef MICROPY_INCLUDED_STM32F4XX_HAL_CONF_H
6+
#define MICROPY_INCLUDED_STM32F4XX_HAL_CONF_H
7+
8+
#include "boards/stm32f4xx_hal_conf_base.h"
9+
10+
// Oscillator values in Hz
11+
#define HSE_VALUE (25000000)
12+
#define LSE_VALUE (32768)
13+
#define EXTERNAL_CLOCK_VALUE (12288000)
14+
15+
// Oscillator timeouts in ms
16+
#define HSE_STARTUP_TIMEOUT (100)
17+
#define LSE_STARTUP_TIMEOUT (5000)
18+
19+
#endif // MICROPY_INCLUDED_STM32F4XX_HAL_CONF_H

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy