diff options
author | Boris Vinogradov <no111u3@gmail.com> | 2021-08-28 23:19:55 +0300 |
---|---|---|
committer | Damien George <damien@micropython.org> | 2021-09-10 15:49:26 +1000 |
commit | 97bbc0bb91a6215eecdeb39c37505fda96a1d74d (patch) | |
tree | 4277926bc0d68a1518190ca55bd2eabe772e2ef3 | |
parent | 0ec5052f622307429ab5dd74f1582bcd0a8e0aa1 (diff) |
stm32/boards/VCC_GND_H743VI: Add board definition for VCC_GND_H743VI.
-rw-r--r-- | ports/stm32/boards/VCC_GND_H743VI/board_init.c | 9 | ||||
-rw-r--r-- | ports/stm32/boards/VCC_GND_H743VI/mpconfigboard.h | 103 | ||||
-rw-r--r-- | ports/stm32/boards/VCC_GND_H743VI/mpconfigboard.mk | 21 | ||||
-rw-r--r-- | ports/stm32/boards/VCC_GND_H743VI/pins.csv | 80 | ||||
-rw-r--r-- | ports/stm32/boards/VCC_GND_H743VI/stm32h7xx_hal_conf.h | 19 |
5 files changed, 232 insertions, 0 deletions
diff --git a/ports/stm32/boards/VCC_GND_H743VI/board_init.c b/ports/stm32/boards/VCC_GND_H743VI/board_init.c new file mode 100644 index 000000000..53b685ff9 --- /dev/null +++ b/ports/stm32/boards/VCC_GND_H743VI/board_init.c @@ -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); +} diff --git a/ports/stm32/boards/VCC_GND_H743VI/mpconfigboard.h b/ports/stm32/boards/VCC_GND_H743VI/mpconfigboard.h new file mode 100644 index 000000000..9ef5490fd --- /dev/null +++ b/ports/stm32/boards/VCC_GND_H743VI/mpconfigboard.h @@ -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); diff --git a/ports/stm32/boards/VCC_GND_H743VI/mpconfigboard.mk b/ports/stm32/boards/VCC_GND_H743VI/mpconfigboard.mk new file mode 100644 index 000000000..1f5fa32a1 --- /dev/null +++ b/ports/stm32/boards/VCC_GND_H743VI/mpconfigboard.mk @@ -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 diff --git a/ports/stm32/boards/VCC_GND_H743VI/pins.csv b/ports/stm32/boards/VCC_GND_H743VI/pins.csv new file mode 100644 index 000000000..6668a92db --- /dev/null +++ b/ports/stm32/boards/VCC_GND_H743VI/pins.csv @@ -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 diff --git a/ports/stm32/boards/VCC_GND_H743VI/stm32h7xx_hal_conf.h b/ports/stm32/boards/VCC_GND_H743VI/stm32h7xx_hal_conf.h new file mode 100644 index 000000000..c4d148b0b --- /dev/null +++ b/ports/stm32/boards/VCC_GND_H743VI/stm32h7xx_hal_conf.h @@ -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 |