Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions boards/px4/fmu-v6xrt/default.px4board
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ CONFIG_DRIVERS_IMU_INVENSENSE_IIM42652=y
CONFIG_COMMON_INS=y
CONFIG_COMMON_LIGHT=y
CONFIG_COMMON_MAGNETOMETER=y
CONFIG_DRIVERS_MAGNETOMETER_BOSCH_BMM350=y
CONFIG_DRIVERS_MAGNETOMETER_LIS2MDL=y
CONFIG_DRIVERS_OSD_MSP_OSD=y
CONFIG_DRIVERS_POWER_MONITOR_INA226=y
CONFIG_DRIVERS_POWER_MONITOR_INA228=y
Expand Down
42 changes: 33 additions & 9 deletions boards/px4/fmu-v6xrt/init/rc.board_sensors
Original file line number Diff line number Diff line change
Expand Up @@ -85,19 +85,43 @@ else
fi
fi

# Internal SPI bus ICM42686p (hard-mounted)
icm42688p -6 -R 12 -b 1 -s start
if ver hwtypecmp V6XRT000 V6XRT001
then
# Internal SPI bus ICM42686p (hard-mounted)
icm42688p -6 -R 12 -b 1 -s start

# Internal on IMU SPI BMI088
bmi088 -A -R 4 -s start
bmi088 -G -R 4 -s start

# Internal on IMU SPI bus ICM42688p
icm42688p -R 6 -b 2 -s start
fi

# Internal on IMU SPI BMI088
bmi088 -A -R 4 -s start
bmi088 -G -R 4 -s start
if ver hwtypecmp V6XRT002
then
# Internal SPI bus icm45686 (hard-mounted)
icm45686 -R 12 -b 1 -s start

# Internal on IMU SPI bus ICM42688p
icm42688p -R 6 -b 2 -s start
# Internal on IMU SPI BMI088
bmi088 -A -R 4 -s start
bmi088 -G -R 4 -s start

# Internal magnetometer on I2c
bmm150 -I start
# Internal on IMU SPI bus icm45686
icm45686 -R 6 -b 2 -s start
fi

if ver hwtypecmp V6XRT000
then
# Internal magnetometer on I2c
bmm150 -I start
fi

if ver hwtypecmp V6XRT001 V6XRT002
then
# Internal magnetometer on I2c
bmm350 -I start
fi

# 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)
ist8310 -X -b 1 -R 10 start
Expand Down
3 changes: 2 additions & 1 deletion boards/px4/fmu-v6xrt/src/board_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -297,9 +297,10 @@
#define GPIO_HW_VER_SENSE /* GPIO_AD_23 GPIO9 Pin 22 */ ADC_GPIO(5, 22)
#define HW_INFO_INIT_PREFIX "V6XRT"

#define BOARD_NUM_SPI_CFG_HW_VERSIONS 2 // Rev 0 & 1
#define BOARD_NUM_SPI_CFG_HW_VERSIONS 3 // Rev 0, 1 & 2
#define V6XRT_0 HW_FMUM_ID(0x0) // First Release
#define V6XRT_1 HW_FMUM_ID(0x1) // Next Release
#define V6XRT_2 HW_FMUM_ID(0x2) // Next Release

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

Expand Down
20 changes: 20 additions & 0 deletions boards/px4/fmu-v6xrt/src/spi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,26 @@ constexpr px4_spi_bus_all_hw_t px4_spi_buses_all_hw[BOARD_NUM_SPI_CFG_HW_VERSION
initSPIConfigExternal(SPI::CS{GPIO::Port6, GPIO::Pin8}, SPI::DRDY{GPIO::Port1, GPIO::Pin7}), /* GPIO_LPSR_08 GPIO6_IO08 GPIO_EMC_B1_07 GPIO1_IO07*/
}),
}),

initSPIFmumID(V6XRT_2, {
initSPIBus(SPI::Bus::LPSPI1, {
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 */
}, {GPIO::Port2, GPIO::Pin1}), // Power GPIO_EMC_B1_33 GPIO2_IO01

initSPIBus(SPI::Bus::LPSPI2, {
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 */
}, {GPIO::Port1, GPIO::Pin22}), // Power GPIO_EMC_B1_22 GPIO1_IO22

initSPIBus(SPI::Bus::LPSPI3, {
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 */
initSPIDevice(DRV_ACC_DEVTYPE_BMI088, SPI::CS{GPIO::Port2, GPIO::Pin15}), /* GPIO_EMC_B2_05 GPIO2_IO15 */
}, {GPIO::Port1, GPIO::Pin14}), // Power GPIO_EMC_B1_14 GPIO1_IO14

initSPIBusExternal(SPI::Bus::LPSPI6, {
initSPIConfigExternal(SPI::CS{GPIO::Port6, GPIO::Pin9}, SPI::DRDY{GPIO::Port1, GPIO::Pin5}), /* GPIO_LPSR_09 GPIO6_IO09 GPIO_EMC_B1_05 GPIO1_IO05*/
initSPIConfigExternal(SPI::CS{GPIO::Port6, GPIO::Pin8}, SPI::DRDY{GPIO::Port1, GPIO::Pin7}), /* GPIO_LPSR_08 GPIO6_IO08 GPIO_EMC_B1_07 GPIO1_IO07*/
}),
}),
};

static constexpr bool unused = validateSPIConfig(px4_spi_buses_all_hw);
Loading