Skip to content

Commit c906f1e

Browse files
committed
[board] added nucleo-h743zi2 board support
1 parent 07ce70d commit c906f1e

5 files changed

Lines changed: 96 additions & 16 deletions

File tree

README.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -884,43 +884,44 @@ We have out-of-box support for many development boards including documentation.
884884
<td align="center"><a href="https://modm.io/reference/config/modm-nucleo-h533re">NUCLEO-H533RE</a></td>
885885
<td align="center"><a href="https://modm.io/reference/config/modm-nucleo-h723zg">NUCLEO-H723ZG</a></td>
886886
<td align="center"><a href="https://modm.io/reference/config/modm-nucleo-h743zi">NUCLEO-H743ZI</a></td>
887-
<td align="center"><a href="https://modm.io/reference/config/modm-nucleo-l031k6">NUCLEO-L031K6</a></td>
887+
<td align="center"><a href="https://modm.io/reference/config/modm-nucleo-h743zi2">NUCLEO-H743ZI2</a></td>
888888
</tr><tr>
889+
<td align="center"><a href="https://modm.io/reference/config/modm-nucleo-l031k6">NUCLEO-L031K6</a></td>
889890
<td align="center"><a href="https://modm.io/reference/config/modm-nucleo-l053r8">NUCLEO-L053R8</a></td>
890891
<td align="center"><a href="https://modm.io/reference/config/modm-nucleo-l152re">NUCLEO-L152RE</a></td>
891892
<td align="center"><a href="https://modm.io/reference/config/modm-nucleo-l432kc">NUCLEO-L432KC</a></td>
892-
<td align="center"><a href="https://modm.io/reference/config/modm-nucleo-l452re">NUCLEO-L452RE</a></td>
893893
</tr><tr>
894+
<td align="center"><a href="https://modm.io/reference/config/modm-nucleo-l452re">NUCLEO-L452RE</a></td>
894895
<td align="center"><a href="https://modm.io/reference/config/modm-nucleo-l476rg">NUCLEO-L476RG</a></td>
895896
<td align="center"><a href="https://modm.io/reference/config/modm-nucleo-l496zg-p">NUCLEO-L496ZG-P</a></td>
896897
<td align="center"><a href="https://modm.io/reference/config/modm-nucleo-l552ze-q">NUCLEO-L552ZE-Q</a></td>
897-
<td align="center"><a href="https://modm.io/reference/config/modm-nucleo-u083rc">NUCLEO-U083RC</a></td>
898898
</tr><tr>
899+
<td align="center"><a href="https://modm.io/reference/config/modm-nucleo-u083rc">NUCLEO-U083RC</a></td>
899900
<td align="center"><a href="https://modm.io/reference/config/modm-nucleo-u385rg-q">NUCLEO-U385RG-Q</a></td>
900901
<td align="center"><a href="https://modm.io/reference/config/modm-nucleo-u575zi-q">NUCLEO-U575ZI-Q</a></td>
901902
<td align="center"><a href="https://modm.io/reference/config/modm-olimexino-stm32">OLIMEXINO-STM32</a></td>
902-
<td align="center"><a href="https://modm.io/reference/config/modm-rp-pico">Raspberry Pi Pico</a></td>
903903
</tr><tr>
904+
<td align="center"><a href="https://modm.io/reference/config/modm-rp-pico">Raspberry Pi Pico</a></td>
904905
<td align="center"><a href="https://modm.io/reference/config/modm-samd21-mini">SAMD21-MINI</a></td>
905906
<td align="center"><a href="https://modm.io/reference/config/modm-samd21-xplained-pro">SAMD21-XPLAINED-PRO</a></td>
906907
<td align="center"><a href="https://modm.io/reference/config/modm-same54-xplained-pro">SAME54-XPLAINED-PRO</a></td>
907-
<td align="center"><a href="https://modm.io/reference/config/modm-same70-xplained">SAME70-XPLAINED</a></td>
908908
</tr><tr>
909+
<td align="center"><a href="https://modm.io/reference/config/modm-same70-xplained">SAME70-XPLAINED</a></td>
909910
<td align="center"><a href="https://modm.io/reference/config/modm-samg55-xplained-pro">SAMG55-XPLAINED-PRO</a></td>
910911
<td align="center"><a href="https://modm.io/reference/config/modm-samv71-xplained-ultra">SAMV71-XPLAINED-ULTRA</a></td>
911912
<td align="center"><a href="https://modm.io/reference/config/modm-srxe">Smart Response XE</a></td>
912-
<td align="center"><a href="https://modm.io/reference/config/modm-stm32_f4ve">STM32-F4VE</a></td>
913913
</tr><tr>
914+
<td align="center"><a href="https://modm.io/reference/config/modm-stm32_f4ve">STM32-F4VE</a></td>
914915
<td align="center"><a href="https://modm.io/reference/config/modm-stm32f030_demo">STM32F030-DEMO</a></td>
915916
<td align="center"><a href="https://modm.io/reference/config/modm-thingplus-rp2040">THINGPLUS-RP2040</a></td>
916917
<td align="center"><a href="https://modm.io/reference/config/modm-weact-c011f6">WEACT-C011F6</a></td>
917-
<td align="center"><a href="https://modm.io/reference/config/modm-weact-g0b1cb">WEACT-G0B1CB</a></td>
918918
</tr><tr>
919+
<td align="center"><a href="https://modm.io/reference/config/modm-weact-g0b1cb">WEACT-G0B1CB</a></td>
919920
<td align="center"><a href="https://modm.io/reference/config/modm-weact-h503cb">WEACT-H503CB</a></td>
920921
<td align="center"><a href="https://modm.io/reference/config/modm-weact-h523ce">WEACT-H523CE</a></td>
921922
<td align="center"><a href="https://modm.io/reference/config/modm-weact-h562rg">WEACT-H562RG</a></td>
922-
<td align="center"><a href="https://modm.io/reference/config/modm-weact-u585ci">WEACT-U585CI</a></td>
923923
</tr><tr>
924+
<td align="center"><a href="https://modm.io/reference/config/modm-weact-u585ci">WEACT-U585CI</a></td>
924925
</tr>
925926
</table>
926927
<!--/bsptable-->
Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,12 @@ using namespace modm::literals;
3030
struct SystemClock
3131
{
3232
static constexpr uint32_t Hse = 8_MHz;
33-
33+
%% if board == "stm32h743zi"
3434
// NOTE: revision Y at 400MHz, only revision V runs at 480Mhz!!!
3535
static constexpr uint32_t SysClk = 400_MHz;
36+
%% else
37+
static constexpr uint32_t SysClk = 480_MHz;
38+
%% endif
3639
static constexpr uint32_t Pll2Q = 120_MHz;
3740
// Max 400MHz or 480MHz
3841
static constexpr uint32_t Hclk = SysClk / 1; // D1CPRE
@@ -113,7 +116,11 @@ struct SystemClock
113116
const Rcc::PllFactors pllFactors1{
114117
.range = Rcc::PllInputRange::MHz4_8,
115118
.pllM = 2, // 8MHz / M= 4MHz
119+
%% if board == "stm32h743zi"
116120
.pllN = 100, // 4MHz * N= 400MHz
121+
%% else
122+
.pllN = 120,
123+
%% endif
117124
.pllP = 1, // 400MHz / P= 400MHz = F_cpu
118125
.pllQ = 10, // 400MHz / Q= 40MHz
119126
.pllR = 10, // 400MHz / R= 40MHz
@@ -167,9 +174,14 @@ struct SystemClock
167174
using Button = GpioInputC13;
168175

169176
using LedGreen = GpioOutputB0;
170-
using LedBlue = GpioOutputB7;
171177
using LedRed = GpioOutputB14;
178+
%% if board == "stm32h743zi"
179+
using LedBlue = GpioOutputB7;
172180
using Leds = SoftwareGpioPort< LedRed, LedBlue, LedGreen >;
181+
%% else
182+
using LedYellow = GpioOutputE1;
183+
using Leds = SoftwareGpioPort< LedRed, LedYellow, LedGreen >;
184+
%% endif
173185
/// @}
174186

175187
namespace usb
@@ -182,8 +194,11 @@ using Dm = GpioA11;
182194
using Dp = GpioA12;
183195

184196
using Overcurrent = GpioInputG7; // OTG_FS_OverCurrent
197+
%% if board == "stm32h743zi"
185198
using Power = GpioOutputG6; // OTG_FS_PowerSwitchOn
186-
199+
%% else
200+
using Power = GpioOutputD10; // OTG_FS_PowerSwitchOn
201+
%% endif
187202
using Device = UsbFs;
188203
/// @}
189204
}
@@ -212,9 +227,7 @@ initialize()
212227
stlink::Uart::connect<stlink::Tx::Tx, stlink::Rx::Rx>();
213228
stlink::Uart::initialize<SystemClock, 115200_Bd>();
214229

215-
LedGreen::setOutput(modm::Gpio::Low);
216-
LedBlue::setOutput(modm::Gpio::Low);
217-
LedRed::setOutput(modm::Gpio::Low);
230+
Leds::setOutput(modm::Gpio::Low);
218231

219232
Button::setInput();
220233
}

