From bf8d759d3d497740512428fde82ad756bd5221c0 Mon Sep 17 00:00:00 2001 From: achim Date: Wed, 4 May 2022 20:05:16 +0200 Subject: [PATCH] boards: matek h743 slim support v1 and v1.5 IMU variants - remove temp compensation to still fit into flash --- boards/matek/h743-slim/default.px4board | 3 ++- boards/matek/h743-slim/init/rc.board_sensors | 8 ++++++-- boards/matek/h743-slim/src/spi.cpp | 1 + 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/boards/matek/h743-slim/default.px4board b/boards/matek/h743-slim/default.px4board index 1cea04c931..a08901e249 100644 --- a/boards/matek/h743-slim/default.px4board +++ b/boards/matek/h743-slim/default.px4board @@ -14,6 +14,7 @@ CONFIG_DRIVERS_DSHOT=y CONFIG_DRIVERS_GPS=y CONFIG_DRIVERS_IMU_INVENSENSE_MPU6000=y CONFIG_DRIVERS_IMU_INVENSENSE_ICM20602=y +CONFIG_DRIVERS_IMU_INVENSENSE_ICM42605=y CONFIG_COMMON_LIGHT=y CONFIG_COMMON_MAGNETOMETER=y CONFIG_COMMON_OPTICAL_FLOW=y @@ -51,7 +52,7 @@ CONFIG_MODULES_CONTROL_ALLOCATOR=y CONFIG_MODULES_NAVIGATOR=y CONFIG_MODULES_RC_UPDATE=y CONFIG_MODULES_SENSORS=y -CONFIG_MODULES_TEMPERATURE_COMPENSATION=y +CONFIG_MODULES_TEMPERATURE_COMPENSATION=n CONFIG_MODULES_GIMBAL=y CONFIG_SYSTEMCMDS_BL_UPDATE=y CONFIG_SYSTEMCMDS_ACTUATOR_TEST=y diff --git a/boards/matek/h743-slim/init/rc.board_sensors b/boards/matek/h743-slim/init/rc.board_sensors index 91dcdb8c68..c37c3b3b58 100644 --- a/boards/matek/h743-slim/init/rc.board_sensors +++ b/boards/matek/h743-slim/init/rc.board_sensors @@ -5,8 +5,12 @@ board_adc start -# Internal SPI bus ICM-20602 -icm20602 -R 12 -s start +# Internal SPI bus ICM-42605 +if ! icm42605 -R 14 -s start +then + # internal SPI bus ICM-20602 + icm20602 -R 12 -s start +fi # Internal SPI bus MPU-6000 mpu6000 -R 12 -s start diff --git a/boards/matek/h743-slim/src/spi.cpp b/boards/matek/h743-slim/src/spi.cpp index 5135cbcc3b..db673bedf0 100644 --- a/boards/matek/h743-slim/src/spi.cpp +++ b/boards/matek/h743-slim/src/spi.cpp @@ -48,6 +48,7 @@ constexpr px4_spi_bus_t px4_spi_buses[SPI_BUS_MAX_BUS_ITEMS] = { initSPIConfigExternal(SPI::CS{GPIO::PortE, GPIO::Pin2}), }), initSPIBus(SPI::Bus::SPI4, { + initSPIDevice(DRV_IMU_DEVTYPE_ICM42605, SPI::CS{GPIO::PortC, GPIO::Pin13}), initSPIDevice(DRV_IMU_DEVTYPE_ICM20602, SPI::CS{GPIO::PortE, GPIO::Pin11}), }), };