Skip to content

Commit 051e290

Browse files
committed
stm32/boards/NUCLEO_H723ZG: Add new H723 board.
The following have been tested and are working: - 550MHz CPU frequency - UART REPL via ST-Link - USB REPL and mass storage - 3x LEDs and 1x user button - Ethernet Signed-off-by: Damien George <damien@micropython.org>
1 parent d995c01 commit 051e290

File tree

7 files changed

+314
-0
lines changed

7 files changed

+314
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"deploy": [
3+
"../deploy.md"
4+
],
5+
"docs": "",
6+
"features": [],
7+
"images": [
8+
"nucleo_h723zg.jpg"
9+
],
10+
"mcu": "stm32h7",
11+
"product": "Nucleo H723ZG",
12+
"thumbnail": "",
13+
"url": "",
14+
"vendor": "ST Microelectronics"
15+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#include "py/mphal.h"
2+
3+
void NUCLEO_H723ZG_board_early_init(void) {
4+
// Turn off the USB switch.
5+
mp_hal_pin_output(pyb_pin_OTG_FS_POWER);
6+
mp_hal_pin_low(pyb_pin_OTG_FS_POWER);
7+
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
include("$(PORT_DIR)/boards/manifest.py")
2+
require("bundle-networking")
Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
#define MICROPY_HW_BOARD_NAME "NUCLEO_H723ZG"
2+
#define MICROPY_HW_MCU_NAME "STM32H723ZGT6"
3+
4+
#define MICROPY_HW_ENABLE_RTC (1)
5+
#define MICROPY_HW_ENABLE_RNG (0) // RNG needs proper configuration
6+
#define MICROPY_HW_ENABLE_ADC (1)
7+
#define MICROPY_HW_ENABLE_DAC (1)
8+
#define MICROPY_HW_ENABLE_USB (1)
9+
#define MICROPY_HW_ENABLE_SDCARD (1)
10+
#define MICROPY_HW_HAS_SWITCH (1)
11+
#define MICROPY_HW_HAS_FLASH (1)
12+
13+
#define MICROPY_BOARD_EARLY_INIT NUCLEO_H723ZG_board_early_init
14+
15+
// There is no external HS crystal, instead it comes from ST-LINK MCO output which is 8MHz.
16+
// The following gives a 550MHz CPU speed.
17+
#define MICROPY_HW_CLK_USE_BYPASS (1)
18+
#define MICROPY_HW_CLK_PLLM (4)
19+
#define MICROPY_HW_CLK_PLLN (275)
20+
#define MICROPY_HW_CLK_PLLP (1)
21+
#define MICROPY_HW_CLK_PLLQ (4)
22+
#define MICROPY_HW_CLK_PLLR (2)
23+
#define MICROPY_HW_CLK_PLLVCI (RCC_PLL1VCIRANGE_1)
24+
#define MICROPY_HW_CLK_PLLVCO (RCC_PLL1VCOWIDE)
25+
#define MICROPY_HW_CLK_PLLFRAC (0)
26+
27+
// The USB clock is set using PLL3
28+
#define MICROPY_HW_CLK_PLL3M (4)
29+
#define MICROPY_HW_CLK_PLL3N (120)
30+
#define MICROPY_HW_CLK_PLL3P (2)
31+
#define MICROPY_HW_CLK_PLL3Q (5)
32+
#define MICROPY_HW_CLK_PLL3R (2)
33+
#define MICROPY_HW_CLK_PLL3VCI (RCC_PLL3VCIRANGE_1)
34+
#define MICROPY_HW_CLK_PLL3VCO (RCC_PLL3VCOWIDE)
35+
#define MICROPY_HW_CLK_PLL3FRAC (0)
36+
37+
// 4 wait states
38+
#define MICROPY_HW_FLASH_LATENCY FLASH_LATENCY_4
39+
40+
// The board has an external 32kHz crystal attached
41+
#define MICROPY_HW_RTC_USE_LSE (1)
42+
43+
// UART config
44+
#define MICROPY_HW_UART2_TX (pin_D5)
45+
#define MICROPY_HW_UART2_RX (pin_D6)
46+
#define MICROPY_HW_UART2_RTS (pin_D4)
47+
#define MICROPY_HW_UART2_CTS (pin_D3)
48+
#define MICROPY_HW_UART3_TX (pin_D8)
49+
#define MICROPY_HW_UART3_RX (pin_D9)
50+
#define MICROPY_HW_UART5_TX (pin_B6)
51+
#define MICROPY_HW_UART5_RX (pin_B12)
52+
#define MICROPY_HW_UART6_TX (pin_C6)
53+
#define MICROPY_HW_UART6_RX (pin_C7)
54+
#define MICROPY_HW_UART7_TX (pin_F7)
55+
#define MICROPY_HW_UART7_RX (pin_F6)
56+
#define MICROPY_HW_UART8_TX (pin_E1)
57+
#define MICROPY_HW_UART8_RX (pin_E0)
58+
59+
#define MICROPY_HW_UART_REPL PYB_UART_3
60+
#define MICROPY_HW_UART_REPL_BAUD 115200
61+
62+
// I2C buses
63+
#define MICROPY_HW_I2C1_SCL (pin_B8)
64+
#define MICROPY_HW_I2C1_SDA (pin_B9)
65+
#define MICROPY_HW_I2C2_SCL (pin_F1)
66+
#define MICROPY_HW_I2C2_SDA (pin_F0)
67+
#define MICROPY_HW_I2C4_SCL (pin_F14)
68+
#define MICROPY_HW_I2C4_SDA (pin_F15)
69+
70+
// SPI buses
71+
#define MICROPY_HW_SPI3_NSS (pin_A4)
72+
#define MICROPY_HW_SPI3_SCK (pin_B3)
73+
#define MICROPY_HW_SPI3_MISO (pin_B4)
74+
#define MICROPY_HW_SPI3_MOSI (pin_B5)
75+
76+
// USRSW is pulled low. Pressing the button makes the input go high.
77+
#define MICROPY_HW_USRSW_PIN (pin_C13)
78+
#define MICROPY_HW_USRSW_PULL (GPIO_NOPULL)
79+
#define MICROPY_HW_USRSW_EXTI_MODE (GPIO_MODE_IT_RISING)
80+
#define MICROPY_HW_USRSW_PRESSED (1)
81+
82+
// LEDs
83+
#define MICROPY_HW_LED1 (pin_B0) // green
84+
#define MICROPY_HW_LED2 (pin_E1) // yellow
85+
#define MICROPY_HW_LED3 (pin_B14) // red
86+
#define MICROPY_HW_LED_ON(pin) (mp_hal_pin_high(pin))
87+
#define MICROPY_HW_LED_OFF(pin) (mp_hal_pin_low(pin))
88+
89+
// USB config
90+
#define MICROPY_HW_USB_HS (1)
91+
#define MICROPY_HW_USB_HS_IN_FS (1)
92+
#define MICROPY_HW_USB_VBUS_DETECT_PIN (pin_A9)
93+
#define MICROPY_HW_USB_OTG_ID_PIN (pin_A10)
94+
95+
// FDCAN bus
96+
#define MICROPY_HW_CAN1_NAME "FDCAN1"
97+
#define MICROPY_HW_CAN1_TX (pin_D1)
98+
#define MICROPY_HW_CAN1_RX (pin_D0)
99+
100+
// SD card detect switch
101+
#define MICROPY_HW_SDCARD_DETECT_PIN (pin_G2)
102+
#define MICROPY_HW_SDCARD_DETECT_PULL (GPIO_PULLUP)
103+
#define MICROPY_HW_SDCARD_DETECT_PRESENT (GPIO_PIN_RESET)
104+
105+
// Ethernet via RMII
106+
#define MICROPY_HW_ETH_MDC (pin_C1)
107+
#define MICROPY_HW_ETH_MDIO (pin_A2)
108+
#define MICROPY_HW_ETH_RMII_REF_CLK (pin_A1)
109+
#define MICROPY_HW_ETH_RMII_CRS_DV (pin_A7)
110+
#define MICROPY_HW_ETH_RMII_RXD0 (pin_C4)
111+
#define MICROPY_HW_ETH_RMII_RXD1 (pin_C5)
112+
#define MICROPY_HW_ETH_RMII_TX_EN (pin_G11)
113+
#define MICROPY_HW_ETH_RMII_TXD0 (pin_G13)
114+
#define MICROPY_HW_ETH_RMII_TXD1 (pin_B13)
115+
116+
void NUCLEO_H723ZG_board_early_init(void);
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
USE_MBOOT ?= 0
2+
3+
# MCU settings
4+
MCU_SERIES = h7
5+
CMSIS_MCU = STM32H723xx
6+
MICROPY_FLOAT_IMPL = double
7+
AF_FILE = boards/stm32h723_af.csv
8+
9+
ifeq ($(USE_MBOOT),1)
10+
# When using Mboot everything goes after the bootloader
11+
LD_FILES = boards/stm32h723.ld boards/common_bl.ld
12+
TEXT0_ADDR = 0x08020000
13+
else
14+
# When not using Mboot everything goes at the start of flash
15+
LD_FILES = boards/stm32h723.ld boards/common_basic.ld
16+
TEXT0_ADDR = 0x08000000
17+
endif
18+
19+
# MicroPython settings
20+
MICROPY_PY_LWIP = 1
21+
MICROPY_PY_USSL = 1
22+
MICROPY_SSL_MBEDTLS = 1
23+
MICROPY_VFS_LFS2 = 1
24+
25+
FROZEN_MANIFEST ?= $(BOARD_DIR)/manifest.py
Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
A0,PA3
2+
A1,PC0
3+
A2,PC3
4+
A3,PB1
5+
A4,PC2
6+
A5,PF10
7+
A6,PF4
8+
A7,PF5
9+
A8,PF6
10+
D0,PB7
11+
D1,PB6
12+
D2,PG14
13+
D3,PE13
14+
D4,PE14
15+
D5,PE11
16+
D6,PE9
17+
D7,PG12
18+
D8,PF3
19+
D9,PD15
20+
D10,PD14
21+
D11,PB5
22+
D12,PA6
23+
D13,PA7
24+
D14,PB9
25+
D15,PB8
26+
D16,PC6
27+
D17,PB15
28+
D18,PB13
29+
D19,PB12
30+
D20,PA15
31+
D21,PC7
32+
D22,PB5
33+
D23,PB3
34+
D24,PA4
35+
D25,PB4
36+
D26,PG6
37+
D27,PB2
38+
D28,PD13
39+
D29,PD12
40+
D30,PD11
41+
D31,PE2
42+
D32,PA0
43+
D33,PB0
44+
D34,PE0
45+
D35,PB11
46+
D36,PB10
47+
D37,PE15
48+
D38,PE6
49+
D39,PE12
50+
D40,PE10
51+
D41,PE7
52+
D42,PE8
53+
D43,PC8
54+
D44,PC9
55+
D45,PC10
56+
D46,PC11
57+
D47,PC12
58+
D48,PD2
59+
D49,PG2
60+
D50,PG3
61+
D51,PD7
62+
D52,PD6
63+
D53,PD5
64+
D54,PD4
65+
D55,PD3
66+
D56,PE2
67+
D57,PE4
68+
D58,PE5
69+
D59,PE6
70+
D60,PE3
71+
D61,PF8
72+
D62,PF7
73+
D63,PF9
74+
D64,PG1
75+
D65,PG0
76+
D66,PD1
77+
D67,PD0
78+
D68,PF0
79+
D69,PF1
80+
D70,PF2
81+
D71,PE9
82+
D72,PB2
83+
DAC1,PA4
84+
DAC2,PA5
85+
LED1,PB0
86+
LED2,PE1
87+
LED3,PB14
88+
SW,PC13
89+
I2C1_SDA,PB9
90+
I2C1_SCL,PB8
91+
I2C2_SDA,PF0
92+
I2C2_SCL,PF1
93+
I2C4_SCL,PF14
94+
I2C4_SDA,PF15
95+
SD_D0,PC8
96+
SD_D1,PC9
97+
SD_D2,PC10
98+
SD_D3,PC11
99+
SD_CMD,PD2
100+
SD_CK,PC12
101+
SD_SW,PG2
102+
OTG_FS_POWER,PD10
103+
OTG_FS_OVER_CURRENT,PG7
104+
USB_VBUS,PA9
105+
USB_ID,PA10
106+
USB_DM,PA11
107+
USB_DP,PA12
108+
UART2_TX,PD5
109+
UART2_RX,PD6
110+
UART2_RTS,PD4
111+
UART2_CTS,PD3
112+
UART3_TX,PD8
113+
UART3_RX,PD9
114+
UART5_TX,PB6
115+
UART5_RX,PB12
116+
UART6_TX,PC6
117+
UART6_RX,PC7
118+
UART7_TX,PF7
119+
UART7_RX,PF6
120+
UART8_TX,PE1
121+
UART8_RX,PE0
122+
ETH_MDC,PC1
123+
ETH_MDIO,PA2
124+
ETH_RMII_REF_CLK,PA1
125+
ETH_RMII_CRS_DV,PA7
126+
ETH_RMII_RXD0,PC4
127+
ETH_RMII_RXD1,PC5
128+
ETH_RMII_TX_EN,PG11
129+
ETH_RMII_TXD0,PG13
130+
ETH_RMII_TXD1,PB13
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_STM32H7XX_HAL_CONF_H
6+
#define MICROPY_INCLUDED_STM32H7XX_HAL_CONF_H
7+
8+
#include "boards/stm32h7xx_hal_conf_base.h"
9+
10+
// Oscillator values in Hz
11+
#define HSE_VALUE (8000000)
12+
#define LSE_VALUE (32768)
13+
#define EXTERNAL_CLOCK_VALUE (12288000)
14+
15+
// Oscillator timeouts in ms
16+
#define HSE_STARTUP_TIMEOUT (5000)
17+
#define LSE_STARTUP_TIMEOUT (5000)
18+
19+
#endif // MICROPY_INCLUDED_STM32H7XX_HAL_CONF_H

0 commit comments

Comments
 (0)