From e0686024f782091a526b66a8e77f69c882ff6b03 Mon Sep 17 00:00:00 2001 From: EmaxModel <99713279+EmaxModel@users.noreply.github.com> Date: Tue, 5 Aug 2025 10:15:28 +0800 Subject: [PATCH 1/5] Add files via upload --- configs/EMAX_G473_AIO/config.h | 97 ++++++++++++++++++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 configs/EMAX_G473_AIO/config.h diff --git a/configs/EMAX_G473_AIO/config.h b/configs/EMAX_G473_AIO/config.h new file mode 100644 index 000000000..e16751d62 --- /dev/null +++ b/configs/EMAX_G473_AIO/config.h @@ -0,0 +1,97 @@ +/* + * 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 STM32G47X + +#define BOARD_NAME EMAX_G473 +#define MANUFACTURER_ID EMAX + +#define USE_ACC +#define USE_GYRO +#define USE_ACC_SPI_ICM42688P +#define USE_GYRO_SPI_ICM42688P +#define USE_FLASH +#define USE_FLASH_W25Q128FV +#define USE_MAX7456 + +#define BEEPER_PIN PA8 +#define MOTOR1_PIN PB0 +#define MOTOR2_PIN PB1 +#define MOTOR3_PIN PC6 +#define MOTOR4_PIN PA4 +#define LED_STRIP_PIN PB2 +#define UART1_TX_PIN PA9 +#define UART2_TX_PIN PA2 +#define UART3_TX_PIN PB10 +#define UART4_TX_PIN PC10 +#define UART1_RX_PIN PA10 +#define UART2_RX_PIN PA3 +#define UART3_RX_PIN PB11 +#define UART4_RX_PIN PC11 +#define I2C1_SCL_PIN PA15 +#define I2C1_SDA_PIN PB7 +#define LED0_PIN PB6 +#define LED1_PIN PB9 +#define SPI1_SCK_PIN PA5 +#define SPI2_SCK_PIN PB13 +#define SPI3_SCK_PIN PB3 +#define SPI1_SDI_PIN PA6 +#define SPI2_SDI_PIN PB14 +#define SPI3_SDI_PIN PB4 +#define SPI1_SDO_PIN PA7 +#define SPI2_SDO_PIN PB15 +#define SPI3_SDO_PIN PB5 +#define ADC_VBAT_PIN PA0 +#define ADC_CURR_PIN PA1 +#define FLASH_CS_PIN PC13 +#define MAX7456_SPI_CS_PIN PB12 +#define GYRO_1_EXTI_PIN PC4 +#define GYRO_1_CS_PIN PC14 + +#define TIMER_PIN_MAPPING \ + TIMER_PIN_MAP( 0, PB2, 1, 1 ) \ + TIMER_PIN_MAP( 1, PB0, 1, 2 ) \ + TIMER_PIN_MAP( 2, PB1, 1, 3 ) \ + TIMER_PIN_MAP( 3, PC6, 1, 4 ) \ + TIMER_PIN_MAP( 4, PA4, 1, 5 ) + +#define ADC1_DMA_OPT 0 + +#define VTX_SMARTAUDIO_UART SERIAL_PORT_USART2 +#define SERIALRX_UART SERIAL_PORT_USART3 + +#define BARO_I2C_INSTANCE I2CDEV_1 +#define MAG_I2C_INSTANCE I2CDEV_1 +#define SERIALRX_PROVIDER SERIALRX_CRSF +#define DEFAULT_BLACKBOX_DEVICE BLACKBOX_DEVICE_FLASH +#define DEFAULT_DSHOT_BURST DSHOT_DMAR_OFF +#define DEFAULT_DSHOT_BITBANG DSHOT_BITBANG_ON +#define DEFAULT_CURRENT_METER_SOURCE CURRENT_METER_ADC +#define DEFAULT_VOLTAGE_METER_SOURCE VOLTAGE_METER_ADC +#define DEFAULT_CURRENT_METER_SCALE 750 +#define BEEPER_INVERTED +#define SYSTEM_HSE_MHZ 8 +#define MAX7456_SPI_INSTANCE SPI2 +#define FLASH_SPI_INSTANCE SPI3 +#define GYRO_1_SPI_INSTANCE SPI1 +#define GYRO_1_ALIGN CW180_DEG From 4b109cd7901eda8225a79e4b615c9c7e492bf1b5 Mon Sep 17 00:00:00 2001 From: EmaxModel <99713279+EmaxModel@users.noreply.github.com> Date: Tue, 5 Aug 2025 10:44:38 +0800 Subject: [PATCH 2/5] Update config.h --- configs/EMAX_G473_AIO/config.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configs/EMAX_G473_AIO/config.h b/configs/EMAX_G473_AIO/config.h index e16751d62..86b04a734 100644 --- a/configs/EMAX_G473_AIO/config.h +++ b/configs/EMAX_G473_AIO/config.h @@ -23,7 +23,7 @@ #define FC_TARGET_MCU STM32G47X -#define BOARD_NAME EMAX_G473 +#define BOARD_NAME EMAX_G473_AIO #define MANUFACTURER_ID EMAX #define USE_ACC From e2d76d1662c3ba69ec44b618554a120d032a4d23 Mon Sep 17 00:00:00 2001 From: EmaxModel <99713279+EmaxModel@users.noreply.github.com> Date: Tue, 16 Sep 2025 10:53:59 +0800 Subject: [PATCH 3/5] Update config.h --- configs/EMAX_G473_AIO/config.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/configs/EMAX_G473_AIO/config.h b/configs/EMAX_G473_AIO/config.h index 86b04a734..8a9da7759 100644 --- a/configs/EMAX_G473_AIO/config.h +++ b/configs/EMAX_G473_AIO/config.h @@ -37,8 +37,8 @@ #define BEEPER_PIN PA8 #define MOTOR1_PIN PB0 #define MOTOR2_PIN PB1 -#define MOTOR3_PIN PC6 -#define MOTOR4_PIN PA4 +#define MOTOR3_PIN PB6 +#define MOTOR4_PIN PB9 #define LED_STRIP_PIN PB2 #define UART1_TX_PIN PA9 #define UART2_TX_PIN PA2 @@ -50,8 +50,8 @@ #define UART4_RX_PIN PC11 #define I2C1_SCL_PIN PA15 #define I2C1_SDA_PIN PB7 -#define LED0_PIN PB6 -#define LED1_PIN PB9 +#define LED0_PIN PC6 +#define LED1_PIN PA4 #define SPI1_SCK_PIN PA5 #define SPI2_SCK_PIN PB13 #define SPI3_SCK_PIN PB3 From 6c049ce9c196ce25fb54c79556a6df63fd915927 Mon Sep 17 00:00:00 2001 From: EmaxModel <99713279+EmaxModel@users.noreply.github.com> Date: Tue, 16 Sep 2025 17:04:45 +0800 Subject: [PATCH 4/5] Update config.h --- configs/EMAX_G473_AIO/config.h | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/configs/EMAX_G473_AIO/config.h b/configs/EMAX_G473_AIO/config.h index 8a9da7759..30beb4f6d 100644 --- a/configs/EMAX_G473_AIO/config.h +++ b/configs/EMAX_G473_AIO/config.h @@ -69,11 +69,12 @@ #define GYRO_1_CS_PIN PC14 #define TIMER_PIN_MAPPING \ - TIMER_PIN_MAP( 0, PB2, 1, 1 ) \ - TIMER_PIN_MAP( 1, PB0, 1, 2 ) \ - TIMER_PIN_MAP( 2, PB1, 1, 3 ) \ - TIMER_PIN_MAP( 3, PC6, 1, 4 ) \ - TIMER_PIN_MAP( 4, PA4, 1, 5 ) + TIMER_PIN_MAP( 0, PB0, 1, 1 ) \ + TIMER_PIN_MAP( 1, PB1, 1, 2 ) \ + TIMER_PIN_MAP( 2, PB6, 2, 3 ) \ + TIMER_PIN_MAP( 3, PB9, 2, 4 ) \ + TIMER_PIN_MAP( 4, PB2, 1, 5 ) \ + TIMER_PIN_MAP( 5, PA8, 1, -1 ) #define ADC1_DMA_OPT 0 @@ -88,7 +89,7 @@ #define DEFAULT_DSHOT_BITBANG DSHOT_BITBANG_ON #define DEFAULT_CURRENT_METER_SOURCE CURRENT_METER_ADC #define DEFAULT_VOLTAGE_METER_SOURCE VOLTAGE_METER_ADC -#define DEFAULT_CURRENT_METER_SCALE 750 +#define DEFAULT_CURRENT_METER_SCALE 470 #define BEEPER_INVERTED #define SYSTEM_HSE_MHZ 8 #define MAX7456_SPI_INSTANCE SPI2 From df3415241131cc4450836ad13e030b97fa51b1ec Mon Sep 17 00:00:00 2001 From: EmaxModel <99713279+EmaxModel@users.noreply.github.com> Date: Tue, 16 Sep 2025 17:22:04 +0800 Subject: [PATCH 5/5] Update config.h --- configs/EMAX_G473_AIO/config.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configs/EMAX_G473_AIO/config.h b/configs/EMAX_G473_AIO/config.h index 30beb4f6d..fa9eeb840 100644 --- a/configs/EMAX_G473_AIO/config.h +++ b/configs/EMAX_G473_AIO/config.h @@ -31,7 +31,7 @@ #define USE_ACC_SPI_ICM42688P #define USE_GYRO_SPI_ICM42688P #define USE_FLASH -#define USE_FLASH_W25Q128FV +#define USE_FLASH_M25P16 #define USE_MAX7456 #define BEEPER_PIN PA8