From c76b0d86a046ae9c07c15811007e596d0f42b065 Mon Sep 17 00:00:00 2001 From: MarcEspuna Date: Thu, 27 Mar 2025 23:54:17 +0100 Subject: [PATCH 01/16] Added KonexH743 target --- configs/KONEXH743/config.h | 157 +++++++++++++++++++++++++++++++++++++ 1 file changed, 157 insertions(+) create mode 100644 configs/KONEXH743/config.h diff --git a/configs/KONEXH743/config.h b/configs/KONEXH743/config.h new file mode 100644 index 000000000..002544527 --- /dev/null +++ b/configs/KONEXH743/config.h @@ -0,0 +1,157 @@ +/* + * This file is part of Betaflight. + * + * Betaflight is free software. You can redistribute this software + * and/or modify this software 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. + * + * Betaflight 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 software. + * + * If not, see . + */ + +#pragma once + +#define FC_TARGET_MCU STM32H743 + +#define BOARD_NAME KONEXH743 +#define MANUFACTURER_ID KONX + +#define USE_GYRO +#define USE_GYRO_CLKIN +#define USE_ACC +#define USE_GYRO_SPI_ICM42688P +#define USE_ACC_SPI_ICM42688P + +#define USE_FLASH +#define USE_FLASH_W25N01G + +#define USE_BARO +#define USE_BARO_BMP388 + +#define LED0_PIN PC13 +#define LED1_PIN PC10 + +#define LED_STRIP_PIN PC9 + +#define BEEPER_PIN PE10 +#define BEEPER_INVERTED + +#define UART3_TX_PIN PD8 +#define UART3_RX_PIN PD9 + +#define UART4_TX_PIN PA0 +#define UART4_RX_PIN PA1 + +#define UART5_RX_PIN PD2 + +#define UART6_TX_PIN PC6 +#define UART6_RX_PIN PC7 + +#define UART7_RX_PIN PA8 + +#define UART8_TX_PIN PE1 +#define UART8_RX_PIN PE0 + +#define I2C2_SCL_PIN PB10 +#define I2C2_SDA_PIN PB11 + +#define SPI1_SCK_PIN PA5 +#define SPI1_SDI_PIN PA6 +#define SPI1_SDO_PIN PA7 +#define GYRO_1_CS_PIN PB1 +#define GYRO_1_EXTI_PIN PB0 + +#define SPI2_SCK_PIN PB13 +#define SPI2_SDI_PIN PB14 +#define SPI2_SDO_PIN PB15 +#define GYRO_2_CS_PIN PB12 +#define GYRO_2_EXTI_PIN PE13 + +#define SPI4_SCK_PIN PE2 +#define SPI4_SDI_PIN PE5 +#define SPI4_SDO_PIN PE6 +#define FLASH_CS_PIN PE4 + +#define ADC_VBAT_PIN PC0 +#define ADC_CURR_PIN PC3 + +#define MOTOR1_PIN PB9 +#define MOTOR2_PIN PB8 +#define MOTOR3_PIN PB7 +#define MOTOR4_PIN PB6 +#define MOTOR5_PIN PB4 +#define MOTOR6_PIN PB5 +#define MOTOR7_PIN PB3 +#define MOTOR8_PIN PA15 + +#define VTX_ENABLE_PIN PE3 +#define PINIO1_PIN VTX_ENABLE_PIN +#define PINIO1_BOX 40 + +#define GYRO_1_CLKIN_PIN PA3 +#define GYRO_2_CLKIN_PIN PA3 + +// Index, Pin, 1-based occurrence of pin in fullTimerHardware, dma opt (use -1 for no DMA) +// See timerio.c and timer_stm32h7xx.c + +// MOTOR1 PB9 TIM4 CH4 +// MOTOR2 PB8 TIM4 CH3 +// MOTOR3 PB7 TIM4 CH2 +// MOTOR4 PB6 TIM4 CH1 +// MOTOR5 PB4 TIM3 CH1 +// MOTOR6 PB5 TIM3 CH2 +// MOTOR7 PB3 TIM2 CH2 +// MOTOR8 PA15 TIM2 CH1 + +// LED PC9 TIM8 CH4 + +// CLKIN PA3 TIM15_CH2 + +#define TIMER_PIN_MAPPING \ + TIMER_PIN_MAP( 0, PB9, 2, 1 ) \ + TIMER_PIN_MAP( 1, PB8, 2, 2 ) \ + TIMER_PIN_MAP( 2, PB7, 2, 3 ) \ + TIMER_PIN_MAP( 3, PB6, 2, 4 ) \ + TIMER_PIN_MAP( 4, PB4, 1, 5 ) \ + TIMER_PIN_MAP( 5, PB5, 1, 6 ) \ + TIMER_PIN_MAP( 6, PB3, 1, 7 ) \ + TIMER_PIN_MAP( 7, PA15, 1, 8 ) \ + TIMER_PIN_MAP( 8, PC9, 2, 0 ) \ + TIMER_PIN_MAP( 9, PA3, 3, -1 ) + +#define USE_ADC +#define ADC1_DMA_OPT 8 +#define ADC2_DMA_OPT 9 +#define ADC3_DMA_OPT 10 + +#define SERIALRX_UART SERIAL_PORT_UART4 + +#define BARO_I2C_INSTANCE (I2CDEV_2) +#define DEFAULT_BLACKBOX_DEVICE BLACKBOX_DEVICE_FLASH + +#define DEFAULT_CURRENT_METER_SOURCE CURRENT_METER_ADC +#define DEFAULT_VOLTAGE_METER_SOURCE VOLTAGE_METER_ADC +#define DEFAULT_CURRENT_METER_SCALE 100 +#define DEFAULT_VOLTAGE_METER_SCALE 155 + +#define FLASH_SPI_INSTANCE SPI4 +#define SPI4_TX_DMA_OPT 13 + +#define USE_SPI_GYRO +#define GYRO_1_SPI_INSTANCE SPI1 +#define GYRO_2_SPI_INSTANCE SPI2 + +#define DEFAULT_GYRO_TO_USE GYRO_CONFIG_USE_GYRO_1 + +#define GYRO_1_ALIGN CW90_DEG +#define GYRO_2_ALIGN CW0_DEG \ No newline at end of file From 0e727d5b5b2276b9c5d923f374ffe04f7addd381 Mon Sep 17 00:00:00 2001 From: MarcEspuna <76654758+MarcEspuna@users.noreply.github.com> Date: Fri, 28 Mar 2025 00:34:41 +0100 Subject: [PATCH 02/16] Update configs/KONEXH743/config.h Co-authored-by: Mark Haslinghuis --- configs/KONEXH743/config.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configs/KONEXH743/config.h b/configs/KONEXH743/config.h index 002544527..6d42ea649 100644 --- a/configs/KONEXH743/config.h +++ b/configs/KONEXH743/config.h @@ -125,7 +125,7 @@ TIMER_PIN_MAP( 4, PB4, 1, 5 ) \ TIMER_PIN_MAP( 5, PB5, 1, 6 ) \ TIMER_PIN_MAP( 6, PB3, 1, 7 ) \ - TIMER_PIN_MAP( 7, PA15, 1, 8 ) \ + TIMER_PIN_MAP( 7, PA15, 1, 11 ) \ TIMER_PIN_MAP( 8, PC9, 2, 0 ) \ TIMER_PIN_MAP( 9, PA3, 3, -1 ) From b1b4f23e95d44dbda2b3685de1c1bb36ee5d3d6e Mon Sep 17 00:00:00 2001 From: MarcEspuna <76654758+MarcEspuna@users.noreply.github.com> Date: Fri, 28 Mar 2025 00:34:49 +0100 Subject: [PATCH 03/16] Update configs/KONEXH743/config.h Co-authored-by: Mark Haslinghuis --- configs/KONEXH743/config.h | 1 - 1 file changed, 1 deletion(-) diff --git a/configs/KONEXH743/config.h b/configs/KONEXH743/config.h index 6d42ea649..3b6ab8e1d 100644 --- a/configs/KONEXH743/config.h +++ b/configs/KONEXH743/config.h @@ -129,7 +129,6 @@ TIMER_PIN_MAP( 8, PC9, 2, 0 ) \ TIMER_PIN_MAP( 9, PA3, 3, -1 ) -#define USE_ADC #define ADC1_DMA_OPT 8 #define ADC2_DMA_OPT 9 #define ADC3_DMA_OPT 10 From 3c9779b3d63b9b531dfd3f70ac35cea2742d0a53 Mon Sep 17 00:00:00 2001 From: MarcEspuna <76654758+MarcEspuna@users.noreply.github.com> Date: Fri, 28 Mar 2025 00:34:58 +0100 Subject: [PATCH 04/16] Update configs/KONEXH743/config.h Co-authored-by: Mark Haslinghuis --- configs/KONEXH743/config.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configs/KONEXH743/config.h b/configs/KONEXH743/config.h index 3b6ab8e1d..88ecf9fc1 100644 --- a/configs/KONEXH743/config.h +++ b/configs/KONEXH743/config.h @@ -135,7 +135,7 @@ #define SERIALRX_UART SERIAL_PORT_UART4 -#define BARO_I2C_INSTANCE (I2CDEV_2) +#define BARO_I2C_INSTANCE I2CDEV_2 #define DEFAULT_BLACKBOX_DEVICE BLACKBOX_DEVICE_FLASH #define DEFAULT_CURRENT_METER_SOURCE CURRENT_METER_ADC From b12c11baaa3d8514d82ac9e7406fbe8299c29dc7 Mon Sep 17 00:00:00 2001 From: MarcEspuna Date: Fri, 28 Mar 2025 00:59:46 +0100 Subject: [PATCH 05/16] Removed unnecessary default voltage/current meter values --- configs/KONEXH743/config.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/configs/KONEXH743/config.h b/configs/KONEXH743/config.h index 002544527..d2ec228e0 100644 --- a/configs/KONEXH743/config.h +++ b/configs/KONEXH743/config.h @@ -141,8 +141,6 @@ #define DEFAULT_CURRENT_METER_SOURCE CURRENT_METER_ADC #define DEFAULT_VOLTAGE_METER_SOURCE VOLTAGE_METER_ADC -#define DEFAULT_CURRENT_METER_SCALE 100 -#define DEFAULT_VOLTAGE_METER_SCALE 155 #define FLASH_SPI_INSTANCE SPI4 #define SPI4_TX_DMA_OPT 13 From 45b0e8c3f3db900344815a0985735384135d2905 Mon Sep 17 00:00:00 2001 From: MarcEspuna Date: Fri, 28 Mar 2025 01:01:00 +0100 Subject: [PATCH 06/16] Removed unnecessary DMA SPI OPT --- configs/KONEXH743/config.h | 1 - 1 file changed, 1 deletion(-) diff --git a/configs/KONEXH743/config.h b/configs/KONEXH743/config.h index d2ec228e0..8d73b610a 100644 --- a/configs/KONEXH743/config.h +++ b/configs/KONEXH743/config.h @@ -143,7 +143,6 @@ #define DEFAULT_VOLTAGE_METER_SOURCE VOLTAGE_METER_ADC #define FLASH_SPI_INSTANCE SPI4 -#define SPI4_TX_DMA_OPT 13 #define USE_SPI_GYRO #define GYRO_1_SPI_INSTANCE SPI1 From 1bfeca4be4a9f8799e30d35a2f97877ae166ef1e Mon Sep 17 00:00:00 2001 From: MarcEspuna <76654758+MarcEspuna@users.noreply.github.com> Date: Fri, 28 Mar 2025 19:38:20 +0100 Subject: [PATCH 07/16] Update configs/KONEXH743/config.h Co-authored-by: Mark Haslinghuis --- configs/KONEXH743/config.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configs/KONEXH743/config.h b/configs/KONEXH743/config.h index bb34e49c8..8732e7339 100644 --- a/configs/KONEXH743/config.h +++ b/configs/KONEXH743/config.h @@ -150,4 +150,4 @@ #define DEFAULT_GYRO_TO_USE GYRO_CONFIG_USE_GYRO_1 #define GYRO_1_ALIGN CW90_DEG -#define GYRO_2_ALIGN CW0_DEG \ No newline at end of file +#define GYRO_2_ALIGN CW0_DEG From b5b18e58fb07c28b14ee4dbe70671b19f5ce2141 Mon Sep 17 00:00:00 2001 From: MarcEspuna <76654758+MarcEspuna@users.noreply.github.com> Date: Fri, 28 Mar 2025 19:50:56 +0100 Subject: [PATCH 08/16] Update configs/KONEXH743/config.h Co-authored-by: Mark Haslinghuis --- configs/KONEXH743/config.h | 1 + 1 file changed, 1 insertion(+) diff --git a/configs/KONEXH743/config.h b/configs/KONEXH743/config.h index 8732e7339..354df65b4 100644 --- a/configs/KONEXH743/config.h +++ b/configs/KONEXH743/config.h @@ -97,6 +97,7 @@ #define VTX_ENABLE_PIN PE3 #define PINIO1_PIN VTX_ENABLE_PIN #define PINIO1_BOX 40 +#define PINIO1_CONFIG 129 #define GYRO_1_CLKIN_PIN PA3 #define GYRO_2_CLKIN_PIN PA3 From 79c992266a4dc0a1f198c5e4f9fe8c0962121357 Mon Sep 17 00:00:00 2001 From: MarcEspuna <76654758+MarcEspuna@users.noreply.github.com> Date: Fri, 28 Mar 2025 20:40:51 +0100 Subject: [PATCH 09/16] Update configs/KONEXH743/config.h Co-authored-by: Mark Haslinghuis --- configs/KONEXH743/config.h | 1 - 1 file changed, 1 deletion(-) diff --git a/configs/KONEXH743/config.h b/configs/KONEXH743/config.h index 354df65b4..ab73fc079 100644 --- a/configs/KONEXH743/config.h +++ b/configs/KONEXH743/config.h @@ -100,7 +100,6 @@ #define PINIO1_CONFIG 129 #define GYRO_1_CLKIN_PIN PA3 -#define GYRO_2_CLKIN_PIN PA3 // Index, Pin, 1-based occurrence of pin in fullTimerHardware, dma opt (use -1 for no DMA) // See timerio.c and timer_stm32h7xx.c From 5e68d8953cc67c1f811ac5412e29ca4139021d06 Mon Sep 17 00:00:00 2001 From: MarcEspuna <76654758+MarcEspuna@users.noreply.github.com> Date: Fri, 28 Mar 2025 20:41:02 +0100 Subject: [PATCH 10/16] Update configs/KONEXH743/config.h Co-authored-by: Mark Haslinghuis --- configs/KONEXH743/config.h | 1 - 1 file changed, 1 deletion(-) diff --git a/configs/KONEXH743/config.h b/configs/KONEXH743/config.h index ab73fc079..e864acfc7 100644 --- a/configs/KONEXH743/config.h +++ b/configs/KONEXH743/config.h @@ -147,7 +147,6 @@ #define GYRO_1_SPI_INSTANCE SPI1 #define GYRO_2_SPI_INSTANCE SPI2 -#define DEFAULT_GYRO_TO_USE GYRO_CONFIG_USE_GYRO_1 #define GYRO_1_ALIGN CW90_DEG #define GYRO_2_ALIGN CW0_DEG From 9da763925b3e6d91afba4dd8f68425a5bacb5de7 Mon Sep 17 00:00:00 2001 From: MarcEspuna <76654758+MarcEspuna@users.noreply.github.com> Date: Wed, 2 Apr 2025 19:33:42 +0200 Subject: [PATCH 11/16] Update configs/KONEXH743/config.h Co-authored-by: ot0tot <36753790+ot0tot@users.noreply.github.com> --- configs/KONEXH743/config.h | 1 + 1 file changed, 1 insertion(+) diff --git a/configs/KONEXH743/config.h b/configs/KONEXH743/config.h index e864acfc7..3991f5c94 100644 --- a/configs/KONEXH743/config.h +++ b/configs/KONEXH743/config.h @@ -136,6 +136,7 @@ #define SERIALRX_UART SERIAL_PORT_UART4 #define BARO_I2C_INSTANCE I2CDEV_2 +#define MAG_I2C_INSTANCE I2CDEV_4 #define DEFAULT_BLACKBOX_DEVICE BLACKBOX_DEVICE_FLASH #define DEFAULT_CURRENT_METER_SOURCE CURRENT_METER_ADC From 7c4189d1b7be79af1bf2053bfab91b14f90492bf Mon Sep 17 00:00:00 2001 From: MarcEspuna <76654758+MarcEspuna@users.noreply.github.com> Date: Wed, 2 Apr 2025 19:33:53 +0200 Subject: [PATCH 12/16] Update configs/KONEXH743/config.h Co-authored-by: ot0tot <36753790+ot0tot@users.noreply.github.com> --- configs/KONEXH743/config.h | 1 - 1 file changed, 1 deletion(-) diff --git a/configs/KONEXH743/config.h b/configs/KONEXH743/config.h index 3991f5c94..6af198809 100644 --- a/configs/KONEXH743/config.h +++ b/configs/KONEXH743/config.h @@ -144,7 +144,6 @@ #define FLASH_SPI_INSTANCE SPI4 -#define USE_SPI_GYRO #define GYRO_1_SPI_INSTANCE SPI1 #define GYRO_2_SPI_INSTANCE SPI2 From 92605345a3279da650b0477bb98472ad34675ec1 Mon Sep 17 00:00:00 2001 From: MarcEspuna <76654758+MarcEspuna@users.noreply.github.com> Date: Wed, 2 Apr 2025 19:34:09 +0200 Subject: [PATCH 13/16] Update configs/KONEXH743/config.h Co-authored-by: ot0tot <36753790+ot0tot@users.noreply.github.com> --- configs/KONEXH743/config.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/configs/KONEXH743/config.h b/configs/KONEXH743/config.h index 6af198809..cf8d89fca 100644 --- a/configs/KONEXH743/config.h +++ b/configs/KONEXH743/config.h @@ -64,6 +64,8 @@ #define I2C2_SCL_PIN PB10 #define I2C2_SDA_PIN PB11 +#define I2C4_SCL_PIN PD12 +#define I2C4_SDA_PIN PD13 #define SPI1_SCK_PIN PA5 #define SPI1_SDI_PIN PA6 From 46e68a52e41af7d1ff722be0ade266b0ce0eda9f Mon Sep 17 00:00:00 2001 From: MarcEspuna <76654758+MarcEspuna@users.noreply.github.com> Date: Wed, 2 Apr 2025 19:35:42 +0200 Subject: [PATCH 14/16] Update configs/KONEXH743/config.h Co-authored-by: ot0tot <36753790+ot0tot@users.noreply.github.com> --- configs/KONEXH743/config.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configs/KONEXH743/config.h b/configs/KONEXH743/config.h index cf8d89fca..67d296b67 100644 --- a/configs/KONEXH743/config.h +++ b/configs/KONEXH743/config.h @@ -85,7 +85,7 @@ #define FLASH_CS_PIN PE4 #define ADC_VBAT_PIN PC0 -#define ADC_CURR_PIN PC3 +#define ADC_CURR_PIN PC5 #define MOTOR1_PIN PB9 #define MOTOR2_PIN PB8 From 51b62972b5b0b6f8a90438bfbabaa558d7e61dc9 Mon Sep 17 00:00:00 2001 From: MarcEspuna <76654758+MarcEspuna@users.noreply.github.com> Date: Wed, 2 Apr 2025 19:35:55 +0200 Subject: [PATCH 15/16] Update configs/KONEXH743/config.h Co-authored-by: ot0tot <36753790+ot0tot@users.noreply.github.com> --- configs/KONEXH743/config.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/configs/KONEXH743/config.h b/configs/KONEXH743/config.h index 67d296b67..31f2056f8 100644 --- a/configs/KONEXH743/config.h +++ b/configs/KONEXH743/config.h @@ -120,16 +120,16 @@ // CLKIN PA3 TIM15_CH2 #define TIMER_PIN_MAPPING \ - TIMER_PIN_MAP( 0, PB9, 2, 1 ) \ - TIMER_PIN_MAP( 1, PB8, 2, 2 ) \ - TIMER_PIN_MAP( 2, PB7, 2, 3 ) \ - TIMER_PIN_MAP( 3, PB6, 2, 4 ) \ - TIMER_PIN_MAP( 4, PB4, 1, 5 ) \ - TIMER_PIN_MAP( 5, PB5, 1, 6 ) \ - TIMER_PIN_MAP( 6, PB3, 1, 7 ) \ - TIMER_PIN_MAP( 7, PA15, 1, 11 ) \ - TIMER_PIN_MAP( 8, PC9, 2, 0 ) \ - TIMER_PIN_MAP( 9, PA3, 3, -1 ) + TIMER_PIN_MAP( 0, PB9 , 2, 1 ) \ + TIMER_PIN_MAP( 1, PB8 , 2, 2 ) \ + TIMER_PIN_MAP( 2, PB7 , 2, 3 ) \ + TIMER_PIN_MAP( 3, PB6 , 2, 4 ) \ + TIMER_PIN_MAP( 4, PB4 , 1, 5 ) \ + TIMER_PIN_MAP( 5, PB5 , 1, 6 ) \ + TIMER_PIN_MAP( 6, PB3 , 1, 7 ) \ + TIMER_PIN_MAP( 7, PA15, 1, 11 ) \ + TIMER_PIN_MAP( 8, PC9 , 2, 0 ) \ + TIMER_PIN_MAP( 9, PA3 , 3, -1 ) #define ADC1_DMA_OPT 8 #define ADC2_DMA_OPT 9 From 61f13b93201a4e81ab264f8cfd84091a9fef8683 Mon Sep 17 00:00:00 2001 From: MarcEspuna <76654758+MarcEspuna@users.noreply.github.com> Date: Wed, 2 Apr 2025 20:20:02 +0200 Subject: [PATCH 16/16] Update configs/KONEXH743/config.h Co-authored-by: Mark Haslinghuis --- configs/KONEXH743/config.h | 1 + 1 file changed, 1 insertion(+) diff --git a/configs/KONEXH743/config.h b/configs/KONEXH743/config.h index 31f2056f8..b70080bbe 100644 --- a/configs/KONEXH743/config.h +++ b/configs/KONEXH743/config.h @@ -86,6 +86,7 @@ #define ADC_VBAT_PIN PC0 #define ADC_CURR_PIN PC5 +#define ADC_EXTERNAL1_PIN PC1 #define MOTOR1_PIN PB9 #define MOTOR2_PIN PB8