Skip to content

Commit f70d7b5

Browse files
committed
stm32/boards: Add STM32H747I-DISCO board definition.
Adds support for STM32H747I-DISCO evaluation board with: - STM32H747XI dual-core MCU (Cortex-M7 @ 400MHz + Cortex-M4) - 32MB SDRAM (32-bit bus @ 120MHz) - Dual QSPI flash (2x512Mbit MT25QL512ABB) - USB High-Speed via ULPI PHY (USB3320C-EZK @ 480Mbps) - USART1 console via ST-LINK V3 VCP - 10/100 Ethernet (LAN8742A RMII) - requires hardware modification - microSD card slot (8-bit SDMMC1) - 4 LEDs, 5-position joystick, user button - Arduino Uno v3 headers - PMOD and STMod+ expansion connectors - LCD and camera connectors (DSI/DCMI) - Audio codec (WM8994) - OpenAMP support for M7-M4 communication Software configuration: - RTC uses LSE (32.768kHz crystal on PC14/PC15) - lwIP networking stack with SSL/TLS (mbedTLS with HW acceleration) - exFAT filesystem support - Frozen modules: asyncio, networking, time, senml, logging Known limitations: - Ethernet requires hardware modification (ETH_MDC/SAI4_D1 pin conflict) Signed-off-by: Andrew Leech <[email protected]>
1 parent a148ed2 commit f70d7b5

File tree

10 files changed

+905
-0
lines changed

10 files changed

+905
-0
lines changed
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/*
2+
* This file is part of the MicroPython project, http://micropython.org/
3+
*
4+
* The MIT License (MIT)
5+
*
6+
* Copyright (c) 2025 Andrew Leech
7+
*
8+
* Permission is hereby granted, free of charge, to any person obtaining a copy
9+
* of this software and associated documentation files (the "Software"), to deal
10+
* in the Software without restriction, including without limitation the rights
11+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12+
* copies of the Software, and to permit persons to whom the Software is
13+
* furnished to do so, subject to the following conditions:
14+
*
15+
* The above copyright notice and this permission notice shall be included in
16+
* all copies or substantial portions of the Software.
17+
*
18+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24+
* THE SOFTWARE.
25+
*/
26+
27+
#include "storage.h"
28+
#include "qspi.h"
29+
30+
#if MICROPY_HW_SPIFLASH_ENABLE_CACHE
31+
// Shared cache for QSPI block device
32+
static mp_spiflash_cache_t spi_bdev_cache;
33+
#endif
34+
35+
// External QSPI flash uses hardware QSPI interface
36+
const mp_spiflash_config_t spiflash_config = {
37+
.bus_kind = MP_SPIFLASH_BUS_QSPI,
38+
.bus.u_qspi.data = NULL,
39+
.bus.u_qspi.proto = &qspi_proto,
40+
#if MICROPY_HW_SPIFLASH_ENABLE_CACHE
41+
.cache = &spi_bdev_cache,
42+
#endif
43+
};
44+
45+
spi_bdev_t spi_bdev;
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"deploy": [
3+
"../deploy.md"
4+
],
5+
"docs": "",
6+
"features": [
7+
"DAC",
8+
"Dual-core",
9+
"Ethernet",
10+
"External Flash",
11+
"External RAM",
12+
"microSD",
13+
"USB"
14+
],
15+
"images": [
16+
"stm32h747i_disco.jpg"
17+
],
18+
"mcu": "stm32h7",
19+
"product": "Discovery Kit H747I",
20+
"thumbnail": "",
21+
"url": "https://www.st.com/en/evaluation-tools/stm32h747i-disco.html",
22+
"vendor": "ST Microelectronics"
23+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
The Ethernet interface requires a hardware modification due to a pin conflict
2+
between ETH_MDC (PC1) and the SAI4_D1 digital MEMS microphone. To enable
3+
Ethernet, the MEMS microphone must be disconnected from PC1. See the
4+
STM32H747I-DISCO user manual (UM2411) for modification details.
5+
6+
The board includes additional hardware not currently configured in MicroPython:
7+
4" LCD touchscreen (DSI), camera connector (DCMI), WM8994 audio codec, and
8+
digital MEMS microphones.
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
/*
2+
* This file is part of the MicroPython project, http://micropython.org/
3+
*
4+
* The MIT License (MIT)
5+
*
6+
* Copyright (c) 2025 Andrew Leech
7+
*
8+
* Permission is hereby granted, free of charge, to any person obtaining a copy
9+
* of this software and associated documentation files (the "Software"), to deal
10+
* in the Software without restriction, including without limitation the rights
11+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12+
* copies of the Software, and to permit persons to whom the Software is
13+
* furnished to do so, subject to the following conditions:
14+
*
15+
* The above copyright notice and this permission notice shall be included in
16+
* all copies or substantial portions of the Software.
17+
*
18+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24+
* THE SOFTWARE.
25+
*/
26+
27+
#include <string.h>
28+
#include "py/mphal.h"
29+
#include "storage.h"
30+
#include "sdram.h"
31+
32+
void DISCO_board_early_init(void) {
33+
HAL_InitTick(0);
34+
}
35+
36+
void DISCO_board_low_power(int mode) {
37+
switch (mode) {
38+
case 0: // Leave stop mode.
39+
sdram_leave_low_power();
40+
break;
41+
case 1: // Enter stop mode.
42+
sdram_enter_low_power();
43+
break;
44+
case 2: // Enter standby mode.
45+
sdram_enter_power_down();
46+
break;
47+
}
48+
49+
#if MICROPY_HW_ENABLE_INTERNAL_FLASH_STORAGE == 0
50+
// Enable QSPI deepsleep for modes 1 and 2
51+
mp_spiflash_deepsleep(&spi_bdev.spiflash, (mode != 0));
52+
#endif
53+
54+
#if defined(M4_APP_ADDR)
55+
// Signal Cortex-M4 to go to Standby mode.
56+
if (mode == 2) {
57+
__HAL_RCC_HSEM_CLK_ENABLE();
58+
HAL_HSEM_FastTake(0);
59+
HAL_HSEM_Release(0, 0);
60+
__HAL_RCC_HSEM_CLK_DISABLE();
61+
HAL_Delay(100);
62+
}
63+
#endif
64+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
include("$(PORT_DIR)/boards/manifest.py")
2+
3+
# Networking
4+
require("bundle-networking")
5+
6+
# Utils
7+
require("time")
8+
require("senml")
9+
require("logging")

0 commit comments

Comments
 (0)