Skip to content

Commit 4fdd2a1

Browse files
committed
[board] Add STM32F723E-DISCOVERY board
1 parent bc41e22 commit 4fdd2a1

File tree

5 files changed

+328
-14
lines changed

5 files changed

+328
-14
lines changed

README.md

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -672,74 +672,75 @@ We have out-of-box support for many development boards including documentation.
672672
</tr><tr>
673673
<td align="center"><a href="https://modm.io/reference/config/modm-disco-f429zi">DISCO-F429ZI</a></td>
674674
<td align="center"><a href="https://modm.io/reference/config/modm-disco-f469ni">DISCO-F469NI</a></td>
675+
<td align="center"><a href="https://modm.io/reference/config/modm-disco-f723ie">DISCO-F723IE</a></td>
675676
<td align="center"><a href="https://modm.io/reference/config/modm-disco-f746ng">DISCO-F746NG</a></td>
676-
<td align="center"><a href="https://modm.io/reference/config/modm-disco-f769ni">DISCO-F769NI</a></td>
677677
</tr><tr>
678+
<td align="center"><a href="https://modm.io/reference/config/modm-disco-f769ni">DISCO-F769NI</a></td>
678679
<td align="center"><a href="https://modm.io/reference/config/modm-disco-l152rc">DISCO-L152RC</a></td>
679680
<td align="center"><a href="https://modm.io/reference/config/modm-disco-l476vg">DISCO-L476VG</a></td>
680681
<td align="center"><a href="https://modm.io/reference/config/modm-feather-m0">FEATHER-M0</a></td>
681-
<td align="center"><a href="https://modm.io/reference/config/modm-feather-m4">FEATHER-M4</a></td>
682682
</tr><tr>
683+
<td align="center"><a href="https://modm.io/reference/config/modm-feather-m4">FEATHER-M4</a></td>
683684
<td align="center"><a href="https://modm.io/reference/config/modm-feather-rp2040">FEATHER-RP2040</a></td>
684685
<td align="center"><a href="https://modm.io/reference/config/modm-mega-2560-pro">MEGA-2560-PRO</a></td>
685686
<td align="center"><a href="https://modm.io/reference/config/modm-nucleo-c031c6">NUCLEO-C031C6</a></td>
686-
<td align="center"><a href="https://modm.io/reference/config/modm-nucleo-f031k6">NUCLEO-F031K6</a></td>
687687
</tr><tr>
688+
<td align="center"><a href="https://modm.io/reference/config/modm-nucleo-f031k6">NUCLEO-F031K6</a></td>
688689
<td align="center"><a href="https://modm.io/reference/config/modm-nucleo-f042k6">NUCLEO-F042K6</a></td>
689690
<td align="center"><a href="https://modm.io/reference/config/modm-nucleo-f072rb">NUCLEO-F072RB</a></td>
690691
<td align="center"><a href="https://modm.io/reference/config/modm-nucleo-f091rc">NUCLEO-F091RC</a></td>
691-
<td align="center"><a href="https://modm.io/reference/config/modm-nucleo-f103rb">NUCLEO-F103RB</a></td>
692692
</tr><tr>
693+
<td align="center"><a href="https://modm.io/reference/config/modm-nucleo-f103rb">NUCLEO-F103RB</a></td>
693694
<td align="center"><a href="https://modm.io/reference/config/modm-nucleo-f303k8">NUCLEO-F303K8</a></td>
694695
<td align="center"><a href="https://modm.io/reference/config/modm-nucleo-f303re">NUCLEO-F303RE</a></td>
695696
<td align="center"><a href="https://modm.io/reference/config/modm-nucleo-f334r8">NUCLEO-F334R8</a></td>
696-
<td align="center"><a href="https://modm.io/reference/config/modm-nucleo-f401re">NUCLEO-F401RE</a></td>
697697
</tr><tr>
698+
<td align="center"><a href="https://modm.io/reference/config/modm-nucleo-f401re">NUCLEO-F401RE</a></td>
698699
<td align="center"><a href="https://modm.io/reference/config/modm-nucleo-f411re">NUCLEO-F411RE</a></td>
699700
<td align="center"><a href="https://modm.io/reference/config/modm-nucleo-f429zi">NUCLEO-F429ZI</a></td>
700701
<td align="center"><a href="https://modm.io/reference/config/modm-nucleo-f439zi">NUCLEO-F439ZI</a></td>
701-
<td align="center"><a href="https://modm.io/reference/config/modm-nucleo-f446re">NUCLEO-F446RE</a></td>
702702
</tr><tr>
703+
<td align="center"><a href="https://modm.io/reference/config/modm-nucleo-f446re">NUCLEO-F446RE</a></td>
703704
<td align="center"><a href="https://modm.io/reference/config/modm-nucleo-f446ze">NUCLEO-F446ZE</a></td>
704705
<td align="center"><a href="https://modm.io/reference/config/modm-nucleo-f746zg">NUCLEO-F746ZG</a></td>
705706
<td align="center"><a href="https://modm.io/reference/config/modm-nucleo-f767zi">NUCLEO-F767ZI</a></td>
706-
<td align="center"><a href="https://modm.io/reference/config/modm-nucleo-g070rb">NUCLEO-G070RB</a></td>
707707
</tr><tr>
708+
<td align="center"><a href="https://modm.io/reference/config/modm-nucleo-g070rb">NUCLEO-G070RB</a></td>
708709
<td align="center"><a href="https://modm.io/reference/config/modm-nucleo-g071rb">NUCLEO-G071RB</a></td>
709710
<td align="center"><a href="https://modm.io/reference/config/modm-nucleo-g431kb">NUCLEO-G431KB</a></td>
710711
<td align="center"><a href="https://modm.io/reference/config/modm-nucleo-g431rb">NUCLEO-G431RB</a></td>
711-
<td align="center"><a href="https://modm.io/reference/config/modm-nucleo-g474re">NUCLEO-G474RE</a></td>
712712
</tr><tr>
713+
<td align="center"><a href="https://modm.io/reference/config/modm-nucleo-g474re">NUCLEO-G474RE</a></td>
713714
<td align="center"><a href="https://modm.io/reference/config/modm-nucleo-h723zg">NUCLEO-H723ZG</a></td>
714715
<td align="center"><a href="https://modm.io/reference/config/modm-nucleo-h743zi">NUCLEO-H743ZI</a></td>
715716
<td align="center"><a href="https://modm.io/reference/config/modm-nucleo-l031k6">NUCLEO-L031K6</a></td>
716-
<td align="center"><a href="https://modm.io/reference/config/modm-nucleo-l053r8">NUCLEO-L053R8</a></td>
717717
</tr><tr>
718+
<td align="center"><a href="https://modm.io/reference/config/modm-nucleo-l053r8">NUCLEO-L053R8</a></td>
718719
<td align="center"><a href="https://modm.io/reference/config/modm-nucleo-l152re">NUCLEO-L152RE</a></td>
719720
<td align="center"><a href="https://modm.io/reference/config/modm-nucleo-l432kc">NUCLEO-L432KC</a></td>
720721
<td align="center"><a href="https://modm.io/reference/config/modm-nucleo-l452re">NUCLEO-L452RE</a></td>
721-
<td align="center"><a href="https://modm.io/reference/config/modm-nucleo-l476rg">NUCLEO-L476RG</a></td>
722722
</tr><tr>
723+
<td align="center"><a href="https://modm.io/reference/config/modm-nucleo-l476rg">NUCLEO-L476RG</a></td>
723724
<td align="center"><a href="https://modm.io/reference/config/modm-nucleo-l496zg-p">NUCLEO-L496ZG-P</a></td>
724725
<td align="center"><a href="https://modm.io/reference/config/modm-nucleo-l552ze-q">NUCLEO-L552ZE-Q</a></td>
725726
<td align="center"><a href="https://modm.io/reference/config/modm-nucleo-u575zi-q">NUCLEO-U575ZI-Q</a></td>
726-
<td align="center"><a href="https://modm.io/reference/config/modm-olimexino-stm32">OLIMEXINO-STM32</a></td>
727727
</tr><tr>
728+
<td align="center"><a href="https://modm.io/reference/config/modm-olimexino-stm32">OLIMEXINO-STM32</a></td>
728729
<td align="center"><a href="https://modm.io/reference/config/modm-rp-pico">Raspberry Pi Pico</a></td>
729730
<td align="center"><a href="https://modm.io/reference/config/modm-samd21-mini">SAMD21-MINI</a></td>
730731
<td align="center"><a href="https://modm.io/reference/config/modm-samd21-xplained-pro">SAMD21-XPLAINED-PRO</a></td>
731-
<td align="center"><a href="https://modm.io/reference/config/modm-same54-xplained-pro">SAME54-XPLAINED-PRO</a></td>
732732
</tr><tr>
733+
<td align="center"><a href="https://modm.io/reference/config/modm-same54-xplained-pro">SAME54-XPLAINED-PRO</a></td>
733734
<td align="center"><a href="https://modm.io/reference/config/modm-same70-xplained">SAME70-XPLAINED</a></td>
734735
<td align="center"><a href="https://modm.io/reference/config/modm-samg55-xplained-pro">SAMG55-XPLAINED-PRO</a></td>
735736
<td align="center"><a href="https://modm.io/reference/config/modm-samv71-xplained-ultra">SAMV71-XPLAINED-ULTRA</a></td>
736-
<td align="center"><a href="https://modm.io/reference/config/modm-srxe">Smart Response XE</a></td>
737737
</tr><tr>
738+
<td align="center"><a href="https://modm.io/reference/config/modm-srxe">Smart Response XE</a></td>
738739
<td align="center"><a href="https://modm.io/reference/config/modm-stm32_f4ve">STM32-F4VE</a></td>
739740
<td align="center"><a href="https://modm.io/reference/config/modm-stm32f030_demo">STM32F030-DEMO</a></td>
740741
<td align="center"><a href="https://modm.io/reference/config/modm-thingplus-rp2040">THINGPLUS-RP2040</a></td>
741-
<td align="center"><a href="https://modm.io/reference/config/modm-weact-c011f6">WEACT-C011F6</a></td>
742742
</tr><tr>
743+
<td align="center"><a href="https://modm.io/reference/config/modm-weact-c011f6">WEACT-C011F6</a></td>
743744
</tr>
744745
</table>
745746
<!--/bsptable-->

