stm32/boards/NUCLEO_H563ZI: Add new NUCLEO-H563ZI board definition.

Configuration:
- Clock is HSE, CPU runs at 250MHz.
- REPL on USB and UART connected to the ST-Link interface.
- Storage is configured for internal flash memory.
- Three LEDs and one user button.
- Ethernet is enabled.

Signed-off-by: Rene Straub <rene@see5.ch>
This commit is contained in:
Rene Straub 2023-08-06 11:18:53 +02:00 committed by Damien George
parent 70feb123bf
commit 0cc100be2c
5 changed files with 278 additions and 0 deletions

View File

@ -0,0 +1,15 @@
{
"deploy": [
"../deploy.md"
],
"docs": "",
"features": [],
"images": [
"nucleo_h563zi.jpg"
],
"mcu": "stm32h5",
"product": "Nucleo H563ZI",
"thumbnail": "",
"url": "",
"vendor": "ST Microelectronics"
}

View File

@ -0,0 +1,91 @@
#define MICROPY_HW_BOARD_NAME "NUCLEO_H563ZI"
#define MICROPY_HW_MCU_NAME "STM32H563ZI"
#define MICROPY_PY_PYB_LEGACY (0)
#define MICROPY_HW_ENABLE_INTERNAL_FLASH_STORAGE (1)
#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_HAS_SWITCH (1)
#define MICROPY_HW_HAS_FLASH (1)
// The board has a 8MHz oscillator, the following gives 250MHz CPU speed
#define MICROPY_HW_CLK_USE_BYPASS (1)
#define MICROPY_HW_CLK_PLLM (2)
#define MICROPY_HW_CLK_PLLN (125)
#define MICROPY_HW_CLK_PLLP (2)
#define MICROPY_HW_CLK_PLLQ (2)
#define MICROPY_HW_CLK_PLLR (2)
#define MICROPY_HW_CLK_PLLVCI_LL (LL_RCC_PLLINPUTRANGE_4_8)
#define MICROPY_HW_CLK_PLLVCO_LL (LL_RCC_PLLVCORANGE_WIDE)
#define MICROPY_HW_CLK_PLLFRAC (0)
// PLL3 with Q output at 48MHz for USB
// #define MICROPY_HW_CLK_USE_PLL3_FOR_USB
#define MICROPY_HW_CLK_PLL3M (8)
#define MICROPY_HW_CLK_PLL3N (192)
#define MICROPY_HW_CLK_PLL3P (2)
#define MICROPY_HW_CLK_PLL3Q (4)
#define MICROPY_HW_CLK_PLL3R (2)
#define MICROPY_HW_CLK_PLL3FRAC (0)
#define MICROPY_HW_CLK_PLL3VCI_LL (LL_RCC_PLLINPUTRANGE_1_2)
#define MICROPY_HW_CLK_PLL3VCO_LL (LL_RCC_PLLVCORANGE_MEDIUM)
// 5 wait states, according to Table 37, Reference Manual (RM0481 Rev 1)
#define MICROPY_HW_FLASH_LATENCY FLASH_LATENCY_5
// There is an external 32kHz oscillator
#define MICROPY_HW_RTC_USE_LSE (1)
// UART config
#define MICROPY_HW_UART1_TX (pin_B6) // SB14: Arduino Connector CN10-Pin14 (D1)
#define MICROPY_HW_UART1_RX (pin_B7) // SB63: Arduino Connector CN10-Pin16 (D0)
#define MICROPY_HW_UART3_TX (pin_D8) // SB23: ST-Link
#define MICROPY_HW_UART3_RX (pin_D9) // SB18: ST-Link
// Connect REPL to UART3 which is provided on ST-Link USB interface
#define MICROPY_HW_UART_REPL PYB_UART_3
#define MICROPY_HW_UART_REPL_BAUD 115200
// I2C buses
#define MICROPY_HW_I2C1_SCL (pin_B8) // Arduino Connector CN7-Pin2 (D15)
#define MICROPY_HW_I2C1_SDA (pin_B9) // Arduino Connector CN7-Pin4 (D14)
#define MICROPY_HW_I2C2_SCL (pin_F1) // Connector CN9-Pin19
#define MICROPY_HW_I2C2_SDA (pin_F0) // Connector CN9-Pin21
// SPI buses
// PD14 according to datasheet not working as SPI1_NSS, have to use as GPIO, not as AF
#define MICROPY_HW_SPI1_NSS (pin_D14) // Arduino Connector CN7-Pin16 (D10)
#define MICROPY_HW_SPI1_SCK (pin_A5) // Arduino Connector CN7-Pin10 (D13)
#define MICROPY_HW_SPI1_MISO (pin_G9) // Arduino Connector CN7-Pin12 (D12)
#define MICROPY_HW_SPI1_MOSI (pin_B5) // Arduino Connector CN7-Pin14 (D11)
// USRSW is pulled low. Pressing the button makes the input go high.
#define MICROPY_HW_USRSW_PIN (pin_C13)
#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_B0) // Green
#define MICROPY_HW_LED2 (pin_F4) // Orange
#define MICROPY_HW_LED3 (pin_G4) // Red
#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_MAIN_DEV (USB_PHY_FS_ID)
// Ethernet via RMII
#define MICROPY_HW_ETH_MDC (pin_C1)
#define MICROPY_HW_ETH_MDIO (pin_A2)
#define MICROPY_HW_ETH_RMII_REF_CLK (pin_A1)
#define MICROPY_HW_ETH_RMII_CRS_DV (pin_A7)
#define MICROPY_HW_ETH_RMII_RXD0 (pin_C4)
#define MICROPY_HW_ETH_RMII_RXD1 (pin_C5)
#define MICROPY_HW_ETH_RMII_TX_EN (pin_G11)
#define MICROPY_HW_ETH_RMII_TXD0 (pin_G13)
#define MICROPY_HW_ETH_RMII_TXD1 (pin_B15)

