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

Add STM32H7 support #652

Merged
merged 16 commits into from
Jul 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions .github/workflows/compile-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -425,3 +425,45 @@ jobs:
with:
name: stm32g4-compile-all-2
path: test/all/log

stm32h7-compile-all-1:
if: github.event.label.name == 'ci:hal'
runs-on: ubuntu-20.04
container:
image: ghcr.io/modm-ext/modm-build-cortex-m:latest
steps:
- name: Check out repository
uses: actions/checkout@v2
- name: Checkout code and update modm tools
run: |
(git submodule sync && git submodule update --init --jobs 8) & pip3 install --upgrade --upgrade-strategy=eager modm & wait
- name: Compile HAL for all STM32H7 Part 1
run: |
(cd test/all && python3 run_all.py stm32h7 --quick-remaining --split 2 --part 0)
- name: Upload log artifacts
if: always()
uses: actions/upload-artifact@v2
with:
name: stm32h7-compile-all-1
path: test/all/log

stm32h7-compile-all-2:
if: github.event.label.name == 'ci:hal'
runs-on: ubuntu-20.04
container:
image: ghcr.io/modm-ext/modm-build-cortex-m:latest
steps:
- name: Check out repository
uses: actions/checkout@v2
- name: Checkout code and update modm tools
run: |
(git submodule sync && git submodule update --init --jobs 8) & pip3 install --upgrade --upgrade-strategy=eager modm & wait
- name: Compile HAL for all STM32H7 Part 2
run: |
(cd test/all && python3 run_all.py stm32h7 --quick-remaining --split 2 --part 1)
- name: Upload log artifacts
if: always()
uses: actions/upload-artifact@v2
with:
name: stm32h7-compile-all-2
path: test/all/log
4 changes: 4 additions & 0 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,10 @@ jobs:
if: always()
run: |
(cd examples && ../tools/scripts/examples_compile.py nucleo_g474re nucleo_g431rb nucleo_g431kb)
- name: Examples STM32H7 Series
if: always()
run: |
(cd examples && ../tools/scripts/examples_compile.py nucleo_h743zi nucleo_h723zg)

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

## Microcontrollers

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

- STMicroelectronics STM32: <!--stmcount-->2438<!--/stmcount--> devices.
- STMicroelectronics STM32: <!--stmcount-->2593<!--/stmcount--> devices.
- Microchip SAM: <!--samcount-->163<!--/samcount--> devices.
- Microchip AVR: <!--avrcount-->506<!--/avrcount--> devices.
- Microchip AVR: <!--avrcount-->382<!--/avrcount--> devices.

Here is a table with all device families and the peripheral drivers they support:

