Skip to content

Commit 584f5e3

Browse files
committed
[board] Add NUCLEO-G0B1RE board
1 parent 32a788b commit 584f5e3

File tree

4 files changed

+81
-16
lines changed

4 files changed

+81
-16
lines changed

README.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -708,39 +708,40 @@ We have out-of-box support for many development boards including documentation.
708708
</tr><tr>
709709
<td align="center"><a href="https://modm.io/reference/config/modm-nucleo-g070rb">NUCLEO-G070RB</a></td>
710710
<td align="center"><a href="https://modm.io/reference/config/modm-nucleo-g071rb">NUCLEO-G071RB</a></td>
711+
<td align="center"><a href="https://modm.io/reference/config/modm-nucleo-g0b1re">NUCLEO-G0B1RE</a></td>
711712
<td align="center"><a href="https://modm.io/reference/config/modm-nucleo-g431kb">NUCLEO-G431KB</a></td>
712-
<td align="center"><a href="https://modm.io/reference/config/modm-nucleo-g431rb">NUCLEO-G431RB</a></td>
713713
</tr><tr>
714+
<td align="center"><a href="https://modm.io/reference/config/modm-nucleo-g431rb">NUCLEO-G431RB</a></td>
714715
<td align="center"><a href="https://modm.io/reference/config/modm-nucleo-g474re">NUCLEO-G474RE</a></td>
715716
<td align="center"><a href="https://modm.io/reference/config/modm-nucleo-h723zg">NUCLEO-H723ZG</a></td>
716717
<td align="center"><a href="https://modm.io/reference/config/modm-nucleo-h743zi">NUCLEO-H743ZI</a></td>
717-
<td align="center"><a href="https://modm.io/reference/config/modm-nucleo-l031k6">NUCLEO-L031K6</a></td>
718718
</tr><tr>
719+
<td align="center"><a href="https://modm.io/reference/config/modm-nucleo-l031k6">NUCLEO-L031K6</a></td>
719720
<td align="center"><a href="https://modm.io/reference/config/modm-nucleo-l053r8">NUCLEO-L053R8</a></td>
720721
<td align="center"><a href="https://modm.io/reference/config/modm-nucleo-l152re">NUCLEO-L152RE</a></td>
721722
<td align="center"><a href="https://modm.io/reference/config/modm-nucleo-l432kc">NUCLEO-L432KC</a></td>
722-
<td align="center"><a href="https://modm.io/reference/config/modm-nucleo-l452re">NUCLEO-L452RE</a></td>
723723
</tr><tr>
724+
<td align="center"><a href="https://modm.io/reference/config/modm-nucleo-l452re">NUCLEO-L452RE</a></td>
724725
<td align="center"><a href="https://modm.io/reference/config/modm-nucleo-l476rg">NUCLEO-L476RG</a></td>
725726
<td align="center"><a href="https://modm.io/reference/config/modm-nucleo-l496zg-p">NUCLEO-L496ZG-P</a></td>
726727
<td align="center"><a href="https://modm.io/reference/config/modm-nucleo-l552ze-q">NUCLEO-L552ZE-Q</a></td>
727-
<td align="center"><a href="https://modm.io/reference/config/modm-nucleo-u575zi-q">NUCLEO-U575ZI-Q</a></td>
728728
</tr><tr>
729+
<td align="center"><a href="https://modm.io/reference/config/modm-nucleo-u575zi-q">NUCLEO-U575ZI-Q</a></td>
729730
<td align="center"><a href="https://modm.io/reference/config/modm-olimexino-stm32">OLIMEXINO-STM32</a></td>
730731
<td align="center"><a href="https://modm.io/reference/config/modm-rp-pico">Raspberry Pi Pico</a></td>
731732
<td align="center"><a href="https://modm.io/reference/config/modm-samd21-mini">SAMD21-MINI</a></td>
732-
<td align="center"><a href="https://modm.io/reference/config/modm-samd21-xplained-pro">SAMD21-XPLAINED-PRO</a></td>
733733
</tr><tr>
734+
<td align="center"><a href="https://modm.io/reference/config/modm-samd21-xplained-pro">SAMD21-XPLAINED-PRO</a></td>
734735
<td align="center"><a href="https://modm.io/reference/config/modm-same54-xplained-pro">SAME54-XPLAINED-PRO</a></td>
735736
<td align="center"><a href="https://modm.io/reference/config/modm-same70-xplained">SAME70-XPLAINED</a></td>
736737
<td align="center"><a href="https://modm.io/reference/config/modm-samg55-xplained-pro">SAMG55-XPLAINED-PRO</a></td>
737-
<td align="center"><a href="https://modm.io/reference/config/modm-samv71-xplained-ultra">SAMV71-XPLAINED-ULTRA</a></td>
738738
</tr><tr>
739+
<td align="center"><a href="https://modm.io/reference/config/modm-samv71-xplained-ultra">SAMV71-XPLAINED-ULTRA</a></td>
739740
<td align="center"><a href="https://modm.io/reference/config/modm-srxe">Smart Response XE</a></td>
740741
<td align="center"><a href="https://modm.io/reference/config/modm-stm32_f4ve">STM32-F4VE</a></td>
741742
<td align="center"><a href="https://modm.io/reference/config/modm-stm32f030_demo">STM32F030-DEMO</a></td>
742-
<td align="center"><a href="https://modm.io/reference/config/modm-thingplus-rp2040">THINGPLUS-RP2040</a></td>
743743
</tr><tr>
744+
<td align="center"><a href="https://modm.io/reference/config/modm-thingplus-rp2040">THINGPLUS-RP2040</a></td>
744745
<td align="center"><a href="https://modm.io/reference/config/modm-weact-c011f6">WEACT-C011F6</a></td>
745746
</tr>
746747
</table>

