diff --git a/boards/cubepilot/cubeorangeplus/default.px4board b/boards/cubepilot/cubeorangeplus/default.px4board index 05622fb2f7..3cb645bce3 100644 --- a/boards/cubepilot/cubeorangeplus/default.px4board +++ b/boards/cubepilot/cubeorangeplus/default.px4board @@ -19,6 +19,7 @@ CONFIG_DRIVERS_IMU_ANALOG_DEVICES_ADIS16448=y CONFIG_DRIVERS_IMU_INVENSENSE_ICM20649=y CONFIG_DRIVERS_IMU_INVENSENSE_ICM20948=y CONFIG_DRIVERS_IMU_INVENSENSE_ICM42688P=y +CONFIG_DRIVERS_IMU_INVENSENSE_ICM45686=y CONFIG_DRIVERS_IRLOCK=y CONFIG_COMMON_LIGHT=y CONFIG_COMMON_MAGNETOMETER=y diff --git a/boards/cubepilot/cubeorangeplus/init/rc.board_sensors b/boards/cubepilot/cubeorangeplus/init/rc.board_sensors index 051f06b928..2dc3a6e05d 100644 --- a/boards/cubepilot/cubeorangeplus/init/rc.board_sensors +++ b/boards/cubepilot/cubeorangeplus/init/rc.board_sensors @@ -4,12 +4,27 @@ #------------------------------------------------------------------------------ board_adc start -# SPI4 +# Variants +# 1. Isolated {ICM42688p, ICM20948(with mag)}, body-fixed {ICM20649} +# 2. Isolated {ICM42688p, ICM42688p}, body-fixed {ICM20649, ICM45686, AK09918} +# 3. Isolated {ICM42688p, ICM42688p}, body-fixed {ICM45686, AK09918} + +# SPI4 is isolated, SPI1 is body-fixed + +# SPI4, isolated ms5611 -s -b 4 start -icm42688p -s -b 4 -R 10 start -icm20948 -s -b 4 -R 10 -M start -# SPI1 +icm42688p -s -b 4 -R 10 start -c 15 +if ! icm20948 -s -b 4 -R 10 -M -q start +then + icm42688p -s -b 4 -R 6 start -c 13 +fi + +# SPI1, body-fixed +if ! icm45686 -s -b 1 -R 3 -q start +then + icm20649 -s -b 1 start +fi + ms5611 -s -b 1 start -icm20649 -s -b 1 start diff --git a/boards/cubepilot/cubeorangeplus/src/spi.cpp b/boards/cubepilot/cubeorangeplus/src/spi.cpp index adcf762c00..fe5ca16172 100644 --- a/boards/cubepilot/cubeorangeplus/src/spi.cpp +++ b/boards/cubepilot/cubeorangeplus/src/spi.cpp @@ -38,6 +38,7 @@ constexpr px4_spi_bus_t px4_spi_buses[SPI_BUS_MAX_BUS_ITEMS] = { initSPIBus(SPI::Bus::SPI1, { initSPIDevice(DRV_IMU_DEVTYPE_ICM20649, SPI::CS{GPIO::PortC, GPIO::Pin2}, SPI::DRDY{GPIO::PortD, GPIO::Pin15}), // MPU_CS, MPU_DRDY + initSPIDevice(DRV_IMU_DEVTYPE_ICM45686, SPI::CS{GPIO::PortG, GPIO::Pin1}), // ICM45686_CS initSPIDevice(DRV_BARO_DEVTYPE_MS5611, SPI::CS{GPIO::PortD, GPIO::Pin7}), // BARO_CS }), @@ -48,6 +49,7 @@ constexpr px4_spi_bus_t px4_spi_buses[SPI_BUS_MAX_BUS_ITEMS] = { initSPIBus(SPI::Bus::SPI4, { initSPIDevice(DRV_IMU_DEVTYPE_ICM20948, SPI::CS{GPIO::PortE, GPIO::Pin4}), // MPU_EXT_CS initSPIDevice(DRV_IMU_DEVTYPE_ICM42688P, SPI::CS{GPIO::PortC, GPIO::Pin15}), // ACCEL_EXT_CS + initSPIDevice(DRV_IMU_DEVTYPE_ICM42688P, SPI::CS{GPIO::PortC, GPIO::Pin13}), // GYRO_EXT_CS initSPIDevice(DRV_BARO_DEVTYPE_MS5611, SPI::CS{GPIO::PortC, GPIO::Pin14}), // BARO_EXT_CS }), };