Expand All @@ -95,7 +95,7 @@ Please [discover modm's peripheral drivers for your specific device][discover].
<table>
<tr>
<th align="center"></th>
<th align="center" colspan="11">STM32</th>
<th align="center" colspan="12">STM32</th>
<th align="center" colspan="1">SAM</th>
<th align="center" colspan="3">AT</th>
</tr><tr>
Expand All @@ -108,6 +108,7 @@ Please [discover modm's peripheral drivers for your specific device][discover].
<th align="center">F7</th>
<th align="center">G0</th>
<th align="center">G4</th>
<th align="center">H7</th>
<th align="center">L0</th>
<th align="center">L1</th>
<th align="center">L4</th>
Expand All @@ -126,6 +127,7 @@ Please [discover modm's peripheral drivers for your specific device][discover].
<td align="center">✅</td>
<td align="center">✅</td>
<td align="center">○</td>
<td align="center">○</td>
<td align="center">✅</td>
<td align="center">✅</td>
<td align="center">○</td>
Expand All @@ -142,6 +144,7 @@ Please [discover modm's peripheral drivers for your specific device][discover].
<td align="center">✅</td>
<td align="center">✗</td>
<td align="center">✅</td>
<td align="center">○</td>
<td align="center">✗</td>
<td align="center">✗</td>
<td align="center">✅</td>
Expand All @@ -161,6 +164,7 @@ Please [discover modm's peripheral drivers for your specific device][discover].
<td align="center">✅</td>
<td align="center">○</td>
<td align="center">○</td>
<td align="center">○</td>
<td align="center">✅</td>
<td align="center">○</td>
<td align="center">○</td>
Expand All @@ -179,6 +183,7 @@ Please [discover modm's peripheral drivers for your specific device][discover].
<td align="center">✅</td>
<td align="center">✅</td>
<td align="center">✅</td>
<td align="center">✅</td>
<td align="center">○</td>
<td align="center">✗</td>
<td align="center">○</td>
Expand All @@ -193,6 +198,7 @@ Please [discover modm's peripheral drivers for your specific device][discover].
<td align="center">○</td>
<td align="center">✅</td>
<td align="center">✅</td>
<td align="center">○</td>
<td align="center">✅</td>
<td align="center">✅</td>
<td align="center">✅</td>
Expand All @@ -210,6 +216,7 @@ Please [discover modm's peripheral drivers for your specific device][discover].
<td align="center">✅</td>
<td align="center">✗</td>
<td align="center">✗</td>
<td align="center">○</td>
<td align="center">✗</td>
<td align="center">✗</td>
<td align="center">✗</td>
Expand All @@ -234,6 +241,7 @@ Please [discover modm's peripheral drivers for your specific device][discover].
<td align="center">✅</td>
<td align="center">✅</td>
<td align="center">✅</td>
<td align="center">✅</td>
</tr><tr>
<td align="left">External Memory</td>
<td align="center">✗</td>
Expand All @@ -244,6 +252,7 @@ Please [discover modm's peripheral drivers for your specific device][discover].
<td align="center">○</td>
<td align="center">✗</td>
<td align="center">○</td>
<td align="center">○</td>
<td align="center">✗</td>
<td align="center">✗</td>
<td align="center">○</td>
Expand All @@ -268,6 +277,7 @@ Please [discover modm's peripheral drivers for your specific device][discover].
<td align="center">✅</td>
<td align="center">✅</td>
<td align="center">✅</td>
<td align="center">✅</td>
</tr><tr>
<td align="left">I<sup>2</sup>C</td>
<td align="center">✅</td>
Expand All @@ -281,6 +291,7 @@ Please [discover modm's peripheral drivers for your specific device][discover].
<td align="center">✅</td>
<td align="center">✅</td>
<td align="center">✅</td>
<td align="center">✅</td>
<td align="center">○</td>
<td align="center">✅</td>
<td align="center">✅</td>
Expand All @@ -299,6 +310,7 @@ Please [discover modm's peripheral drivers for your specific device][discover].
<td align="center">○</td>
<td align="center">○</td>
<td align="center">○</td>
<td align="center">○</td>
<td align="center">✗</td>
<td align="center">✗</td>
<td align="center">✗</td>
Expand All @@ -313,6 +325,7 @@ Please [discover modm's peripheral drivers for your specific device][discover].
<td align="center">✅</td>
<td align="center">✅</td>
<td align="center">✅</td>
<td align="center">✅</td>
<td align="center">✗</td>
<td align="center">✅</td>
<td align="center">✗</td>
Expand All @@ -329,6 +342,7 @@ Please [discover modm's peripheral drivers for your specific device][discover].
<td align="center">✅</td>
<td align="center">✅</td>
<td align="center">✅</td>
<td align="center">○</td>
<td align="center">✅</td>
<td align="center">✅</td>
<td align="center">✅</td>
Expand All @@ -350,6 +364,7 @@ Please [discover modm's peripheral drivers for your specific device][discover].
<td align="center">✅</td>
<td align="center">✅</td>
<td align="center">✅</td>
<td align="center">✅</td>
<td align="center">✗</td>
<td align="center">✗</td>
<td align="center">✗</td>
Expand All @@ -366,6 +381,7 @@ Please [discover modm's peripheral drivers for your specific device][discover].
<td align="center">✅</td>
<td align="center">✅</td>
<td align="center">✅</td>
<td align="center">✅</td>
<td align="center">○</td>
<td align="center">○</td>
<td align="center">○</td>
Expand All @@ -386,6 +402,7 @@ Please [discover modm's peripheral drivers for your specific device][discover].
<td align="center">✅</td>
<td align="center">✅</td>
<td align="center">✅</td>
<td align="center">✅</td>
<td align="center">○</td>
</tr><tr>
<td align="left">Unique ID</td>
Expand All @@ -400,6 +417,7 @@ Please [discover modm's peripheral drivers for your specific device][discover].
<td align="center">✅</td>
<td align="center">✅</td>
<td align="center">✅</td>
<td align="center">✅</td>
<td align="center">✗</td>
<td align="center">✗</td>
<td align="center">✗</td>
Expand All @@ -418,6 +436,7 @@ Please [discover modm's peripheral drivers for your specific device][discover].
<td align="center">✅</td>
<td align="center">✅</td>
<td align="center">✅</td>
<td align="center">✅</td>
<td align="center">✗</td>
<td align="center">✗</td>
<td align="center">✗</td>
Expand Down Expand Up @@ -490,20 +509,22 @@ We have out-of-box support for many development boards including documentation.
<td align="center"><a href="https://modm.io/reference/module/modm-board-nucleo-g431rb">NUCLEO-G431RB</a></td>
</tr><tr>
<td align="center"><a href="https://modm.io/reference/module/modm-board-nucleo-g474re">NUCLEO-G474RE</a></td>
<td align="center"><a href="https://modm.io/reference/module/modm-board-nucleo-h723zg">NUCLEO-H723ZG</a></td>
<td align="center"><a href="https://modm.io/reference/module/modm-board-nucleo-h743zi">NUCLEO-H743ZI</a></td>
<td align="center"><a href="https://modm.io/reference/module/modm-board-nucleo-l031k6">NUCLEO-L031K6</a></td>
</tr><tr>
<td align="center"><a href="https://modm.io/reference/module/modm-board-nucleo-l152re">NUCLEO-L152RE</a></td>
<td align="center"><a href="https://modm.io/reference/module/modm-board-nucleo-l432kc">NUCLEO-L432KC</a></td>
</tr><tr>
<td align="center"><a href="https://modm.io/reference/module/modm-board-nucleo-l452re">NUCLEO-L452RE</a></td>
<td align="center"><a href="https://modm.io/reference/module/modm-board-nucleo-l476rg">NUCLEO-L476RG</a></td>
</tr><tr>
<td align="center"><a href="https://modm.io/reference/module/modm-board-nucleo-l496zg-p">NUCLEO-L496ZG-P</a></td>
<td align="center"><a href="https://modm.io/reference/module/modm-board-olimexino-stm32">OLIMEXINO-STM32</a></td>
</tr><tr>
<td align="center"><a href="https://modm.io/reference/module/modm-board-raspberrypi">Raspberry Pi</a></td>
<td align="center"><a href="https://modm.io/reference/module/modm-board-samd21-mini">SAMD21-MINI</a></td>
</tr><tr>
<td align="center"><a href="https://modm.io/reference/module/modm-board-stm32_f4ve">STM32-F4VE</a></td>
<td align="center"><a href="https://modm.io/reference/module/modm-board-stm32f030_demo">STM32F030-DEMO</a></td>
</tr><tr>
</tr>
</table>
<!--/bsptable-->
Expand Down
4 changes: 2 additions & 2 deletions examples/black_pill_f411/usbfatfs/ramdisk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
// ----------------------------------------------------------------------------
static constexpr uint32_t sector_size{512};
static constexpr uint32_t sector_count{230};
// Allocate giant array inside a NOLOAD heap section
modm_section(".heap1") uint8_t ram_disk[sector_count * sector_size];
// Allocate giant array inside the SRAM1 noinit section
modm_section(".noinit_sram1") uint8_t ram_disk[sector_count * sector_size];

DSTATUS disk_initialize(BYTE pdrv) { return pdrv ? STA_NOINIT : 0; }
DSTATUS disk_status(BYTE pdrv) { return pdrv ? STA_NOINIT : 0; }
Expand Down
1 change: 1 addition & 0 deletions examples/generic/delay/project.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<!-- <extends>modm:nucleo-f429zi</extends> -->
<!-- <extends>modm:nucleo-f446re</extends> -->
<!-- <extends>modm:nucleo-g071rb</extends> -->
<!-- <extends>modm:nucleo-h743zi</extends> -->
<extends>modm:nucleo-l152re</extends>
<!-- <extends>modm:nucleo-l432kc</extends> -->
<!-- <extends>modm:nucleo-l476rg</extends> -->
Expand Down
4 changes: 2 additions & 2 deletions examples/nucleo_g071rb/custom_allocator/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@

using namespace Board;

// Allocate giant array inside a NOLOAD heap section
// Allocate giant array inside the SRAM1 noinit section
// Play around with the array size and see effect it has on HeapTable!
modm_section(".heap1")
modm_section(".noinit_sram1")
uint8_t heap_begin[30*1024]; // 31kB overflows the linkerscript
const uint8_t *const heap_end{heap_begin + sizeof(heap_begin)};
const uint8_t *heap_top{heap_begin};
Expand Down
40 changes: 40 additions & 0 deletions examples/nucleo_h723zg/blink/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*
* 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);

while (true)
{
Leds::write(1 << (counter % (Leds::width+1) ));
modm::delay(Button::read() ? 100ms : 500ms);

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

return 0;
}
9 changes: 9 additions & 0 deletions examples/nucleo_h723zg/blink/project.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<library>
<extends>modm:nucleo-h723zg</extends>
<options>
<option name="modm:build:build.path">../../../build/nucleo_h723zg/blink</option>
</options>
<modules>
<module>modm:build:scons</module>
</modules>
</library>
50 changes: 50 additions & 0 deletions examples/nucleo_h743zi/blink/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/*
* 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>
#include <modm/processing.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;

for (const auto [traits, start, end, size] : modm::platform::HeapTable())
{
MODM_LOG_INFO.printf("Memory section %#x @[0x%p,0x%p](%u)\n",
traits.value, start, end, size);
}

uint32_t counter(0);
modm::ShortTimeout tmr;

while (true)
{
Leds::write(1 << (counter % (Leds::width+1) ));
// modm::delay(Button::read() ? 100ms : 500ms);
tmr.restart(Button::read() ? 100ms : 500ms);
while(not tmr.execute()) ;

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

return 0;
}
Loading