From 6d0339ba0c514b9a638373308c04d643f2bf6d5d Mon Sep 17 00:00:00 2001 From: Daniel Agar Date: Mon, 27 Dec 2021 13:19:15 -0500 Subject: [PATCH] I2CSPIDriverBase: sensor start failure ERROR if internal, WARN if external --- boards/cuav/x7pro/init/rc.board_sensors | 2 +- boards/px4/fmu-v4/init/rc.board_sensors | 2 +- boards/px4/fmu-v4pro/init/rc.board_sensors | 2 +- platforms/common/i2c_spi_buses.cpp | 9 ++++++++- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/boards/cuav/x7pro/init/rc.board_sensors b/boards/cuav/x7pro/init/rc.board_sensors index 74f565b176..da9a45c93c 100644 --- a/boards/cuav/x7pro/init/rc.board_sensors +++ b/boards/cuav/x7pro/init/rc.board_sensors @@ -5,7 +5,7 @@ board_adc start # SPI1 -if ! icm20689 -s -b 1 -R 2 start +if ! icm20689 -s -b 1 -R 2 -q start then adis16470 -s -b 1 -R 2 start fi diff --git a/boards/px4/fmu-v4/init/rc.board_sensors b/boards/px4/fmu-v4/init/rc.board_sensors index 2754463ebb..4f6717acb9 100644 --- a/boards/px4/fmu-v4/init/rc.board_sensors +++ b/boards/px4/fmu-v4/init/rc.board_sensors @@ -9,7 +9,7 @@ board_adc start ms5611 -s start # hmc5883 internal SPI bus is rotated 90 deg yaw -if ! hmc5883 -T -s -R 2 start +if ! hmc5883 -T -s -R 2 -q start then # lis3mdl internal SPI bus is rotated 90 deg yaw lis3mdl -s start diff --git a/boards/px4/fmu-v4pro/init/rc.board_sensors b/boards/px4/fmu-v4pro/init/rc.board_sensors index c687c96a4c..7906afc7e2 100644 --- a/boards/px4/fmu-v4pro/init/rc.board_sensors +++ b/boards/px4/fmu-v4pro/init/rc.board_sensors @@ -4,7 +4,7 @@ #------------------------------------------------------------------------------ rgbled start -I -rgbled_ncp5623c start -I +rgbled_ncp5623c start -I -q board_adc start diff --git a/platforms/common/i2c_spi_buses.cpp b/platforms/common/i2c_spi_buses.cpp index e1e1e5a586..91f4c6844f 100644 --- a/platforms/common/i2c_spi_buses.cpp +++ b/platforms/common/i2c_spi_buses.cpp @@ -696,7 +696,14 @@ int I2CSPIDriverBase::module_start(const BusCLIArguments &cli, BusInstanceIterat } if (!started && !cli.quiet_start) { - PX4_WARN("%s: no instance started (no device on bus?)", px4_get_taskname()); + static constexpr char no_instance_started[] {"no instance started (no device on bus?)"}; + + if (iterator.external()) { + PX4_WARN("%s: %s", px4_get_taskname(), no_instance_started); + + } else { + PX4_ERR("%s: %s", px4_get_taskname(), no_instance_started); + } #if defined(CONFIG_I2C)