src/modm/board/nucleo_h743zi/module.lb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,11 @@ def build(env):
5656
env.outbasepath = "modm/src/modm/board"
5757
env.substitutions = {
5858
"with_logger": True,
59-
"with_assert": env.has_module(":architecture:assert")
59+
"with_assert": env.has_module(":architecture:assert"),
60+
"board" : "stm32h743zi"
6061
}
62+
6163
env.template("../board.cpp.in", "board.cpp")
62-
env.copy('.')
64+
env.template("board.hpp.in")
6365
env.copy("../nucleo144_arduino.hpp", "nucleo144_arduino.hpp")
6466
env.collect(":build:openocd.source", "board/st_nucleo_h743zi.cfg")
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<library>
2+
<repositories>
3+
<repository>
4+
<path>../../../../repo.lb</path>
5+
</repository>
6+
</repositories>
7+
8+
<options>
9+
<option name="modm:target">stm32h743zit6/revV</option>
10+
</options>
11+
<modules>
12+
<module>modm:board:nucleo-h743zi2</module>
13+
</modules>
14+
</library>
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
#!/usr/bin/env python3
2+
# -*- coding: utf-8 -*-
3+
#
4+
# Copyright (c) 2016-2018, Niklas Hauser
5+
# Copyright (c) 2017, Fabian Greif
6+
#
7+
# This file is part of the modm project.
8+
#
9+
# This Source Code Form is subject to the terms of the Mozilla Public
10+
# License, v. 2.0. If a copy of the MPL was not distributed with this
11+
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
12+
# -----------------------------------------------------------------------------
13+
14+
def init(module):
15+
module.name = ":board:nucleo-h743zi2"
16+
module.description = """\
17+
# NUCLEO-H743ZI2
18+
19+
[Nucleo kit for STM32H743ZI2](https://www.st.com/en/evaluation-tools/nucleo-h743zi.html)
20+
21+
Please note that this BSP uses the V revision of the STM32H743.
22+
"""
23+
24+
def prepare(module, options):
25+
if not options[":target"].partname.startswith("stm32h743zit"):
26+
return False
27+
28+
module.depends(
29+
":debug",
30+
":architecture:clock",
31+
":platform:core",
32+
":platform:gpio",
33+
":platform:clock",
34+
":platform:uart:3",
35+
":platform:usb:fs")
36+
37+
return True
38+
39+
def build(env):
40+
env.outbasepath = "modm/src/modm/board"
41+
env.substitutions = {
42+
"with_logger": True,
43+
"with_assert": env.has_module(":architecture:assert"),
44+
"board" : "nucleo-h743zi2"
45+
}
46+
47+
env.template("../board.cpp.in", "board.cpp")
48+
env.template("../nucleo_h743zi/board.hpp.in", "board.hpp")
49+
env.copy("../nucleo144_arduino.hpp", "nucleo144_arduino.hpp")
50+
env.collect(":build:openocd.source", "board/st_nucleo_h743zi.cfg")

0 commit comments

Comments
 (0)