Skip to content

Commit

Permalink
Merge pull request #9848 from iNavFlight/mmosca-mambah743-altgyro
Browse files Browse the repository at this point in the history
Add target to switch to second gyro on MAMBAH743_2022B, instead of first gyro.
If you own a MAMBAH743_2022B, it is advisable to recalibrate the gyro when upgrading to INAV 7.1
  • Loading branch information
mmosca authored Mar 24, 2024
2 parents 915d3b3 + 79cd891 commit 5b631f4
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 6 deletions.
4 changes: 4 additions & 0 deletions docs/boards/MAMBAH743_2022B.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,8 @@

Contrary to what the documentation suggests, VTX power is actually on USER2.

# Dual Gyros

INAV 7.1 changed the default gyro of the board from the gyro on SPI4 back to the one on SPI1. A new tagrt ```MAMBAH743_2022B_GYRO2``` was added to use gyro on SPI4, in case you suspect an issue with the gyro on SPI1, you can switch to the gyro on SPI4 by using the new target.


3 changes: 2 additions & 1 deletion src/main/target/MAMBAH743/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
target_stm32h743xi(MAMBAH743)
target_stm32h743xi(MAMBAH743_2022B)
target_stm32h743xi(MAMBAH743_2022B)
target_stm32h743xi(MAMBAH743_2022B_GYRO2)
2 changes: 1 addition & 1 deletion src/main/target/MAMBAH743/target.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
BUSDEV_REGISTER_SPI_TAG(busdev_mpu6000, DEVHW_MPU6000, MPU6000_SPI_BUS, MPU6000_CS_PIN, NONE, 0, DEVFLAGS_NONE, IMU_MPU6000_ALIGN);
BUSDEV_REGISTER_SPI_TAG(busdev_bmi270, DEVHW_BMI270, BMI270_SPI_BUS, BMI270_CS_PIN, NONE, 0, DEVFLAGS_NONE, IMU_BMI270_ALIGN);

#ifdef MAMBAH743_2022B
#ifdef USE_IMU_ICM42605
BUSDEV_REGISTER_SPI_TAG(busdev_icm42605, DEVHW_ICM42605, ICM42605_SPI_BUS, ICM42605_CS_PIN, NONE, 0, DEVFLAGS_NONE, IMU_ICM42605_ALIGN);
#endif

Expand Down
22 changes: 18 additions & 4 deletions src/main/target/MAMBAH743/target.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@
#define TARGET_BOARD_IDENTIFIER "M743"
#define USBD_PRODUCT_STRING "MAMBAH743_2022B"

#elif defined(MAMBAH743_2022B_GYRO2)

#define TARGET_BOARD_IDENTIFIER "M743"
#define USBD_PRODUCT_STRING "MAMBAH743_2022B_GYRO2"

#else

#define TARGET_BOARD_IDENTIFIER "M743"
Expand Down Expand Up @@ -58,13 +63,22 @@
#define BMI270_SPI_BUS BUS_SPI1
#define BMI270_CS_PIN PA4

#ifdef MAMBAH743_2022B

#define USE_SPI_DEVICE_4
#define SPI4_SCK_PIN PE12
#define SPI4_MISO_PIN PE13
#define SPI4_MOSI_PIN PE14

#ifdef MAMBAH743_2022B

#define USE_IMU_ICM42605
#define IMU_ICM42605_ALIGN CW0_DEG
#define ICM42605_SPI_BUS BUS_SPI1
#define ICM42605_CS_PIN PA4

#endif

#ifdef MAMBAH743_2022B_GYRO2

#define USE_IMU_ICM42605
#define IMU_ICM42605_ALIGN CW270_DEG
#define ICM42605_SPI_BUS BUS_SPI4
Expand Down Expand Up @@ -175,7 +189,7 @@
#define USE_ADC
#define ADC_INSTANCE ADC3

#ifdef MAMBAH743_2022B
#if defined(MAMBAH743_2022B) || defined(MAMBAH743_2022B_GYRO2)

#define ADC_CHANNEL_1_PIN PC1
#define ADC_CHANNEL_2_PIN PC3
Expand Down Expand Up @@ -203,7 +217,7 @@
#define USE_PINIO
#define USE_PINIOBOX

#ifdef MAMBAH743_2022B
#if defined(MAMBAH743_2022B) || defined(MAMBAH743_2022B_GYRO2)

#define PINIO1_PIN PC2
#define PINIO2_PIN PC5
Expand Down

0 comments on commit 5b631f4

Please sign in to comment.