Skip to content

Commit 0cc100b

Browse files
renestraubdpgeorge
authored andcommitted
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>
1 parent 70feb12 commit 0cc100b

File tree

5 files changed

+278
-0
lines changed

5 files changed

+278
-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_h563zi.jpg"
9+
],
10+
"mcu": "stm32h5",
11+
"product": "Nucleo H563ZI",
12+
"thumbnail": "",
13+
"url": "",
14+
"vendor": "ST Microelectronics"
15+
}
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
#define MICROPY_HW_BOARD_NAME "NUCLEO_H563ZI"
2+
#define MICROPY_HW_MCU_NAME "STM32H563ZI"
3+
4+
#define MICROPY_PY_PYB_LEGACY (0)
5+
#define MICROPY_HW_ENABLE_INTERNAL_FLASH_STORAGE (1)
6+
#define MICROPY_HW_ENABLE_RTC (1)
7+
#define MICROPY_HW_ENABLE_RNG (1)
8+
#define MICROPY_HW_ENABLE_ADC (1)
9+
#define MICROPY_HW_ENABLE_DAC (1)
10+
#define MICROPY_HW_ENABLE_USB (1)
11+
#define MICROPY_HW_HAS_SWITCH (1)
12+
#define MICROPY_HW_HAS_FLASH (1)
13+
14+
// The board has a 8MHz oscillator, the following gives 250MHz CPU speed
15+
#define MICROPY_HW_CLK_USE_BYPASS (1)
16+
#define MICROPY_HW_CLK_PLLM (2)
17+
#define MICROPY_HW_CLK_PLLN (125)
18+
#define MICROPY_HW_CLK_PLLP (2)
19+
#define MICROPY_HW_CLK_PLLQ (2)
20+
#define MICROPY_HW_CLK_PLLR (2)
21+
#define MICROPY_HW_CLK_PLLVCI_LL (LL_RCC_PLLINPUTRANGE_4_8)
22+
#define MICROPY_HW_CLK_PLLVCO_LL (LL_RCC_PLLVCORANGE_WIDE)
23+
#define MICROPY_HW_CLK_PLLFRAC (0)
24+
25+
// PLL3 with Q output at 48MHz for USB
26+
// #define MICROPY_HW_CLK_USE_PLL3_FOR_USB
27+
#define MICROPY_HW_CLK_PLL3M (8)
28+
#define MICROPY_HW_CLK_PLL3N (192)
29+
#define MICROPY_HW_CLK_PLL3P (2)
30+
#define MICROPY_HW_CLK_PLL3Q (4)
31+
#define MICROPY_HW_CLK_PLL3R (2)
32+
#define MICROPY_HW_CLK_PLL3FRAC (0)
33+
#define MICROPY_HW_CLK_PLL3VCI_LL (LL_RCC_PLLINPUTRANGE_1_2)
34+
#define MICROPY_HW_CLK_PLL3VCO_LL (LL_RCC_PLLVCORANGE_MEDIUM)
35+
36+
// 5 wait states, according to Table 37, Reference Manual (RM0481 Rev 1)
37+
#define MICROPY_HW_FLASH_LATENCY FLASH_LATENCY_5
38+
39+
// There is an external 32kHz oscillator
40+
#define MICROPY_HW_RTC_USE_LSE (1)
41+
42+
// UART config
43+
#define MICROPY_HW_UART1_TX (pin_B6) // SB14: Arduino Connector CN10-Pin14 (D1)
44+
#define MICROPY_HW_UART1_RX (pin_B7) // SB63: Arduino Connector CN10-Pin16 (D0)
45+
#define MICROPY_HW_UART3_TX (pin_D8) // SB23: ST-Link
46+
#define MICROPY_HW_UART3_RX (pin_D9) // SB18: ST-Link
47+
48+
// Connect REPL to UART3 which is provided on ST-Link USB interface
49+
#define MICROPY_HW_UART_REPL PYB_UART_3
50+
#define MICROPY_HW_UART_REPL_BAUD 115200
51+
52+
// I2C buses
53+
#define MICROPY_HW_I2C1_SCL (pin_B8) // Arduino Connector CN7-Pin2 (D15)
54+
#define MICROPY_HW_I2C1_SDA (pin_B9) // Arduino Connector CN7-Pin4 (D14)
55+
#define MICROPY_HW_I2C2_SCL (pin_F1) // Connector CN9-Pin19
56+
#define MICROPY_HW_I2C2_SDA (pin_F0) // Connector CN9-Pin21
57+
58+
// SPI buses
59+
// PD14 according to datasheet not working as SPI1_NSS, have to use as GPIO, not as AF
60+
#define MICROPY_HW_SPI1_NSS (pin_D14) // Arduino Connector CN7-Pin16 (D10)
61+
#define MICROPY_HW_SPI1_SCK (pin_A5) // Arduino Connector CN7-Pin10 (D13)
62+
#define MICROPY_HW_SPI1_MISO (pin_G9) // Arduino Connector CN7-Pin12 (D12)
63+
#define MICROPY_HW_SPI1_MOSI (pin_B5) // Arduino Connector CN7-Pin14 (D11)
64+
65+
// USRSW is pulled low. Pressing the button makes the input go high.
66+
#define MICROPY_HW_USRSW_PIN (pin_C13)
67+
#define MICROPY_HW_USRSW_PULL (GPIO_NOPULL)
68+
#define MICROPY_HW_USRSW_EXTI_MODE (GPIO_MODE_IT_RISING)
69+
#define MICROPY_HW_USRSW_PRESSED (1)
70+
71+
// LEDs
72+
#define MICROPY_HW_LED1 (pin_B0) // Green
73+
#define MICROPY_HW_LED2 (pin_F4) // Orange
74+
#define MICROPY_HW_LED3 (pin_G4) // Red
75+
#define MICROPY_HW_LED_ON(pin) (mp_hal_pin_high(pin))
76+
#define MICROPY_HW_LED_OFF(pin) (mp_hal_pin_low(pin))
77+
78+
// USB config
79+
#define MICROPY_HW_USB_FS (1)
80+
#define MICROPY_HW_USB_MAIN_DEV (USB_PHY_FS_ID)
81+
82+
// Ethernet via RMII
83+
#define MICROPY_HW_ETH_MDC (pin_C1)
84+
#define MICROPY_HW_ETH_MDIO (pin_A2)
85+
#define MICROPY_HW_ETH_RMII_REF_CLK (pin_A1)
86+
#define MICROPY_HW_ETH_RMII_CRS_DV (pin_A7)
87+
#define MICROPY_HW_ETH_RMII_RXD0 (pin_C4)
88+
#define MICROPY_HW_ETH_RMII_RXD1 (pin_C5)
89+
#define MICROPY_HW_ETH_RMII_TX_EN (pin_G11)
90+
#define MICROPY_HW_ETH_RMII_TXD0 (pin_G13)
91+
#define MICROPY_HW_ETH_RMII_TXD1 (pin_B15)
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
USE_MBOOT ?= 0
2+
3+
# MCU settings
4+
MCU_SERIES = h5
5+
CMSIS_MCU = STM32H573xx
6+
MICROPY_FLOAT_IMPL = single
7+
AF_FILE = boards/stm32h573_af.csv
8+
9+
ifeq ($(USE_MBOOT),1)
10+
# When using Mboot everything goes after the bootloader
11+
# TODO: not tested
12+
LD_FILES = boards/stm32h573xi.ld boards/common_bl.ld
13+
TEXT0_ADDR = 0x08008000
14+
else
15+
# When not using Mboot everything goes at the start of flash
16+
LD_FILES = boards/stm32h573xi.ld boards/common_basic.ld
17+
TEXT0_ADDR = 0x08000000
18+
endif
19+
20+
# MicroPython settings
21+
MICROPY_PY_LWIP = 1
22+
MICROPY_PY_SSL = 1
23+
MICROPY_SSL_MBEDTLS = 1
Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
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
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) 2023 Damien P. George
4+
*/
5+
#ifndef MICROPY_INCLUDED_STM32H5XX_HAL_CONF_H
6+
#define MICROPY_INCLUDED_STM32H5XX_HAL_CONF_H
7+
8+
// Oscillator values in Hz
9+
#define HSE_VALUE (8000000)
10+
#define LSE_VALUE (32768)
11+
#define EXTERNAL_CLOCK_VALUE (12288000)
12+
13+
// Oscillator timeouts in ms
14+
#define HSE_STARTUP_TIMEOUT (100)
15+
#define LSE_STARTUP_TIMEOUT (5000)
16+
17+
#include "boards/stm32h5xx_hal_conf_base.h"
18+
19+
#endif // MICROPY_INCLUDED_STM32H5XX_HAL_CONF_H

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy