Skip to content

Commit 7c4f307

Browse files
authored
Merge pull request #2832 from hierophect/stm32-openmv
STM32: Add the OpenMV-H7 R1 board
2 parents 2d7cf4b + 89ff558 commit 7c4f307

File tree

7 files changed

+642
-0
lines changed

7 files changed

+642
-0
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@ jobs:
206206
- "nucleo_h743zi_2"
207207
- "ohs2020_badge"
208208
- "openbook_m4"
209+
- "openmv_h7"
209210
- "particle_argon"
210211
- "particle_boron"
211212
- "particle_xenon"

ports/stm/boards/openmv_h7/board.c

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/*
2+
* This file is part of the MicroPython project, http://micropython.org/
3+
*
4+
* The MIT License (MIT)
5+
*
6+
* Copyright (c) 2017 Scott Shawcroft for Adafruit Industries
7+
*
8+
* Permission is hereby granted, free of charge, to any person obtaining a copy
9+
* of this software and associated documentation files (the "Software"), to deal
10+
* in the Software without restriction, including without limitation the rights
11+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12+
* copies of the Software, and to permit persons to whom the Software is
13+
* furnished to do so, subject to the following conditions:
14+
*
15+
* The above copyright notice and this permission notice shall be included in
16+
* all copies or substantial portions of the Software.
17+
*
18+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24+
* THE SOFTWARE.
25+
*/
26+
27+
#include "boards/board.h"
28+
29+
void board_init(void) {
30+
}
31+
32+
bool board_requests_safe_mode(void) {
33+
return false;
34+
}
35+
36+
void reset_board(void) {
37+
38+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/*
2+
* This file is part of the MicroPython project, http://micropython.org/
3+
*
4+
* The MIT License (MIT)
5+
*
6+
* Copyright (c) 2020 Lucian Copeland for Adafruit Industries
7+
*
8+
* Permission is hereby granted, free of charge, to any person obtaining a copy
9+
* of this software and associated documentation files (the "Software"), to deal
10+
* in the Software without restriction, including without limitation the rights
11+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12+
* copies of the Software, and to permit persons to whom the Software is
13+
* furnished to do so, subject to the following conditions:
14+
*
15+
* The above copyright notice and this permission notice shall be included in
16+
* all copies or substantial portions of the Software.
17+
*
18+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24+
* THE SOFTWARE.
25+
*/
26+
27+
//Micropython setup
28+
29+
#define MICROPY_HW_BOARD_NAME "OPENMV-H7 R1"
30+
#define MICROPY_HW_MCU_NAME "STM32H743"
31+
32+
#define FLASH_PAGE_SIZE (0x4000)
33+
34+
#define BOARD_OSC_DIV (12)
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
USB_VID = 0x239A
2+
USB_PID = 0x8098
3+
USB_PRODUCT = "OpenMV-H7 R1"
4+
USB_MANUFACTURER = "OpenMV, LLC"
5+
USB_DEVICES = "CDC,MSC"
6+
7+
INTERNAL_FLASH_FILESYSTEM = 1
8+
9+
MCU_SERIES = H7
10+
MCU_VARIANT = STM32H743xx
11+
MCU_PACKAGE = LQFP100_x7
12+
13+
LD_COMMON = boards/common_tcm.ld
14+
LD_FILE = boards/STM32H743_fs.ld
15+

ports/stm/boards/openmv_h7/openmv.csv

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
P0,PB15
2+
P1,PB14
3+
P2,PB13
4+
P3,PB12
5+
P4,PB10
6+
P5,PB11
7+
P6,PA05
8+
P7,PD12
9+
P8,PD13
10+
P9,PD14
11+
LED1,PC00
12+
LED2,PC01
13+
LED3,PC02
14+
LED4,PE02
15+
UART1_TX,PB14
16+
UART1_RX,PB15
17+
UART3_TX,PB10
18+
UART3_RX,PB11
19+
I2C2_SCL,PB10
20+
I2C2_SDA,PB11
21+
I2C4_SCL,PD12
22+
I2C4_SDA,PD13
23+
SPI2_NSS,PB12
24+
SPI2_SCK,PB13
25+
SPI2_MISO,PB14
26+
SPI2_MOSI,PB15

ports/stm/boards/openmv_h7/pins.c

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#include "shared-bindings/board/__init__.h"
2+
3+
STATIC const mp_rom_map_elem_t board_module_globals_table[] = {
4+
{ MP_ROM_QSTR(MP_QSTR_P0), MP_ROM_PTR(&pin_PB15) },
5+
{ MP_ROM_QSTR(MP_QSTR_P1), MP_ROM_PTR(&pin_PB14) },
6+
{ MP_ROM_QSTR(MP_QSTR_P2), MP_ROM_PTR(&pin_PB13) },
7+
{ MP_ROM_QSTR(MP_QSTR_P3), MP_ROM_PTR(&pin_PB12) },
8+
{ MP_ROM_QSTR(MP_QSTR_P4), MP_ROM_PTR(&pin_PB10) },
9+
{ MP_ROM_QSTR(MP_QSTR_P5), MP_ROM_PTR(&pin_PB11) },
10+
{ MP_ROM_QSTR(MP_QSTR_P6), MP_ROM_PTR(&pin_PA05) },
11+
{ MP_ROM_QSTR(MP_QSTR_P7), MP_ROM_PTR(&pin_PD12) },
12+
{ MP_ROM_QSTR(MP_QSTR_P8), MP_ROM_PTR(&pin_PD13) },
13+
{ MP_ROM_QSTR(MP_QSTR_P9), MP_ROM_PTR(&pin_PD14) },
14+
{ MP_ROM_QSTR(MP_QSTR_LED1), MP_ROM_PTR(&pin_PC00) },
15+
{ MP_ROM_QSTR(MP_QSTR_LED2), MP_ROM_PTR(&pin_PC01) },
16+
{ MP_ROM_QSTR(MP_QSTR_LED3), MP_ROM_PTR(&pin_PC02) },
17+
{ MP_ROM_QSTR(MP_QSTR_LED4), MP_ROM_PTR(&pin_PE02) },
18+
{ MP_ROM_QSTR(MP_QSTR_LED_RED), MP_ROM_PTR(&pin_PC00) },
19+
{ MP_ROM_QSTR(MP_QSTR_LED_GREEN), MP_ROM_PTR(&pin_PC01) },
20+
{ MP_ROM_QSTR(MP_QSTR_LED_BLUE), MP_ROM_PTR(&pin_PC02) },
21+
{ MP_ROM_QSTR(MP_QSTR_LED_IR), MP_ROM_PTR(&pin_PE02) },
22+
{ MP_ROM_QSTR(MP_QSTR_UART1_TX), MP_ROM_PTR(&pin_PB14) },
23+
{ MP_ROM_QSTR(MP_QSTR_UART1_RX), MP_ROM_PTR(&pin_PB15) },
24+
{ MP_ROM_QSTR(MP_QSTR_UART3_TX), MP_ROM_PTR(&pin_PB10) },
25+
{ MP_ROM_QSTR(MP_QSTR_UART3_RX), MP_ROM_PTR(&pin_PB11) },
26+
{ MP_ROM_QSTR(MP_QSTR_I2C2_SCL), MP_ROM_PTR(&pin_PB10) },
27+
{ MP_ROM_QSTR(MP_QSTR_I2C2_SDA), MP_ROM_PTR(&pin_PB11) },
28+
{ MP_ROM_QSTR(MP_QSTR_I2C4_SCL), MP_ROM_PTR(&pin_PD12) },
29+
{ MP_ROM_QSTR(MP_QSTR_I2C4_SDA), MP_ROM_PTR(&pin_PD13) },
30+
{ MP_ROM_QSTR(MP_QSTR_SPI2_NSS), MP_ROM_PTR(&pin_PB12) },
31+
{ MP_ROM_QSTR(MP_QSTR_SPI2_SCK), MP_ROM_PTR(&pin_PB13) },
32+
{ MP_ROM_QSTR(MP_QSTR_SPI2_MISO), MP_ROM_PTR(&pin_PB14) },
33+
{ MP_ROM_QSTR(MP_QSTR_SPI2_MOSI), MP_ROM_PTR(&pin_PB15) },
34+
};
35+
MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table);

0 commit comments

Comments
 (0)