Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

STM32H7 dual core devices #844

Draft
wants to merge 9 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ jobs:
- name: Examples STM32H7 Series
if: always()
run: |
(cd examples && ../tools/scripts/examples_compile.py nucleo_h743zi nucleo_h723zg stm32h750vbt6_devebox)
(cd examples && ../tools/scripts/examples_compile.py nucleo_h743zi nucleo_h723zg stm32h750vbt6_devebox nucleo_h755zi-q)

stm32f4-examples-1:
runs-on: ubuntu-20.04
Expand Down
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ git clone --recurse-submodules --jobs 8 https://github.com/modm-io/modm.git

## Microcontrollers

modm can create a HAL for <!--allcount-->3287<!--/allcount--> devices of these vendors:
modm can create a HAL for <!--allcount-->3385<!--/allcount--> devices of these vendors:

- STMicroelectronics STM32: <!--stmcount-->2712<!--/stmcount--> devices.
- STMicroelectronics STM32: <!--stmcount-->2810<!--/stmcount--> devices.
- Microchip SAM: <!--samcount-->186<!--/samcount--> devices.
- Microchip AVR: <!--avrcount-->388<!--/avrcount--> devices.
- Raspberry Pi: <!--rpicount-->1<!--/rpicount--> device.
Expand Down Expand Up @@ -595,26 +595,27 @@ We have out-of-box support for many development boards including documentation.
<td align="center"><a href="https://modm.io/reference/config/modm-nucleo-h723zg">NUCLEO-H723ZG</a></td>
<td align="center"><a href="https://modm.io/reference/config/modm-nucleo-h743zi">NUCLEO-H743ZI</a></td>
</tr><tr>
<td align="center"><a href="https://modm.io/reference/config/modm-nucleo-h755zi-q">NUCLEO-H755ZI-Q</a></td>
<td align="center"><a href="https://modm.io/reference/config/modm-nucleo-l031k6">NUCLEO-L031K6</a></td>
<td align="center"><a href="https://modm.io/reference/config/modm-nucleo-l053r8">NUCLEO-L053R8</a></td>
<td align="center"><a href="https://modm.io/reference/config/modm-nucleo-l152re">NUCLEO-L152RE</a></td>
<td align="center"><a href="https://modm.io/reference/config/modm-nucleo-l432kc">NUCLEO-L432KC</a></td>
</tr><tr>
<td align="center"><a href="https://modm.io/reference/config/modm-nucleo-l432kc">NUCLEO-L432KC</a></td>
<td align="center"><a href="https://modm.io/reference/config/modm-nucleo-l452re">NUCLEO-L452RE</a></td>
<td align="center"><a href="https://modm.io/reference/config/modm-nucleo-l476rg">NUCLEO-L476RG</a></td>
<td align="center"><a href="https://modm.io/reference/config/modm-nucleo-l496zg-p">NUCLEO-L496ZG-P</a></td>
<td align="center"><a href="https://modm.io/reference/config/modm-nucleo-l552ze-q">NUCLEO-L552ZE-Q</a></td>
</tr><tr>
<td align="center"><a href="https://modm.io/reference/config/modm-nucleo-l552ze-q">NUCLEO-L552ZE-Q</a></td>
<td align="center"><a href="https://modm.io/reference/config/modm-olimexino-stm32">OLIMEXINO-STM32</a></td>
<td align="center"><a href="https://modm.io/reference/config/modm-raspberrypi">Raspberry Pi</a></td>
<td align="center"><a href="https://modm.io/reference/config/modm-rp-pico">Raspberry Pi Pico</a></td>
<td align="center"><a href="https://modm.io/reference/config/modm-samd21-mini">SAMD21-MINI</a></td>
</tr><tr>
<td align="center"><a href="https://modm.io/reference/config/modm-samd21-mini">SAMD21-MINI</a></td>
<td align="center"><a href="https://modm.io/reference/config/modm-samg55-xplained-pro">SAMG55-XPLAINED-PRO</a></td>
<td align="center"><a href="https://modm.io/reference/config/modm-srxe">Smart Response XE</a></td>
<td align="center"><a href="https://modm.io/reference/config/modm-stm32_f4ve">STM32-F4VE</a></td>
<td align="center"><a href="https://modm.io/reference/config/modm-stm32f030_demo">STM32F030-DEMO</a></td>
</tr><tr>
<td align="center"><a href="https://modm.io/reference/config/modm-stm32f030_demo">STM32F030-DEMO</a></td>
</tr>
</table>
<!--/bsptable-->
Expand Down
27 changes: 27 additions & 0 deletions examples/nucleo_h755zi-q/blink/cm4/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
* Copyright (c) 2022, Christopher Durand
*
* This file is part of the modm project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
// ----------------------------------------------------------------------------

#include <modm/board.hpp>

using namespace Board;

int
main()
{
Board::initialize();

while(1)
{
LedGreen::toggle();
modm::delay_ms(1000);
}
return 0;
}
10 changes: 10 additions & 0 deletions examples/nucleo_h755zi-q/blink/cm4/project.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<library>
<extends>modm:nucleo-h755zi-q</extends>
<options>
<option name="modm:build:build.path">../../../../build/nucleo_h755zi-q/blink_cm4</option>
<option name="modm:target">stm32h755zit6@m4</option>
</options>
<modules>
<module>modm:build:scons</module>
</modules>
</library>
43 changes: 43 additions & 0 deletions examples/nucleo_h755zi-q/blink/cm7/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/*
* Copyright (c) 2022, Christopher Durand
* Copyright (c) 2016-2017, Niklas Hauser
*
* This file is part of the modm project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
// ----------------------------------------------------------------------------

#include <modm/board.hpp>

using namespace Board;

int
main()
{
Board::initialize();
Leds::setOutput();

// Use the logging streams to print some messages.
// Change MODM_LOG_LEVEL above to enable or disable these messages
MODM_LOG_DEBUG << "debug" << modm::endl;
MODM_LOG_INFO << "info" << modm::endl;
MODM_LOG_WARNING << "warning" << modm::endl;
MODM_LOG_ERROR << "error" << modm::endl;

uint32_t counter(0);

LedYellow::set();
while (true)
{
LedYellow::toggle();
LedRed::toggle();
modm::delay(Button::read() ? 100ms : 500ms);

MODM_LOG_INFO << "loop: " << counter++ << modm::endl;
}

return 0;
}
10 changes: 10 additions & 0 deletions examples/nucleo_h755zi-q/blink/cm7/project.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<library>
<extends>modm:nucleo-h755zi-q</extends>
<options>
<option name="modm:build:build.path">../../../../build/nucleo_h755zi-q/blink_cm7</option>
<option name="modm:target">stm32h755zit6@m7</option>
</options>
<modules>
<module>modm:build:scons</module>
</modules>
</library>
4 changes: 3 additions & 1 deletion ext/st/module.lb
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ def common_header_file(env):
family_header = folder + ".h"
folder = "stm32/{}/Include".format(folder)
define = None
core_define = "CORE_CM{}".format(core) if device.identifier.get("core") else None

content = Path(localpath(folder, family_header)).read_text(encoding="utf-8", errors="replace")
match = re.findall(r"if defined\((?P<define>STM32[FLGH][\w\d]+)\)", content)
Expand All @@ -136,6 +137,7 @@ def common_header_file(env):
headers = {
"define": define,
"family_define": family_define,
"core_define": core_define,
"core_header": core_header,
"device_header": device_header,
"family_header": family_header,
Expand Down Expand Up @@ -179,7 +181,7 @@ def build(env):
env.substitutions = bprops
env.substitutions.update({
"headers": [bprops["device_header"], bprops["system_header"]],
"defines": [bprops["define"]],
"defines": [bprops["define"]] + ([bprops["core_define"]] if bprops["core_define"] is not None else []),
"target": env[":target"].identifier,
})
env.outbasepath = "modm/src/modm/platform"
Expand Down
106 changes: 106 additions & 0 deletions src/modm/board/nucleo144_arduino_h745_55.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
/*
* Copyright (c) 2022, Christopher Durand
* Copyright (c) 2017, Niklas Hauser
*
* This file is part of the modm project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
// ----------------------------------------------------------------------------

// Nucleo144 Arduino Header Footprint

#ifndef MODM_STM32_NUCLEO144_ARDUINO_H745_55_HPP
#define MODM_STM32_NUCLEO144_ARDUINO_H745_55_HPP

// Arduino Footprint
using A0 = GpioA3;
using A1 = GpioC0;
using A2 = GpioC3;
using A3 = GpioB1;
using A4 = GpioC2;
using A5 = GpioF11;
// Zio Footprint
using A6 = GpioF6;
using A7 = GpioF10;
using A8 = GpioA2; // RMII_MDIO

// Arduino Footprint
using D0 = GpioB7;
using D1 = GpioB6;
using D2 = GpioG14;
using D3 = GpioE13;
using D4 = GpioE14;
using D5 = GpioE11;
using D6 = GpioA8;
using D7 = GpioG12; // SMPS PG
using D8 = GpioG9; // SMPS EN
using D9 = GpioD15;
using D10 = GpioD14;
using D11 = GpioB5;
using D12 = GpioA6;
using D13 = GpioA5;
using D14 = GpioB9;
using D15 = GpioB8;
// Zio Footprint
using D16 = GpioC6;
using D17 = GpioB15;
using D18 = GpioB13; // RMII TXD1
using D19 = GpioB12;
using D20 = GpioA15;
using D21 = GpioC7;
using D22 = GpioB5;
using D23 = GpioB3; // SWO
using D24 = GpioA4;
using D25 = GpioB4;
using D26 = GpioG6;
using D27 = GpioB2;
using D28 = GpioD13;
using D29 = GpioD12;
using D30 = GpioD11;
using D31 = GpioE2;
using D32 = GpioA0;
using D33 = GpioB0;
using D34 = GpioE0;
using D35 = GpioB11;
using D36 = GpioB10;
using D37 = GpioE15;
using D38 = GpioE6;
using D39 = GpioE12;
using D40 = GpioE10;
using D41 = GpioE7;
using D42 = GpioE8;
using D43 = GpioC8;
using D44 = GpioC9;
using D45 = GpioC10;
using D46 = GpioC11;
using D47 = GpioC12;
using D48 = GpioD2;
using D49 = GpioG10; // SMPS_SW
using D50 = GpioG8; // SMPS V1
using D51 = GpioD7;
using D52 = GpioD6;
using D53 = GpioD5;
using D54 = GpioD4;
using D55 = GpioD3;
using D56 = GpioE2;
using D57 = GpioE4;
using D58 = GpioE5;
using D59 = GpioE6;
using D60 = GpioE3;
using D61 = GpioF8;
using D62 = GpioF7;
using D63 = GpioF9;
using D64 = GpioD10; // USB_FS_PWR_EN
using D65 = GpioB14; // LED RED
using D66 = GpioD1;
using D67 = GpioD0;
using D68 = GpioF15;
using D69 = GpioF14;
using D70 = GpioB5;
using D71 = GpioE9;
using D72 = GpioB2;

#endif // MODM_STM32_NUCLEO144_ARDUINO_H745_55_HPP