Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
mcauser committed Feb 13, 2020
0 parents commit e8f65b7
Show file tree
Hide file tree
Showing 8 changed files with 525 additions and 0 deletions.
21 changes: 21 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2020 Mike Causer

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
204 changes: 204 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,204 @@
# MCUDev DevEBox STM32H7XX_M

MicroPython board definition files for the MCUDev STM32H7XX_M mini dev boards.

There are two versions with different STM32H7 chips:

* STM32H750VBT6 - 128K flash
* STM32H743VIT6 - 2048K flash

**Markings:** DevEBox STM32H7XX_M Ver:V2.0 SN:1907

![board](docs/STM32H7XX_M.jpg)

You can buy one for around $29 AUD (Feb 2020) on [AliExpress].

### Build the firmware

Clone the board definitions to your [MicroPython](https://github.com/micropython/micropython) `ports/stm32/boards` folder.

```bash
cd micropython/ports/stm32/boards
git clone https://github.com/mcauser/MCUDEV_DEVEBOX_H7XX_M.git

cd ..
make BOARD=MCUDEV_DEVEBOX_H7XX_M
```

### Flashing via DFU

This board can be flashed using DFU. To put the board in DFU mode, disconnect
USB, set BOOT0 to ON by connecting pin BT0 to 3V3 and reconnect USB.

Now you can flash the board using USB with the command:

```bash
make BOARD=MCUDEV_DEVEBOX_H7XX_M deploy
```

Once the upload is complete, disconnect USB, set BOOT0 to OFF by connecting
pin BT0 to GND and reconnect USB.

Alternatively, you can use the MicroPython command `pyb.bootloader()`
to get into DFU mode without needing to use the switch.

Currently, you need to unplug and replug the board in order to switch from DFU
mode back to regular mode.

### Accessing the board

Once built and deployed, you can access the MicroPython REPL (the Python prompt) via USB serial.

```bash
screen /dev/tty.usbmodem1422 115200
# or
screen /dev/ttyACM0 115200
```

### STM32H750VBT6 Specifications

* STM32H750VBT6 ARM Cortex M7
* 128 Kbyte Flash, 1 Mbyte RAM

### STM32H743VIT6 Specifications

* STM32H743VIT6 ARM Cortex M7
* 2 Mbyte Flash, 1 Mbyte RAM

### Common Specifications

* 400MHz, 1027 DMIPS / 2.14 DMIPS / MHz
* 25MHz system crystal
* 32.768KHz RTC crystal
* SWD header (BOOT0, 3V3, GND, PA13/SWDIO, PA14/SWCLK)
* 6x SPI, 4x USART, 4x UART, 1x LPUART, 3x I2S, 1x LPI2S, 4x I2C
* 4x SAI, SPDIFRX, SWPMI, MDIO Slave, 2x SD/SDIO/MMC, 2x CAN
* 2x USB OTG, 1x FS, 1x HS/FS
* Micro SD
* Winbond W25Q64 64Mbit QSPI Flash
* 1x 10/100 Ethernet MAC with DMA
* HDMI-CEC
* 1x 8 to 14-bit Parallel Camera interface
* 3x ADC (16-bit / 36-channel)
* 1x temperature sensor
* 2x DAC (12-bit)
* 2x ULP comparators
* 2x Op Amps
* 1x high res timer, 2x 32-bit timers, 2x advanced timers, 10x general timers,
* 5x low power timers, 2x watchdogs, 1x systick timer
* 96-bit unique ID
* AMS1117-3.3V: 3.3V LDO voltage regulator, max current 800mA
* Micro USB for power and comms
* Power LED D1
* User LED D2 (PA1) active low
* Reset button, 2x user buttons K1 (PE3), K2 (PC5)
* 2x22 2.54mm side headers
* DCMI camera interface (OV2640, OV5640)
* SPI TFT/OLED header (3V3, GND, SDI, SCL, CS, SDO, D/C, BLK)
* RTC battery header B1 beside camera interface
* M3 mounting holes
* Dimensions: 40.89mm x 68.59mm

### Exposed Port Pins

* PA0-PA15
* PB0-PB15
* PC0-PC13 (PC14 OSC32_IN and PC15 OSC32_OUT not broken out)
* PD0-PD15
* PE0-PE15

Note: The PB15 next to PE14 is mislabelled. It should be PE15.

### Peripherals

#### TFT/OLED (J4)

* 1 3V3
* 2 GND
* 3 PB15 MOSI
* 4 PB13 SCK
* 5 PB12 CS
* 6 PB14 MISO
* 7 PB1 RS
* 8 PB0 BLK

#### QSPI Flash W25Q64 (U3)

* 1 PB6 QSPI_BK1_NCS
* 2 PD12 QSPI_BK1_IO1
* 3 PE2 QSPI_BK1_IO2
* 4 GND
* 5 PD11 QSPI_BK1_IO0
* 6 PB2 QSPI_CLK
* 7 PD13 QSPI_BK1_IO3
* 8 VCC 3V3

#### SWD debug (J1)

* 1 Boot0
* 2 3V3
* 3 GND
* 4 PA13 SWDIO
* 5 PA14 SWCLK

#### USB (J5)

* 1 VCC 5V
* 2 PA11 USB_DM
* 3 PA12 USB_DP
* 4 NC ID
* 5 GND

#### Micro SD (U5)

* 1 PC10 SDIO_D2
* 2 PC11 SDIO_D3
* 3 PD2 SDIO_CMD
* 4 3V3
* 5 PC12 SDIO_SCK
* 6 GND
* 7 PC8 SDIO_D0
* 8 PC9 SDIO_D1
* 9 NC SD_NC

#### User Button (K1)

* PE3

#### User Button (K2)

* PC5

#### User LED (D2)

* PA1

#### Battery (B1)

* 1 BAT54C
* 2 GND

### Links

* [STM32H750VB on st.com](https://www.st.com/en/microcontrollers-microprocessors/stm32h750vb.html)
* [STM32H743VI on st.com](https://www.st.com/en/microcontrollers-microprocessors/stm32h743vi.html)
* Buy on [AliExpress] or search for "STM32H750VBT6" or "STM32H743VIT6"
* Buy on [Taobao](https://item.taobao.com/item.htm?id=601083694791)
* [STM32H7XX_M schematics](https://github.com/mcauser/MCUDEV_DEVEBOX_H7XX_M/blob/master/docs/STM32H7XX_M_schematics.pdf)

### Related boards

* [MCUDev Black STM32F407VET6](https://github.com/mcauser/BLACK_F407VE)
* [MCUDev Black STM32F407ZET6](https://github.com/mcauser/BLACK_F407ZE)
* [MCUDev Black STM32F407ZGT6](https://github.com/mcauser/BLACK_F407ZG)
* [MCUDev DevEBox STM32F407VET6](https://github.com/mcauser/MCUDEV_DEVEBOX_F407VET6)
* [MCUDev DevEBox STM32F407VGT6](https://github.com/mcauser/MCUDEV_DEVEBOX_F407VGT6)
* [MCUDev DevEBox STM32H7XX_M](MCUDEV_DEVEBOX_H7XX_M) - this board
* [VCC GND STM32F407VET6 Mini](https://github.com/mcauser/VCC_GND_F407VE)
* [VCC GND STM32F407ZGT6 Mini](https://github.com/mcauser/VCC_GND_F407ZG)

[AliExpress]: https://www.aliexpress.com/item/4000300005466.html

## License

Licensed under the [MIT License](http://opensource.org/licenses/MIT).
Binary file added docs/STM32H7XX_M.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/STM32H7XX_M_schematics.pdf
Binary file not shown.
156 changes: 156 additions & 0 deletions mpconfigboard.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
#define MICROPY_HW_BOARD_NAME "MCUDEV DEVEBOX STM32H7XX_M"
#define MICROPY_HW_MCU_NAME "STM32H7XX"
#define MICROPY_HW_FLASH_FS_LABEL "DEVEBOXH7XX_M"

#define MICROPY_HW_HAS_SWITCH (1) // has 2 buttons K1, K2
#define MICROPY_HW_HAS_FLASH (1)
#define MICROPY_HW_ENABLE_RNG (1)
#define MICROPY_HW_ENABLE_RTC (1)
#define MICROPY_HW_ENABLE_DAC (1)
#define MICROPY_HW_ENABLE_USB (1)
#define MICROPY_HW_ENABLE_SDCARD (0) // it has a sd scard, but no detect pin

// HSE is 25MHz
#define MICROPY_HW_CLK_PLLM (25) // divide external clock by this to get 1MHz
#define MICROPY_HW_CLK_PLLN (160) // PLL clock in MHz
#define MICROPY_HW_CLK_PLLP (RCC_PLLP_DIV2) // divide PLL clock by this to get core clock
#define MICROPY_HW_CLK_PLLQ (4) // divide core clock by this to get 40MHz

// The board has a 32kHz crystal for the RTC
#define MICROPY_HW_RTC_USE_LSE (1)
#define MICROPY_HW_RTC_USE_US (0)
// #define MICROPY_HW_RTC_USE_CALOUT (1) // turn on/off PC13 512Hz output

// LPUART1_TX A9,B6
// LPUART1_RX A10,B7
// LPUART1_CTS A11
// LPUART1_RTS A12

// USART1
#define MICROPY_HW_UART1_TX (pin_A9) // A9,B6,B14
#define MICROPY_HW_UART1_RX (pin_A10) // A10,B7,B15
// USART1_CK A8
// USART1_CTS A11
// USART1_NSS A11
// USART1_RTS A12

// USART2
#define MICROPY_HW_UART2_TX (pin_A2) // A2,D5
#define MICROPY_HW_UART2_RX (pin_A3) // A3,D6
// USART2_CTS A0,D3
// USART2_NSS A0,D3
// USART2_RTS A1,D4
// USART2_CK A4,D7

// USART3
#define MICROPY_HW_UART3_TX (pin_D8) // B10,C10,D8
#define MICROPY_HW_UART3_RX (pin_D9) // B11,C11,D9
// USART3_NSS B13,D11
// USART3_CTS B13,D11
// USART3_RTS B14,D12
// USART3_CK B12,C12,D10

// UART4
#define MICROPY_HW_UART4_TX (pin_A0) // A0,A12,B9,C10,D1
#define MICROPY_HW_UART4_RX (pin_A1) // A1,A11,B8,C11,D0
// UART4_RTS A15,B14
// UART4_CTS B0,B15

// UART5
#define MICROPY_HW_UART5_TX (pin_C12) // B6,B13,C12
#define MICROPY_HW_UART5_RX (pin_D2) // B5,B12,D2
// UART5_RTS C8
// UART5_CTS C9

// USART6
#define MICROPY_HW_UART_TX (pin_C6) // C6
#define MICROPY_HW_UART_RX (pin_C7) // C7
// USART6_CK C8

// UART7
#define MICROPY_HW_UART7_TX (pin_E8) // A15,B4,E8
#define MICROPY_HW_UART7_RX (pin_E7) // A8,B3,E7
// UART7_RTS E9
// UART7_CTS E10

// UART8
#define MICROPY_HW_UART8_TX (pin_E1) // E1
#define MICROPY_HW_UART8_RX (pin_E0) // E0
// UART8_CTS D14
// UART8_RTS D15

// I2C busses
#define MICROPY_HW_I2C1_SCL (pin_B8) // B6,B8
#define MICROPY_HW_I2C1_SDA (pin_B9) // B7,B9

#define MICROPY_HW_I2C2_SCL (pin_B10) // B10
#define MICROPY_HW_I2C2_SDA (pin_B11) // B11

#define MICROPY_HW_I2C3_SCL (pin_A8) // A8
#define MICROPY_HW_I2C3_SDA (pin_C9) // C9

#define MICROPY_HW_I2C4_SCL (pin_B6) // B6,B8,D12
#define MICROPY_HW_I2C4_SDA (pin_B7) // B7,D13

// SPI busses
#define MICROPY_HW_SPI1_NSS (pin_A4) // A4,A15
#define MICROPY_HW_SPI1_SCK (pin_A5) // A5,B3
#define MICROPY_HW_SPI1_MISO (pin_A6) // A6,B4
#define MICROPY_HW_SPI1_MOSI (pin_A7) // A7,B5,D7

#define MICROPY_HW_SPI2_NSS (pin_B12) // A11,B4,B9,B12
#define MICROPY_HW_SPI2_SCK (pin_B13) // A9,A12,B10,B13,D3
#define MICROPY_HW_SPI2_MISO (pin_B14) // B14,C2
#define MICROPY_HW_SPI2_MOSI (pin_B15) // B15,C1,C3

#define MICROPY_HW_SPI3_NSS (pin_A15) // A4,A15
#define MICROPY_HW_SPI3_SCK (pin_B3) // B3,C10
#define MICROPY_HW_SPI3_MISO (pin_B4) // B4,C11
#define MICROPY_HW_SPI3_MOSI (pin_B2) // B2,B5,C12,D6

#define MICROPY_HW_SPI4_NSS (pin_E4) // E4,E11
#define MICROPY_HW_SPI4_SCK (pin_E2) // E2,E12
#define MICROPY_HW_SPI4_MISO (pin_E5) // E5,E13
#define MICROPY_HW_SPI4_MOSI (pin_E6) // E6,E14

// no SPI5

#define MICROPY_HW_SPI6_NSS (pin_A4) // A4,A15
#define MICROPY_HW_SPI6_SCK (pin_A5) // A5,B3
#define MICROPY_HW_SPI6_MISO (pin_A6) // A6,B4
#define MICROPY_HW_SPI6_MOSI (pin_A7) // A7,B5

// CAN busses
#define MICROPY_HW_CAN1_TX (pin_B9) // A12,B9,D1
#define MICROPY_HW_CAN1_RX (pin_B8) // A11,B8,D0

// K0 has no pullup or pulldown; Pressing the button makes the input go low.
#define MICROPY_HW_USRSW_PIN (pin_E3)
#define MICROPY_HW_USRSW_PULL (GPIO_PULLUP)
#define MICROPY_HW_USRSW_EXTI_MODE (GPIO_MODE_IT_FALLING)
#define MICROPY_HW_USRSW_PRESSED (0)

// LEDs
// LED D1 is the power LED and always on
#define MICROPY_HW_LED1 (pin_A1) // LED D2
#define MICROPY_HW_LED_ON(pin) (mp_hal_pin_low(pin))
#define MICROPY_HW_LED_OFF(pin) (mp_hal_pin_high(pin))

// SD card detect switch
// #define MICROPY_HW_SDCARD_DETECT_PIN (pin_A8) // nope
// #define MICROPY_HW_SDCARD_DETECT_PULL (GPIO_PULLUP)
// #define MICROPY_HW_SDCARD_DETECT_PRESENT (GPIO_PIN_RESET)
// 1 PC10 - DAT2/RES
// 2 PC11 - CD/DAT3/CS
// 3 PD2 - CMD/DI
// 4 VCC - VDD
// 5 PC12 - CLK/SCLK
// 6 GND - VSS
// 7 PC8 - DAT0/D0
// 8 PC9 - DAT1/RES
// 9 SW2 - NC

// 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)
Loading

0 comments on commit e8f65b7

Please sign in to comment.