Skip to content

Commit

Permalink
[Core] Add support for STM32F429
Browse files Browse the repository at this point in the history
  • Loading branch information
drashna committed Jan 12, 2025
1 parent ebe621d commit 671002c
Show file tree
Hide file tree
Showing 13 changed files with 665 additions and 1 deletion.
1 change: 1 addition & 0 deletions data/schemas/keyboard.jsonschema
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
"STM32F405",
"STM32F407",
"STM32F411",
"STM32F429",
"STM32F446",
"STM32G431",
"STM32G474",
Expand Down
27 changes: 27 additions & 0 deletions keyboards/handwired/onekey/waveshare_f429/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/* Copyright 2021 QMK
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#pragma once


#define BACKLIGHT_PWM_DRIVER PWMD5
#define BACKLIGHT_PWM_CHANNEL 1

#define ADC_PIN A0

#define SOLENOID_PIN B12
#define SOLENOID_PINS { B12, B13, B14, B15 }
#define SOLENOID_PINS_ACTIVE_STATE { high, high, low }
25 changes: 25 additions & 0 deletions keyboards/handwired/onekey/waveshare_f429/halconf.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/* Copyright 2021 QMK
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#pragma once

#define HAL_USE_ADC TRUE

#define HAL_USE_I2C TRUE

#define HAL_USE_PWM TRUE

#include_next <halconf.h>
24 changes: 24 additions & 0 deletions keyboards/handwired/onekey/waveshare_f429/keyboard.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"keyboard_name": "Onekey WaveShare STM32F429",
"processor": "STM32F429",
"bootloader": "stm32-dfu",
"usb": {
"shared_endpoint": {
"keyboard": true
}
},
"matrix_pins": {
"cols": ["B0"],
"rows": ["A7"]
},
"backlight": {
"pin": "A0"
},
"ws2812": {
"pin": "A1"
},
"apa102": {
"data_pin": "A1",
"clock_pin": "A2"
}
}
28 changes: 28 additions & 0 deletions keyboards/handwired/onekey/waveshare_f429/mcuconf.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/* Copyright 2021 QMK
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

#pragma once

#include_next <mcuconf.h>

#undef STM32_ADC_USE_ADC1
#define STM32_ADC_USE_ADC1 TRUE

#undef STM32_I2C_USE_I2C1
#define STM32_I2C_USE_I2C1 TRUE

#undef STM32_PWM_USE_TIM5
#define STM32_PWM_USE_TIM5 TRUE
5 changes: 5 additions & 0 deletions keyboards/handwired/onekey/waveshare_f429/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# F411 Blackpill onekey

* Supported Hardware: STM32F411CEU6 WeAct v1.3

To trigger keypress, short together pins *B0* and *A7*.
3 changes: 2 additions & 1 deletion lib/python/qmk/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,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', 'STM32H723', 'STM32H733', 'STM32L412', 'STM32L422', 'STM32L432', 'STM32L433', 'STM32L442', 'STM32L443', 'GD32VF103', 'WB32F3G71', 'WB32FQ95', 'AT32F415'
CHIBIOS_PROCESSORS = 'cortex-m0', 'cortex-m0plus', 'cortex-m3', 'cortex-m4', 'MKL26Z64', 'MK20DX128', 'MK20DX256', 'MK64FX512', 'MK66FX1M0', 'RP2040', 'STM32F042', 'STM32F072', 'STM32F103', 'STM32F303', 'STM32F401', 'STM32F405', 'STM32F407', 'STM32F411', 'STM32F429', 'STM32F446', 'STM32G431', 'STM32G474', 'STM32H723', 'STM32H733', 'STM32L412', 'STM32L422', 'STM32L432', 'STM32L433', 'STM32L442', 'STM32L443', 'GD32VF103', 'WB32F3G71', 'WB32FQ95', 'AT32F415'
LUFA_PROCESSORS = 'at90usb162', 'atmega16u2', 'atmega32u2', 'atmega16u4', 'atmega32u4', 'at90usb646', 'at90usb647', 'at90usb1286', 'at90usb1287', None
VUSB_PROCESSORS = 'atmega32a', 'atmega328p', 'atmega328', 'attiny85'

Expand All @@ -41,6 +41,7 @@
"STM32F405": "stm32-dfu",
"STM32F407": "stm32-dfu",
"STM32F411": "stm32-dfu",
"STM32F429": "stm32-dfu",
"STM32F446": "stm32-dfu",
"STM32G431": "stm32-dfu",
"STM32G474": "stm32-dfu",
Expand Down
9 changes: 9 additions & 0 deletions platforms/chibios/boards/GENERIC_STM32_F429XI/board/board.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# List of all the board related files.
BOARDSRC = $(CHIBIOS)/os/hal/boards/ST_NUCLEO144_F429ZI/board.c

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

# Shared variables
ALLCSRC += $(BOARDSRC)
ALLINC += $(BOARDINC)
24 changes: 24 additions & 0 deletions platforms/chibios/boards/GENERIC_STM32_F429XI/configs/board.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/* Copyright 2020 Nick Brassel (tzarc)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#pragma once

#define STM32_HSECLK 8000000U
// The following is required to disable the pull-down on PA9, when PA9 is used for the keyboard matrix:
#define BOARD_OTG_NOVBUSSENS

#include_next <board.h>

#undef STM32_HSE_BYPASS
33 changes: 33 additions & 0 deletions platforms/chibios/boards/GENERIC_STM32_F429XI/configs/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/* Copyright 2021 Andrei Purdea
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

/* Address for jumping to bootloader on STM32 chips. */
/* It is chip dependent, the correct number can be looked up by checking against ST's application note AN2606.
*/

#ifndef EARLY_INIT_PERFORM_BOOTLOADER_JUMP
# define EARLY_INIT_PERFORM_BOOTLOADER_JUMP TRUE
#endif

#ifdef WEAR_LEVELING_EMBEDDED_FLASH
# ifndef WEAR_LEVELING_EFL_FIRST_SECTOR
# ifdef BOOTLOADER_TINYUF2
# define WEAR_LEVELING_EFL_FIRST_SECTOR 3
# else
# define WEAR_LEVELING_EFL_FIRST_SECTOR 1
# endif
# endif
#endif
Loading

0 comments on commit 671002c

Please sign in to comment.