stm32/boards/VCC_GND_H743VI: Add board definition for VCC_GND_H743VI.

This commit is contained in:
Boris Vinogradov 2021-08-28 23:19:55 +03:00 committed by Damien George
parent 0ec5052f62
commit 97bbc0bb91
5 changed files with 232 additions and 0 deletions

View File

@ -0,0 +1,9 @@
#include "py/mphal.h"
void VCC_GND_STM32H743VI_board_early_init(void) {
// set SPI and QSPI flashes CS pin high
mp_hal_pin_output(pin_B10);
mp_hal_pin_write(pin_B10, 1);
mp_hal_pin_output(pin_B12);
mp_hal_pin_write(pin_B12, 1);
}

View File

@ -0,0 +1,103 @@
/* This file is part of the MicroPython project, http://micropython.org/
* MIT License; Copyright (c) 2021 Damien P. George
*/
// STM32H743VIT6 H7 core board by VCC-GND Studio
// http://vcc-gnd.com/
// https://item.taobao.com/item.htm?ft=t&id=614466740679
// https://www.aliexpress.com/wholesale?SearchText=STM32H743VIT6
#define MICROPY_HW_BOARD_NAME "VCC-GND STM32H743VI"
#define MICROPY_HW_MCU_NAME "STM32H743VI"
#define MICROPY_HW_FLASH_FS_LABEL "VCCGNDH743VI"
#define MICROPY_HW_ENABLE_RTC (1)
#define MICROPY_HW_ENABLE_RNG (1)
#define MICROPY_HW_ENABLE_ADC (1)
#define MICROPY_HW_ENABLE_DAC (1)
#define MICROPY_HW_ENABLE_USB (1)
#define MICROPY_HW_ENABLE_SDCARD (1)
#define MICROPY_HW_HAS_SWITCH (1)
#define MICROPY_HW_HAS_FLASH (1)
#define MICROPY_BOARD_EARLY_INIT VCC_GND_STM32H743VI_board_early_init
// The board has an 25MHz HSE, the following gives 480MHz CPU speed
#define MICROPY_HW_CLK_PLLM (5)
#define MICROPY_HW_CLK_PLLN (192)
#define MICROPY_HW_CLK_PLLP (2)
#define MICROPY_HW_CLK_PLLQ (4)
#define MICROPY_HW_CLK_PLLR (2)
// The USB clock is set using PLL3
#define MICROPY_HW_CLK_PLL3M (5)
#define MICROPY_HW_CLK_PLL3N (48)
#define MICROPY_HW_CLK_PLL3P (2)
#define MICROPY_HW_CLK_PLL3Q (5)
#define MICROPY_HW_CLK_PLL3R (2)
// 5 wait states
#define MICROPY_HW_FLASH_LATENCY FLASH_LATENCY_5
// UART config
#define MICROPY_HW_UART2_TX (pin_D5)
#define MICROPY_HW_UART2_RX (pin_D6)
#define MICROPY_HW_UART2_RTS (pin_D4)
#define MICROPY_HW_UART2_CTS (pin_D3)
#define MICROPY_HW_UART3_TX (pin_D8)
#define MICROPY_HW_UART3_RX (pin_D9)
#define MICROPY_HW_UART5_TX (pin_B6)
#define MICROPY_HW_UART5_RX (pin_B12)
#define MICROPY_HW_UART6_TX (pin_C6)
#define MICROPY_HW_UART6_RX (pin_C7)
#define MICROPY_HW_UART8_TX (pin_E1)
#define MICROPY_HW_UART8_RX (pin_E0)
// I2C buses
#define MICROPY_HW_I2C1_SCL (pin_B6)
#define MICROPY_HW_I2C1_SDA (pin_B7)
#define MICROPY_HW_I2C2_SCL (pin_B10)
#define MICROPY_HW_I2C2_SDA (pin_B11)
#define MICROPY_HW_I2C3_SCL (pin_A8)
#define MICROPY_HW_I2C3_SDA (pin_C9)
// SPI buses
#define MICROPY_HW_SPI1_NSS (pin_A4)
#define MICROPY_HW_SPI1_SCK (pin_A5)
#define MICROPY_HW_SPI1_MISO (pin_A6)
#define MICROPY_HW_SPI1_MOSI (pin_A7)
#define MICROPY_HW_SPI2_NSS (pin_B12)
#define MICROPY_HW_SPI2_SCK (pin_B13)
#define MICROPY_HW_SPI2_MISO (pin_B14)
#define MICROPY_HW_SPI2_MOSI (pin_B15)
// USRSW is pulled low. Pressing the button makes the input go high.
#define MICROPY_HW_USRSW_PIN (pin_B3)
#define MICROPY_HW_USRSW_PULL (GPIO_NOPULL)
#define MICROPY_HW_USRSW_EXTI_MODE (GPIO_MODE_IT_RISING)
#define MICROPY_HW_USRSW_PRESSED (1)
// LEDs
#define MICROPY_HW_LED1 (pin_A13) // red
#define MICROPY_HW_LED2 (pin_A14) // green
#define MICROPY_HW_LED3 (pin_A15) // yellow
#define MICROPY_HW_LED4 (pin_B4) // blue
#define MICROPY_HW_LED_ON(pin) (mp_hal_pin_high(pin))
#define MICROPY_HW_LED_OFF(pin) (mp_hal_pin_low(pin))
// USB config
#define MICROPY_HW_USB_FS (1)
#define MICROPY_HW_USB_VBUS_DETECT_PIN (pin_A9)
#define MICROPY_HW_USB_OTG_ID_PIN (pin_A10)
// FDCAN bus
#define MICROPY_HW_CAN1_NAME "FDCAN1"
#define MICROPY_HW_CAN1_TX (pin_D1)
#define MICROPY_HW_CAN1_RX (pin_D0)
// SD card detect switch
#define MICROPY_HW_SDCARD_DETECT_PIN (pin_A8)
#define MICROPY_HW_SDCARD_DETECT_PULL (GPIO_PULLUP)
#define MICROPY_HW_SDCARD_DETECT_PRESENT (GPIO_PIN_RESET)
void VCC_GND_STM32H743VI_board_early_init(void);

