From fd85c5aef31a4bd128177878a28ac58e985c7bbc Mon Sep 17 00:00:00 2001 From: swagprincess Date: Sun, 24 Nov 2024 18:39:21 +0100 Subject: [PATCH 1/7] Fix SEQUREH7V2 --- configs/SEQUREH7V2/config.h | 99 ++++++++++++++++++++++++------------- 1 file changed, 64 insertions(+), 35 deletions(-) diff --git a/configs/SEQUREH7V2/config.h b/configs/SEQUREH7V2/config.h index f3218df7..651de90a 100644 --- a/configs/SEQUREH7V2/config.h +++ b/configs/SEQUREH7V2/config.h @@ -22,28 +22,30 @@ #pragma once + #define FC_TARGET_MCU STM32H743 #define BOARD_NAME SEQUREH7V2 #define MANUFACTURER_ID SQRE #define USE_ACC -#define USE_ACC_SPI_MPU6000 -#define USE_GYRO_SPI_ICM42688P -#define USE_GYRO -#define USE_GYRO_SPI_MPU6000 #define USE_ACC_SPI_ICM42688P + +#define USE_GYRO +#define USE_GYRO_SPI_ICM42688P + #define USE_BARO #define USE_BARO_BMP280 + #define USE_FLASH #define USE_FLASH_W25Q128FV + #define USE_MAX7456 -#ifndef USE_CAMERA_CONTROL #define USE_CAMERA_CONTROL -#endif #define BEEPER_PIN PD15 + #define MOTOR1_PIN PB4 #define MOTOR2_PIN PB5 #define MOTOR3_PIN PB0 @@ -52,57 +54,77 @@ #define MOTOR6_PIN PB7 #define MOTOR7_PIN PB10 #define MOTOR8_PIN PB11 + #define LED_STRIP_PIN PA8 + #define UART1_TX_PIN PA9 -#define UART2_TX_PIN PA2 -#define UART4_TX_PIN PA0 -#define UART6_TX_PIN PC6 -#define UART7_TX_PIN PE8 #define UART1_RX_PIN PA10 + +#define UART2_TX_PIN PA2 #define UART2_RX_PIN PA3 + +#define UART4_TX_PIN PA0 #define UART4_RX_PIN PA1 + +#define UART6_TX_PIN PC6 #define UART6_RX_PIN PC7 + +#define UART7_TX_PIN PE8 #define UART7_RX_PIN PE7 + #define UART8_RX_PIN PE0 + #define I2C1_SCL_PIN PB8 #define I2C1_SDA_PIN PB9 + #define LED0_PIN PC13 + #define SPI1_SCK_PIN PA5 -#define SPI2_SCK_PIN PB13 -#define SPI3_SCK_PIN PC10 #define SPI1_SDI_PIN PA6 -#define SPI2_SDI_PIN PB14 -#define SPI3_SDI_PIN PC11 #define SPI1_SDO_PIN PA7 + +#define SPI2_SCK_PIN PB13 +#define SPI2_SDI_PIN PB14 #define SPI2_SDO_PIN PB15 + +#define SPI3_SCK_PIN PC10 +#define SPI3_SDI_PIN PC11 #define SPI3_SDO_PIN PC12 + #define ADC_VBAT_PIN PC3 #define ADC_CURR_PIN PC2 + #define CAMERA_CONTROL_PIN PB3 + #define FLASH_CS_PIN PA15 + #define MAX7456_SPI_CS_PIN PA4 + #define GYRO_1_EXTI_PIN PD0 #define GYRO_1_CS_PIN PB12 #define TIMER_PIN_MAPPING \ - TIMER_PIN_MAP( 1, PB5, 1, -1) \ - TIMER_PIN_MAP( 2, PB0, 2, -1) \ - TIMER_PIN_MAP( 3, PB1, 2, -1) \ - TIMER_PIN_MAP( 4, PB6, 2, -1) \ - TIMER_PIN_MAP( 5, PB7, 2, -1) \ - TIMER_PIN_MAP( 6, PB10, 1, -1) \ - TIMER_PIN_MAP( 7, PB11, 1, -1) \ - TIMER_PIN_MAP( 8, PA8, 1, 4) \ - TIMER_PIN_MAP( 9, PB3, 1, -1) \ - TIMER_PIN_MAP(10, PB8, 2, -1) \ - TIMER_PIN_MAP(11, PB9, 2, -1) - -#define ADC1_DMA_OPT 8 -#define ADC3_DMA_OPT 9 -#define TIMUP1_DMA_OPT 0 -#define TIMUP3_DMA_OPT 2 -#define TIMUP5_DMA_OPT 0 -#define TIMUP8_DMA_OPT 2 + TIMER_PIN_MAP(1, PB4, 1, 0) \ + TIMER_PIN_MAP(2, PB5, 1, 0) \ + TIMER_PIN_MAP(3, PB0, 2, 0) \ + TIMER_PIN_MAP(4, PB1, 2, 0) \ + TIMER_PIN_MAP(5, PB6, 2, 0) \ + TIMER_PIN_MAP(6, PB7, 2, 0) \ + TIMER_PIN_MAP(7, PB10, 1, 0) \ + TIMER_PIN_MAP(8, PB11, 1, 0) \ + TIMER_PIN_MAP(9, PA8, 1, 0) \ + TIMER_PIN_MAP(10, PB3, 1, 0) + +#define ADC1_DMA_OPT 0 +#define ADC3_DMA_OPT 0 + +#define TIMUP1_DMA_OPT 0 +#define TIMUP2_DMA_OPT 0 +#define TIMUP3_DMA_OPT 0 +#define TIMUP4_DMA_OPT 0 +#define TIMUP8_DMA_OPT 0 + +#define DEFAULT_DSHOT_BURST DSHOT_DMAR_ON #define SERIALRX_UART SERIAL_PORT_USART1 #define GPS_UART SERIAL_PORT_USART6 @@ -111,15 +133,22 @@ #define MAG_I2C_INSTANCE (I2CDEV_1) #define BARO_I2C_INSTANCE (I2CDEV_1) + #define ADC_INSTANCE ADC1 + #define DEFAULT_BLACKBOX_DEVICE BLACKBOX_DEVICE_FLASH -#define DEFAULT_DSHOT_BURST DSHOT_DMAR_OFF + #define DEFAULT_CURRENT_METER_SOURCE CURRENT_METER_ADC +#define DEFAULT_CURRENT_METER_SCALE 1052 + #define DEFAULT_VOLTAGE_METER_SOURCE VOLTAGE_METER_ADC #define DEFAULT_VOLTAGE_METER_SCALE 110 -#define DEFAULT_CURRENT_METER_SCALE 1052 + #define BEEPER_INVERTED + #define MAX7456_SPI_INSTANCE SPI1 + #define GYRO_1_SPI_INSTANCE SPI2 -#define FLASH_SPI_INSTANCE SPI3 #define GYRO_1_ALIGN CW90_DEG + +#define FLASH_SPI_INSTANCE SPI3 \ No newline at end of file From 1520970857ee5261e08a16984a24fe1fdf7105c9 Mon Sep 17 00:00:00 2001 From: lucy <95239842+swagprincess@users.noreply.github.com> Date: Sun, 24 Nov 2024 19:02:56 +0100 Subject: [PATCH 2/7] Update configs/SEQUREH7V2/config.h Co-authored-by: Mark Haslinghuis --- configs/SEQUREH7V2/config.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/configs/SEQUREH7V2/config.h b/configs/SEQUREH7V2/config.h index 651de90a..8af8ba6b 100644 --- a/configs/SEQUREH7V2/config.h +++ b/configs/SEQUREH7V2/config.h @@ -104,16 +104,16 @@ #define GYRO_1_CS_PIN PB12 #define TIMER_PIN_MAPPING \ - TIMER_PIN_MAP(1, PB4, 1, 0) \ - TIMER_PIN_MAP(2, PB5, 1, 0) \ - TIMER_PIN_MAP(3, PB0, 2, 0) \ - TIMER_PIN_MAP(4, PB1, 2, 0) \ - TIMER_PIN_MAP(5, PB6, 2, 0) \ - TIMER_PIN_MAP(6, PB7, 2, 0) \ - TIMER_PIN_MAP(7, PB10, 1, 0) \ - TIMER_PIN_MAP(8, PB11, 1, 0) \ - TIMER_PIN_MAP(9, PA8, 1, 0) \ - TIMER_PIN_MAP(10, PB3, 1, 0) + TIMER_PIN_MAP( 0, PB4, 1, 0 ) \ + TIMER_PIN_MAP( 1, PB5, 1, 0 ) \ + TIMER_PIN_MAP( 2, PB0, 2, 0 ) \ + TIMER_PIN_MAP( 3, PB1, 2, 0 ) \ + TIMER_PIN_MAP( 4, PB6, 2, 0 ) \ + TIMER_PIN_MAP( 5, PB7, 2, 0 ) \ + TIMER_PIN_MAP( 6, PB10, 1, 0 ) \ + TIMER_PIN_MAP( 7, PB11, 1, 0 ) \ + TIMER_PIN_MAP( 8, PA8, 1, 0 ) \ + TIMER_PIN_MAP( 9, PB3, 1, -1 ) #define ADC1_DMA_OPT 0 #define ADC3_DMA_OPT 0 From bc0a60c403139633e8b667e6db2567946711bf8c Mon Sep 17 00:00:00 2001 From: lucy <95239842+swagprincess@users.noreply.github.com> Date: Sun, 24 Nov 2024 19:03:01 +0100 Subject: [PATCH 3/7] Update configs/SEQUREH7V2/config.h Co-authored-by: Mark Haslinghuis --- configs/SEQUREH7V2/config.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configs/SEQUREH7V2/config.h b/configs/SEQUREH7V2/config.h index 8af8ba6b..90ce7c0c 100644 --- a/configs/SEQUREH7V2/config.h +++ b/configs/SEQUREH7V2/config.h @@ -151,4 +151,4 @@ #define GYRO_1_SPI_INSTANCE SPI2 #define GYRO_1_ALIGN CW90_DEG -#define FLASH_SPI_INSTANCE SPI3 \ No newline at end of file +#define FLASH_SPI_INSTANCE SPI3 From 1942f48b43cb3ba4df9b3794a1f1c58497c71a6f Mon Sep 17 00:00:00 2001 From: swagprincess Date: Sun, 24 Nov 2024 19:09:02 +0100 Subject: [PATCH 4/7] fix camera control --- configs/SEQUREH7V2/config.h | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/configs/SEQUREH7V2/config.h b/configs/SEQUREH7V2/config.h index 651de90a..72b3540e 100644 --- a/configs/SEQUREH7V2/config.h +++ b/configs/SEQUREH7V2/config.h @@ -104,19 +104,19 @@ #define GYRO_1_CS_PIN PB12 #define TIMER_PIN_MAPPING \ - TIMER_PIN_MAP(1, PB4, 1, 0) \ - TIMER_PIN_MAP(2, PB5, 1, 0) \ - TIMER_PIN_MAP(3, PB0, 2, 0) \ - TIMER_PIN_MAP(4, PB1, 2, 0) \ - TIMER_PIN_MAP(5, PB6, 2, 0) \ - TIMER_PIN_MAP(6, PB7, 2, 0) \ - TIMER_PIN_MAP(7, PB10, 1, 0) \ - TIMER_PIN_MAP(8, PB11, 1, 0) \ - TIMER_PIN_MAP(9, PA8, 1, 0) \ - TIMER_PIN_MAP(10, PB3, 1, 0) - -#define ADC1_DMA_OPT 0 -#define ADC3_DMA_OPT 0 + TIMER_PIN_MAP( 0, PB4, 1, 0 ) \ + TIMER_PIN_MAP( 1, PB5, 1, 0 ) \ + TIMER_PIN_MAP( 2, PB0, 2, 0 ) \ + TIMER_PIN_MAP( 3, PB1, 2, 0 ) \ + TIMER_PIN_MAP( 4, PB6, 2, 0 ) \ + TIMER_PIN_MAP( 5, PB7, 2, 0 ) \ + TIMER_PIN_MAP( 6, PB10, 1, 0 ) \ + TIMER_PIN_MAP( 7, PB11, 1, 0 ) \ + TIMER_PIN_MAP( 8, PA8, 1, 0 ) \ + TIMER_PIN_MAP( 9, PB3, 1, -1 ) + +#define ADC1_DMA_OPT 0 +#define ADC3_DMA_OPT 0 #define TIMUP1_DMA_OPT 0 #define TIMUP2_DMA_OPT 0 From e089e54fa38c7157e85c36339951e79a64853930 Mon Sep 17 00:00:00 2001 From: swagprincess Date: Sun, 24 Nov 2024 19:11:32 +0100 Subject: [PATCH 5/7] fix camera control --- configs/SEQUREH7V2/config.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/configs/SEQUREH7V2/config.h b/configs/SEQUREH7V2/config.h index 2b7a02d6..cfaa4a24 100644 --- a/configs/SEQUREH7V2/config.h +++ b/configs/SEQUREH7V2/config.h @@ -42,7 +42,9 @@ #define USE_MAX7456 +#ifndef USE_CAMERA_CONTROL #define USE_CAMERA_CONTROL +#endif #define BEEPER_PIN PD15 @@ -151,4 +153,4 @@ #define GYRO_1_SPI_INSTANCE SPI2 #define GYRO_1_ALIGN CW90_DEG -#define FLASH_SPI_INSTANCE SPI3 +#define FLASH_SPI_INSTANCE SPI3 \ No newline at end of file From 8b83ce72432b7ff0a442d99240179e977763b310 Mon Sep 17 00:00:00 2001 From: Mark Haslinghuis Date: Sun, 24 Nov 2024 22:03:04 +0100 Subject: [PATCH 6/7] Update configs/SEQUREH7V2/config.h --- configs/SEQUREH7V2/config.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configs/SEQUREH7V2/config.h b/configs/SEQUREH7V2/config.h index cfaa4a24..de1710da 100644 --- a/configs/SEQUREH7V2/config.h +++ b/configs/SEQUREH7V2/config.h @@ -153,4 +153,4 @@ #define GYRO_1_SPI_INSTANCE SPI2 #define GYRO_1_ALIGN CW90_DEG -#define FLASH_SPI_INSTANCE SPI3 \ No newline at end of file +#define FLASH_SPI_INSTANCE SPI3 From f77f0080bdfe00ed5dce5a9d9cc96cfb7b1e241f Mon Sep 17 00:00:00 2001 From: Mark Haslinghuis Date: Sun, 24 Nov 2024 22:06:25 +0100 Subject: [PATCH 7/7] Reordering --- configs/SEQUREH7V2/config.h | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/configs/SEQUREH7V2/config.h b/configs/SEQUREH7V2/config.h index de1710da..6fa9485b 100644 --- a/configs/SEQUREH7V2/config.h +++ b/configs/SEQUREH7V2/config.h @@ -18,13 +18,9 @@ * * If not, see . */ - - #pragma once - #define FC_TARGET_MCU STM32H743 - #define BOARD_NAME SEQUREH7V2 #define MANUFACTURER_ID SQRE @@ -126,31 +122,27 @@ #define TIMUP4_DMA_OPT 0 #define TIMUP8_DMA_OPT 0 -#define DEFAULT_DSHOT_BURST DSHOT_DMAR_ON +#define ADC_INSTANCE ADC1 #define SERIALRX_UART SERIAL_PORT_USART1 #define GPS_UART SERIAL_PORT_USART6 #define MSP_DISPLAYPORT_UART SERIAL_PORT_USART7 #define ESC_SENSOR_UART SERIAL_PORT_USART8 -#define MAG_I2C_INSTANCE (I2CDEV_1) -#define BARO_I2C_INSTANCE (I2CDEV_1) +#define BARO_I2C_INSTANCE I2CDEV_1 +#define MAG_I2C_INSTANCE I2CDEV_1 -#define ADC_INSTANCE ADC1 +#define FLASH_SPI_INSTANCE SPI3 +#define GYRO_1_SPI_INSTANCE SPI2 +#define MAX7456_SPI_INSTANCE SPI1 +#define DEFAULT_DSHOT_BURST DSHOT_DMAR_ON #define DEFAULT_BLACKBOX_DEVICE BLACKBOX_DEVICE_FLASH - #define DEFAULT_CURRENT_METER_SOURCE CURRENT_METER_ADC #define DEFAULT_CURRENT_METER_SCALE 1052 - #define DEFAULT_VOLTAGE_METER_SOURCE VOLTAGE_METER_ADC #define DEFAULT_VOLTAGE_METER_SCALE 110 #define BEEPER_INVERTED -#define MAX7456_SPI_INSTANCE SPI1 - -#define GYRO_1_SPI_INSTANCE SPI2 #define GYRO_1_ALIGN CW90_DEG - -#define FLASH_SPI_INSTANCE SPI3