View File

@ -0,0 +1,23 @@
USE_MBOOT ?= 0
# MCU settings
MCU_SERIES = h5
CMSIS_MCU = STM32H573xx
MICROPY_FLOAT_IMPL = single
AF_FILE = boards/stm32h573_af.csv
ifeq ($(USE_MBOOT),1)
# When using Mboot everything goes after the bootloader
# TODO: not tested
LD_FILES = boards/stm32h573xi.ld boards/common_bl.ld
TEXT0_ADDR = 0x08008000
else
# When not using Mboot everything goes at the start of flash
LD_FILES = boards/stm32h573xi.ld boards/common_basic.ld
TEXT0_ADDR = 0x08000000
endif
# MicroPython settings
MICROPY_PY_LWIP = 1
MICROPY_PY_SSL = 1
MICROPY_SSL_MBEDTLS = 1

View File

@ -0,0 +1,130 @@
,PA0
,PA1
,PA2
,PA3
,PA4
,PA5
,PA7
,PA8
,PA9
,PA10
,PA11
,PA12
,PA13
,PA14
,PA15
,PB0
,PB2
,PB3
,PB4
,PB5
,PB6
,PB7
,PB8
,PB9
,PB10
,PB11
,PB12
,PB13
,PB14
,PB15
,PC1
,PC4
,PC5
,PC6
,PC7
,PC8
,PC9
,PC10
,PC11
,PC12
,PC13
,PC14
,PC15
,PD0
,PD1
,PD2
,PD3
,PD4
,PD5
,PD6
,PD7
,PD8
,PD9
,PD10
,PD11
,PD12
,PD13
,PD14
,PE0
,PE1
,PE2
,PE3
,PE4
,PE5
,PE6
,PE7
,PE8
,PE10
,PE12
,PE15
,PF0
,PF1
,PF2
,PF4
,PF5
,PF6
,PF7
,PF8
,PF9
,PF10
,PF12
,PF13
,PF14
,PF15
,PG0
,PG1
,PG2
,PG3
,PG4
,PG5
,PG6
,PG7
,PG8
,PG9
,PG10
,PG11
,PG13
,PG15
A0,PA6
A1,PC0
A2,PC3
A3,PB1
A4,PC2
A5,PF11
D2,PG14
D3,PE13
D4,PE14
D5,PE11
D6,PE9
D7,PG12
D8,PF3
D9,PD15
UART1_TX,PB6
UART1_RX,PB7
UART3_TX,PD8
UART3_RX,PD9
LED_GREEN,PB0
LED_ORANGE,PF4
LED_RED,PG4
SW,PC13
I2C1_SDA,PB9
I2C1_SCL,PB8
I2C2_SDA,PF1
I2C2_SCL,PF0
USB_DM,PA11
USB_DP,PA12
SPI_A_CS,PD14
SPI_A_SCK,PA5
SPI_A_MOSI,PB5
SPI_A_MISO,PG9
1 PA0
2 PA1
3 PA2
4 PA3
5 PA4
6 PA5
7 PA7
8 PA8
9 PA9
10 PA10
11 PA11
12 PA12
13 PA13
14 PA14
15 PA15
16 PB0
17 PB2
18 PB3
19 PB4
20 PB5
21 PB6
22 PB7
23 PB8
24 PB9
25 PB10
26 PB11
27 PB12
28 PB13
29 PB14
30 PB15
31 PC1
32 PC4
33 PC5
34 PC6
35 PC7
36 PC8
37 PC9
38 PC10
39 PC11
40 PC12
41 PC13
42 PC14
43 PC15
44 PD0
45 PD1
46 PD2
47 PD3
48 PD4
49 PD5
50 PD6
51 PD7
52 PD8
53 PD9
54 PD10
55 PD11
56 PD12
57 PD13
58 PD14
59 PE0
60 PE1
61 PE2
62 PE3
63 PE4
64 PE5
65 PE6
66 PE7
67 PE8
68 PE10
69 PE12
70 PE15
71 PF0
72 PF1
73 PF2
74 PF4
75 PF5
76 PF6
77 PF7
78 PF8
79 PF9
80 PF10
81 PF12
82 PF13
83 PF14
84 PF15
85 PG0
86 PG1
87 PG2
88 PG3
89 PG4
90 PG5
91 PG6
92 PG7
93 PG8
94 PG9
95 PG10
96 PG11
97 PG13
98 PG15
99 A0 PA6
100 A1 PC0
101 A2 PC3
102 A3 PB1
103 A4 PC2
104 A5 PF11
105 D2 PG14
106 D3 PE13
107 D4 PE14
108 D5 PE11
109 D6 PE9
110 D7 PG12
111 D8 PF3
112 D9 PD15
113 UART1_TX PB6
114 UART1_RX PB7
115 UART3_TX PD8
116 UART3_RX PD9
117 LED_GREEN PB0
118 LED_ORANGE PF4
119 LED_RED PG4
120 SW PC13
121 I2C1_SDA PB9
122 I2C1_SCL PB8
123 I2C2_SDA PF1
124 I2C2_SCL PF0
125 USB_DM PA11
126 USB_DP PA12
127 SPI_A_CS PD14
128 SPI_A_SCK PA5
129 SPI_A_MOSI PB5
130 SPI_A_MISO PG9

View File

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