diff --git a/boards/cubepilot/cubeorangeplus/init/rc.board_sensors b/boards/cubepilot/cubeorangeplus/init/rc.board_sensors index 2dc3a6e05de..61a3fbf138f 100644 --- a/boards/cubepilot/cubeorangeplus/init/rc.board_sensors +++ b/boards/cubepilot/cubeorangeplus/init/rc.board_sensors @@ -21,9 +21,13 @@ then fi # SPI1, body-fixed -if ! icm45686 -s -b 1 -R 3 -q start +if icm45686 -s -b 1 -R 3 -q start then + # if we detected the ICM45686 we also ought to have an AK09918 + ak09916 start -I -R 13 +else icm20649 -s -b 1 start + fi ms5611 -s -b 1 start diff --git a/boards/cubepilot/cubeorangeplus/nuttx-config/include/board.h b/boards/cubepilot/cubeorangeplus/nuttx-config/include/board.h index 3a4abd0235e..00a886d0860 100644 --- a/boards/cubepilot/cubeorangeplus/nuttx-config/include/board.h +++ b/boards/cubepilot/cubeorangeplus/nuttx-config/include/board.h @@ -187,6 +187,7 @@ #define STM32_RCC_D1CCIPR_SDMMCSEL RCC_D1CCIPR_SDMMC_PLL1 #define STM32_RCC_D2CCIP2R_I2C123SRC RCC_D2CCIP2R_I2C123SEL_HSI /* I2C123 clock source */ +#define STM32_RCC_D3CCIPR_I2C4SRC RCC_D3CCIPR_I2C4SEL_HSI #define STM32_RCC_D2CCIP1R_SPI123SRC RCC_D2CCIP1R_SPI123SEL_PLL2 /* SPI123 clock source */ #define STM32_RCC_D2CCIP1R_SPI45SRC RCC_D2CCIP1R_SPI45SEL_PLL2 /* SPI45 clock source */ #define STM32_RCC_D2CCIP2R_USBSRC RCC_D2CCIP2R_USBSEL_PLL3 /* USB 1 and 2 clock source */ @@ -264,3 +265,6 @@ #define GPIO_I2C2_SCL GPIO_I2C2_SCL_1 /* PB10 */ #define GPIO_I2C2_SDA GPIO_I2C2_SDA_1 /* PB11 */ + +#define GPIO_I2C4_SCL GPIO_I2C4_SCL_2 /* PF14 */ +#define GPIO_I2C4_SDA GPIO_I2C4_SDA_2 /* PF15 */ diff --git a/boards/cubepilot/cubeorangeplus/nuttx-config/nsh/defconfig b/boards/cubepilot/cubeorangeplus/nuttx-config/nsh/defconfig index 139b9ea48c2..7bab0a36af9 100644 --- a/boards/cubepilot/cubeorangeplus/nuttx-config/nsh/defconfig +++ b/boards/cubepilot/cubeorangeplus/nuttx-config/nsh/defconfig @@ -189,6 +189,7 @@ CONFIG_STM32H7_DMACAPABLE=y CONFIG_STM32H7_FLOWCONTROL_BROKEN=y CONFIG_STM32H7_I2C1=y CONFIG_STM32H7_I2C2=y +CONFIG_STM32H7_I2C4=y CONFIG_STM32H7_I2C_DYNTIMEO=y CONFIG_STM32H7_I2C_DYNTIMEO_STARTSTOP=10 CONFIG_STM32H7_OTGFS=y diff --git a/boards/cubepilot/cubeorangeplus/nuttx-config/test/defconfig b/boards/cubepilot/cubeorangeplus/nuttx-config/test/defconfig index 59c549337b3..0eebadc3770 100644 --- a/boards/cubepilot/cubeorangeplus/nuttx-config/test/defconfig +++ b/boards/cubepilot/cubeorangeplus/nuttx-config/test/defconfig @@ -189,6 +189,7 @@ CONFIG_STM32H7_DMACAPABLE=y CONFIG_STM32H7_FLOWCONTROL_BROKEN=y CONFIG_STM32H7_I2C1=y CONFIG_STM32H7_I2C2=y +CONFIG_STM32H7_I2C4=y CONFIG_STM32H7_I2C_DYNTIMEO=y CONFIG_STM32H7_I2C_DYNTIMEO_STARTSTOP=10 CONFIG_STM32H7_OTGFS=y diff --git a/boards/cubepilot/cubeorangeplus/src/board_config.h b/boards/cubepilot/cubeorangeplus/src/board_config.h index ad81b75d1eb..1646925c3a3 100644 --- a/boards/cubepilot/cubeorangeplus/src/board_config.h +++ b/boards/cubepilot/cubeorangeplus/src/board_config.h @@ -180,6 +180,8 @@ PX4_MAKE_GPIO_OUTPUT_CLEAR(GPIO_I2C1_SDA), \ PX4_MAKE_GPIO_OUTPUT_CLEAR(GPIO_I2C2_SCL), \ PX4_MAKE_GPIO_OUTPUT_CLEAR(GPIO_I2C2_SDA), \ + PX4_MAKE_GPIO_OUTPUT_CLEAR(GPIO_I2C4_SCL), \ + PX4_MAKE_GPIO_OUTPUT_CLEAR(GPIO_I2C4_SDA), \ PX4_GPIO_PIN_OFF(GPIO_SDMMC1_D0), \ PX4_GPIO_PIN_OFF(GPIO_SDMMC1_D1), \ PX4_GPIO_PIN_OFF(GPIO_SDMMC1_D2), \ diff --git a/boards/cubepilot/cubeorangeplus/src/i2c.cpp b/boards/cubepilot/cubeorangeplus/src/i2c.cpp index 5625423e377..9fcdb91a87e 100644 --- a/boards/cubepilot/cubeorangeplus/src/i2c.cpp +++ b/boards/cubepilot/cubeorangeplus/src/i2c.cpp @@ -36,4 +36,5 @@ constexpr px4_i2c_bus_t px4_i2c_buses[I2C_BUS_MAX_BUS_ITEMS] = { initI2CBusExternal(2), initI2CBusExternal(1), + initI2CBusInternal(4), };