examples/generic/usb/project.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
<!-- <extends>modm:disco-f411ve</extends> -->
99
<!-- <extends>modm:disco-f429zi</extends> -->
1010
<!-- <extends>modm:disco-f469ni</extends> -->
11+
<!-- <extends>modm:disco-f723ie</extends> -->
1112
<!-- <extends>modm:disco-f746ng</extends> -->
1213
<!-- <extends>modm:disco-l476vg</extends> -->
1314
<!-- <extends>modm:feather-m0</extends> -->

src/modm/board/disco_f723ie/board.hpp

Lines changed: 225 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,225 @@
1+
/*
2+
* Copyright (c) 2015-2018, Niklas Hauser
3+
* Copyright (c) 2016, Fabian Greif
4+
* Copyright (c) 2016-2017, Sascha Schade
5+
* Copyright (c) 2018, Antal Szabó
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+
15+
#pragma once
16+
17+
#include <modm/platform.hpp>
18+
#include <modm/architecture/interface/clock.hpp>
19+
#include <modm/debug/logger.hpp>
20+
21+
/// @ingroup modm_board_disco_f723ie
22+
#define MODM_BOARD_HAS_LOGGER
23+
24+
using namespace modm::platform;
25+
26+
namespace Board
27+
{
28+
/// @ingroup modm_board_disco_f723ie
29+
/// @{
30+
using namespace modm::literals;
31+
32+
/// STM32F7 running at 216MHz from the external 25MHz clock
33+
struct SystemClock
34+
{
35+
static constexpr uint32_t Frequency = 216_MHz;
36+
static constexpr uint32_t Apb1 = Frequency / 4;
37+
static constexpr uint32_t Apb2 = Frequency / 2;
38+
39+
static constexpr uint32_t Adc1 = Apb2;
40+
static constexpr uint32_t Adc2 = Apb2;
41+
static constexpr uint32_t Adc3 = Apb2;
42+
43+
static constexpr uint32_t Spi1 = Apb2;
44+
static constexpr uint32_t Spi2 = Apb1;
45+
static constexpr uint32_t Spi3 = Apb1;
46+
static constexpr uint32_t Spi4 = Apb2;
47+
48+
static constexpr uint32_t Usart1 = Apb2;
49+
static constexpr uint32_t Usart2 = Apb1;
50+
static constexpr uint32_t Usart3 = Apb1;
51+
static constexpr uint32_t Uart4 = Apb1;
52+
static constexpr uint32_t Uart5 = Apb1;
53+
static constexpr uint32_t Usart6 = Apb2;
54+
static constexpr uint32_t Uart7 = Apb1;
55+
static constexpr uint32_t Uart8 = Apb1;
56+
57+
static constexpr uint32_t Can1 = Apb1;
58+
static constexpr uint32_t Can2 = Apb1;
59+
60+
static constexpr uint32_t I2c1 = Apb1;
61+
static constexpr uint32_t I2c2 = Apb1;
62+
static constexpr uint32_t I2c3 = Apb1;
63+
static constexpr uint32_t I2c4 = Apb1;
64+
65+
static constexpr uint32_t Apb1Timer = Apb1 * 2;
66+
static constexpr uint32_t Apb2Timer = Apb2 * 2;
67+
static constexpr uint32_t Timer1 = Apb2Timer;
68+
static constexpr uint32_t Timer2 = Apb1Timer;
69+
static constexpr uint32_t Timer3 = Apb1Timer;
70+
static constexpr uint32_t Timer4 = Apb1Timer;
71+
static constexpr uint32_t Timer5 = Apb1Timer;
72+
static constexpr uint32_t Timer6 = Apb1Timer;
73+
static constexpr uint32_t Timer7 = Apb1Timer;
74+
static constexpr uint32_t Timer8 = Apb2Timer;
75+
static constexpr uint32_t Timer10 = Apb2Timer;
76+
static constexpr uint32_t Timer11 = Apb2Timer;
77+
static constexpr uint32_t Timer12 = Apb1Timer;
78+
static constexpr uint32_t Timer13 = Apb1Timer;
79+
static constexpr uint32_t Timer14 = Apb1Timer;
80+
81+
static constexpr uint32_t Usb = 48_MHz;
82+
static constexpr uint32_t Iwdg = Rcc::LsiFrequency;
83+
static constexpr uint32_t Rtc = 32.768_kHz;
84+
85+
static bool inline
86+
enable()
87+
{
88+
Rcc::enableLowSpeedExternalCrystal();
89+
Rcc::enableRealTimeClock(Rcc::RealTimeClockSource::LowSpeedExternalCrystal);
90+
91+
Rcc::enableExternalClock(); // 25 MHz
92+
const Rcc::PllFactors pllFactors{
93+
.pllM = 25, // 25MHz / M=25 -> 1MHz
94+
.pllN = 432, // 1MHz * N=432 -> 432MHz
95+
.pllP = 2, // 432MHz / P=2 -> 216MHz = F_cpu
96+
.pllQ = 9 // 432MHz / Q=9 -> 48MHz = F_usb
97+
};
98+
Rcc::enablePll(Rcc::PllSource::ExternalClock, pllFactors);
99+
// Required for 216 MHz clock
100+
Rcc::enableOverdriveMode();
101+
102+
Rcc::setFlashLatency<Frequency>();
103+
Rcc::enableSystemClock(Rcc::SystemClockSource::Pll);
104+
// APB1 is running at 54MHz
105+
Rcc::setApb1Prescaler(Rcc::Apb1Prescaler::Div4);
106+
// APB2 is running at 108MHz
107+
Rcc::setApb2Prescaler(Rcc::Apb2Prescaler::Div2);
108+
Rcc::updateCoreFrequency<Frequency>();
109+
110+
return true;
111+
}
112+
};
113+
114+
// Arduino footprint
115+
using A0 = GpioA6;
116+
using A1 = GpioA4;
117+
using A2 = GpioC4;
118+
using A3 = GpioF10;
119+
using A4 = GpioC0;
120+
using A5 = GpioC1;
121+
122+
using D0 = GpioA3;
123+
using D1 = GpioA2;
124+
using D2 = GpioC5;
125+
using D3 = GpioE5;
126+
using D4 = GpioH3;
127+
using D5 = GpioB0;
128+
using D6 = GpioE6;
129+
using D7 = GpioE3;
130+
using D8 = GpioE4;
131+
using D9 = GpioH6;
132+
using D10 = GpioA1;
133+
using D11 = GpioB5;
134+
using D12 = GpioB4;
135+
using D13 = GpioOutputA5;
136+
using D14 = GpioH5;
137+
using D15 = GpioH4;
138+
139+
using Button = GpioInputA0; // User Button
140+
using LedRed = GpioOutputA7; // User Red LED
141+
using LedGreen = GpioOutputB1; // User Green LED
142+
using LedD13 = D13; // User Blue LED (Arduino D13)
143+
144+
using Leds = SoftwareGpioPort< LedD13, LedGreen, LedRed >;
145+
/// @}
146+
147+
namespace usb_fs
148+
{
149+
/// @ingroup modm_board_disco_f723ie
150+
/// @{
151+
using Vbus = GpioA9;
152+
using Id = GpioA10;
153+
using Dm = GpioA11;
154+
using Dp = GpioA12;
155+
using Overcurrent = GpioB10;
156+
using Power = GpioG8;
157+
158+
using Device = UsbFs;
159+
/// @}
160+
}
161+
162+
namespace usb_hs
163+
{
164+
/// @ingroup modm_board_disco_f723ie
165+
/// @{
166+
167+
using Vbus = GpioB13;
168+
using Id = GpioB12;
169+
using Dm = GpioB14;
170+
using Dp = GpioB15;
171+
using Overcurrent = GpioH10;
172+
using Power = GpioH12;
173+
174+
using Device = UsbHs;
175+
/// @}
176+
}
177+
178+
namespace stlink
179+
{
180+
/// @ingroup modm_board_disco_f723ie
181+
/// @{
182+
using Tx = GpioOutputC6;
183+
using Rx = GpioInputC7;
184+
using Uart = BufferedUart<UsartHal6, UartTxBuffer<2048>>;
185+
/// @}
186+
}
187+
188+
/// @ingroup modm_board_disco_f723ie
189+
/// @{
190+
using LoggerDevice = modm::IODeviceWrapper< stlink::Uart, modm::IOBuffer::BlockIfFull >;
191+
192+
inline void
193+
initialize()
194+
{
195+
SystemClock::enable();
196+
SysTickTimer::initialize<SystemClock>();
197+
198+
stlink::Uart::connect<stlink::Tx::Tx, stlink::Rx::Rx>();
199+
stlink::Uart::initialize<SystemClock, 115200_Bd>();
200+
201+
Button::setInput();
202+
}
203+
204+
inline void
205+
initializeUsb(uint8_t priority=3)
206+
{
207+
// Full-speed USB port
208+
usb_fs::Device::initialize<SystemClock>(priority);
209+
usb_fs::Device::connect<usb_fs::Dm::Dm, usb_fs::Dp::Dp, usb_fs::Id::Id>();
210+
usb_fs::Overcurrent::setInput();
211+
212+
// Enable VBUS Sensing B
213+
USB_OTG_FS->GCCFG |= USB_OTG_GCCFG_VBDEN;
214+
215+
// High-speed USB port
216+
usb_hs::Device::initialize<SystemClock>(priority);
217+
usb_hs::Device::connect<usb_hs::Dm::Dm, usb_hs::Dp::Dp, usb_hs::Id::Id>();
218+
usb_hs::Overcurrent::setInput();
219+
220+
// Enable VBUS Sensing B
221+
USB_OTG_HS->GCCFG |= USB_OTG_GCCFG_VBDEN;
222+
}
223+
/// @}
224+
225+
}

src/modm/board/disco_f723ie/board.xml

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">stm32f723iek6</option>
10+
</options>
11+
<modules>
12+
<module>modm:board:disco-f723ie</module>
13+
</modules>
14+
</library>

0 commit comments

Comments
 (0)