From 19964d56edc7b74d06d50e52ebb5fd26ce6f3371 Mon Sep 17 00:00:00 2001 From: Julian Oes Date: Mon, 11 Sep 2023 18:09:03 +1200 Subject: [PATCH] fmu-6x: Use i2c_launcher by default This switches all SENS_EN_INAXXX params to 0 by default and instead uses the i2c_launcher command. However, if any one the SENS_EN_INAXXX param is set, it no longer tries to auto-configure it. Signed-off-by: Julian Oes --- boards/px4/fmu-v6x/default.px4board | 3 ++- boards/px4/fmu-v6x/init/rc.board_defaults | 4 +++- boards/px4/fmu-v6x/init/rc.board_sensors | 19 +++++++++++++++---- boards/px4/fmu-v6x/nuttx-config/nsh/defconfig | 2 +- 4 files changed, 21 insertions(+), 7 deletions(-) diff --git a/boards/px4/fmu-v6x/default.px4board b/boards/px4/fmu-v6x/default.px4board index 37206cbdacd..eb3fc220f6d 100644 --- a/boards/px4/fmu-v6x/default.px4board +++ b/boards/px4/fmu-v6x/default.px4board @@ -83,8 +83,9 @@ CONFIG_SYSTEMCMDS_BSONDUMP=y CONFIG_SYSTEMCMDS_DMESG=y CONFIG_SYSTEMCMDS_GPIO=y CONFIG_SYSTEMCMDS_HARDFAULT_LOG=y -CONFIG_SYSTEMCMDS_I2CDETECT=y CONFIG_SYSTEMCMDS_I2C_LAUNCHER=y +CONFIG_USER_I2C_LAUNCHER=y +CONFIG_SYSTEMCMDS_I2CDETECT=y CONFIG_SYSTEMCMDS_LED_CONTROL=y CONFIG_SYSTEMCMDS_MFT=y CONFIG_SYSTEMCMDS_MTD=y diff --git a/boards/px4/fmu-v6x/init/rc.board_defaults b/boards/px4/fmu-v6x/init/rc.board_defaults index b94e5f78e67..93acc0fbd29 100644 --- a/boards/px4/fmu-v6x/init/rc.board_defaults +++ b/boards/px4/fmu-v6x/init/rc.board_defaults @@ -12,9 +12,11 @@ param set-default MAV_2_RATE 100000 param set-default MAV_2_REMOTE_PRT 14550 param set-default MAV_2_UDP_PRT 14550 +# By disabling all 3 INA modules, we use the +# i2c_launcher instead. param set-default SENS_EN_INA238 0 param set-default SENS_EN_INA228 0 -param set-default SENS_EN_INA226 1 +param set-default SENS_EN_INA226 0 if ver hwtypecmp V6X009010 V6X010010 then diff --git a/boards/px4/fmu-v6x/init/rc.board_sensors b/boards/px4/fmu-v6x/init/rc.board_sensors index 8762d267fd7..6a47d72f0e7 100644 --- a/boards/px4/fmu-v6x/init/rc.board_sensors +++ b/boards/px4/fmu-v6x/init/rc.board_sensors @@ -3,6 +3,7 @@ # PX4 FMUv6X specific board sensors init #------------------------------------------------------------------------------ set HAVE_PM2 yes +set INA_CONFIGURED no if ver hwtypecmp V6X005000 V6X005001 V6X005003 V6X005004 then @@ -25,6 +26,8 @@ then then ina226 -X -b 2 -t 2 -k start fi + + set INA_CONFIGURED yes fi if param compare SENS_EN_INA228 1 @@ -35,6 +38,8 @@ then then ina228 -X -b 2 -t 2 -k start fi + + set INA_CONFIGURED yes fi if param compare SENS_EN_INA238 1 @@ -45,6 +50,8 @@ then then ina238 -X -b 2 -t 2 -k start fi + + set INA_CONFIGURED yes fi #Start Auterion Power Module selector for Skynode boards @@ -52,11 +59,14 @@ if ver hwtypecmp V6X009010 V6X010010 then pm_selector_auterion start else - # INA226, INA228, INA238 auto-start - i2c_launcher start -b 1 - if [ $HAVE_PM2 = yes ] + if [ $INA_CONFIGURED = no ] then - i2c_launcher start -b 2 + # INA226, INA228, INA238 auto-start + i2c_launcher start -b 1 + if [ $HAVE_PM2 = yes ] + then + i2c_launcher start -b 2 + fi fi fi @@ -151,4 +161,5 @@ fi # Baro on I2C3 ms5611 -X start +unset INA_CONFIGURED unset HAVE_PM2 diff --git a/boards/px4/fmu-v6x/nuttx-config/nsh/defconfig b/boards/px4/fmu-v6x/nuttx-config/nsh/defconfig index e5f02a46a75..87c8a46f04d 100644 --- a/boards/px4/fmu-v6x/nuttx-config/nsh/defconfig +++ b/boards/px4/fmu-v6x/nuttx-config/nsh/defconfig @@ -207,7 +207,6 @@ CONFIG_SCHED_INSTRUMENTATION_SWITCH=y CONFIG_SCHED_LPWORK=y CONFIG_SCHED_LPWORKPRIORITY=50 CONFIG_SCHED_LPWORKSTACKSIZE=1632 -CONFIG_SCHED_WAITPID=y CONFIG_SDMMC2_SDIO_PULLUP=y CONFIG_SEM_PREALLOCHOLDERS=32 CONFIG_SERIAL_IFLOWCONTROL_WATERMARKS=y @@ -287,6 +286,7 @@ CONFIG_SYSTEM_CDCACM=y CONFIG_SYSTEM_DHCPC_RENEW=y CONFIG_SYSTEM_NSH=y CONFIG_SYSTEM_PING=y +CONFIG_SYSTEM_SYSTEM=y CONFIG_TASK_NAME_SIZE=24 CONFIG_UART4_BAUD=57600 CONFIG_UART4_RXBUFSIZE=600