Skip to content

Commit

Permalink
STM32H723 support (qmk#21352)
Browse files Browse the repository at this point in the history
  • Loading branch information
tzarc authored and csolje committed Oct 21, 2023
1 parent 56f3e7c commit 1899bfc
Show file tree
Hide file tree
Showing 13 changed files with 702 additions and 16 deletions.
2 changes: 2 additions & 0 deletions data/schemas/keyboard.jsonschema
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@
"STM32F446",
"STM32G431",
"STM32G474",
"STM32H723",
"STM32H733",
"STM32L412",
"STM32L422",
"STM32L432",
Expand Down
2 changes: 2 additions & 0 deletions docs/compatible_microcontrollers.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ You can also use any ARM chip with USB that [ChibiOS](https://www.chibios.org) s
* [STM32F446](https://www.st.com/en/microcontrollers-microprocessors/stm32f446.html)
* [STM32G431](https://www.st.com/en/microcontrollers-microprocessors/stm32g4x1.html)
* [STM32G474](https://www.st.com/en/microcontrollers-microprocessors/stm32g4x4.html)
* [STM32H723](https://www.st.com/en/microcontrollers-microprocessors/stm32h723-733.html)
* [STM32H733](https://www.st.com/en/microcontrollers-microprocessors/stm32h723-733.html)
* [STM32L412](https://www.st.com/en/microcontrollers-microprocessors/stm32l4x2.html)
* [STM32L422](https://www.st.com/en/microcontrollers-microprocessors/stm32l4x2.html)
* [STM32L432](https://www.st.com/en/microcontrollers-microprocessors/stm32l4x2.html)
Expand Down
19 changes: 19 additions & 0 deletions keyboards/handwired/onekey/nucleo_h723zg/info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"keyboard_name": "Onekey Nucleo H723ZG",
"processor": "STM32H723",
"bootloader": "stm32-dfu",
"matrix_pins": {
"cols": ["A9"],
"rows": ["A10"]
},
"backlight": {
"pin": "B8"
},
"ws2812": {
"pin": "A0"
},
"apa102": {
"data_pin": "A0",
"clock_pin": "B13"
}
}
5 changes: 5 additions & 0 deletions keyboards/handwired/onekey/nucleo_h723zg/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# ST Microelectronics Nucleo144-H723 onekey

Supported Hardware: <https://www.st.com/en/evaluation-tools/nucleo-h723zg.html>

To trigger keypress, short together pins *A9* and *A10*.
Empty file.
4 changes: 3 additions & 1 deletion lib/python/qmk/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
MAX_KEYBOARD_SUBFOLDERS = 5

# Supported processor types
CHIBIOS_PROCESSORS = 'cortex-m0', 'cortex-m0plus', 'cortex-m3', 'cortex-m4', 'MKL26Z64', 'MK20DX128', 'MK20DX256', 'MK64FX512', 'MK66FX1M0', 'RP2040', 'STM32F042', 'STM32F072', 'STM32F103', 'STM32F303', 'STM32F401', 'STM32F405', 'STM32F407', 'STM32F411', 'STM32F446', 'STM32G431', 'STM32G474', 'STM32L412', 'STM32L422', 'STM32L432', 'STM32L433', 'STM32L442', 'STM32L443', 'GD32VF103', 'WB32F3G71', 'WB32FQ95'
CHIBIOS_PROCESSORS = 'cortex-m0', 'cortex-m0plus', 'cortex-m3', 'cortex-m4', 'MKL26Z64', 'MK20DX128', 'MK20DX256', 'MK64FX512', 'MK66FX1M0', 'RP2040', 'STM32F042', 'STM32F072', 'STM32F103', 'STM32F303', 'STM32F401', 'STM32F405', 'STM32F407', 'STM32F411', 'STM32F446', 'STM32G431', 'STM32G474', 'STM32H723', 'STM32H733', 'STM32L412', 'STM32L422', 'STM32L432', 'STM32L433', 'STM32L442', 'STM32L443', 'GD32VF103', 'WB32F3G71', 'WB32FQ95'
LUFA_PROCESSORS = 'at90usb162', 'atmega16u2', 'atmega32u2', 'atmega16u4', 'atmega32u4', 'at90usb646', 'at90usb647', 'at90usb1286', 'at90usb1287', None
VUSB_PROCESSORS = 'atmega32a', 'atmega328p', 'atmega328', 'attiny85'

Expand All @@ -36,6 +36,8 @@
"STM32F446": "stm32-dfu",
"STM32G431": "stm32-dfu",
"STM32G474": "stm32-dfu",
"STM32H723": "stm32-dfu",
"STM32H733": "stm32-dfu",
"STM32L412": "stm32-dfu",
"STM32L422": "stm32-dfu",
"STM32L432": "stm32-dfu",
Expand Down
12 changes: 12 additions & 0 deletions platforms/chibios/boards/GENERIC_STM32_H723XG/board/board.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# List of all the board related files.
BOARDSRC = $(CHIBIOS)/os/hal/boards/ST_NUCLEO144_H723ZG/board.c

# Extra files
BOARDSRC += $(BOARD_PATH)/board/extra.c

# Required include directories
BOARDINC = $(CHIBIOS)/os/hal/boards/ST_NUCLEO144_H723ZG

# Shared variables
ALLCSRC += $(BOARDSRC)
ALLINC += $(BOARDINC)
36 changes: 36 additions & 0 deletions platforms/chibios/boards/GENERIC_STM32_H723XG/board/extra.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// Copyright 2023 Nick Brassel (@tzarc)
// SPDX-License-Identifier: GPL-2.0-or-later
#include <hal.h>
#define BOOTLOADER_MAGIC 0xDEADBEEF

////////////////////////////////////////////////////////////////////////////////
// Different signalling for bootloader entry
// - RAM is cleared on reset, so we can't use the usual __ram0_end__ symbol.
// - Use backup registers in the RTC peripheral to store the magic value instead.

static inline void enable_backup_register_access(void) {
PWR->CR1 |= PWR_CR1_DBP;
}

static inline void disable_backup_register_access(void) {
PWR->CR1 &= ~PWR_CR1_DBP;
}

void bootloader_marker_enable(void) {
enable_backup_register_access();
RTC->BKP0R = BOOTLOADER_MAGIC;
disable_backup_register_access();
}

bool bootloader_marker_active(void) {
enable_backup_register_access();
bool ret = RTC->BKP0R == BOOTLOADER_MAGIC;
disable_backup_register_access();
return ret;
}

void bootloader_marker_disable(void) {
enable_backup_register_access();
RTC->BKP0R = 0;
disable_backup_register_access();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// Copyright 2023 Nick Brassel (@tzarc)
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once

#define USB_DRIVER USBD2

#ifndef EARLY_INIT_PERFORM_BOOTLOADER_JUMP
# define EARLY_INIT_PERFORM_BOOTLOADER_JUMP TRUE
#endif
Loading

0 comments on commit 1899bfc

Please sign in to comment.