Skip to content

Commit 322475f

Browse files
fmu-v6xrt: Add V6XRT001 and V6XRT002 sensor set
1 parent 089887f commit 322475f

File tree

3 files changed

+55
-10
lines changed

3 files changed

+55
-10
lines changed

boards/px4/fmu-v6xrt/init/rc.board_sensors

Lines changed: 33 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -85,19 +85,43 @@ else
8585
fi
8686
fi
8787

88-
# Internal SPI bus ICM42686p (hard-mounted)
89-
icm42688p -6 -R 12 -b 1 -s start
88+
if ver hwtypecmp V6XRT000 V6XRT001
89+
then
90+
# Internal SPI bus ICM42686p (hard-mounted)
91+
icm42688p -6 -R 12 -b 1 -s start
92+
93+
# Internal on IMU SPI BMI088
94+
bmi088 -A -R 4 -s start
95+
bmi088 -G -R 4 -s start
96+
97+
# Internal on IMU SPI bus ICM42688p
98+
icm42688p -R 6 -b 2 -s start
99+
fi
90100

91-
# Internal on IMU SPI BMI088
92-
bmi088 -A -R 4 -s start
93-
bmi088 -G -R 4 -s start
101+
if ver hwtypecmp V6XRT002
102+
then
103+
# Internal SPI bus icm45686 (hard-mounted)
104+
icm45686 -R 12 -b 1 -s start
94105

95-
# Internal on IMU SPI bus ICM42688p
96-
icm42688p -R 6 -b 2 -s start
106+
# Internal on IMU SPI BMI088
107+
bmi088 -A -R 4 -s start
108+
bmi088 -G -R 4 -s start
97109

98-
# Internal magnetometer on I2c
99-
bmm150 -I start
110+
# Internal on IMU SPI bus icm45686
111+
icm45686 -R 6 -b 2 -s start
112+
fi
100113

114+
if ver hwtypecmp V6XRT000
115+
then
116+
# Internal magnetometer on I2c
117+
bmm150 -I start
118+
fi
119+
120+
if ver hwtypecmp V6XRT001 V6XRT002
121+
then
122+
# Internal magnetometer on I2c
123+
bmm350 -I start
124+
fi
101125

102126
# External compass on GPS1/I2C1 (the 3rd external bus): standard Holybro Pixhawk 4 or CUAV V5 GPS/compass puck (with lights, safety button, and buzzer)
103127
ist8310 -X -b 1 -R 10 start

boards/px4/fmu-v6xrt/src/board_config.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,9 +297,10 @@
297297
#define GPIO_HW_VER_SENSE /* GPIO_AD_23 GPIO9 Pin 22 */ ADC_GPIO(5, 22)
298298
#define HW_INFO_INIT_PREFIX "V6XRT"
299299

300-
#define BOARD_NUM_SPI_CFG_HW_VERSIONS 2 // Rev 0 & 1
300+
#define BOARD_NUM_SPI_CFG_HW_VERSIONS 3 // Rev 0, 1 & 2
301301
#define V6XRT_0 HW_FMUM_ID(0x0) // First Release
302302
#define V6XRT_1 HW_FMUM_ID(0x1) // Next Release
303+
#define V6XRT_2 HW_FMUM_ID(0x2) // Next Release
303304

304305
#define BOARD_I2C_LATEINIT 1 /* See Note about SE550 Eanable */
305306

boards/px4/fmu-v6xrt/src/spi.cpp

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,26 @@ constexpr px4_spi_bus_all_hw_t px4_spi_buses_all_hw[BOARD_NUM_SPI_CFG_HW_VERSION
8181
initSPIConfigExternal(SPI::CS{GPIO::Port6, GPIO::Pin8}, SPI::DRDY{GPIO::Port1, GPIO::Pin7}), /* GPIO_LPSR_08 GPIO6_IO08 GPIO_EMC_B1_07 GPIO1_IO07*/
8282
}),
8383
}),
84+
85+
initSPIFmumID(V6XRT_2, {
86+
initSPIBus(SPI::Bus::LPSPI1, {
87+
initSPIDevice(DRV_IMU_DEVTYPE_ICM45686, SPI::CS{GPIO::Port2, GPIO::Pin11}, SPI::DRDY{GPIO::Port3, GPIO::Pin19}), /* GPIO_EMC_B2_01 GPIO2_IO11, GPIO_AD_20, GPIO3_IO19 */
88+
}, {GPIO::Port2, GPIO::Pin1}), // Power GPIO_EMC_B1_33 GPIO2_IO01
89+
90+
initSPIBus(SPI::Bus::LPSPI2, {
91+
initSPIDevice(DRV_IMU_DEVTYPE_ICM45686, SPI::CS{GPIO::Port3, GPIO::Pin24}, SPI::DRDY{GPIO::Port2, GPIO::Pin7}), /* GPIO_AD_25 GPIO3_IO24, GPIO_EMC_B1_39 GPIO2_IO07 */
92+
}, {GPIO::Port1, GPIO::Pin22}), // Power GPIO_EMC_B1_22 GPIO1_IO22
93+
94+
initSPIBus(SPI::Bus::LPSPI3, {
95+
initSPIDevice(DRV_GYR_DEVTYPE_BMI088, SPI::CS{GPIO::Port2, GPIO::Pin18}, SPI::DRDY{GPIO::Port2, GPIO::Pin28}), /* GPIO_EMC_B2_08 GPIO2_IO18, GPIO_EMC_B2_18 GPIO2_IO28 */
96+
initSPIDevice(DRV_ACC_DEVTYPE_BMI088, SPI::CS{GPIO::Port2, GPIO::Pin15}), /* GPIO_EMC_B2_05 GPIO2_IO15 */
97+
}, {GPIO::Port1, GPIO::Pin14}), // Power GPIO_EMC_B1_14 GPIO1_IO14
98+
99+
initSPIBusExternal(SPI::Bus::LPSPI6, {
100+
initSPIConfigExternal(SPI::CS{GPIO::Port6, GPIO::Pin9}, SPI::DRDY{GPIO::Port1, GPIO::Pin5}), /* GPIO_LPSR_09 GPIO6_IO09 GPIO_EMC_B1_05 GPIO1_IO05*/
101+
initSPIConfigExternal(SPI::CS{GPIO::Port6, GPIO::Pin8}, SPI::DRDY{GPIO::Port1, GPIO::Pin7}), /* GPIO_LPSR_08 GPIO6_IO08 GPIO_EMC_B1_07 GPIO1_IO07*/
102+
}),
103+
}),
84104
};
85105

86106
static constexpr bool unused = validateSPIConfig(px4_spi_buses_all_hw);

0 commit comments

Comments
 (0)