src/modm/board/nucleo_g071rb/board.hpp

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,24 @@
88
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
99
*/
1010

11-
#ifndef MODM_STM32_NUCLEO_G071RB_HPP
12-
#define MODM_STM32_NUCLEO_G071RB_HPP
11+
#ifndef MODM_STM32_NUCLEO_G0x1Rx_HPP
12+
#define MODM_STM32_NUCLEO_G0x1Rx_HPP
1313

1414
#include <modm/platform.hpp>
1515
#include <modm/architecture/interface/clock.hpp>
1616
#include <modm/debug/logger.hpp>
17-
/// @ingroup modm_board_nucleo_g071rb modm_board_nucleo_g070rb
17+
/// @ingroup modm_board_nucleo_g070rb modm_board_nucleo_g071rb modm_board_nucleo_g0b1re
1818
#define MODM_BOARD_HAS_LOGGER
1919

2020
using namespace modm::platform;
2121

2222
namespace Board
2323
{
24-
/// @ingroup modm_board_nucleo_g071rb modm_board_nucleo_g070rb
24+
/// @ingroup modm_board_nucleo_g070rb modm_board_nucleo_g071rb modm_board_nucleo_g0b1re
2525
/// @{
2626
using namespace modm::literals;
2727

28-
/// STM32G071RB running at 64MHz generated from the internal 16MHz crystal
28+
/// STM32G0x1Rx running at 64MHz generated from the internal 16MHz crystal
2929
struct SystemClock
3030
{
3131
static constexpr uint32_t Frequency = 64_MHz;
@@ -40,11 +40,14 @@ struct SystemClock
4040
static constexpr uint32_t Rcc = Ahb;
4141
static constexpr uint32_t Dmamux = Ahb;
4242
static constexpr uint32_t Dma = Ahb;
43+
static constexpr uint32_t Dma2 = Ahb;
44+
static constexpr uint32_t Dma1 = Ahb;
4345

4446
static constexpr uint32_t Dbg = Apb;
4547
static constexpr uint32_t Timer17 = Apb;
4648
static constexpr uint32_t Timer16 = Apb;
4749
static constexpr uint32_t Timer15 = Apb;
50+
static constexpr uint32_t Usart6 = Apb;
4851
static constexpr uint32_t Usart1 = Apb;
4952
static constexpr uint32_t Spi1 = Apb;
5053
static constexpr uint32_t I2s1 = Apb;
@@ -59,25 +62,35 @@ struct SystemClock
5962
static constexpr uint32_t Ucpd2 = Apb;
6063
static constexpr uint32_t Ucpd1 = Apb;
6164
static constexpr uint32_t LpTimer2 = Apb;
65+
static constexpr uint32_t I2c3 = Apb;
66+
static constexpr uint32_t LpUart2 = Apb;
6267
static constexpr uint32_t LpUart1 = Apb;
6368
static constexpr uint32_t LpTimer1 = Apb;
6469
static constexpr uint32_t HdmiCec = Apb;
6570
static constexpr uint32_t Dac = Apb;
6671
static constexpr uint32_t Pwr = Apb;
72+
static constexpr uint32_t Crs = Apb;
73+
static constexpr uint32_t Fdcan2 = Apb;
74+
static constexpr uint32_t Fdcan1 = Apb;
75+
static constexpr uint32_t Usb = Apb;
6776
static constexpr uint32_t I2c2 = Apb;
6877
static constexpr uint32_t I2c1 = Apb;
78+
static constexpr uint32_t Usart5 = Apb;
6979
static constexpr uint32_t Usart4 = Apb;
7080
static constexpr uint32_t Usart3 = Apb;
7181
static constexpr uint32_t Usart2 = Apb;
82+
static constexpr uint32_t Spi3 = Apb;
7283
static constexpr uint32_t Spi2 = Apb;
84+
static constexpr uint32_t I2s2 = Apb;
7385
static constexpr uint32_t Iwdg = Rcc::LsiFrequency;
7486
static constexpr uint32_t Wwdg = Apb;
87+
static constexpr uint32_t Rtc = 32.768_kHz;
7588
static constexpr uint32_t Timer14 = Apb;
7689
static constexpr uint32_t Timer7 = Apb;
7790
static constexpr uint32_t Timer6 = Apb;
91+
static constexpr uint32_t Timer4 = Apb;
7892
static constexpr uint32_t Timer3 = Apb;
7993
static constexpr uint32_t Timer2 = Apb;
80-
static constexpr uint32_t Rtc = 32.768_kHz;
8194

8295
static bool inline
8396
enable()
@@ -138,15 +151,15 @@ using Leds = SoftwareGpioPort< LedD13 >;
138151

139152
namespace stlink
140153
{
141-
/// @ingroup modm_board_nucleo_g071rb modm_board_nucleo_g070rb
154+
/// @ingroup modm_board_nucleo_g070rb modm_board_nucleo_g071rb modm_board_nucleo_g0b1re
142155
/// @{
143156
using Rx = GpioInputA3;
144157
using Tx = GpioOutputA2;
145158
using Uart = BufferedUart<UsartHal2, UartTxBuffer<2048>>;
146159
/// @}
147160
}
148161

149-
/// @ingroup modm_board_nucleo_g071rb modm_board_nucleo_g070rb
162+
/// @ingroup modm_board_nucleo_g070rb modm_board_nucleo_g071rb modm_board_nucleo_g0b1re
150163
/// @{
151164
using LoggerDevice = modm::IODeviceWrapper< stlink::Uart, modm::IOBuffer::BlockIfFull >;
152165

@@ -165,4 +178,4 @@ initialize()
165178

166179
}
167180

168-
#endif // MODM_STM32_NUCLEO_G071RB_HPP
181+
#endif // MODM_STM32_NUCLEO_G0x1Rx_HPP
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">stm32g0b1ret6</option>
10+
</options>
11+
<modules>
12+
<module>modm:board:nucleo-g0b1re</module>
13+
</modules>
14+
</library>
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#!/usr/bin/env python3
2+
# -*- coding: utf-8 -*-
3+
#
4+
# Copyright (c) 2019, Niklas Hauser
5+
#
6+
# This file is part of the modm project.
7+
#
8+
# This Source Code Form is subject to the terms of the Mozilla Public
9+
# License, v. 2.0. If a copy of the MPL was not distributed with this
10+
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
11+
# -----------------------------------------------------------------------------
12+
13+
def init(module):
14+
module.name = ":board:nucleo-g0b1re"
15+
module.description = """\
16+
# NUCLEO-G0B1RE
17+
18+
[Nucleo kit for STM32G0B1RE](https://www.st.com/en/evaluation-tools/nucleo-g0b1re.html)
19+
"""
20+
21+
def prepare(module, options):
22+
if not options[":target"].partname.startswith("stm32g0b1ret"):
23+
return False
24+
25+
module.depends(":platform:core", ":platform:gpio", ":platform:clock", ":platform:uart:2",
26+
":debug", ":architecture:clock")
27+
return True
28+
29+
def build(env):
30+
env.outbasepath = "modm/src/modm/board"
31+
env.substitutions = {
32+
"with_logger": True,
33+
"with_assert": env.has_module(":architecture:assert")
34+
}
35+
env.template("../board.cpp.in", "board.cpp")
36+
env.copy("../nucleo_g071rb/board.hpp", "board.hpp")
37+
env.collect(":build:openocd.source", "board/st_nucleo_g0.cfg")

0 commit comments

Comments
 (0)