View File

@ -0,0 +1,21 @@
USE_MBOOT ?= 0
# MCU settings
MCU_SERIES = h7
CMSIS_MCU = STM32H743xx
MICROPY_FLOAT_IMPL = double
AF_FILE = boards/stm32h743_af.csv
ifeq ($(USE_MBOOT),1)
# When using Mboot all the text goes together after the filesystem
LD_FILES = boards/stm32h743.ld boards/common_blifs.ld
TEXT0_ADDR = 0x08040000
else
# When not using Mboot the ISR text goes first, then the rest after the filesystem
LD_FILES = boards/stm32h743.ld boards/common_ifs.ld
TEXT0_ADDR = 0x08000000
TEXT1_ADDR = 0x08040000
endif
# MicroPython settings
MICROPY_VFS_LFS2 = 1

View File

@ -0,0 +1,80 @@
A0,PA0
A1,PA1
A2,PA2
A3,PA3
A4,PA4
A5,PA5
A6,PA6
A7,PA7
A8,PA8
A9,PA9
A10,PA10
A11,PA11
A12,PA12
A13,PA13
A14,PA14
A15,PA15
B0,PB0
B1,PB1
B2,PB2
B3,PB3
B4,PB4
B5,PB5
B6,PB6
B7,PB7
B8,PB8
B9,PB9
B10,PB10
B11,PB11
B12,PB12
B13,PB13
B14,PB14
B15,PB15
C0,PC0
C1,PC1
C2,PC2
C3,PC3
C4,PC4
C5,PC5
C6,PC6
C7,PC7
C8,PC8
C9,PC9
C10,PC10
C11,PC11
C12,PC12
C13,PC13
C14,PC14
C15,PC15
D0,PD0
D1,PD1
D2,PD2
D3,PD3
D4,PD4
D5,PD5
D6,PD6
D7,PD7
D8,PD8
D9,PD9
D10,PD10
D11,PD11
D12,PD12
D13,PD13
D14,PD14
D15,PD15
E0,PE0
E1,PE1
E2,PE2
E3,PE3
E4,PE4
E5,PE5
E6,PE6
E7,PE7
E8,PE8
E9,PE9
E10,PE10
E11,PE11
E12,PE12
E13,PE13
E14,PE14
E15,PE15
1 A0 PA0
2 A1 PA1
3 A2 PA2
4 A3 PA3
5 A4 PA4
6 A5 PA5
7 A6 PA6
8 A7 PA7
9 A8 PA8
10 A9 PA9
11 A10 PA10
12 A11 PA11
13 A12 PA12
14 A13 PA13
15 A14 PA14
16 A15 PA15
17 B0 PB0
18 B1 PB1
19 B2 PB2
20 B3 PB3
21 B4 PB4
22 B5 PB5
23 B6 PB6
24 B7 PB7
25 B8 PB8
26 B9 PB9
27 B10 PB10
28 B11 PB11
29 B12 PB12
30 B13 PB13
31 B14 PB14
32 B15 PB15
33 C0 PC0
34 C1 PC1
35 C2 PC2
36 C3 PC3
37 C4 PC4
38 C5 PC5
39 C6 PC6
40 C7 PC7
41 C8 PC8
42 C9 PC9
43 C10 PC10
44 C11 PC11
45 C12 PC12
46 C13 PC13
47 C14 PC14
48 C15 PC15
49 D0 PD0
50 D1 PD1
51 D2 PD2
52 D3 PD3
53 D4 PD4
54 D5 PD5
55 D6 PD6
56 D7 PD7
57 D8 PD8
58 D9 PD9
59 D10 PD10
60 D11 PD11
61 D12 PD12
62 D13 PD13
63 D14 PD14
64 D15 PD15
65 E0 PE0
66 E1 PE1
67 E2 PE2
68 E3 PE3
69 E4 PE4
70 E5 PE5
71 E6 PE6
72 E7 PE7
73 E8 PE8
74 E9 PE9
75 E10 PE10
76 E11 PE11
77 E12 PE12
78 E13 PE13
79 E14 PE14
80 E15 PE15

View File

@ -0,0 +1,19 @@
/* This file is part of the MicroPython project, http://micropython.org/
* The MIT License (MIT)
* Copyright (c) 2019 Damien P. George
*/
#ifndef MICROPY_INCLUDED_STM32H7XX_HAL_CONF_H
#define MICROPY_INCLUDED_STM32H7XX_HAL_CONF_H
#include "boards/stm32h7xx_hal_conf_base.h"
// Oscillator values in Hz
#define HSE_VALUE (25000000)
#define LSE_VALUE (32768)
#define EXTERNAL_CLOCK_VALUE (12288000)
// Oscillator timeouts in ms
#define HSE_STARTUP_TIMEOUT (5000)
#define LSE_STARTUP_TIMEOUT (5000)
#endif // MICROPY_INCLUDED_STM32H7XX_HAL_CONF_H