Skip to content

STM32: Add the OpenMV-H7 R1 board #2832

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

Merged
merged 1 commit into from
Apr 30, 2020
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
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ jobs:
- "nucleo_h743zi_2"
- "ohs2020_badge"
- "openbook_m4"
- "openmv_h7"
- "particle_argon"
- "particle_boron"
- "particle_xenon"
Expand Down
38 changes: 38 additions & 0 deletions ports/stm/boards/openmv_h7/board.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*
* This file is part of the MicroPython project, http://micropython.org/
*
* The MIT License (MIT)
*
* Copyright (c) 2017 Scott Shawcroft for Adafruit Industries
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/

#include "boards/board.h"

void board_init(void) {
}

bool board_requests_safe_mode(void) {
return false;
}

void reset_board(void) {

}
34 changes: 34 additions & 0 deletions ports/stm/boards/openmv_h7/mpconfigboard.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
* This file is part of the MicroPython project, http://micropython.org/
*
* The MIT License (MIT)
*
* Copyright (c) 2020 Lucian Copeland for Adafruit Industries
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/

//Micropython setup

#define MICROPY_HW_BOARD_NAME "OPENMV-H7 R1"
#define MICROPY_HW_MCU_NAME "STM32H743"

#define FLASH_PAGE_SIZE (0x4000)

#define BOARD_OSC_DIV (12)
15 changes: 15 additions & 0 deletions ports/stm/boards/openmv_h7/mpconfigboard.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
USB_VID = 0x239A
USB_PID = 0x8098
USB_PRODUCT = "OpenMV-H7 R1"
USB_MANUFACTURER = "OpenMV, LLC"
USB_DEVICES = "CDC,MSC"

INTERNAL_FLASH_FILESYSTEM = 1

MCU_SERIES = H7
MCU_VARIANT = STM32H743xx
MCU_PACKAGE = LQFP100_x7

LD_COMMON = boards/common_tcm.ld
LD_FILE = boards/STM32H743_fs.ld

26 changes: 26 additions & 0 deletions ports/stm/boards/openmv_h7/openmv.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
P0,PB15
P1,PB14
P2,PB13
P3,PB12
P4,PB10
P5,PB11
P6,PA05
P7,PD12
P8,PD13
P9,PD14
LED1,PC00
LED2,PC01
LED3,PC02
LED4,PE02
UART1_TX,PB14
UART1_RX,PB15
UART3_TX,PB10
UART3_RX,PB11
I2C2_SCL,PB10
I2C2_SDA,PB11
I2C4_SCL,PD12
I2C4_SDA,PD13
SPI2_NSS,PB12
SPI2_SCK,PB13
SPI2_MISO,PB14
SPI2_MOSI,PB15
35 changes: 35 additions & 0 deletions ports/stm/boards/openmv_h7/pins.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#include "shared-bindings/board/__init__.h"

STATIC const mp_rom_map_elem_t board_module_globals_table[] = {
{ MP_ROM_QSTR(MP_QSTR_P0), MP_ROM_PTR(&pin_PB15) },
{ MP_ROM_QSTR(MP_QSTR_P1), MP_ROM_PTR(&pin_PB14) },
{ MP_ROM_QSTR(MP_QSTR_P2), MP_ROM_PTR(&pin_PB13) },
{ MP_ROM_QSTR(MP_QSTR_P3), MP_ROM_PTR(&pin_PB12) },
{ MP_ROM_QSTR(MP_QSTR_P4), MP_ROM_PTR(&pin_PB10) },
{ MP_ROM_QSTR(MP_QSTR_P5), MP_ROM_PTR(&pin_PB11) },
{ MP_ROM_QSTR(MP_QSTR_P6), MP_ROM_PTR(&pin_PA05) },
{ MP_ROM_QSTR(MP_QSTR_P7), MP_ROM_PTR(&pin_PD12) },
{ MP_ROM_QSTR(MP_QSTR_P8), MP_ROM_PTR(&pin_PD13) },
{ MP_ROM_QSTR(MP_QSTR_P9), MP_ROM_PTR(&pin_PD14) },
{ MP_ROM_QSTR(MP_QSTR_LED1), MP_ROM_PTR(&pin_PC00) },
{ MP_ROM_QSTR(MP_QSTR_LED2), MP_ROM_PTR(&pin_PC01) },
{ MP_ROM_QSTR(MP_QSTR_LED3), MP_ROM_PTR(&pin_PC02) },
{ MP_ROM_QSTR(MP_QSTR_LED4), MP_ROM_PTR(&pin_PE02) },
{ MP_ROM_QSTR(MP_QSTR_LED_RED), MP_ROM_PTR(&pin_PC00) },
{ MP_ROM_QSTR(MP_QSTR_LED_GREEN), MP_ROM_PTR(&pin_PC01) },
{ MP_ROM_QSTR(MP_QSTR_LED_BLUE), MP_ROM_PTR(&pin_PC02) },
{ MP_ROM_QSTR(MP_QSTR_LED_IR), MP_ROM_PTR(&pin_PE02) },
{ MP_ROM_QSTR(MP_QSTR_UART1_TX), MP_ROM_PTR(&pin_PB14) },
{ MP_ROM_QSTR(MP_QSTR_UART1_RX), MP_ROM_PTR(&pin_PB15) },
{ MP_ROM_QSTR(MP_QSTR_UART3_TX), MP_ROM_PTR(&pin_PB10) },
{ MP_ROM_QSTR(MP_QSTR_UART3_RX), MP_ROM_PTR(&pin_PB11) },
{ MP_ROM_QSTR(MP_QSTR_I2C2_SCL), MP_ROM_PTR(&pin_PB10) },
{ MP_ROM_QSTR(MP_QSTR_I2C2_SDA), MP_ROM_PTR(&pin_PB11) },
{ MP_ROM_QSTR(MP_QSTR_I2C4_SCL), MP_ROM_PTR(&pin_PD12) },
{ MP_ROM_QSTR(MP_QSTR_I2C4_SDA), MP_ROM_PTR(&pin_PD13) },
{ MP_ROM_QSTR(MP_QSTR_SPI2_NSS), MP_ROM_PTR(&pin_PB12) },
{ MP_ROM_QSTR(MP_QSTR_SPI2_SCK), MP_ROM_PTR(&pin_PB13) },
{ MP_ROM_QSTR(MP_QSTR_SPI2_MISO), MP_ROM_PTR(&pin_PB14) },
{ MP_ROM_QSTR(MP_QSTR_SPI2_MOSI), MP_ROM_PTR(&pin_PB15) },
};
MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table);
Loading