From b4555db0e7ff47bfbef03774aaec9d31c8cedada Mon Sep 17 00:00:00 2001 From: Daniel Agar Date: Fri, 10 Mar 2023 15:00:35 -0500 Subject: [PATCH] WIP: px4log --- ROMFS/CMakeLists.txt | 2 +- ROMFS/cannode/init.d/rcS | 6 +- ROMFS/px4fmu_common/.nshrc | 8 + ROMFS/px4fmu_common/CMakeLists.txt | 2 + .../init.d-posix/px4-rc.simulator | 32 +-- ROMFS/px4fmu_common/init.d-posix/rc.replay | 4 +- ROMFS/px4fmu_common/init.d-posix/rcS | 24 +- ROMFS/px4fmu_common/init.d/CMakeLists.txt | 1 + ROMFS/px4fmu_common/init.d/rc.airship_apps | 4 +- ROMFS/px4fmu_common/init.d/rc.autostart_ext | 2 +- ROMFS/px4fmu_common/init.d/rc.balloon_apps | 4 +- ROMFS/px4fmu_common/init.d/rc.mc_apps | 4 +- ROMFS/px4fmu_common/init.d/rc.sysinit | 3 + ROMFS/px4fmu_common/init.d/rc.vehicle_setup | 2 +- ROMFS/px4fmu_common/init.d/rcS | 37 ++- ROMFS/px4fmu_test/init.d/rcS | 26 +- Tools/px4airframes/rcout.py | 4 +- Tools/px_romfs_pruner.py | 2 +- Tools/serial/rc.serial.jinja | 2 +- Tools/serial/rc.serial_port.jinja | 2 +- boards/airmind/mindpx-v2/default.px4board | 2 + .../mindpx-v2/nuttx-config/nsh/defconfig | 1 + boards/ark/can-flow/default.px4board | 2 + .../ark/can-flow/nuttx-config/nsh/defconfig | 1 + boards/ark/can-gps/default.px4board | 2 + boards/ark/can-gps/nuttx-config/nsh/defconfig | 1 + boards/ark/can-rtk-gps/default.px4board | 2 + .../can-rtk-gps/nuttx-config/nsh/defconfig | 1 + boards/ark/cannode/default.px4board | 2 + boards/ark/cannode/nuttx-config/nsh/defconfig | 1 + boards/ark/fmu-v6x/default.px4board | 2 + boards/ark/fmu-v6x/nuttx-config/nsh/defconfig | 1 + boards/ark/fmu-v6x/src/board_config.h | 1 - boards/atl/mantis-edu/default.px4board | 2 + .../atl/mantis-edu/nuttx-config/nsh/defconfig | 1 + boards/atl/mantis-edu/src/board_config.h | 1 - boards/av/x-v1/default.px4board | 2 + boards/av/x-v1/nuttx-config/nsh/defconfig | 1 + boards/av/x-v1/src/board_config.h | 1 - boards/beaglebone/blue/default.px4board | 2 + boards/bitcraze/crazyflie/default.px4board | 2 + .../crazyflie/nuttx-config/nsh/defconfig | 1 + boards/bitcraze/crazyflie/src/board_config.h | 3 +- boards/bitcraze/crazyflie21/default.px4board | 2 + .../crazyflie21/nuttx-config/nsh/defconfig | 1 + .../bitcraze/crazyflie21/src/board_config.h | 3 +- boards/cuav/can-gps-v1/default.px4board | 2 + .../can-gps-v1/nuttx-config/nsh/defconfig | 1 + boards/cuav/nora/default.px4board | 2 + boards/cuav/nora/nuttx-config/nsh/defconfig | 1 + boards/cuav/nora/src/board_config.h | 1 - boards/cuav/x7pro/default.px4board | 2 + boards/cuav/x7pro/nuttx-config/nsh/defconfig | 1 + boards/cuav/x7pro/nuttx-config/test/defconfig | 1 + boards/cuav/x7pro/src/board_config.h | 1 - boards/cubepilot/cubeorange/default.px4board | 2 + .../cubeorange/nuttx-config/nsh/defconfig | 1 + .../cubeorange/nuttx-config/test/defconfig | 1 + .../cubepilot/cubeorange/src/board_config.h | 1 - .../cubepilot/cubeorangeplus/default.px4board | 2 + .../cubeorangeplus/nuttx-config/nsh/defconfig | 1 + .../nuttx-config/test/defconfig | 1 + .../cubeorangeplus/src/board_config.h | 1 - boards/cubepilot/cubeyellow/default.px4board | 2 + .../cubeyellow/nuttx-config/nsh/defconfig | 1 + .../cubepilot/cubeyellow/src/board_config.h | 1 - .../diatone/mamba-f405-mk2/default.px4board | 2 + .../mamba-f405-mk2/nuttx-config/nsh/defconfig | 1 + .../diatone/mamba-f405-mk2/src/board_config.h | 3 - boards/emlid/navio2/default.px4board | 2 + boards/flywoo/gn-f405/default.px4board | 2 + .../flywoo/gn-f405/nuttx-config/nsh/defconfig | 1 + boards/flywoo/gn-f405/src/board_config.h | 3 +- boards/freefly/can-rtk-gps/default.px4board | 2 + .../can-rtk-gps/nuttx-config/nsh/defconfig | 1 + boards/freefly/can-rtk-gps/src/board_config.h | 1 - boards/holybro/can-gps-v1/default.px4board | 2 + .../can-gps-v1/nuttx-config/nsh/defconfig | 1 + boards/holybro/durandal-v1/default.px4board | 2 + .../durandal-v1/nuttx-config/nsh/defconfig | 1 + boards/holybro/durandal-v1/src/board_config.h | 1 - boards/holybro/kakutef7/default.px4board | 2 + .../kakutef7/nuttx-config/nsh/defconfig | 1 + boards/holybro/kakuteh7/default.px4board | 2 + .../kakuteh7/nuttx-config/nsh/defconfig | 1 + boards/holybro/kakuteh7/src/board_config.h | 1 - boards/holybro/kakuteh7mini/default.px4board | 2 + .../kakuteh7mini/nuttx-config/nsh/defconfig | 1 + .../holybro/kakuteh7mini/src/board_config.h | 1 - boards/holybro/kakuteh7v2/default.px4board | 2 + .../kakuteh7v2/nuttx-config/nsh/defconfig | 1 + boards/holybro/kakuteh7v2/src/board_config.h | 1 - boards/holybro/pix32v5/default.px4board | 2 + .../pix32v5/nuttx-config/nsh/defconfig | 1 + boards/holybro/pix32v5/src/board_config.h | 1 - boards/matek/gnss-m9n-f4/default.px4board | 2 + .../gnss-m9n-f4/nuttx-config/nsh/defconfig | 1 + boards/matek/gnss-m9n-f4/src/board_config.h | 1 - boards/matek/h743-mini/default.px4board | 2 + .../h743-mini/nuttx-config/nsh/defconfig | 1 + boards/matek/h743-mini/src/board_config.h | 1 - boards/matek/h743-slim/default.px4board | 2 + .../h743-slim/nuttx-config/nsh/defconfig | 1 + boards/matek/h743-slim/src/board_config.h | 1 - boards/matek/h743/default.px4board | 2 + boards/matek/h743/nuttx-config/nsh/defconfig | 1 + boards/matek/h743/src/board_config.h | 1 - boards/modalai/fc-v1/default.px4board | 2 + .../modalai/fc-v1/nuttx-config/nsh/defconfig | 1 + boards/modalai/fc-v1/src/board_config.h | 1 - boards/modalai/fc-v2/default.px4board | 2 + .../modalai/fc-v2/nuttx-config/nsh/defconfig | 1 + boards/modalai/fc-v2/src/board_config.h | 1 - boards/modalai/voxl2/default.px4board | 2 + boards/mro/ctrl-zero-classic/default.px4board | 2 + .../nuttx-config/nsh/defconfig | 1 + .../mro/ctrl-zero-classic/src/board_config.h | 1 - boards/mro/ctrl-zero-f7-oem/default.px4board | 2 + .../nuttx-config/nsh/defconfig | 1 + .../mro/ctrl-zero-f7-oem/src/board_config.h | 1 - boards/mro/ctrl-zero-f7/default.px4board | 2 + .../ctrl-zero-f7/nuttx-config/nsh/defconfig | 1 + boards/mro/ctrl-zero-f7/src/board_config.h | 1 - boards/mro/ctrl-zero-h7-oem/default.px4board | 2 + .../nuttx-config/nsh/defconfig | 1 + .../mro/ctrl-zero-h7-oem/src/board_config.h | 1 - boards/mro/ctrl-zero-h7/default.px4board | 2 + .../ctrl-zero-h7/nuttx-config/nsh/defconfig | 1 + boards/mro/ctrl-zero-h7/src/board_config.h | 1 - boards/mro/pixracerpro/default.px4board | 2 + .../pixracerpro/nuttx-config/nsh/defconfig | 1 + boards/mro/pixracerpro/src/board_config.h | 1 - boards/mro/x21-777/default.px4board | 2 + boards/mro/x21-777/nuttx-config/nsh/defconfig | 1 + boards/mro/x21-777/src/board_config.h | 1 - boards/mro/x21/default.px4board | 2 + boards/mro/x21/nuttx-config/nsh/defconfig | 1 + boards/nxp/fmuk66-e/default.px4board | 2 + .../nxp/fmuk66-e/nuttx-config/nsh/defconfig | 1 + .../fmuk66-e/nuttx-config/socketcan/defconfig | 1 + boards/nxp/fmuk66-v3/default.px4board | 2 + .../nxp/fmuk66-v3/nuttx-config/nsh/defconfig | 1 + .../nuttx-config/socketcan/defconfig | 1 + .../nxp/fmuk66-v3/nuttx-config/test/defconfig | 1 + boards/nxp/fmurt1062-v1/default.px4board | 2 + .../fmurt1062-v1/nuttx-config/nsh/defconfig | 1 + boards/nxp/fmurt1062-v1/src/board_config.h | 1 - boards/nxp/mr-canhubk3/default.px4board | 2 + .../mr-canhubk3/nuttx-config/nsh/defconfig | 1 + .../nuttx-config/sysview/defconfig | 1 + boards/nxp/mr-canhubk3/src/board_config.h | 1 - boards/nxp/ucans32k146/default.px4board | 2 + .../ucans32k146/nuttx-config/nsh/defconfig | 1 + boards/omnibus/f4sd/default.px4board | 2 + .../omnibus/f4sd/nuttx-config/nsh/defconfig | 1 + boards/omnibus/f4sd/src/board_config.h | 3 +- boards/px4/fmu-v2/default.px4board | 2 + boards/px4/fmu-v2/nuttx-config/nsh/defconfig | 1 + boards/px4/fmu-v3/default.px4board | 2 + boards/px4/fmu-v3/nuttx-config/nsh/defconfig | 1 + boards/px4/fmu-v4/default.px4board | 2 + boards/px4/fmu-v4/nuttx-config/nsh/defconfig | 1 + boards/px4/fmu-v4/nuttx-config/test/defconfig | 1 + boards/px4/fmu-v4pro/default.px4board | 2 + .../px4/fmu-v4pro/nuttx-config/nsh/defconfig | 1 + .../px4/fmu-v4pro/nuttx-config/test/defconfig | 1 + boards/px4/fmu-v5/default.px4board | 2 + .../fmu-v5/nuttx-config/cryptotest/defconfig | 1 + .../px4/fmu-v5/nuttx-config/cyphal/defconfig | 1 + .../px4/fmu-v5/nuttx-config/debug/defconfig | 1 + boards/px4/fmu-v5/nuttx-config/nsh/defconfig | 1 + .../fmu-v5/nuttx-config/protected/defconfig | 1 + .../fmu-v5/nuttx-config/stackcheck/defconfig | 1 + boards/px4/fmu-v5/nuttx-config/test/defconfig | 1 + boards/px4/fmu-v5/src/board_config.h | 1 - boards/px4/fmu-v5x/default.px4board | 2 + boards/px4/fmu-v5x/nuttx-config/nsh/defconfig | 1 + .../px4/fmu-v5x/nuttx-config/test/defconfig | 1 + boards/px4/fmu-v5x/src/board_config.h | 1 - boards/px4/fmu-v5x/src/init.cpp | 13 +- boards/px4/fmu-v5x/src/manifest.c | 8 +- boards/px4/fmu-v5x/src/sdio.c | 10 +- boards/px4/fmu-v6c/default.px4board | 2 + boards/px4/fmu-v6c/nuttx-config/nsh/defconfig | 1 + boards/px4/fmu-v6c/src/board_config.h | 1 - boards/px4/fmu-v6u/default.px4board | 2 + boards/px4/fmu-v6u/nuttx-config/nsh/defconfig | 1 + boards/px4/fmu-v6u/src/board_config.h | 1 - boards/px4/fmu-v6x/default.px4board | 2 + boards/px4/fmu-v6x/nuttx-config/nsh/defconfig | 1 + boards/px4/fmu-v6x/src/board_config.h | 1 - boards/px4/raspberrypi/default.px4board | 2 + boards/px4/sitl/default.px4board | 2 + boards/raspberrypi/pico/default.px4board | 2 + .../pico/nuttx-config/nsh/defconfig | 1 + boards/raspberrypi/pico/src/board_config.h | 3 +- boards/scumaker/pilotpi/default.px4board | 2 + .../smartap-airlink/default.px4board | 2 + .../nuttx-config/nsh/defconfig | 1 + .../smartap-airlink/src/board_config.h | 1 - boards/spracing/h7extreme/default.px4board | 2 + .../h7extreme/nuttx-config/nsh/defconfig | 1 + boards/spracing/h7extreme/src/board_config.h | 1 - boards/thepeach/k1/default.px4board | 2 + boards/thepeach/k1/nuttx-config/nsh/defconfig | 1 + boards/thepeach/r1/default.px4board | 2 + boards/thepeach/r1/nuttx-config/nsh/defconfig | 1 + boards/uvify/core/default.px4board | 2 + boards/uvify/core/nuttx-config/nsh/defconfig | 1 + boards/uvify/core/src/board_config.h | 3 +- boards/uvify/core/src/init.c | 2 +- msg/LogMessage.msg | 2 +- platforms/common/CMakeLists.txt | 1 - platforms/common/i2c_spi_buses.cpp | 29 +-- .../px4_platform_common/console_buffer.h | 99 -------- .../common/include/px4_platform_common/log.h | 1 - .../include/px4_platform_common/log_history.h | 68 ----- .../include/px4_platform_common/module.h | 4 +- platforms/common/px4_log.cpp | 136 +--------- platforms/common/px4_log_history.cpp | 147 ----------- platforms/common/shutdown.cpp | 6 +- platforms/common/uORB/Subscription.hpp | 2 + .../common/uORB/SubscriptionBlocking.hpp | 2 + platforms/nuttx/Debug/PX4 | 17 -- platforms/nuttx/src/px4/common/CMakeLists.txt | 1 - .../nuttx/src/px4/common/console_buffer.cpp | 239 ------------------ .../src/px4/common/console_buffer_usr.cpp | 65 ----- platforms/nuttx/src/px4/common/px4_init.cpp | 18 +- .../src/px4/common/px4_protected_layers.cmake | 1 - .../nuttx/src/px4/rpi/rpi_common/spi/spi.cpp | 2 +- .../src/px4/stm/stm32_common/spi/spi.cpp | 3 +- .../ros2/include/px4_platform_common/module.h | 2 +- .../broadcom/afbrs50/AFBRS50.cpp | 14 +- src/modules/logger/logger.cpp | 63 ++--- src/modules/logger/logger.h | 6 +- src/modules/mavlink/mavlink_main.cpp | 23 +- src/systemcmds/dmesg/Kconfig | 12 - src/systemcmds/hardfault_log/hardfault_log.c | 99 +++----- src/systemcmds/hist/Kconfig | 5 - .../{hist => px4log}/CMakeLists.txt | 13 +- src/systemcmds/px4log/Kconfig | 12 + .../{hist/hist.cpp => px4log/px4log.cpp} | 63 +++-- .../{dmesg => px4log_tail}/CMakeLists.txt | 15 +- src/systemcmds/px4log_tail/Kconfig | 12 + .../dmesg.cpp => px4log_tail/px4log_tail.cpp} | 104 ++++---- 245 files changed, 573 insertions(+), 1185 deletions(-) create mode 100644 ROMFS/px4fmu_common/.nshrc create mode 100644 ROMFS/px4fmu_common/init.d/rc.sysinit delete mode 100644 platforms/common/include/px4_platform_common/console_buffer.h delete mode 100644 platforms/common/include/px4_platform_common/log_history.h delete mode 100644 platforms/common/px4_log_history.cpp delete mode 100644 platforms/nuttx/src/px4/common/console_buffer.cpp delete mode 100644 platforms/nuttx/src/px4/common/console_buffer_usr.cpp delete mode 100644 src/systemcmds/dmesg/Kconfig delete mode 100644 src/systemcmds/hist/Kconfig rename src/systemcmds/{hist => px4log}/CMakeLists.txt (91%) create mode 100644 src/systemcmds/px4log/Kconfig rename src/systemcmds/{hist/hist.cpp => px4log/px4log.cpp} (60%) rename src/systemcmds/{dmesg => px4log_tail}/CMakeLists.txt (88%) create mode 100644 src/systemcmds/px4log_tail/Kconfig rename src/systemcmds/{dmesg/dmesg.cpp => px4log_tail/px4log_tail.cpp} (53%) diff --git a/ROMFS/CMakeLists.txt b/ROMFS/CMakeLists.txt index 532b659b05..325faad53b 100644 --- a/ROMFS/CMakeLists.txt +++ b/ROMFS/CMakeLists.txt @@ -79,7 +79,7 @@ get_property(romfs_cmake_files GLOBAL PROPERTY PX4_ROMFS_CMAKE_FILES) get_property(romfs_copy_files GLOBAL PROPERTY PX4_ROMFS_FILES) get_property(module_config_files GLOBAL PROPERTY PX4_MODULE_CONFIG_FILES) file(GLOB jinja_templates ${PX4_SOURCE_DIR}/Tools/serial/*.jinja) -if (px4_constrained_flash_build) +if(px4_constrained_flash_build) set(added_arguments --constrained-flash) endif() if(PX4_ETHERNET) diff --git a/ROMFS/cannode/init.d/rcS b/ROMFS/cannode/init.d/rcS index 0d9da3a10a..39c3ed9102 100644 --- a/ROMFS/cannode/init.d/rcS +++ b/ROMFS/cannode/init.d/rcS @@ -51,7 +51,7 @@ fi set BOARD_ARCH_RC_DEFAULTS ${R}etc/init.d/rc.board_arch_defaults if [ -f $BOARD_ARCH_RC_DEFAULTS ] then - echo "Board architecture defaults: ${BOARD_ARCH_RC_DEFAULTS}" + px4log "Board architecture defaults: ${BOARD_ARCH_RC_DEFAULTS}" . $BOARD_ARCH_RC_DEFAULTS fi unset BOARD_ARCH_RC_DEFAULTS @@ -62,7 +62,7 @@ unset BOARD_ARCH_RC_DEFAULTS set BOARD_RC_DEFAULTS ${R}etc/init.d/rc.board_defaults if [ -f $BOARD_RC_DEFAULTS ] then - echo "Board defaults: ${BOARD_RC_DEFAULTS}" + px4log "Board defaults: ${BOARD_RC_DEFAULTS}" . $BOARD_RC_DEFAULTS fi unset BOARD_RC_DEFAULTS @@ -79,7 +79,7 @@ rgbled_ncp5623c start -X -q set BOARD_RC_SENSORS ${R}etc/init.d/rc.board_sensors if [ -f $BOARD_RC_SENSORS ] then - echo "Board sensors: ${BOARD_RC_SENSORS}" + px4log "Board sensors: ${BOARD_RC_SENSORS}" . $BOARD_RC_SENSORS fi unset BOARD_RC_SENSORS diff --git a/ROMFS/px4fmu_common/.nshrc b/ROMFS/px4fmu_common/.nshrc new file mode 100644 index 0000000000..d5a58da401 --- /dev/null +++ b/ROMFS/px4fmu_common/.nshrc @@ -0,0 +1,8 @@ +#!/bin/sh + +px4log_tail & + +# +# Print full system version. +# +ver all diff --git a/ROMFS/px4fmu_common/CMakeLists.txt b/ROMFS/px4fmu_common/CMakeLists.txt index 281e5a87a0..ebe47059b8 100644 --- a/ROMFS/px4fmu_common/CMakeLists.txt +++ b/ROMFS/px4fmu_common/CMakeLists.txt @@ -31,6 +31,8 @@ # ############################################################################ +px4_add_romfs_files(.nshrc) + add_subdirectory(init.d) # TODO: make this configurable from the board config, or better combine if("${PX4_BOARD}" MATCHES "sitl") diff --git a/ROMFS/px4fmu_common/init.d-posix/px4-rc.simulator b/ROMFS/px4fmu_common/init.d-posix/px4-rc.simulator index 1f4693d4c1..3187a4c986 100644 --- a/ROMFS/px4fmu_common/init.d-posix/px4-rc.simulator +++ b/ROMFS/px4fmu_common/init.d-posix/px4-rc.simulator @@ -6,7 +6,7 @@ param set-default IMU_INTEG_RATE 250 if [ "$PX4_SIMULATOR" = "sihsim" ] || [ "$(param show -q SYS_AUTOSTART)" -eq "0" ]; then - echo "INFO [init] SIH simulator" + px4log "INFO [init] SIH simulator" if [ -n "${PX4_HOME_LAT}" ]; then param set SIH_LOC_LAT0 ${PX4_HOME_LAT} @@ -32,7 +32,7 @@ if [ "$PX4_SIMULATOR" = "sihsim" ] || [ "$(param show -q SYS_AUTOSTART)" -eq "0" fi else - echo "ERROR [init] simulator_sih failed to start" + px4log "ERROR [init] simulator_sih failed to start" exit 1 fi @@ -54,7 +54,7 @@ elif [ "$PX4_SIMULATOR" = "gz" ] || [ "$(param show -q SIM_GZ_EN)" -eq "1" ]; th gz_command="gz" gz_sub_command="sim" else - echo "ERROR [init] Gazebo gz please install gz-garden" + px4log "ERROR [init] Gazebo gz please install gz-garden" exit 1 fi @@ -64,7 +64,7 @@ elif [ "$PX4_SIMULATOR" = "gz" ] || [ "$(param show -q SIM_GZ_EN)" -eq "1" ]; th # shellcheck disable=SC2153 if [ -z "${gz_world}" ] && [ -n "${PX4_GZ_WORLDS}" ] && [ -n "${PX4_GZ_WORLD}" ]; then - echo "INFO [init] starting gazebo with world: ${PX4_GZ_WORLDS}/${PX4_GZ_WORLD}.sdf" + px4log "INFO [init] starting gazebo with world: ${PX4_GZ_WORLDS}/${PX4_GZ_WORLD}.sdf" ${gz_command} ${gz_sub_command} --verbose=1 -r -s "${PX4_GZ_WORLDS}/${PX4_GZ_WORLD}.sdf" & @@ -74,7 +74,7 @@ elif [ "$PX4_SIMULATOR" = "gz" ] || [ "$(param show -q SIM_GZ_EN)" -eq "1" ]; th fi else - echo "INFO [init] gazebo already running world: ${gz_world}" + px4log "INFO [init] gazebo already running world: ${gz_world}" PX4_GZ_WORLD=${gz_world} fi @@ -85,10 +85,10 @@ elif [ "$PX4_SIMULATOR" = "gz" ] || [ "$(param show -q SIM_GZ_EN)" -eq "1" ]; th if [ -n "${PX4_GZ_MODEL_POSE}" ]; then # Clean potential input line formatting. model_pose="$( echo "${PX4_GZ_MODEL_POSE}" | sed -e 's/^[ \t]*//; s/[ \t]*$//; s/,/ /g; s/ / /g; s/ /,/g' )" - echo "INFO [init] PX4_GZ_MODEL_POSE set, spawning at: ${model_pose}" + px4log "INFO [init] PX4_GZ_MODEL_POSE set, spawning at: ${model_pose}" else - echo "WARN [init] PX4_GZ_MODEL_POSE not set, spawning at origin." + px4log "WARN [init] PX4_GZ_MODEL_POSE not set, spawning at origin." model_pose="0,0,0,0,0,0" fi @@ -112,7 +112,7 @@ elif [ "$PX4_SIMULATOR" = "gz" ] || [ "$(param show -q SIM_GZ_EN)" -eq "1" ]; th fi else - echo "ERROR [init] gz_bridge failed to start" + px4log "ERROR [init] gz_bridge failed to start" exit 1 fi @@ -138,13 +138,13 @@ elif [ "$PX4_SIMULATOR" = "gz" ] || [ "$(param show -q SIM_GZ_EN)" -eq "1" ]; th fi else - echo "ERROR [init] gz_bridge failed to start" + px4log "ERROR [init] gz_bridge failed to start" exit 1 fi elif [ -n "${PX4_SIM_MODEL}" ] && [ -z "${PX4_GZ_MODEL_NAME}" ] && [ -z "${PX4_GZ_MODEL}" ]; then - echo "WARN [init] PX4_GZ_MODEL_NAME or PX4_GZ_MODEL not set using PX4_SIM_MODEL." + px4log "WARN [init] PX4_GZ_MODEL_NAME or PX4_GZ_MODEL not set using PX4_SIM_MODEL." if gz_bridge start -m "${PX4_SIM_MODEL#*gz_}" -w "${PX4_GZ_WORLD}" -i "${px4_instance}"; then if param compare -s SENS_EN_BAROSIM 1 @@ -165,18 +165,18 @@ elif [ "$PX4_SIMULATOR" = "gz" ] || [ "$(param show -q SIM_GZ_EN)" -eq "1" ]; th fi else - echo "ERROR [init] gz_bridge failed to start" + px4log "ERROR [init] gz_bridge failed to start" exit 1 fi else - echo "ERROR [init] failed to pass only PX4_GZ_MODEL_NAME or PX4_GZ_MODEL" + px4log "ERROR [init] failed to pass only PX4_GZ_MODEL_NAME or PX4_GZ_MODEL" exit 1 fi elif [ "$PX4_SIM_MODEL" = "jmavsim_iris" ] || [ "$(param show -q SYS_AUTOSTART)" -eq "10017" ]; then - echo "INFO [init] jMAVSim simulator" + px4log "INFO [init] jMAVSim simulator" if jps | grep -i jmavsim; then kill "$(jps | grep -i jmavsim | awk '{print $1}')" || true @@ -198,15 +198,15 @@ else if [ -z "${PX4_SIM_HOSTNAME}" ]; then if [ -z "${PX4_SIM_HOST_ADDR}" ]; then - echo "INFO [init] PX4_SIM_HOSTNAME: localhost" + px4log "INFO [init] PX4_SIM_HOSTNAME: localhost" simulator_mavlink start -c $simulator_tcp_port else - echo "INFO [init] PX4_SIM_HOSTNAME: ${PX4_SIM_HOST_ADDR}" + px4log "INFO [init] PX4_SIM_HOSTNAME: ${PX4_SIM_HOST_ADDR}" simulator_mavlink start -t "${PX4_SIM_HOST_ADDR}" "${simulator_tcp_port}" fi else - echo "INFO [init] PX4_SIM_HOSTNAME: ${PX4_SIM_HOSTNAME}" + px4log "INFO [init] PX4_SIM_HOSTNAME: ${PX4_SIM_HOSTNAME}" simulator_mavlink start -h "${PX4_SIM_HOSTNAME}" "${simulator_tcp_port}" fi diff --git a/ROMFS/px4fmu_common/init.d-posix/rc.replay b/ROMFS/px4fmu_common/init.d-posix/rc.replay index ea0510280f..052391e142 100644 --- a/ROMFS/px4fmu_common/init.d-posix/rc.replay +++ b/ROMFS/px4fmu_common/init.d-posix/rc.replay @@ -4,12 +4,12 @@ # shellcheck disable=SC2154 if [ ! -f ${replay} ]; then - echo "Invalid replay log file ${replay}" + px4log "Invalid replay log file ${replay}" exit 1 fi if [ ! -f replay_params.txt ]; then - echo "Creating $(pwd)/replay_params.txt" + px4log "Creating $(pwd)/replay_params.txt" ulog_params -i "${replay}" -l ' ' | grep -e '^EKF2' > replay_params.txt fi diff --git a/ROMFS/px4fmu_common/init.d-posix/rcS b/ROMFS/px4fmu_common/init.d-posix/rcS index 3b7210d89f..dff13bc275 100644 --- a/ROMFS/px4fmu_common/init.d-posix/rcS +++ b/ROMFS/px4fmu_common/init.d-posix/rcS @@ -13,6 +13,8 @@ set +e #search path for sourcing px4-rc.* PATH="$PATH:${R}etc/init.d-posix" +px4log_tail & + # # Main SITL startup script # @@ -40,7 +42,7 @@ then elif [ -n "$PX4_SYS_AUTOSTART" ] then - echo "env SYS_AUTOSTART: ${PX4_SYS_AUTOSTART}" + px4log "env SYS_AUTOSTART: ${PX4_SYS_AUTOSTART}" SYS_AUTOSTART=${PX4_SYS_AUTOSTART} elif [ "$PX4_SIM_MODEL" = "none" ] || [ -z $PX4_SIM_MODEL ] @@ -55,11 +57,11 @@ then # shellcheck disable=SC2012 REQUESTED_AUTOSTART=$(ls "${R}etc/init.d-posix/airframes" | sed -n 's/^\([0-9][0-9]*\)_'${PX4_SIM_MODEL}'$/\1/p') if [ -z "$REQUESTED_AUTOSTART" ]; then - echo "ERROR [init] Unknown model $PX4_SIM_MODEL (not found by name on ${R}etc/init.d-posix/airframes)" + px4log "ERROR [init] Unknown model $PX4_SIM_MODEL (not found by name on ${R}etc/init.d-posix/airframes)" exit 1 else SYS_AUTOSTART=$REQUESTED_AUTOSTART - echo "INFO [init] found model autostart file as SYS_AUTOSTART=$REQUESTED_AUTOSTART" + px4log "INFO [init] found model autostart file as SYS_AUTOSTART=$REQUESTED_AUTOSTART" fi fi @@ -72,7 +74,7 @@ if [ -f $PARAM_FILE ]; then if ! param import then - echo "ERROR [init] param import failed" + px4log "ERROR [init] param import failed" bsondump $PARAM_FILE @@ -82,7 +84,7 @@ if [ -f $PARAM_FILE ]; then # try importing from backup file if [ -f $PARAM_BACKUP_FILE ] then - echo "[init] importing from parameter backup" + px4log "[init] importing from parameter backup" # dump current backup file contents for comparison bsondump $PARAM_BACKUP_FILE @@ -97,7 +99,7 @@ if [ -f $PARAM_FILE ]; then fi elif [ -f $PARAM_BACKUP_FILE ]; then - echo "ERROR [init] primary param file $PARAM_FILE unavailable, using backup $PARAM_BACKUP_FILE" + px4log "ERROR [init] primary param file $PARAM_FILE unavailable, using backup $PARAM_BACKUP_FILE" param import $PARAM_BACKUP_FILE fi @@ -191,19 +193,19 @@ param set-default COM_LOW_BAT_ACT 2 # Adapt timeout parameters if simulation runs faster or slower than realtime. if [ -n "$PX4_SIM_SPEED_FACTOR" ]; then COM_DL_LOSS_T_LONGER=$(echo "$PX4_SIM_SPEED_FACTOR * 10" | bc) - echo "COM_DL_LOSS_T set to $COM_DL_LOSS_T_LONGER" + px4log "COM_DL_LOSS_T set to $COM_DL_LOSS_T_LONGER" param set COM_DL_LOSS_T $COM_DL_LOSS_T_LONGER COM_RC_LOSS_T_LONGER=$(echo "$PX4_SIM_SPEED_FACTOR * 0.5" | bc) - echo "COM_RC_LOSS_T set to $COM_RC_LOSS_T_LONGER" + px4log "COM_RC_LOSS_T set to $COM_RC_LOSS_T_LONGER" param set COM_RC_LOSS_T $COM_RC_LOSS_T_LONGER COM_OF_LOSS_T_LONGER=$(echo "$PX4_SIM_SPEED_FACTOR * 0.5" | bc) - echo "COM_OF_LOSS_T set to $COM_OF_LOSS_T_LONGER" + px4log "COM_OF_LOSS_T set to $COM_OF_LOSS_T_LONGER" param set COM_OF_LOSS_T $COM_OF_LOSS_T_LONGER COM_OBC_LOSS_T_LONGER=$(echo "$PX4_SIM_SPEED_FACTOR * 5.0" | bc) - echo "COM_OBC_LOSS_T set to $COM_OBC_LOSS_T_LONGER" + px4log "COM_OBC_LOSS_T set to $COM_OBC_LOSS_T_LONGER" param set COM_OBC_LOSS_T $COM_OBC_LOSS_T_LONGER fi @@ -229,7 +231,7 @@ then elif [ ! -e "$autostart_file" ] && [ "$SYS_AUTOSTART" -ne "0" ] then - echo "Error: no autostart file found ($autostart_file)" + px4log "Error: no autostart file found ($autostart_file)" exit 1 fi diff --git a/ROMFS/px4fmu_common/init.d/CMakeLists.txt b/ROMFS/px4fmu_common/init.d/CMakeLists.txt index 3f19c22f01..1d6a3c6f75 100644 --- a/ROMFS/px4fmu_common/init.d/CMakeLists.txt +++ b/ROMFS/px4fmu_common/init.d/CMakeLists.txt @@ -46,6 +46,7 @@ px4_add_romfs_files( rc.logging rc.mc_apps rc.mc_defaults + rc.sysinit rcS rc.sensors rc.thermal_cal diff --git a/ROMFS/px4fmu_common/init.d/rc.airship_apps b/ROMFS/px4fmu_common/init.d/rc.airship_apps index 837a3a2161..0f64d67e72 100644 --- a/ROMFS/px4fmu_common/init.d/rc.airship_apps +++ b/ROMFS/px4fmu_common/init.d/rc.airship_apps @@ -20,10 +20,10 @@ then # if attitude_estimator_q start then - echo "WARN [init] Estimator LPE unsupported, EKF2 recommended." + px4log "WARN [init] Estimator LPE unsupported, EKF2 recommended." local_position_estimator start else - echo "ERROR [init] Estimator LPE not available. Using EKF2" + px4log "ERROR [init] Estimator LPE not available. Using EKF2" param set SYS_MC_EST_GROUP 2 param save reboot diff --git a/ROMFS/px4fmu_common/init.d/rc.autostart_ext b/ROMFS/px4fmu_common/init.d/rc.autostart_ext index 4291a3db37..7aa639f8ef 100644 --- a/ROMFS/px4fmu_common/init.d/rc.autostart_ext +++ b/ROMFS/px4fmu_common/init.d/rc.autostart_ext @@ -7,5 +7,5 @@ if [ -e ${SDCARD_EXT_PATH}/rc.autostart ] then . ${SDCARD_EXT_PATH}/rc.autostart else - echo "Error: ${SDCARD_EXT_PATH}/rc.autostart does not exist" + px4log "Error: ${SDCARD_EXT_PATH}/rc.autostart does not exist" fi diff --git a/ROMFS/px4fmu_common/init.d/rc.balloon_apps b/ROMFS/px4fmu_common/init.d/rc.balloon_apps index 2adb216ec1..20a2e3734c 100644 --- a/ROMFS/px4fmu_common/init.d/rc.balloon_apps +++ b/ROMFS/px4fmu_common/init.d/rc.balloon_apps @@ -17,10 +17,10 @@ then # if attitude_estimator_q start then - echo "WARN [init] Estimator LPE unsupported, EKF2 recommended." + px4log "WARN [init] Estimator LPE unsupported, EKF2 recommended." local_position_estimator start else - echo "ERROR [init] Estimator LPE not available. Using EKF2" + px4log "ERROR [init] Estimator LPE not available. Using EKF2" param set SYS_MC_EST_GROUP 2 param save reboot diff --git a/ROMFS/px4fmu_common/init.d/rc.mc_apps b/ROMFS/px4fmu_common/init.d/rc.mc_apps index 8158ab8b03..0b027df421 100644 --- a/ROMFS/px4fmu_common/init.d/rc.mc_apps +++ b/ROMFS/px4fmu_common/init.d/rc.mc_apps @@ -20,10 +20,10 @@ then # if attitude_estimator_q start then - echo "WARN [init] Estimator LPE unsupported, EKF2 recommended." + px4log "WARN [init] Estimator LPE unsupported, EKF2 recommended." local_position_estimator start else - echo "ERROR [init] Estimator LPE not available. Using EKF2" + px4log "ERROR [init] Estimator LPE not available. Using EKF2" param set SYS_MC_EST_GROUP 2 param save reboot diff --git a/ROMFS/px4fmu_common/init.d/rc.sysinit b/ROMFS/px4fmu_common/init.d/rc.sysinit new file mode 100644 index 0000000000..a5037002c1 --- /dev/null +++ b/ROMFS/px4fmu_common/init.d/rc.sysinit @@ -0,0 +1,3 @@ +#!/bin/sh +# Un comment and use set +e to ignore and set -e to enable 'exit on error control' +set +e diff --git a/ROMFS/px4fmu_common/init.d/rc.vehicle_setup b/ROMFS/px4fmu_common/init.d/rc.vehicle_setup index 4f8497bc19..227891d582 100644 --- a/ROMFS/px4fmu_common/init.d/rc.vehicle_setup +++ b/ROMFS/px4fmu_common/init.d/rc.vehicle_setup @@ -66,6 +66,6 @@ fi # if [ $VEHICLE_TYPE = none ] then - echo "No autostart ID found" + px4log "No autostart ID found" ekf2 start & fi diff --git a/ROMFS/px4fmu_common/init.d/rcS b/ROMFS/px4fmu_common/init.d/rcS index 04a07cfee9..dd389e20d1 100644 --- a/ROMFS/px4fmu_common/init.d/rcS +++ b/ROMFS/px4fmu_common/init.d/rcS @@ -36,11 +36,6 @@ set SDCARD_FORMAT no set STARTUP_TUNE 1 set VEHICLE_TYPE none -# -# Print full system version. -# -ver all - # # Try to mount the microSD card. # @@ -50,7 +45,7 @@ then then if [ -f "/fs/microsd/.format" ] then - echo "INFO [init] format /dev/mmcsd0 requested (/fs/microsd/.format)" + px4log "INFO [init] format /dev/mmcsd0 requested (/fs/microsd/.format)" set SDCARD_FORMAT yes rm /fs/microsd/.format umount /fs/microsd @@ -62,22 +57,22 @@ then if [ $SDCARD_AVAILABLE = no -o $SDCARD_FORMAT = yes ] then - echo "INFO [init] formatting /dev/mmcsd0" + px4log "INFO [init] formatting /dev/mmcsd0" set STARTUP_TUNE 15 # tune 15 = SD_ERROR (overridden to SD_INIT if format + mount succeeds) if mkfatfs -F 32 /dev/mmcsd0 then - echo "INFO [init] card formatted" + px4log "INFO [init] card formatted" if mount -t vfat /dev/mmcsd0 /fs/microsd then set SDCARD_AVAILABLE yes set STARTUP_TUNE 14 # tune 14 = SD_INIT else - echo "ERROR [init] card mount failed" + px4log "ERROR [init] card mount failed" fi else - echo "ERROR [init] format failed" + px4log "ERROR [init] format failed" fi fi @@ -127,7 +122,7 @@ else param select $PARAM_FILE if ! param import then - echo "ERROR [init] param import failed" + px4log "ERROR [init] param import failed" set STARTUP_TUNE 2 # tune 2 = ERROR_TUNE bsondump $PARAM_FILE @@ -140,7 +135,7 @@ else # try importing from backup file if [ -f $PARAM_BACKUP_FILE ] then - echo "[init] importing from parameter backup" + px4log "[init] importing from parameter backup" # dump current backup file contents for comparison bsondump $PARAM_BACKUP_FILE @@ -182,7 +177,7 @@ else set BOARD_ARCH_RC_DEFAULTS ${R}etc/init.d/rc.board_arch_defaults if [ -f $BOARD_ARCH_RC_DEFAULTS ] then - echo "Board architecture defaults: ${BOARD_ARCH_RC_DEFAULTS}" + px4log "Board architecture defaults: ${BOARD_ARCH_RC_DEFAULTS}" . $BOARD_ARCH_RC_DEFAULTS fi unset BOARD_ARCH_RC_DEFAULTS @@ -193,7 +188,7 @@ else set BOARD_RC_DEFAULTS ${R}etc/init.d/rc.board_defaults if [ -f $BOARD_RC_DEFAULTS ] then - echo "Board defaults: ${BOARD_RC_DEFAULTS}" + px4log "Board defaults: ${BOARD_RC_DEFAULTS}" . $BOARD_RC_DEFAULTS fi unset BOARD_RC_DEFAULTS @@ -211,7 +206,7 @@ else then set AUTOSTART_PATH etc/init.d/rc.autostart_ext else - echo "ERROR [init] SD card not mounted - trying to load airframe from ROMFS" + px4log "ERROR [init] SD card not mounted - trying to load airframe from ROMFS" fi fi . ${R}$AUTOSTART_PATH @@ -260,7 +255,7 @@ else # if [ -f $FCONFIG ] then - echo "Custom: ${FCONFIG}" + px4log "Custom: ${FCONFIG}" . $FCONFIG fi @@ -295,7 +290,7 @@ else if ! px4io start then - echo "PX4IO start failed" + px4log "PX4IO start failed" set STARTUP_TUNE 2 # tune 2 = ERROR_TUNE fi fi @@ -360,7 +355,7 @@ else set BOARD_RC_SENSORS ${R}etc/init.d/rc.board_sensors if [ -f $BOARD_RC_SENSORS ] then - echo "Board sensors: ${BOARD_RC_SENSORS}" + px4log "Board sensors: ${BOARD_RC_SENSORS}" . $BOARD_RC_SENSORS fi unset BOARD_RC_SENSORS @@ -401,7 +396,7 @@ else set BOARD_RC_MAVLINK ${R}etc/init.d/rc.board_mavlink if [ -f $BOARD_RC_MAVLINK ] then - echo "Board mavlink: ${BOARD_RC_MAVLINK}" + px4log "Board mavlink: ${BOARD_RC_MAVLINK}" . $BOARD_RC_MAVLINK fi unset BOARD_RC_MAVLINK @@ -476,7 +471,7 @@ else set BOARD_RC_EXTRAS ${R}etc/init.d/rc.board_extras if [ -f $BOARD_RC_EXTRAS ] then - echo "Board extras: ${BOARD_RC_EXTRAS}" + px4log "Board extras: ${BOARD_RC_EXTRAS}" . $BOARD_RC_EXTRAS fi unset BOARD_RC_EXTRAS @@ -486,7 +481,7 @@ else # if [ -f $FEXTRAS ] then - echo "Addons script: ${FEXTRAS}" + px4log "Addons script: ${FEXTRAS}" . $FEXTRAS fi diff --git a/ROMFS/px4fmu_test/init.d/rcS b/ROMFS/px4fmu_test/init.d/rcS index 2a146a3e83..be03800f5e 100644 --- a/ROMFS/px4fmu_test/init.d/rcS +++ b/ROMFS/px4fmu_test/init.d/rcS @@ -19,11 +19,11 @@ fi mount -t vfat /dev/mmcsd0 /fs/microsd if [ $? = 0 ] then - echo "[i] card mounted at /fs/microsd" + px4log "[i] card mounted at /fs/microsd" # Start playing the startup tune tune_control play -t 1 # tune 1 = STARTUP else - echo "[i] no microSD card found" + px4log "[i] no microSD card found" tune_control play error fi @@ -43,9 +43,9 @@ fi param select $PARAM_FILE if param load then - echo "[param] Loaded: $PARAM_FILE" + px4log "[param] Loaded: $PARAM_FILE" else - echo "[param] FAILED loading $PARAM_FILE" + px4log "[param] FAILED loading $PARAM_FILE" fi # @@ -53,7 +53,7 @@ fi # if [ -f $BOARD_RC ] then - echo "Board init: ${BOARD_RC}" + px4log "Board init: ${BOARD_RC}" . $BOARD_RC fi @@ -64,24 +64,24 @@ fi if px4io checkcrc $io_file then - echo "PX4IO CRC OK" + px4log "PX4IO CRC OK" else - echo "PX4IO CRC failure" + px4log "PX4IO CRC failure" tune_control play -t 16 # tune 16 = PROG_PX4IO if px4io update $io_file then if px4io start then - echo "PX4IO restart OK" + px4log "PX4IO restart OK" tune_control play-t 17 # tune 17 = PROG_PX4IO_OK else - echo "PX4IO restart failed" + px4log "PX4IO restart failed" tune_control play -t 18 # tune 18 = PROG_PX4IO_ERR set unit_test_failure 1 set unit_test_failure_list "${unit_test_failure_list} px4io_flash" fi else - echo "PX4IO update failed" + px4log "PX4IO update failed" tune_control play -t 18 # tune 18 = PROG_PX4IO_ERR set unit_test_failure 1 set unit_test_failure_list "${unit_test_failure_list} px4io_flash" @@ -90,7 +90,7 @@ fi if px4io start then - echo "PX4IO OK" + px4log "PX4IO OK" else set unit_test_failure 1 set unit_test_failure_list "${unit_test_failure_list} px4io_start" @@ -117,11 +117,11 @@ ver all if tests all then echo - echo "All Unit Tests PASSED" + px4log "All Unit Tests PASSED" led_control on -c green else echo - echo "Some Unit Tests FAILED" + px4log "Some Unit Tests FAILED" led_control on -c red fi diff --git a/Tools/px4airframes/rcout.py b/Tools/px4airframes/rcout.py index 9bc8747185..a677e1ce65 100644 --- a/Tools/px4airframes/rcout.py +++ b/Tools/px4airframes/rcout.py @@ -77,11 +77,11 @@ class RCOutput(): result += "\n" result += "if [ ${AIRFRAME} != none ]\n" result += "then\n" - result += "\techo \"Loading airframe: /etc/init.d/airframes/${AIRFRAME}\"\n" + result += "\tpx4log \"Loading airframe: /etc/init.d/airframes/${AIRFRAME}\"\n" result += "\t. /etc/init.d/airframes/${AIRFRAME}\n" if not post_start: result += "else\n" - result += "\techo \"ERROR [init] No file matches SYS_AUTOSTART value found in : /etc/init.d/airframes\"\n" + result += "\tpx4log \"ERROR [init] No file matches SYS_AUTOSTART value found in : /etc/init.d/airframes\"\n" # Reset the configuration result += "\tparam set SYS_AUTOSTART 0\n" result += "\ttone_alarm ${TUNE_ERR}\n" diff --git a/Tools/px_romfs_pruner.py b/Tools/px_romfs_pruner.py index 20ae3109bf..6a03755068 100755 --- a/Tools/px_romfs_pruner.py +++ b/Tools/px_romfs_pruner.py @@ -69,7 +69,7 @@ def main(): file_path = os.path.join(root, file) # delete hidden files - if file.startswith("."): + if file.startswith(".") and not ".nshrc" in file: os.remove(file_path) continue diff --git a/Tools/serial/rc.serial.jinja b/Tools/serial/rc.serial.jinja index 753f2af750..8740179e91 100644 --- a/Tools/serial/rc.serial.jinja +++ b/Tools/serial/rc.serial.jinja @@ -14,7 +14,7 @@ set i {{ command.instance }} . $PRT_F if [ $SERIAL_DEV != none ]; then {% if not constrained_flash -%} - echo "Starting {{ command.label }} on $SERIAL_DEV" + px4log "Starting {{ command.label }} on $SERIAL_DEV" {% endif -%} {{ command.command }} fi diff --git a/Tools/serial/rc.serial_port.jinja b/Tools/serial/rc.serial_port.jinja index 0877321761..4190165f64 100644 --- a/Tools/serial/rc.serial_port.jinja +++ b/Tools/serial/rc.serial_port.jinja @@ -11,7 +11,7 @@ if param compare "$PRT" {{ serial_device.index }}; then set PRT_{{ serial_device.tag }}_ 1 {% if not constrained_flash -%} else - echo "Conflicting config for {{ serial_device.device }}" + px4log "Conflicting config for {{ serial_device.device }}" {% endif -%} fi fi diff --git a/boards/airmind/mindpx-v2/default.px4board b/boards/airmind/mindpx-v2/default.px4board index 282c6b0f04..d75c9957a4 100644 --- a/boards/airmind/mindpx-v2/default.px4board +++ b/boards/airmind/mindpx-v2/default.px4board @@ -86,6 +86,8 @@ CONFIG_SYSTEMCMDS_MTD=y CONFIG_SYSTEMCMDS_NSHTERM=y CONFIG_SYSTEMCMDS_PARAM=y CONFIG_SYSTEMCMDS_PERF=y +CONFIG_SYSTEMCMDS_PX4LOG=y +CONFIG_SYSTEMCMDS_PX4LOG_TAIL=y CONFIG_SYSTEMCMDS_REBOOT=y CONFIG_SYSTEMCMDS_REFLECT=y CONFIG_SYSTEMCMDS_SD_BENCH=y diff --git a/boards/airmind/mindpx-v2/nuttx-config/nsh/defconfig b/boards/airmind/mindpx-v2/nuttx-config/nsh/defconfig index 9a19661dd1..ce68760c79 100644 --- a/boards/airmind/mindpx-v2/nuttx-config/nsh/defconfig +++ b/boards/airmind/mindpx-v2/nuttx-config/nsh/defconfig @@ -132,6 +132,7 @@ CONFIG_NSH_MAXARGUMENTS=15 CONFIG_NSH_NESTDEPTH=8 CONFIG_NSH_QUOTE=y CONFIG_NSH_ROMFSETC=y +CONFIG_NSH_ROMFSRC=y CONFIG_NSH_ROMFSSECTSIZE=128 CONFIG_NSH_STRERROR=y CONFIG_NSH_VARS=y diff --git a/boards/ark/can-flow/default.px4board b/boards/ark/can-flow/default.px4board index a120df6638..232b1ba80e 100644 --- a/boards/ark/can-flow/default.px4board +++ b/boards/ark/can-flow/default.px4board @@ -24,6 +24,8 @@ CONFIG_MODULES_SENSORS=y # CONFIG_SENSORS_VEHICLE_MAGNETOMETER is not set CONFIG_SYSTEMCMDS_PARAM=y CONFIG_SYSTEMCMDS_PERF=y +CONFIG_SYSTEMCMDS_PX4LOG=y +CONFIG_SYSTEMCMDS_PX4LOG_TAIL=y CONFIG_SYSTEMCMDS_REBOOT=y CONFIG_SYSTEMCMDS_TOP=y CONFIG_SYSTEMCMDS_TOPIC_LISTENER=y diff --git a/boards/ark/can-flow/nuttx-config/nsh/defconfig b/boards/ark/can-flow/nuttx-config/nsh/defconfig index 15d145881e..f545f82f4d 100644 --- a/boards/ark/can-flow/nuttx-config/nsh/defconfig +++ b/boards/ark/can-flow/nuttx-config/nsh/defconfig @@ -107,6 +107,7 @@ CONFIG_NSH_MAXARGUMENTS=15 CONFIG_NSH_NESTDEPTH=8 CONFIG_NSH_QUOTE=y CONFIG_NSH_ROMFSETC=y +CONFIG_NSH_ROMFSRC=y CONFIG_NSH_ROMFSSECTSIZE=128 CONFIG_NSH_STRERROR=y CONFIG_NSH_VARS=y diff --git a/boards/ark/can-gps/default.px4board b/boards/ark/can-gps/default.px4board index 86af45774c..ed93a9db82 100644 --- a/boards/ark/can-gps/default.px4board +++ b/boards/ark/can-gps/default.px4board @@ -28,6 +28,8 @@ CONFIG_MODULES_SENSORS=y # CONFIG_SENSORS_VEHICLE_GPS_POSITION is not set CONFIG_SYSTEMCMDS_PARAM=y CONFIG_SYSTEMCMDS_PERF=y +CONFIG_SYSTEMCMDS_PX4LOG=y +CONFIG_SYSTEMCMDS_PX4LOG_TAIL=y CONFIG_SYSTEMCMDS_REBOOT=y CONFIG_SYSTEMCMDS_SYSTEM_TIME=y CONFIG_SYSTEMCMDS_TOP=y diff --git a/boards/ark/can-gps/nuttx-config/nsh/defconfig b/boards/ark/can-gps/nuttx-config/nsh/defconfig index f734bc8168..f24f2c5628 100644 --- a/boards/ark/can-gps/nuttx-config/nsh/defconfig +++ b/boards/ark/can-gps/nuttx-config/nsh/defconfig @@ -109,6 +109,7 @@ CONFIG_NSH_MAXARGUMENTS=15 CONFIG_NSH_NESTDEPTH=8 CONFIG_NSH_QUOTE=y CONFIG_NSH_ROMFSETC=y +CONFIG_NSH_ROMFSRC=y CONFIG_NSH_ROMFSSECTSIZE=128 CONFIG_NSH_STRERROR=y CONFIG_NSH_VARS=y diff --git a/boards/ark/can-rtk-gps/default.px4board b/boards/ark/can-rtk-gps/default.px4board index b74e74a630..70366210fc 100644 --- a/boards/ark/can-rtk-gps/default.px4board +++ b/boards/ark/can-rtk-gps/default.px4board @@ -29,6 +29,8 @@ CONFIG_MODULES_SENSORS=y # CONFIG_SENSORS_VEHICLE_GPS_POSITION is not set CONFIG_SYSTEMCMDS_PARAM=y CONFIG_SYSTEMCMDS_PERF=y +CONFIG_SYSTEMCMDS_PX4LOG=y +CONFIG_SYSTEMCMDS_PX4LOG_TAIL=y CONFIG_SYSTEMCMDS_REBOOT=y CONFIG_SYSTEMCMDS_SYSTEM_TIME=y CONFIG_SYSTEMCMDS_TOP=y diff --git a/boards/ark/can-rtk-gps/nuttx-config/nsh/defconfig b/boards/ark/can-rtk-gps/nuttx-config/nsh/defconfig index ba2d6f2143..2c57fc7408 100644 --- a/boards/ark/can-rtk-gps/nuttx-config/nsh/defconfig +++ b/boards/ark/can-rtk-gps/nuttx-config/nsh/defconfig @@ -109,6 +109,7 @@ CONFIG_NSH_MAXARGUMENTS=15 CONFIG_NSH_NESTDEPTH=8 CONFIG_NSH_QUOTE=y CONFIG_NSH_ROMFSETC=y +CONFIG_NSH_ROMFSRC=y CONFIG_NSH_ROMFSSECTSIZE=128 CONFIG_NSH_STRERROR=y CONFIG_NSH_VARS=y diff --git a/boards/ark/cannode/default.px4board b/boards/ark/cannode/default.px4board index 332237310a..f16a6617cc 100644 --- a/boards/ark/cannode/default.px4board +++ b/boards/ark/cannode/default.px4board @@ -44,6 +44,8 @@ CONFIG_SYSTEMCMDS_ACTUATOR_TEST=y CONFIG_SYSTEMCMDS_I2CDETECT=y CONFIG_SYSTEMCMDS_LED_CONTROL=y CONFIG_SYSTEMCMDS_PARAM=y +CONFIG_SYSTEMCMDS_PX4LOG=y +CONFIG_SYSTEMCMDS_PX4LOG_TAIL=y CONFIG_SYSTEMCMDS_REBOOT=y CONFIG_SYSTEMCMDS_TOP=y CONFIG_SYSTEMCMDS_TOPIC_LISTENER=y diff --git a/boards/ark/cannode/nuttx-config/nsh/defconfig b/boards/ark/cannode/nuttx-config/nsh/defconfig index a0882b71be..b28733708b 100644 --- a/boards/ark/cannode/nuttx-config/nsh/defconfig +++ b/boards/ark/cannode/nuttx-config/nsh/defconfig @@ -109,6 +109,7 @@ CONFIG_NSH_MAXARGUMENTS=15 CONFIG_NSH_NESTDEPTH=8 CONFIG_NSH_QUOTE=y CONFIG_NSH_ROMFSETC=y +CONFIG_NSH_ROMFSRC=y CONFIG_NSH_ROMFSSECTSIZE=128 CONFIG_NSH_STRERROR=y CONFIG_NSH_VARS=y diff --git a/boards/ark/fmu-v6x/default.px4board b/boards/ark/fmu-v6x/default.px4board index 2ac125ba3a..9a02ad5978 100644 --- a/boards/ark/fmu-v6x/default.px4board +++ b/boards/ark/fmu-v6x/default.px4board @@ -78,6 +78,8 @@ CONFIG_SYSTEMCMDS_NETMAN=y CONFIG_SYSTEMCMDS_NSHTERM=y CONFIG_SYSTEMCMDS_PARAM=y CONFIG_SYSTEMCMDS_PERF=y +CONFIG_SYSTEMCMDS_PX4LOG=y +CONFIG_SYSTEMCMDS_PX4LOG_TAIL=y CONFIG_SYSTEMCMDS_REBOOT=y CONFIG_SYSTEMCMDS_SD_BENCH=y CONFIG_SYSTEMCMDS_SD_STRESS=y diff --git a/boards/ark/fmu-v6x/nuttx-config/nsh/defconfig b/boards/ark/fmu-v6x/nuttx-config/nsh/defconfig index 212213f994..49cf803519 100644 --- a/boards/ark/fmu-v6x/nuttx-config/nsh/defconfig +++ b/boards/ark/fmu-v6x/nuttx-config/nsh/defconfig @@ -178,6 +178,7 @@ CONFIG_NSH_MAXARGUMENTS=15 CONFIG_NSH_NESTDEPTH=8 CONFIG_NSH_QUOTE=y CONFIG_NSH_ROMFSETC=y +CONFIG_NSH_ROMFSRC=y CONFIG_NSH_ROMFSSECTSIZE=128 CONFIG_NSH_STRERROR=y CONFIG_NSH_TELNET=y diff --git a/boards/ark/fmu-v6x/src/board_config.h b/boards/ark/fmu-v6x/src/board_config.h index 752caf497e..412293248b 100644 --- a/boards/ark/fmu-v6x/src/board_config.h +++ b/boards/ark/fmu-v6x/src/board_config.h @@ -489,7 +489,6 @@ GPIO_SPIX_SYNC \ } -#define BOARD_ENABLE_CONSOLE_BUFFER #define PX4_I2C_BUS_MTD 4,5 diff --git a/boards/atl/mantis-edu/default.px4board b/boards/atl/mantis-edu/default.px4board index 58fcec76d7..8a706d642c 100644 --- a/boards/atl/mantis-edu/default.px4board +++ b/boards/atl/mantis-edu/default.px4board @@ -40,6 +40,8 @@ CONFIG_SYSTEMCMDS_HARDFAULT_LOG=y CONFIG_SYSTEMCMDS_LED_CONTROL=y CONFIG_SYSTEMCMDS_PARAM=y CONFIG_SYSTEMCMDS_PERF=y +CONFIG_SYSTEMCMDS_PX4LOG=y +CONFIG_SYSTEMCMDS_PX4LOG_TAIL=y CONFIG_SYSTEMCMDS_REBOOT=y CONFIG_SYSTEMCMDS_SHUTDOWN=y CONFIG_SYSTEMCMDS_SYSTEM_TIME=y diff --git a/boards/atl/mantis-edu/nuttx-config/nsh/defconfig b/boards/atl/mantis-edu/nuttx-config/nsh/defconfig index 3368ce48e1..92ebbdac73 100644 --- a/boards/atl/mantis-edu/nuttx-config/nsh/defconfig +++ b/boards/atl/mantis-edu/nuttx-config/nsh/defconfig @@ -138,6 +138,7 @@ CONFIG_NSH_MAXARGUMENTS=15 CONFIG_NSH_NESTDEPTH=8 CONFIG_NSH_QUOTE=y CONFIG_NSH_ROMFSETC=y +CONFIG_NSH_ROMFSRC=y CONFIG_NSH_ROMFSSECTSIZE=128 CONFIG_NSH_STRERROR=y CONFIG_NSH_VARS=y diff --git a/boards/atl/mantis-edu/src/board_config.h b/boards/atl/mantis-edu/src/board_config.h index 8b8a99b12e..1d74555591 100644 --- a/boards/atl/mantis-edu/src/board_config.h +++ b/boards/atl/mantis-edu/src/board_config.h @@ -191,7 +191,6 @@ GPIO_OTGFS_VBUS \ } -#define BOARD_ENABLE_CONSOLE_BUFFER #define BOARD_NUM_IO_TIMERS 1 diff --git a/boards/av/x-v1/default.px4board b/boards/av/x-v1/default.px4board index 13001cc4f9..c9d3af5f13 100644 --- a/boards/av/x-v1/default.px4board +++ b/boards/av/x-v1/default.px4board @@ -83,6 +83,8 @@ CONFIG_SYSTEMCMDS_NETMAN=y CONFIG_SYSTEMCMDS_NSHTERM=y CONFIG_SYSTEMCMDS_PARAM=y CONFIG_SYSTEMCMDS_PERF=y +CONFIG_SYSTEMCMDS_PX4LOG=y +CONFIG_SYSTEMCMDS_PX4LOG_TAIL=y CONFIG_SYSTEMCMDS_REBOOT=y CONFIG_SYSTEMCMDS_REFLECT=y CONFIG_SYSTEMCMDS_SD_BENCH=y diff --git a/boards/av/x-v1/nuttx-config/nsh/defconfig b/boards/av/x-v1/nuttx-config/nsh/defconfig index 73efed90a1..6848f415f0 100644 --- a/boards/av/x-v1/nuttx-config/nsh/defconfig +++ b/boards/av/x-v1/nuttx-config/nsh/defconfig @@ -167,6 +167,7 @@ CONFIG_NSH_MAXARGUMENTS=15 CONFIG_NSH_NESTDEPTH=8 CONFIG_NSH_QUOTE=y CONFIG_NSH_ROMFSETC=y +CONFIG_NSH_ROMFSRC=y CONFIG_NSH_ROMFSSECTSIZE=128 CONFIG_NSH_STRERROR=y CONFIG_NSH_TELNET=y diff --git a/boards/av/x-v1/src/board_config.h b/boards/av/x-v1/src/board_config.h index b87abf26c0..96c7eb8781 100644 --- a/boards/av/x-v1/src/board_config.h +++ b/boards/av/x-v1/src/board_config.h @@ -146,7 +146,6 @@ GPIO_CAN1_TX, \ } -#define BOARD_ENABLE_CONSOLE_BUFFER #define BOARD_NUM_IO_TIMERS 6 diff --git a/boards/beaglebone/blue/default.px4board b/boards/beaglebone/blue/default.px4board index be5f802bbb..0a43f1c83b 100644 --- a/boards/beaglebone/blue/default.px4board +++ b/boards/beaglebone/blue/default.px4board @@ -66,6 +66,8 @@ CONFIG_SYSTEMCMDS_DYN=y CONFIG_SYSTEMCMDS_LED_CONTROL=y CONFIG_SYSTEMCMDS_PARAM=y CONFIG_SYSTEMCMDS_PERF=y +CONFIG_SYSTEMCMDS_PX4LOG=y +CONFIG_SYSTEMCMDS_PX4LOG_TAIL=y CONFIG_SYSTEMCMDS_SD_BENCH=y CONFIG_SYSTEMCMDS_SHUTDOWN=y CONFIG_SYSTEMCMDS_SYSTEM_TIME=y diff --git a/boards/bitcraze/crazyflie/default.px4board b/boards/bitcraze/crazyflie/default.px4board index a407eb27fe..f683601689 100644 --- a/boards/bitcraze/crazyflie/default.px4board +++ b/boards/bitcraze/crazyflie/default.px4board @@ -38,6 +38,8 @@ CONFIG_SYSTEMCMDS_MTD=y CONFIG_SYSTEMCMDS_NSHTERM=y CONFIG_SYSTEMCMDS_PARAM=y CONFIG_SYSTEMCMDS_PERF=y +CONFIG_SYSTEMCMDS_PX4LOG=y +CONFIG_SYSTEMCMDS_PX4LOG_TAIL=y CONFIG_SYSTEMCMDS_REBOOT=y CONFIG_SYSTEMCMDS_SD_BENCH=y CONFIG_SYSTEMCMDS_TOP=y diff --git a/boards/bitcraze/crazyflie/nuttx-config/nsh/defconfig b/boards/bitcraze/crazyflie/nuttx-config/nsh/defconfig index 85951b83dd..40ec31a01d 100644 --- a/boards/bitcraze/crazyflie/nuttx-config/nsh/defconfig +++ b/boards/bitcraze/crazyflie/nuttx-config/nsh/defconfig @@ -130,6 +130,7 @@ CONFIG_NSH_MMCSDSPIPORTNO=1 CONFIG_NSH_NESTDEPTH=8 CONFIG_NSH_QUOTE=y CONFIG_NSH_ROMFSETC=y +CONFIG_NSH_ROMFSRC=y CONFIG_NSH_ROMFSSECTSIZE=128 CONFIG_NSH_STRERROR=y CONFIG_NSH_VARS=y diff --git a/boards/bitcraze/crazyflie/src/board_config.h b/boards/bitcraze/crazyflie/src/board_config.h index 5b9529a682..813eae91d3 100644 --- a/boards/bitcraze/crazyflie/src/board_config.h +++ b/boards/bitcraze/crazyflie/src/board_config.h @@ -155,8 +155,7 @@ #define HRT_TIMER_CHANNEL 1 /* use capture/compare channel */ -#define BOARD_ENABLE_CONSOLE_BUFFER -#define BOARD_CONSOLE_BUFFER_SIZE (1024*3) + __BEGIN_DECLS diff --git a/boards/bitcraze/crazyflie21/default.px4board b/boards/bitcraze/crazyflie21/default.px4board index 9f2e37f8f1..0486812ee9 100644 --- a/boards/bitcraze/crazyflie21/default.px4board +++ b/boards/bitcraze/crazyflie21/default.px4board @@ -37,6 +37,8 @@ CONFIG_SYSTEMCMDS_MTD=y CONFIG_SYSTEMCMDS_NSHTERM=y CONFIG_SYSTEMCMDS_PARAM=y CONFIG_SYSTEMCMDS_PERF=y +CONFIG_SYSTEMCMDS_PX4LOG=y +CONFIG_SYSTEMCMDS_PX4LOG_TAIL=y CONFIG_SYSTEMCMDS_REBOOT=y CONFIG_SYSTEMCMDS_SD_BENCH=y CONFIG_SYSTEMCMDS_SYSTEM_TIME=y diff --git a/boards/bitcraze/crazyflie21/nuttx-config/nsh/defconfig b/boards/bitcraze/crazyflie21/nuttx-config/nsh/defconfig index 4840814672..39172038c0 100644 --- a/boards/bitcraze/crazyflie21/nuttx-config/nsh/defconfig +++ b/boards/bitcraze/crazyflie21/nuttx-config/nsh/defconfig @@ -131,6 +131,7 @@ CONFIG_NSH_MMCSDSPIPORTNO=1 CONFIG_NSH_NESTDEPTH=8 CONFIG_NSH_QUOTE=y CONFIG_NSH_ROMFSETC=y +CONFIG_NSH_ROMFSRC=y CONFIG_NSH_ROMFSSECTSIZE=128 CONFIG_NSH_STRERROR=y CONFIG_NSH_VARS=y diff --git a/boards/bitcraze/crazyflie21/src/board_config.h b/boards/bitcraze/crazyflie21/src/board_config.h index a8ee6029c2..ab36b23667 100644 --- a/boards/bitcraze/crazyflie21/src/board_config.h +++ b/boards/bitcraze/crazyflie21/src/board_config.h @@ -156,8 +156,7 @@ #define HRT_TIMER_CHANNEL 1 /* use capture/compare channel */ -#define BOARD_ENABLE_CONSOLE_BUFFER -#define BOARD_CONSOLE_BUFFER_SIZE (1024*3) + __BEGIN_DECLS diff --git a/boards/cuav/can-gps-v1/default.px4board b/boards/cuav/can-gps-v1/default.px4board index 6b0a5675f5..60f239bcce 100644 --- a/boards/cuav/can-gps-v1/default.px4board +++ b/boards/cuav/can-gps-v1/default.px4board @@ -27,6 +27,8 @@ CONFIG_MODULES_SENSORS=y # CONFIG_SENSORS_VEHICLE_GPS_POSITION is not set CONFIG_SYSTEMCMDS_PARAM=y CONFIG_SYSTEMCMDS_PERF=y +CONFIG_SYSTEMCMDS_PX4LOG=y +CONFIG_SYSTEMCMDS_PX4LOG_TAIL=y CONFIG_SYSTEMCMDS_REBOOT=y CONFIG_SYSTEMCMDS_SYSTEM_TIME=y CONFIG_SYSTEMCMDS_TOP=y diff --git a/boards/cuav/can-gps-v1/nuttx-config/nsh/defconfig b/boards/cuav/can-gps-v1/nuttx-config/nsh/defconfig index 64f884c2db..b47faa74db 100644 --- a/boards/cuav/can-gps-v1/nuttx-config/nsh/defconfig +++ b/boards/cuav/can-gps-v1/nuttx-config/nsh/defconfig @@ -111,6 +111,7 @@ CONFIG_NSH_MAXARGUMENTS=15 CONFIG_NSH_NESTDEPTH=8 CONFIG_NSH_QUOTE=y CONFIG_NSH_ROMFSETC=y +CONFIG_NSH_ROMFSRC=y CONFIG_NSH_ROMFSSECTSIZE=128 CONFIG_NSH_STRERROR=y CONFIG_NSH_VARS=y diff --git a/boards/cuav/nora/default.px4board b/boards/cuav/nora/default.px4board index bd3172a283..0ece9604ef 100644 --- a/boards/cuav/nora/default.px4board +++ b/boards/cuav/nora/default.px4board @@ -87,6 +87,8 @@ CONFIG_SYSTEMCMDS_MTD=y CONFIG_SYSTEMCMDS_NSHTERM=y CONFIG_SYSTEMCMDS_PARAM=y CONFIG_SYSTEMCMDS_PERF=y +CONFIG_SYSTEMCMDS_PX4LOG=y +CONFIG_SYSTEMCMDS_PX4LOG_TAIL=y CONFIG_SYSTEMCMDS_REBOOT=y CONFIG_SYSTEMCMDS_SYSTEM_TIME=y CONFIG_SYSTEMCMDS_TOP=y diff --git a/boards/cuav/nora/nuttx-config/nsh/defconfig b/boards/cuav/nora/nuttx-config/nsh/defconfig index fb84cac440..ce06d1c3bf 100644 --- a/boards/cuav/nora/nuttx-config/nsh/defconfig +++ b/boards/cuav/nora/nuttx-config/nsh/defconfig @@ -138,6 +138,7 @@ CONFIG_NSH_MAXARGUMENTS=15 CONFIG_NSH_NESTDEPTH=8 CONFIG_NSH_QUOTE=y CONFIG_NSH_ROMFSETC=y +CONFIG_NSH_ROMFSRC=y CONFIG_NSH_ROMFSSECTSIZE=128 CONFIG_NSH_STRERROR=y CONFIG_NSH_VARS=y diff --git a/boards/cuav/nora/src/board_config.h b/boards/cuav/nora/src/board_config.h index 56dbf9cc8c..deb96229ba 100644 --- a/boards/cuav/nora/src/board_config.h +++ b/boards/cuav/nora/src/board_config.h @@ -200,7 +200,6 @@ #define BOARD_HAS_ON_RESET 1 -#define BOARD_ENABLE_CONSOLE_BUFFER #define PX4_GPIO_INIT_LIST { \ PX4_ADC_GPIO, \ diff --git a/boards/cuav/x7pro/default.px4board b/boards/cuav/x7pro/default.px4board index c6c4d4bdb9..aec07cb113 100644 --- a/boards/cuav/x7pro/default.px4board +++ b/boards/cuav/x7pro/default.px4board @@ -88,6 +88,8 @@ CONFIG_SYSTEMCMDS_MTD=y CONFIG_SYSTEMCMDS_NSHTERM=y CONFIG_SYSTEMCMDS_PARAM=y CONFIG_SYSTEMCMDS_PERF=y +CONFIG_SYSTEMCMDS_PX4LOG=y +CONFIG_SYSTEMCMDS_PX4LOG_TAIL=y CONFIG_SYSTEMCMDS_REBOOT=y CONFIG_SYSTEMCMDS_SD_BENCH=y CONFIG_SYSTEMCMDS_SD_STRESS=y diff --git a/boards/cuav/x7pro/nuttx-config/nsh/defconfig b/boards/cuav/x7pro/nuttx-config/nsh/defconfig index 1088a24c02..70684cdb60 100644 --- a/boards/cuav/x7pro/nuttx-config/nsh/defconfig +++ b/boards/cuav/x7pro/nuttx-config/nsh/defconfig @@ -138,6 +138,7 @@ CONFIG_NSH_MAXARGUMENTS=15 CONFIG_NSH_NESTDEPTH=8 CONFIG_NSH_QUOTE=y CONFIG_NSH_ROMFSETC=y +CONFIG_NSH_ROMFSRC=y CONFIG_NSH_ROMFSSECTSIZE=128 CONFIG_NSH_STRERROR=y CONFIG_NSH_VARS=y diff --git a/boards/cuav/x7pro/nuttx-config/test/defconfig b/boards/cuav/x7pro/nuttx-config/test/defconfig index 7506c06387..786c9a4287 100644 --- a/boards/cuav/x7pro/nuttx-config/test/defconfig +++ b/boards/cuav/x7pro/nuttx-config/test/defconfig @@ -138,6 +138,7 @@ CONFIG_NSH_MAXARGUMENTS=15 CONFIG_NSH_NESTDEPTH=8 CONFIG_NSH_QUOTE=y CONFIG_NSH_ROMFSETC=y +CONFIG_NSH_ROMFSRC=y CONFIG_NSH_ROMFSSECTSIZE=128 CONFIG_NSH_STRERROR=y CONFIG_NSH_VARS=y diff --git a/boards/cuav/x7pro/src/board_config.h b/boards/cuav/x7pro/src/board_config.h index f8a1824ebc..9da9b0f478 100644 --- a/boards/cuav/x7pro/src/board_config.h +++ b/boards/cuav/x7pro/src/board_config.h @@ -200,7 +200,6 @@ #define BOARD_HAS_ON_RESET 1 -#define BOARD_ENABLE_CONSOLE_BUFFER #define PX4_GPIO_INIT_LIST { \ PX4_ADC_GPIO, \ diff --git a/boards/cubepilot/cubeorange/default.px4board b/boards/cubepilot/cubeorange/default.px4board index 89848f8523..f184bc190f 100644 --- a/boards/cubepilot/cubeorange/default.px4board +++ b/boards/cubepilot/cubeorange/default.px4board @@ -80,6 +80,8 @@ CONFIG_SYSTEMCMDS_MTD=y CONFIG_SYSTEMCMDS_NSHTERM=y CONFIG_SYSTEMCMDS_PARAM=y CONFIG_SYSTEMCMDS_PERF=y +CONFIG_SYSTEMCMDS_PX4LOG=y +CONFIG_SYSTEMCMDS_PX4LOG_TAIL=y CONFIG_SYSTEMCMDS_REBOOT=y CONFIG_SYSTEMCMDS_SYSTEM_TIME=y CONFIG_SYSTEMCMDS_TOP=y diff --git a/boards/cubepilot/cubeorange/nuttx-config/nsh/defconfig b/boards/cubepilot/cubeorange/nuttx-config/nsh/defconfig index fe6a962c27..d584765e29 100644 --- a/boards/cubepilot/cubeorange/nuttx-config/nsh/defconfig +++ b/boards/cubepilot/cubeorange/nuttx-config/nsh/defconfig @@ -139,6 +139,7 @@ CONFIG_NSH_MAXARGUMENTS=15 CONFIG_NSH_NESTDEPTH=8 CONFIG_NSH_QUOTE=y CONFIG_NSH_ROMFSETC=y +CONFIG_NSH_ROMFSRC=y CONFIG_NSH_ROMFSSECTSIZE=128 CONFIG_NSH_STRERROR=y CONFIG_NSH_VARS=y diff --git a/boards/cubepilot/cubeorange/nuttx-config/test/defconfig b/boards/cubepilot/cubeorange/nuttx-config/test/defconfig index 54613e1e61..ae8fe16518 100644 --- a/boards/cubepilot/cubeorange/nuttx-config/test/defconfig +++ b/boards/cubepilot/cubeorange/nuttx-config/test/defconfig @@ -139,6 +139,7 @@ CONFIG_NSH_MAXARGUMENTS=15 CONFIG_NSH_NESTDEPTH=8 CONFIG_NSH_QUOTE=y CONFIG_NSH_ROMFSETC=y +CONFIG_NSH_ROMFSRC=y CONFIG_NSH_ROMFSSECTSIZE=128 CONFIG_NSH_STRERROR=y CONFIG_NSH_VARS=y diff --git a/boards/cubepilot/cubeorange/src/board_config.h b/boards/cubepilot/cubeorange/src/board_config.h index 5cab2c5f82..7761cbb235 100644 --- a/boards/cubepilot/cubeorange/src/board_config.h +++ b/boards/cubepilot/cubeorange/src/board_config.h @@ -150,7 +150,6 @@ -#define BOARD_ENABLE_CONSOLE_BUFFER #define PX4_GPIO_INIT_LIST { \ PX4_ADC_GPIO, \ diff --git a/boards/cubepilot/cubeorangeplus/default.px4board b/boards/cubepilot/cubeorangeplus/default.px4board index f8442ceba8..f9f4118dd0 100644 --- a/boards/cubepilot/cubeorangeplus/default.px4board +++ b/boards/cubepilot/cubeorangeplus/default.px4board @@ -80,6 +80,8 @@ CONFIG_SYSTEMCMDS_MTD=y CONFIG_SYSTEMCMDS_NSHTERM=y CONFIG_SYSTEMCMDS_PARAM=y CONFIG_SYSTEMCMDS_PERF=y +CONFIG_SYSTEMCMDS_PX4LOG=y +CONFIG_SYSTEMCMDS_PX4LOG_TAIL=y CONFIG_SYSTEMCMDS_REBOOT=y CONFIG_SYSTEMCMDS_SYSTEM_TIME=y CONFIG_SYSTEMCMDS_TOP=y diff --git a/boards/cubepilot/cubeorangeplus/nuttx-config/nsh/defconfig b/boards/cubepilot/cubeorangeplus/nuttx-config/nsh/defconfig index 7bab0a36af..e925f174b2 100644 --- a/boards/cubepilot/cubeorangeplus/nuttx-config/nsh/defconfig +++ b/boards/cubepilot/cubeorangeplus/nuttx-config/nsh/defconfig @@ -139,6 +139,7 @@ CONFIG_NSH_MAXARGUMENTS=15 CONFIG_NSH_NESTDEPTH=8 CONFIG_NSH_QUOTE=y CONFIG_NSH_ROMFSETC=y +CONFIG_NSH_ROMFSRC=y CONFIG_NSH_ROMFSSECTSIZE=128 CONFIG_NSH_STRERROR=y CONFIG_NSH_VARS=y diff --git a/boards/cubepilot/cubeorangeplus/nuttx-config/test/defconfig b/boards/cubepilot/cubeorangeplus/nuttx-config/test/defconfig index 0eebadc377..5c13105dc1 100644 --- a/boards/cubepilot/cubeorangeplus/nuttx-config/test/defconfig +++ b/boards/cubepilot/cubeorangeplus/nuttx-config/test/defconfig @@ -139,6 +139,7 @@ CONFIG_NSH_MAXARGUMENTS=15 CONFIG_NSH_NESTDEPTH=8 CONFIG_NSH_QUOTE=y CONFIG_NSH_ROMFSETC=y +CONFIG_NSH_ROMFSRC=y CONFIG_NSH_ROMFSSECTSIZE=128 CONFIG_NSH_STRERROR=y CONFIG_NSH_VARS=y diff --git a/boards/cubepilot/cubeorangeplus/src/board_config.h b/boards/cubepilot/cubeorangeplus/src/board_config.h index 1646925c3a..a3b1a8b131 100644 --- a/boards/cubepilot/cubeorangeplus/src/board_config.h +++ b/boards/cubepilot/cubeorangeplus/src/board_config.h @@ -160,7 +160,6 @@ -#define BOARD_ENABLE_CONSOLE_BUFFER #define PX4_GPIO_INIT_LIST { \ PX4_ADC_GPIO, \ diff --git a/boards/cubepilot/cubeyellow/default.px4board b/boards/cubepilot/cubeyellow/default.px4board index 87af360c81..6301858aea 100644 --- a/boards/cubepilot/cubeyellow/default.px4board +++ b/boards/cubepilot/cubeyellow/default.px4board @@ -87,6 +87,8 @@ CONFIG_SYSTEMCMDS_MTD=y CONFIG_SYSTEMCMDS_NSHTERM=y CONFIG_SYSTEMCMDS_PARAM=y CONFIG_SYSTEMCMDS_PERF=y +CONFIG_SYSTEMCMDS_PX4LOG=y +CONFIG_SYSTEMCMDS_PX4LOG_TAIL=y CONFIG_SYSTEMCMDS_REBOOT=y CONFIG_SYSTEMCMDS_REFLECT=y CONFIG_SYSTEMCMDS_SD_BENCH=y diff --git a/boards/cubepilot/cubeyellow/nuttx-config/nsh/defconfig b/boards/cubepilot/cubeyellow/nuttx-config/nsh/defconfig index f00b3e93a3..220ad10f17 100644 --- a/boards/cubepilot/cubeyellow/nuttx-config/nsh/defconfig +++ b/boards/cubepilot/cubeyellow/nuttx-config/nsh/defconfig @@ -138,6 +138,7 @@ CONFIG_NSH_MAXARGUMENTS=15 CONFIG_NSH_NESTDEPTH=8 CONFIG_NSH_QUOTE=y CONFIG_NSH_ROMFSETC=y +CONFIG_NSH_ROMFSRC=y CONFIG_NSH_ROMFSSECTSIZE=128 CONFIG_NSH_STRERROR=y CONFIG_NSH_VARS=y diff --git a/boards/cubepilot/cubeyellow/src/board_config.h b/boards/cubepilot/cubeyellow/src/board_config.h index 53fff3ac6e..960b9a2311 100644 --- a/boards/cubepilot/cubeyellow/src/board_config.h +++ b/boards/cubepilot/cubeyellow/src/board_config.h @@ -145,7 +145,6 @@ -#define BOARD_ENABLE_CONSOLE_BUFFER #define PX4_GPIO_INIT_LIST { \ PX4_ADC_GPIO, \ diff --git a/boards/diatone/mamba-f405-mk2/default.px4board b/boards/diatone/mamba-f405-mk2/default.px4board index 6655e8e388..ac678a8c58 100644 --- a/boards/diatone/mamba-f405-mk2/default.px4board +++ b/boards/diatone/mamba-f405-mk2/default.px4board @@ -40,5 +40,7 @@ CONFIG_SYSTEMCMDS_MFT=y CONFIG_SYSTEMCMDS_MTD=y CONFIG_SYSTEMCMDS_NSHTERM=y CONFIG_SYSTEMCMDS_PARAM=y +CONFIG_SYSTEMCMDS_PX4LOG=y +CONFIG_SYSTEMCMDS_PX4LOG_TAIL=y CONFIG_SYSTEMCMDS_REBOOT=y CONFIG_SYSTEMCMDS_VER=y diff --git a/boards/diatone/mamba-f405-mk2/nuttx-config/nsh/defconfig b/boards/diatone/mamba-f405-mk2/nuttx-config/nsh/defconfig index 8fed52b508..6810c90693 100644 --- a/boards/diatone/mamba-f405-mk2/nuttx-config/nsh/defconfig +++ b/boards/diatone/mamba-f405-mk2/nuttx-config/nsh/defconfig @@ -97,6 +97,7 @@ CONFIG_NSH_MMCSDSPIPORTNO=2 CONFIG_NSH_NESTDEPTH=8 CONFIG_NSH_READLINE=y CONFIG_NSH_ROMFSETC=y +CONFIG_NSH_ROMFSRC=y CONFIG_NSH_ROMFSSECTSIZE=128 CONFIG_NSH_STRERROR=y CONFIG_NSH_VARS=y diff --git a/boards/diatone/mamba-f405-mk2/src/board_config.h b/boards/diatone/mamba-f405-mk2/src/board_config.h index 7c2b17d84d..a523e02b78 100644 --- a/boards/diatone/mamba-f405-mk2/src/board_config.h +++ b/boards/diatone/mamba-f405-mk2/src/board_config.h @@ -154,9 +154,6 @@ #define BOARD_HAS_ON_RESET 1 -#define BOARD_ENABLE_CONSOLE_BUFFER -#define BOARD_CONSOLE_BUFFER_SIZE (1024*2) - __BEGIN_DECLS diff --git a/boards/emlid/navio2/default.px4board b/boards/emlid/navio2/default.px4board index 0773fe9f88..060867341b 100644 --- a/boards/emlid/navio2/default.px4board +++ b/boards/emlid/navio2/default.px4board @@ -68,6 +68,8 @@ CONFIG_SYSTEMCMDS_DYN=y CONFIG_SYSTEMCMDS_LED_CONTROL=y CONFIG_SYSTEMCMDS_PARAM=y CONFIG_SYSTEMCMDS_PERF=y +CONFIG_SYSTEMCMDS_PX4LOG=y +CONFIG_SYSTEMCMDS_PX4LOG_TAIL=y CONFIG_SYSTEMCMDS_SD_BENCH=y CONFIG_SYSTEMCMDS_SHUTDOWN=y CONFIG_SYSTEMCMDS_SYSTEM_TIME=y diff --git a/boards/flywoo/gn-f405/default.px4board b/boards/flywoo/gn-f405/default.px4board index b016b0db9a..855d9853da 100644 --- a/boards/flywoo/gn-f405/default.px4board +++ b/boards/flywoo/gn-f405/default.px4board @@ -32,6 +32,8 @@ CONFIG_SYSTEMCMDS_DMESG=y CONFIG_SYSTEMCMDS_HARDFAULT_LOG=y CONFIG_SYSTEMCMDS_I2CDETECT=y CONFIG_SYSTEMCMDS_PARAM=y +CONFIG_SYSTEMCMDS_PX4LOG=y +CONFIG_SYSTEMCMDS_PX4LOG_TAIL=y CONFIG_SYSTEMCMDS_REBOOT=y CONFIG_SYSTEMCMDS_TOP=y CONFIG_SYSTEMCMDS_TOPIC_LISTENER=y diff --git a/boards/flywoo/gn-f405/nuttx-config/nsh/defconfig b/boards/flywoo/gn-f405/nuttx-config/nsh/defconfig index 52ed2f86da..74d0b86fcb 100644 --- a/boards/flywoo/gn-f405/nuttx-config/nsh/defconfig +++ b/boards/flywoo/gn-f405/nuttx-config/nsh/defconfig @@ -130,6 +130,7 @@ CONFIG_NSH_MMCSDSPIPORTNO=2 CONFIG_NSH_NESTDEPTH=8 CONFIG_NSH_QUOTE=y CONFIG_NSH_ROMFSETC=y +CONFIG_NSH_ROMFSRC=y CONFIG_NSH_ROMFSSECTSIZE=128 CONFIG_NSH_STRERROR=y CONFIG_NSH_VARS=y diff --git a/boards/flywoo/gn-f405/src/board_config.h b/boards/flywoo/gn-f405/src/board_config.h index 756389e5b8..95486bb286 100644 --- a/boards/flywoo/gn-f405/src/board_config.h +++ b/boards/flywoo/gn-f405/src/board_config.h @@ -156,8 +156,7 @@ #define BOARD_HAS_ON_RESET 1 -#define BOARD_ENABLE_CONSOLE_BUFFER -#define BOARD_CONSOLE_BUFFER_SIZE (1024*3) + __BEGIN_DECLS diff --git a/boards/freefly/can-rtk-gps/default.px4board b/boards/freefly/can-rtk-gps/default.px4board index c2759ba300..ed1a2f6547 100644 --- a/boards/freefly/can-rtk-gps/default.px4board +++ b/boards/freefly/can-rtk-gps/default.px4board @@ -30,6 +30,8 @@ CONFIG_SYSTEMCMDS_MFT=y CONFIG_SYSTEMCMDS_MTD=y CONFIG_SYSTEMCMDS_PARAM=y CONFIG_SYSTEMCMDS_PERF=y +CONFIG_SYSTEMCMDS_PX4LOG=y +CONFIG_SYSTEMCMDS_PX4LOG_TAIL=y CONFIG_SYSTEMCMDS_REBOOT=y CONFIG_SYSTEMCMDS_SYSTEM_TIME=y CONFIG_SYSTEMCMDS_TOP=y diff --git a/boards/freefly/can-rtk-gps/nuttx-config/nsh/defconfig b/boards/freefly/can-rtk-gps/nuttx-config/nsh/defconfig index 3ea9c492e6..29f3db9106 100644 --- a/boards/freefly/can-rtk-gps/nuttx-config/nsh/defconfig +++ b/boards/freefly/can-rtk-gps/nuttx-config/nsh/defconfig @@ -123,6 +123,7 @@ CONFIG_NSH_MAXARGUMENTS=15 CONFIG_NSH_NESTDEPTH=8 CONFIG_NSH_QUOTE=y CONFIG_NSH_ROMFSETC=y +CONFIG_NSH_ROMFSRC=y CONFIG_NSH_ROMFSSECTSIZE=128 CONFIG_NSH_STRERROR=y CONFIG_NSH_VARS=y diff --git a/boards/freefly/can-rtk-gps/src/board_config.h b/boards/freefly/can-rtk-gps/src/board_config.h index 8a8bbc272a..d6e1bb2002 100644 --- a/boards/freefly/can-rtk-gps/src/board_config.h +++ b/boards/freefly/can-rtk-gps/src/board_config.h @@ -57,7 +57,6 @@ #define HRT_TIMER 2 /* use timer 2 for the HRT */ #define HRT_TIMER_CHANNEL 1 /* use capture/compare channel 1 */ -#define BOARD_ENABLE_CONSOLE_BUFFER __BEGIN_DECLS diff --git a/boards/holybro/can-gps-v1/default.px4board b/boards/holybro/can-gps-v1/default.px4board index 41b3ceeafd..26e49b0b9f 100644 --- a/boards/holybro/can-gps-v1/default.px4board +++ b/boards/holybro/can-gps-v1/default.px4board @@ -28,6 +28,8 @@ CONFIG_MODULES_SENSORS=y # CONFIG_SENSORS_VEHICLE_GPS_POSITION is not set CONFIG_SYSTEMCMDS_PARAM=y CONFIG_SYSTEMCMDS_PERF=y +CONFIG_SYSTEMCMDS_PX4LOG=y +CONFIG_SYSTEMCMDS_PX4LOG_TAIL=y CONFIG_SYSTEMCMDS_REBOOT=y CONFIG_SYSTEMCMDS_SYSTEM_TIME=y CONFIG_SYSTEMCMDS_TOP=y diff --git a/boards/holybro/can-gps-v1/nuttx-config/nsh/defconfig b/boards/holybro/can-gps-v1/nuttx-config/nsh/defconfig index 4dcee619f1..e8e2e51bcd 100644 --- a/boards/holybro/can-gps-v1/nuttx-config/nsh/defconfig +++ b/boards/holybro/can-gps-v1/nuttx-config/nsh/defconfig @@ -112,6 +112,7 @@ CONFIG_NSH_MAXARGUMENTS=15 CONFIG_NSH_NESTDEPTH=8 CONFIG_NSH_QUOTE=y CONFIG_NSH_ROMFSETC=y +CONFIG_NSH_ROMFSRC=y CONFIG_NSH_ROMFSSECTSIZE=128 CONFIG_NSH_STRERROR=y CONFIG_NSH_VARS=y diff --git a/boards/holybro/durandal-v1/default.px4board b/boards/holybro/durandal-v1/default.px4board index 654787e28b..d8c5639f35 100644 --- a/boards/holybro/durandal-v1/default.px4board +++ b/boards/holybro/durandal-v1/default.px4board @@ -79,6 +79,8 @@ CONFIG_SYSTEMCMDS_MTD=y CONFIG_SYSTEMCMDS_NSHTERM=y CONFIG_SYSTEMCMDS_PARAM=y CONFIG_SYSTEMCMDS_PERF=y +CONFIG_SYSTEMCMDS_PX4LOG=y +CONFIG_SYSTEMCMDS_PX4LOG_TAIL=y CONFIG_SYSTEMCMDS_REBOOT=y CONFIG_SYSTEMCMDS_SD_BENCH=y CONFIG_SYSTEMCMDS_SD_STRESS=y diff --git a/boards/holybro/durandal-v1/nuttx-config/nsh/defconfig b/boards/holybro/durandal-v1/nuttx-config/nsh/defconfig index 85363a602e..7c339f9de9 100644 --- a/boards/holybro/durandal-v1/nuttx-config/nsh/defconfig +++ b/boards/holybro/durandal-v1/nuttx-config/nsh/defconfig @@ -140,6 +140,7 @@ CONFIG_NSH_MAXARGUMENTS=15 CONFIG_NSH_NESTDEPTH=8 CONFIG_NSH_QUOTE=y CONFIG_NSH_ROMFSETC=y +CONFIG_NSH_ROMFSRC=y CONFIG_NSH_ROMFSSECTSIZE=128 CONFIG_NSH_STRERROR=y CONFIG_NSH_VARS=y diff --git a/boards/holybro/durandal-v1/src/board_config.h b/boards/holybro/durandal-v1/src/board_config.h index 4f6369b8ce..84fb58b344 100644 --- a/boards/holybro/durandal-v1/src/board_config.h +++ b/boards/holybro/durandal-v1/src/board_config.h @@ -320,7 +320,6 @@ GPIO_SAFETY_SWITCH_IN, \ } -#define BOARD_ENABLE_CONSOLE_BUFFER __BEGIN_DECLS diff --git a/boards/holybro/kakutef7/default.px4board b/boards/holybro/kakutef7/default.px4board index d40c7cdce6..3e4d1fd9cf 100644 --- a/boards/holybro/kakutef7/default.px4board +++ b/boards/holybro/kakutef7/default.px4board @@ -34,3 +34,5 @@ CONFIG_MODULES_RC_UPDATE=y CONFIG_MODULES_SENSORS=y # CONFIG_SENSORS_VEHICLE_AIRSPEED is not set CONFIG_SYSTEMCMDS_PARAM=y +CONFIG_SYSTEMCMDS_PX4LOG=y +CONFIG_SYSTEMCMDS_PX4LOG_TAIL=y diff --git a/boards/holybro/kakutef7/nuttx-config/nsh/defconfig b/boards/holybro/kakutef7/nuttx-config/nsh/defconfig index faf8655412..92d2c6bf5a 100644 --- a/boards/holybro/kakutef7/nuttx-config/nsh/defconfig +++ b/boards/holybro/kakutef7/nuttx-config/nsh/defconfig @@ -141,6 +141,7 @@ CONFIG_NSH_MMCSDSPIPORTNO=1 CONFIG_NSH_NESTDEPTH=8 CONFIG_NSH_QUOTE=y CONFIG_NSH_ROMFSETC=y +CONFIG_NSH_ROMFSRC=y CONFIG_NSH_ROMFSSECTSIZE=128 CONFIG_NSH_STRERROR=y CONFIG_NSH_VARS=y diff --git a/boards/holybro/kakuteh7/default.px4board b/boards/holybro/kakuteh7/default.px4board index 5004769ffe..6090e0cc47 100644 --- a/boards/holybro/kakuteh7/default.px4board +++ b/boards/holybro/kakuteh7/default.px4board @@ -76,6 +76,8 @@ CONFIG_SYSTEMCMDS_MFT=y CONFIG_SYSTEMCMDS_NSHTERM=y CONFIG_SYSTEMCMDS_PARAM=y CONFIG_SYSTEMCMDS_PERF=y +CONFIG_SYSTEMCMDS_PX4LOG=y +CONFIG_SYSTEMCMDS_PX4LOG_TAIL=y CONFIG_SYSTEMCMDS_REBOOT=y CONFIG_SYSTEMCMDS_SD_BENCH=y CONFIG_SYSTEMCMDS_SD_STRESS=y diff --git a/boards/holybro/kakuteh7/nuttx-config/nsh/defconfig b/boards/holybro/kakuteh7/nuttx-config/nsh/defconfig index c7d29ddb92..ba491c069b 100644 --- a/boards/holybro/kakuteh7/nuttx-config/nsh/defconfig +++ b/boards/holybro/kakuteh7/nuttx-config/nsh/defconfig @@ -140,6 +140,7 @@ CONFIG_NSH_MMCSDSPIPORTNO=1 CONFIG_NSH_NESTDEPTH=8 CONFIG_NSH_QUOTE=y CONFIG_NSH_ROMFSETC=y +CONFIG_NSH_ROMFSRC=y CONFIG_NSH_ROMFSSECTSIZE=128 CONFIG_NSH_STRERROR=y CONFIG_NSH_VARS=y diff --git a/boards/holybro/kakuteh7/src/board_config.h b/boards/holybro/kakuteh7/src/board_config.h index 99395eabb9..770895568a 100644 --- a/boards/holybro/kakuteh7/src/board_config.h +++ b/boards/holybro/kakuteh7/src/board_config.h @@ -180,7 +180,6 @@ GPIO_RF_SWITCH, \ } -#define BOARD_ENABLE_CONSOLE_BUFFER #define FLASH_BASED_PARAMS diff --git a/boards/holybro/kakuteh7mini/default.px4board b/boards/holybro/kakuteh7mini/default.px4board index 36240ff734..b1a3e65f2a 100644 --- a/boards/holybro/kakuteh7mini/default.px4board +++ b/boards/holybro/kakuteh7mini/default.px4board @@ -73,6 +73,8 @@ CONFIG_SYSTEMCMDS_MFT=y CONFIG_SYSTEMCMDS_NSHTERM=y CONFIG_SYSTEMCMDS_PARAM=y CONFIG_SYSTEMCMDS_PERF=y +CONFIG_SYSTEMCMDS_PX4LOG=y +CONFIG_SYSTEMCMDS_PX4LOG_TAIL=y CONFIG_SYSTEMCMDS_REBOOT=y CONFIG_SYSTEMCMDS_SD_BENCH=y CONFIG_SYSTEMCMDS_SD_STRESS=y diff --git a/boards/holybro/kakuteh7mini/nuttx-config/nsh/defconfig b/boards/holybro/kakuteh7mini/nuttx-config/nsh/defconfig index f40b0ccbfd..0394ddccdd 100644 --- a/boards/holybro/kakuteh7mini/nuttx-config/nsh/defconfig +++ b/boards/holybro/kakuteh7mini/nuttx-config/nsh/defconfig @@ -139,6 +139,7 @@ CONFIG_NSH_MMCSDSPIPORTNO=1 CONFIG_NSH_NESTDEPTH=8 CONFIG_NSH_QUOTE=y CONFIG_NSH_ROMFSETC=y +CONFIG_NSH_ROMFSRC=y CONFIG_NSH_ROMFSSECTSIZE=128 CONFIG_NSH_STRERROR=y CONFIG_NSH_VARS=y diff --git a/boards/holybro/kakuteh7mini/src/board_config.h b/boards/holybro/kakuteh7mini/src/board_config.h index d40bbb0105..796a83baaf 100644 --- a/boards/holybro/kakuteh7mini/src/board_config.h +++ b/boards/holybro/kakuteh7mini/src/board_config.h @@ -184,7 +184,6 @@ GPIO_VTX_ON, \ } -#define BOARD_ENABLE_CONSOLE_BUFFER #define FLASH_BASED_PARAMS diff --git a/boards/holybro/kakuteh7v2/default.px4board b/boards/holybro/kakuteh7v2/default.px4board index d5f04d1085..3d681aca14 100644 --- a/boards/holybro/kakuteh7v2/default.px4board +++ b/boards/holybro/kakuteh7v2/default.px4board @@ -75,6 +75,8 @@ CONFIG_SYSTEMCMDS_MFT=y CONFIG_SYSTEMCMDS_NSHTERM=y CONFIG_SYSTEMCMDS_PARAM=y CONFIG_SYSTEMCMDS_PERF=y +CONFIG_SYSTEMCMDS_PX4LOG=y +CONFIG_SYSTEMCMDS_PX4LOG_TAIL=y CONFIG_SYSTEMCMDS_REBOOT=y CONFIG_SYSTEMCMDS_SD_BENCH=y CONFIG_SYSTEMCMDS_SD_STRESS=y diff --git a/boards/holybro/kakuteh7v2/nuttx-config/nsh/defconfig b/boards/holybro/kakuteh7v2/nuttx-config/nsh/defconfig index 8ac32ef349..fc8b786ea2 100644 --- a/boards/holybro/kakuteh7v2/nuttx-config/nsh/defconfig +++ b/boards/holybro/kakuteh7v2/nuttx-config/nsh/defconfig @@ -139,6 +139,7 @@ CONFIG_NSH_MMCSDSPIPORTNO=1 CONFIG_NSH_NESTDEPTH=8 CONFIG_NSH_QUOTE=y CONFIG_NSH_ROMFSETC=y +CONFIG_NSH_ROMFSRC=y CONFIG_NSH_ROMFSSECTSIZE=128 CONFIG_NSH_STRERROR=y CONFIG_NSH_VARS=y diff --git a/boards/holybro/kakuteh7v2/src/board_config.h b/boards/holybro/kakuteh7v2/src/board_config.h index c8ec2fabe1..d3b9014b8e 100644 --- a/boards/holybro/kakuteh7v2/src/board_config.h +++ b/boards/holybro/kakuteh7v2/src/board_config.h @@ -183,7 +183,6 @@ GPIO_VTX_ON, \ } -#define BOARD_ENABLE_CONSOLE_BUFFER #define FLASH_BASED_PARAMS diff --git a/boards/holybro/pix32v5/default.px4board b/boards/holybro/pix32v5/default.px4board index 0ebbaf59c3..bdbc52e29a 100644 --- a/boards/holybro/pix32v5/default.px4board +++ b/boards/holybro/pix32v5/default.px4board @@ -91,6 +91,8 @@ CONFIG_SYSTEMCMDS_MTD=y CONFIG_SYSTEMCMDS_NSHTERM=y CONFIG_SYSTEMCMDS_PARAM=y CONFIG_SYSTEMCMDS_PERF=y +CONFIG_SYSTEMCMDS_PX4LOG=y +CONFIG_SYSTEMCMDS_PX4LOG_TAIL=y CONFIG_SYSTEMCMDS_REBOOT=y CONFIG_SYSTEMCMDS_REFLECT=y CONFIG_SYSTEMCMDS_SD_BENCH=y diff --git a/boards/holybro/pix32v5/nuttx-config/nsh/defconfig b/boards/holybro/pix32v5/nuttx-config/nsh/defconfig index 76efc7a11e..49db63d7d7 100644 --- a/boards/holybro/pix32v5/nuttx-config/nsh/defconfig +++ b/boards/holybro/pix32v5/nuttx-config/nsh/defconfig @@ -138,6 +138,7 @@ CONFIG_NSH_MAXARGUMENTS=15 CONFIG_NSH_NESTDEPTH=8 CONFIG_NSH_QUOTE=y CONFIG_NSH_ROMFSETC=y +CONFIG_NSH_ROMFSRC=y CONFIG_NSH_ROMFSSECTSIZE=128 CONFIG_NSH_STRERROR=y CONFIG_NSH_VARS=y diff --git a/boards/holybro/pix32v5/src/board_config.h b/boards/holybro/pix32v5/src/board_config.h index 67b3909f78..f0f125116b 100644 --- a/boards/holybro/pix32v5/src/board_config.h +++ b/boards/holybro/pix32v5/src/board_config.h @@ -428,7 +428,6 @@ GPIO_nARMED_INIT \ } -#define BOARD_ENABLE_CONSOLE_BUFFER #define BOARD_NUM_IO_TIMERS 5 diff --git a/boards/matek/gnss-m9n-f4/default.px4board b/boards/matek/gnss-m9n-f4/default.px4board index 13ecd3e14c..0701ab2a79 100644 --- a/boards/matek/gnss-m9n-f4/default.px4board +++ b/boards/matek/gnss-m9n-f4/default.px4board @@ -30,6 +30,8 @@ CONFIG_SYSTEMCMDS_I2CDETECT=y CONFIG_SYSTEMCMDS_NSHTERM=y CONFIG_SYSTEMCMDS_PARAM=y CONFIG_SYSTEMCMDS_PERF=y +CONFIG_SYSTEMCMDS_PX4LOG=y +CONFIG_SYSTEMCMDS_PX4LOG_TAIL=y CONFIG_SYSTEMCMDS_REBOOT=y CONFIG_SYSTEMCMDS_SERIAL_PASSTHRU=y CONFIG_SERIAL_PASSTHRU_UBLOX=y diff --git a/boards/matek/gnss-m9n-f4/nuttx-config/nsh/defconfig b/boards/matek/gnss-m9n-f4/nuttx-config/nsh/defconfig index fb6ecf3ba4..92d39fa1ff 100644 --- a/boards/matek/gnss-m9n-f4/nuttx-config/nsh/defconfig +++ b/boards/matek/gnss-m9n-f4/nuttx-config/nsh/defconfig @@ -129,6 +129,7 @@ CONFIG_NSH_MMCSDSPIPORTNO=3 CONFIG_NSH_NESTDEPTH=8 CONFIG_NSH_QUOTE=y CONFIG_NSH_ROMFSETC=y +CONFIG_NSH_ROMFSRC=y CONFIG_NSH_ROMFSSECTSIZE=128 CONFIG_NSH_STRERROR=y CONFIG_NSH_VARS=y diff --git a/boards/matek/gnss-m9n-f4/src/board_config.h b/boards/matek/gnss-m9n-f4/src/board_config.h index 7ca98af1c8..8d8162fc9e 100755 --- a/boards/matek/gnss-m9n-f4/src/board_config.h +++ b/boards/matek/gnss-m9n-f4/src/board_config.h @@ -83,7 +83,6 @@ #define HRT_TIMER 3 /* use timer 3 as HRT */ #define HRT_TIMER_CHANNEL 4 /* use capture/compare channel 4 */ -#define BOARD_ENABLE_CONSOLE_BUFFER /* This board provides a DMA pool and APIs */ #define BOARD_DMA_ALLOC_POOL_SIZE 5120 diff --git a/boards/matek/h743-mini/default.px4board b/boards/matek/h743-mini/default.px4board index d7220fee71..a229b33fb6 100644 --- a/boards/matek/h743-mini/default.px4board +++ b/boards/matek/h743-mini/default.px4board @@ -58,6 +58,8 @@ CONFIG_SYSTEMCMDS_I2CDETECT=y CONFIG_SYSTEMCMDS_NSHTERM=y CONFIG_SYSTEMCMDS_PARAM=y CONFIG_SYSTEMCMDS_PERF=y +CONFIG_SYSTEMCMDS_PX4LOG=y +CONFIG_SYSTEMCMDS_PX4LOG_TAIL=y CONFIG_SYSTEMCMDS_REBOOT=y CONFIG_SYSTEMCMDS_SYSTEM_TIME=y CONFIG_SYSTEMCMDS_TOP=y diff --git a/boards/matek/h743-mini/nuttx-config/nsh/defconfig b/boards/matek/h743-mini/nuttx-config/nsh/defconfig index a4c347fe03..17bfe215b9 100644 --- a/boards/matek/h743-mini/nuttx-config/nsh/defconfig +++ b/boards/matek/h743-mini/nuttx-config/nsh/defconfig @@ -133,6 +133,7 @@ CONFIG_NSH_MAXARGUMENTS=15 CONFIG_NSH_NESTDEPTH=8 CONFIG_NSH_QUOTE=y CONFIG_NSH_ROMFSETC=y +CONFIG_NSH_ROMFSRC=y CONFIG_NSH_ROMFSSECTSIZE=128 CONFIG_NSH_STRERROR=y CONFIG_NSH_VARS=y diff --git a/boards/matek/h743-mini/src/board_config.h b/boards/matek/h743-mini/src/board_config.h index 151d6b59c5..39402e0257 100644 --- a/boards/matek/h743-mini/src/board_config.h +++ b/boards/matek/h743-mini/src/board_config.h @@ -185,7 +185,6 @@ GPIO_TONE_ALARM_IDLE, \ } -#define BOARD_ENABLE_CONSOLE_BUFFER #define BOARD_NUM_IO_TIMERS 4 diff --git a/boards/matek/h743-slim/default.px4board b/boards/matek/h743-slim/default.px4board index 491c3e3846..38fc1d6b8e 100644 --- a/boards/matek/h743-slim/default.px4board +++ b/boards/matek/h743-slim/default.px4board @@ -59,6 +59,8 @@ CONFIG_SYSTEMCMDS_I2CDETECT=y CONFIG_SYSTEMCMDS_NSHTERM=y CONFIG_SYSTEMCMDS_PARAM=y CONFIG_SYSTEMCMDS_PERF=y +CONFIG_SYSTEMCMDS_PX4LOG=y +CONFIG_SYSTEMCMDS_PX4LOG_TAIL=y CONFIG_SYSTEMCMDS_REBOOT=y CONFIG_SYSTEMCMDS_SYSTEM_TIME=y CONFIG_SYSTEMCMDS_TOP=y diff --git a/boards/matek/h743-slim/nuttx-config/nsh/defconfig b/boards/matek/h743-slim/nuttx-config/nsh/defconfig index 94267a1a2b..0b55a46991 100644 --- a/boards/matek/h743-slim/nuttx-config/nsh/defconfig +++ b/boards/matek/h743-slim/nuttx-config/nsh/defconfig @@ -135,6 +135,7 @@ CONFIG_NSH_MAXARGUMENTS=15 CONFIG_NSH_NESTDEPTH=8 CONFIG_NSH_QUOTE=y CONFIG_NSH_ROMFSETC=y +CONFIG_NSH_ROMFSRC=y CONFIG_NSH_ROMFSSECTSIZE=128 CONFIG_NSH_STRERROR=y CONFIG_NSH_VARS=y diff --git a/boards/matek/h743-slim/src/board_config.h b/boards/matek/h743-slim/src/board_config.h index f977a2e8dd..f90d2a4be6 100644 --- a/boards/matek/h743-slim/src/board_config.h +++ b/boards/matek/h743-slim/src/board_config.h @@ -178,7 +178,6 @@ GPIO_VIDEO_CAM, \ } -#define BOARD_ENABLE_CONSOLE_BUFFER #define BOARD_NUM_IO_TIMERS 4 diff --git a/boards/matek/h743/default.px4board b/boards/matek/h743/default.px4board index 82b5cff455..fb917f23af 100644 --- a/boards/matek/h743/default.px4board +++ b/boards/matek/h743/default.px4board @@ -60,6 +60,8 @@ CONFIG_SYSTEMCMDS_I2CDETECT=y CONFIG_SYSTEMCMDS_NSHTERM=y CONFIG_SYSTEMCMDS_PARAM=y CONFIG_SYSTEMCMDS_PERF=y +CONFIG_SYSTEMCMDS_PX4LOG=y +CONFIG_SYSTEMCMDS_PX4LOG_TAIL=y CONFIG_SYSTEMCMDS_REBOOT=y CONFIG_SYSTEMCMDS_SYSTEM_TIME=y CONFIG_SYSTEMCMDS_TOP=y diff --git a/boards/matek/h743/nuttx-config/nsh/defconfig b/boards/matek/h743/nuttx-config/nsh/defconfig index 39e976d11c..6f2fb41543 100644 --- a/boards/matek/h743/nuttx-config/nsh/defconfig +++ b/boards/matek/h743/nuttx-config/nsh/defconfig @@ -134,6 +134,7 @@ CONFIG_NSH_MAXARGUMENTS=15 CONFIG_NSH_NESTDEPTH=8 CONFIG_NSH_QUOTE=y CONFIG_NSH_ROMFSETC=y +CONFIG_NSH_ROMFSRC=y CONFIG_NSH_ROMFSSECTSIZE=128 CONFIG_NSH_STRERROR=y CONFIG_NSH_VARS=y diff --git a/boards/matek/h743/src/board_config.h b/boards/matek/h743/src/board_config.h index 151d6b59c5..39402e0257 100644 --- a/boards/matek/h743/src/board_config.h +++ b/boards/matek/h743/src/board_config.h @@ -185,7 +185,6 @@ GPIO_TONE_ALARM_IDLE, \ } -#define BOARD_ENABLE_CONSOLE_BUFFER #define BOARD_NUM_IO_TIMERS 4 diff --git a/boards/modalai/fc-v1/default.px4board b/boards/modalai/fc-v1/default.px4board index e3148558c9..0fc9cbcbfc 100644 --- a/boards/modalai/fc-v1/default.px4board +++ b/boards/modalai/fc-v1/default.px4board @@ -90,6 +90,8 @@ CONFIG_SYSTEMCMDS_MTD=y CONFIG_SYSTEMCMDS_NSHTERM=y CONFIG_SYSTEMCMDS_PARAM=y CONFIG_SYSTEMCMDS_PERF=y +CONFIG_SYSTEMCMDS_PX4LOG=y +CONFIG_SYSTEMCMDS_PX4LOG_TAIL=y CONFIG_SYSTEMCMDS_REBOOT=y CONFIG_SYSTEMCMDS_REFLECT=y CONFIG_SYSTEMCMDS_SD_BENCH=y diff --git a/boards/modalai/fc-v1/nuttx-config/nsh/defconfig b/boards/modalai/fc-v1/nuttx-config/nsh/defconfig index b2d2e7eb77..0163210443 100644 --- a/boards/modalai/fc-v1/nuttx-config/nsh/defconfig +++ b/boards/modalai/fc-v1/nuttx-config/nsh/defconfig @@ -137,6 +137,7 @@ CONFIG_NSH_MAXARGUMENTS=15 CONFIG_NSH_NESTDEPTH=8 CONFIG_NSH_QUOTE=y CONFIG_NSH_ROMFSETC=y +CONFIG_NSH_ROMFSRC=y CONFIG_NSH_ROMFSSECTSIZE=128 CONFIG_NSH_STRERROR=y CONFIG_NSH_VARS=y diff --git a/boards/modalai/fc-v1/src/board_config.h b/boards/modalai/fc-v1/src/board_config.h index dcc182420a..970f705293 100644 --- a/boards/modalai/fc-v1/src/board_config.h +++ b/boards/modalai/fc-v1/src/board_config.h @@ -259,7 +259,6 @@ GPIO_FYSNC_INT_ICM20602 \ } -#define BOARD_ENABLE_CONSOLE_BUFFER #define BOARD_NUM_IO_TIMERS 5 diff --git a/boards/modalai/fc-v2/default.px4board b/boards/modalai/fc-v2/default.px4board index abd1648d34..3719517205 100644 --- a/boards/modalai/fc-v2/default.px4board +++ b/boards/modalai/fc-v2/default.px4board @@ -81,6 +81,8 @@ CONFIG_SYSTEMCMDS_MTD=y CONFIG_SYSTEMCMDS_NSHTERM=y CONFIG_SYSTEMCMDS_PARAM=y CONFIG_SYSTEMCMDS_PERF=y +CONFIG_SYSTEMCMDS_PX4LOG=y +CONFIG_SYSTEMCMDS_PX4LOG_TAIL=y CONFIG_SYSTEMCMDS_REBOOT=y CONFIG_SYSTEMCMDS_SD_BENCH=y CONFIG_SYSTEMCMDS_SD_STRESS=y diff --git a/boards/modalai/fc-v2/nuttx-config/nsh/defconfig b/boards/modalai/fc-v2/nuttx-config/nsh/defconfig index 11bb3c3da9..8d8faab9fc 100644 --- a/boards/modalai/fc-v2/nuttx-config/nsh/defconfig +++ b/boards/modalai/fc-v2/nuttx-config/nsh/defconfig @@ -143,6 +143,7 @@ CONFIG_NSH_MAXARGUMENTS=15 CONFIG_NSH_NESTDEPTH=8 CONFIG_NSH_QUOTE=y CONFIG_NSH_ROMFSETC=y +CONFIG_NSH_ROMFSRC=y CONFIG_NSH_ROMFSSECTSIZE=128 CONFIG_NSH_STRERROR=y CONFIG_NSH_VARS=y diff --git a/boards/modalai/fc-v2/src/board_config.h b/boards/modalai/fc-v2/src/board_config.h index 1d9b338bf4..ebfb2f51e7 100644 --- a/boards/modalai/fc-v2/src/board_config.h +++ b/boards/modalai/fc-v2/src/board_config.h @@ -334,7 +334,6 @@ GPIO_IMU_FYSNC, \ } -#define BOARD_ENABLE_CONSOLE_BUFFER #define BOARD_NUM_IO_TIMERS 5 diff --git a/boards/modalai/voxl2/default.px4board b/boards/modalai/voxl2/default.px4board index f261ea253c..e921d32b1f 100644 --- a/boards/modalai/voxl2/default.px4board +++ b/boards/modalai/voxl2/default.px4board @@ -13,6 +13,8 @@ CONFIG_MODULES_RC_UPDATE=y CONFIG_SYSTEMCMDS_BSONDUMP=y CONFIG_SYSTEMCMDS_PARAM=y CONFIG_SYSTEMCMDS_PERF=y +CONFIG_SYSTEMCMDS_PX4LOG=y +CONFIG_SYSTEMCMDS_PX4LOG_TAIL=y CONFIG_SYSTEMCMDS_TOPIC_LISTENER=y CONFIG_SYSTEMCMDS_UORB=y CONFIG_SYSTEMCMDS_VER=y diff --git a/boards/mro/ctrl-zero-classic/default.px4board b/boards/mro/ctrl-zero-classic/default.px4board index 59b9783d70..11d9937016 100644 --- a/boards/mro/ctrl-zero-classic/default.px4board +++ b/boards/mro/ctrl-zero-classic/default.px4board @@ -83,6 +83,8 @@ CONFIG_SYSTEMCMDS_MTD=y CONFIG_SYSTEMCMDS_NSHTERM=y CONFIG_SYSTEMCMDS_PARAM=y CONFIG_SYSTEMCMDS_PERF=y +CONFIG_SYSTEMCMDS_PX4LOG=y +CONFIG_SYSTEMCMDS_PX4LOG_TAIL=y CONFIG_SYSTEMCMDS_REBOOT=y CONFIG_SYSTEMCMDS_REFLECT=y CONFIG_SYSTEMCMDS_SD_BENCH=y diff --git a/boards/mro/ctrl-zero-classic/nuttx-config/nsh/defconfig b/boards/mro/ctrl-zero-classic/nuttx-config/nsh/defconfig index e5169e78ed..0279534bbf 100644 --- a/boards/mro/ctrl-zero-classic/nuttx-config/nsh/defconfig +++ b/boards/mro/ctrl-zero-classic/nuttx-config/nsh/defconfig @@ -140,6 +140,7 @@ CONFIG_NSH_MAXARGUMENTS=15 CONFIG_NSH_NESTDEPTH=8 CONFIG_NSH_QUOTE=y CONFIG_NSH_ROMFSETC=y +CONFIG_NSH_ROMFSRC=y CONFIG_NSH_ROMFSSECTSIZE=128 CONFIG_NSH_STRERROR=y CONFIG_NSH_VARS=y diff --git a/boards/mro/ctrl-zero-classic/src/board_config.h b/boards/mro/ctrl-zero-classic/src/board_config.h index dfb0dfcb1a..1737816a6f 100644 --- a/boards/mro/ctrl-zero-classic/src/board_config.h +++ b/boards/mro/ctrl-zero-classic/src/board_config.h @@ -159,7 +159,6 @@ #define BOARD_NUM_IO_TIMERS 5 -#define BOARD_ENABLE_CONSOLE_BUFFER #define PX4_GPIO_INIT_LIST { \ PX4_ADC_GPIO, \ diff --git a/boards/mro/ctrl-zero-f7-oem/default.px4board b/boards/mro/ctrl-zero-f7-oem/default.px4board index 9250904055..23cea52121 100644 --- a/boards/mro/ctrl-zero-f7-oem/default.px4board +++ b/boards/mro/ctrl-zero-f7-oem/default.px4board @@ -85,6 +85,8 @@ CONFIG_SYSTEMCMDS_MTD=y CONFIG_SYSTEMCMDS_NSHTERM=y CONFIG_SYSTEMCMDS_PARAM=y CONFIG_SYSTEMCMDS_PERF=y +CONFIG_SYSTEMCMDS_PX4LOG=y +CONFIG_SYSTEMCMDS_PX4LOG_TAIL=y CONFIG_SYSTEMCMDS_REBOOT=y CONFIG_SYSTEMCMDS_REFLECT=y CONFIG_SYSTEMCMDS_SD_BENCH=y diff --git a/boards/mro/ctrl-zero-f7-oem/nuttx-config/nsh/defconfig b/boards/mro/ctrl-zero-f7-oem/nuttx-config/nsh/defconfig index da43bb2b3f..4a6982879e 100644 --- a/boards/mro/ctrl-zero-f7-oem/nuttx-config/nsh/defconfig +++ b/boards/mro/ctrl-zero-f7-oem/nuttx-config/nsh/defconfig @@ -137,6 +137,7 @@ CONFIG_NSH_MAXARGUMENTS=15 CONFIG_NSH_NESTDEPTH=8 CONFIG_NSH_QUOTE=y CONFIG_NSH_ROMFSETC=y +CONFIG_NSH_ROMFSRC=y CONFIG_NSH_ROMFSSECTSIZE=128 CONFIG_NSH_STRERROR=y CONFIG_NSH_VARS=y diff --git a/boards/mro/ctrl-zero-f7-oem/src/board_config.h b/boards/mro/ctrl-zero-f7-oem/src/board_config.h index 5f00959de0..04533f001e 100644 --- a/boards/mro/ctrl-zero-f7-oem/src/board_config.h +++ b/boards/mro/ctrl-zero-f7-oem/src/board_config.h @@ -194,7 +194,6 @@ GPIO_SAFETY_SWITCH_IN, \ } -#define BOARD_ENABLE_CONSOLE_BUFFER #define BOARD_NUM_IO_TIMERS 3 diff --git a/boards/mro/ctrl-zero-f7/default.px4board b/boards/mro/ctrl-zero-f7/default.px4board index 6a544512b4..dc3c511cd3 100644 --- a/boards/mro/ctrl-zero-f7/default.px4board +++ b/boards/mro/ctrl-zero-f7/default.px4board @@ -85,6 +85,8 @@ CONFIG_SYSTEMCMDS_MTD=y CONFIG_SYSTEMCMDS_NSHTERM=y CONFIG_SYSTEMCMDS_PARAM=y CONFIG_SYSTEMCMDS_PERF=y +CONFIG_SYSTEMCMDS_PX4LOG=y +CONFIG_SYSTEMCMDS_PX4LOG_TAIL=y CONFIG_SYSTEMCMDS_REBOOT=y CONFIG_SYSTEMCMDS_REFLECT=y CONFIG_SYSTEMCMDS_SD_BENCH=y diff --git a/boards/mro/ctrl-zero-f7/nuttx-config/nsh/defconfig b/boards/mro/ctrl-zero-f7/nuttx-config/nsh/defconfig index 8ec771c53c..cea1cb7a97 100644 --- a/boards/mro/ctrl-zero-f7/nuttx-config/nsh/defconfig +++ b/boards/mro/ctrl-zero-f7/nuttx-config/nsh/defconfig @@ -137,6 +137,7 @@ CONFIG_NSH_MAXARGUMENTS=15 CONFIG_NSH_NESTDEPTH=8 CONFIG_NSH_QUOTE=y CONFIG_NSH_ROMFSETC=y +CONFIG_NSH_ROMFSRC=y CONFIG_NSH_ROMFSSECTSIZE=128 CONFIG_NSH_STRERROR=y CONFIG_NSH_VARS=y diff --git a/boards/mro/ctrl-zero-f7/src/board_config.h b/boards/mro/ctrl-zero-f7/src/board_config.h index 7dc7ce0455..057b6d75df 100644 --- a/boards/mro/ctrl-zero-f7/src/board_config.h +++ b/boards/mro/ctrl-zero-f7/src/board_config.h @@ -190,7 +190,6 @@ GPIO_SAFETY_SWITCH_IN, \ } -#define BOARD_ENABLE_CONSOLE_BUFFER #define BOARD_NUM_IO_TIMERS 3 diff --git a/boards/mro/ctrl-zero-h7-oem/default.px4board b/boards/mro/ctrl-zero-h7-oem/default.px4board index bc6afa3a00..63f4b9bd69 100644 --- a/boards/mro/ctrl-zero-h7-oem/default.px4board +++ b/boards/mro/ctrl-zero-h7-oem/default.px4board @@ -81,6 +81,8 @@ CONFIG_SYSTEMCMDS_MTD=y CONFIG_SYSTEMCMDS_NSHTERM=y CONFIG_SYSTEMCMDS_PARAM=y CONFIG_SYSTEMCMDS_PERF=y +CONFIG_SYSTEMCMDS_PX4LOG=y +CONFIG_SYSTEMCMDS_PX4LOG_TAIL=y CONFIG_SYSTEMCMDS_REBOOT=y CONFIG_SYSTEMCMDS_REFLECT=y CONFIG_SYSTEMCMDS_SD_BENCH=y diff --git a/boards/mro/ctrl-zero-h7-oem/nuttx-config/nsh/defconfig b/boards/mro/ctrl-zero-h7-oem/nuttx-config/nsh/defconfig index a79a19a5e0..3aca5ac5a5 100644 --- a/boards/mro/ctrl-zero-h7-oem/nuttx-config/nsh/defconfig +++ b/boards/mro/ctrl-zero-h7-oem/nuttx-config/nsh/defconfig @@ -138,6 +138,7 @@ CONFIG_NSH_MAXARGUMENTS=15 CONFIG_NSH_NESTDEPTH=8 CONFIG_NSH_QUOTE=y CONFIG_NSH_ROMFSETC=y +CONFIG_NSH_ROMFSRC=y CONFIG_NSH_ROMFSSECTSIZE=128 CONFIG_NSH_STRERROR=y CONFIG_NSH_VARS=y diff --git a/boards/mro/ctrl-zero-h7-oem/src/board_config.h b/boards/mro/ctrl-zero-h7-oem/src/board_config.h index c573b6522e..28a1cfcc90 100644 --- a/boards/mro/ctrl-zero-h7-oem/src/board_config.h +++ b/boards/mro/ctrl-zero-h7-oem/src/board_config.h @@ -158,7 +158,6 @@ #define BOARD_NUM_IO_TIMERS 3 -#define BOARD_ENABLE_CONSOLE_BUFFER #define PX4_GPIO_INIT_LIST { \ PX4_ADC_GPIO, \ diff --git a/boards/mro/ctrl-zero-h7/default.px4board b/boards/mro/ctrl-zero-h7/default.px4board index 5a58633109..a7a7b95112 100644 --- a/boards/mro/ctrl-zero-h7/default.px4board +++ b/boards/mro/ctrl-zero-h7/default.px4board @@ -82,6 +82,8 @@ CONFIG_SYSTEMCMDS_MTD=y CONFIG_SYSTEMCMDS_NSHTERM=y CONFIG_SYSTEMCMDS_PARAM=y CONFIG_SYSTEMCMDS_PERF=y +CONFIG_SYSTEMCMDS_PX4LOG=y +CONFIG_SYSTEMCMDS_PX4LOG_TAIL=y CONFIG_SYSTEMCMDS_REBOOT=y CONFIG_SYSTEMCMDS_REFLECT=y CONFIG_SYSTEMCMDS_SD_BENCH=y diff --git a/boards/mro/ctrl-zero-h7/nuttx-config/nsh/defconfig b/boards/mro/ctrl-zero-h7/nuttx-config/nsh/defconfig index a0f041492e..345b3bd228 100644 --- a/boards/mro/ctrl-zero-h7/nuttx-config/nsh/defconfig +++ b/boards/mro/ctrl-zero-h7/nuttx-config/nsh/defconfig @@ -138,6 +138,7 @@ CONFIG_NSH_MAXARGUMENTS=15 CONFIG_NSH_NESTDEPTH=8 CONFIG_NSH_QUOTE=y CONFIG_NSH_ROMFSETC=y +CONFIG_NSH_ROMFSRC=y CONFIG_NSH_ROMFSSECTSIZE=128 CONFIG_NSH_STRERROR=y CONFIG_NSH_VARS=y diff --git a/boards/mro/ctrl-zero-h7/src/board_config.h b/boards/mro/ctrl-zero-h7/src/board_config.h index cd8f5921ef..28868120f1 100644 --- a/boards/mro/ctrl-zero-h7/src/board_config.h +++ b/boards/mro/ctrl-zero-h7/src/board_config.h @@ -158,7 +158,6 @@ #define BOARD_NUM_IO_TIMERS 3 -#define BOARD_ENABLE_CONSOLE_BUFFER #define PX4_GPIO_INIT_LIST { \ PX4_ADC_GPIO, \ diff --git a/boards/mro/pixracerpro/default.px4board b/boards/mro/pixracerpro/default.px4board index 3c6d0c249b..490bd8f1d3 100644 --- a/boards/mro/pixracerpro/default.px4board +++ b/boards/mro/pixracerpro/default.px4board @@ -81,6 +81,8 @@ CONFIG_SYSTEMCMDS_MTD=y CONFIG_SYSTEMCMDS_NSHTERM=y CONFIG_SYSTEMCMDS_PARAM=y CONFIG_SYSTEMCMDS_PERF=y +CONFIG_SYSTEMCMDS_PX4LOG=y +CONFIG_SYSTEMCMDS_PX4LOG_TAIL=y CONFIG_SYSTEMCMDS_REBOOT=y CONFIG_SYSTEMCMDS_REFLECT=y CONFIG_SYSTEMCMDS_SD_BENCH=y diff --git a/boards/mro/pixracerpro/nuttx-config/nsh/defconfig b/boards/mro/pixracerpro/nuttx-config/nsh/defconfig index 10446138d7..0bfab70455 100644 --- a/boards/mro/pixracerpro/nuttx-config/nsh/defconfig +++ b/boards/mro/pixracerpro/nuttx-config/nsh/defconfig @@ -139,6 +139,7 @@ CONFIG_NSH_MAXARGUMENTS=15 CONFIG_NSH_NESTDEPTH=8 CONFIG_NSH_QUOTE=y CONFIG_NSH_ROMFSETC=y +CONFIG_NSH_ROMFSRC=y CONFIG_NSH_ROMFSSECTSIZE=128 CONFIG_NSH_STRERROR=y CONFIG_NSH_VARS=y diff --git a/boards/mro/pixracerpro/src/board_config.h b/boards/mro/pixracerpro/src/board_config.h index 0d067bb12c..90bc31e0cc 100644 --- a/boards/mro/pixracerpro/src/board_config.h +++ b/boards/mro/pixracerpro/src/board_config.h @@ -148,7 +148,6 @@ #define BOARD_NUM_IO_TIMERS 3 #define BOARD_DMA_ALLOC_POOL_SIZE 5120 /* This board provides a DMA pool and APIs */ #define BOARD_HAS_ON_RESET 1 /* This board provides the board_on_reset interface */ -#define BOARD_ENABLE_CONSOLE_BUFFER #define PX4_GPIO_INIT_LIST { \ PX4_ADC_GPIO, \ diff --git a/boards/mro/x21-777/default.px4board b/boards/mro/x21-777/default.px4board index 8ea461426b..689e812415 100644 --- a/boards/mro/x21-777/default.px4board +++ b/boards/mro/x21-777/default.px4board @@ -86,6 +86,8 @@ CONFIG_SYSTEMCMDS_MTD=y CONFIG_SYSTEMCMDS_NSHTERM=y CONFIG_SYSTEMCMDS_PARAM=y CONFIG_SYSTEMCMDS_PERF=y +CONFIG_SYSTEMCMDS_PX4LOG=y +CONFIG_SYSTEMCMDS_PX4LOG_TAIL=y CONFIG_SYSTEMCMDS_REBOOT=y CONFIG_SYSTEMCMDS_REFLECT=y CONFIG_SYSTEMCMDS_SD_BENCH=y diff --git a/boards/mro/x21-777/nuttx-config/nsh/defconfig b/boards/mro/x21-777/nuttx-config/nsh/defconfig index 6d15b6c475..07ef47c1a1 100644 --- a/boards/mro/x21-777/nuttx-config/nsh/defconfig +++ b/boards/mro/x21-777/nuttx-config/nsh/defconfig @@ -137,6 +137,7 @@ CONFIG_NSH_MAXARGUMENTS=15 CONFIG_NSH_NESTDEPTH=8 CONFIG_NSH_QUOTE=y CONFIG_NSH_ROMFSETC=y +CONFIG_NSH_ROMFSRC=y CONFIG_NSH_ROMFSSECTSIZE=128 CONFIG_NSH_STRERROR=y CONFIG_NSH_VARS=y diff --git a/boards/mro/x21-777/src/board_config.h b/boards/mro/x21-777/src/board_config.h index 30abf1e467..a9f9108461 100644 --- a/boards/mro/x21-777/src/board_config.h +++ b/boards/mro/x21-777/src/board_config.h @@ -129,7 +129,6 @@ #define SDIO_SLOTNO 0 /* Only one slot */ #define SDIO_MINOR 0 -#define BOARD_ENABLE_CONSOLE_BUFFER #define BOARD_NUM_IO_TIMERS 3 diff --git a/boards/mro/x21/default.px4board b/boards/mro/x21/default.px4board index 04aa8d0bd6..8ae3416b07 100644 --- a/boards/mro/x21/default.px4board +++ b/boards/mro/x21/default.px4board @@ -86,6 +86,8 @@ CONFIG_SYSTEMCMDS_MTD=y CONFIG_SYSTEMCMDS_NSHTERM=y CONFIG_SYSTEMCMDS_PARAM=y CONFIG_SYSTEMCMDS_PERF=y +CONFIG_SYSTEMCMDS_PX4LOG=y +CONFIG_SYSTEMCMDS_PX4LOG_TAIL=y CONFIG_SYSTEMCMDS_REBOOT=y CONFIG_SYSTEMCMDS_REFLECT=y CONFIG_SYSTEMCMDS_SD_BENCH=y diff --git a/boards/mro/x21/nuttx-config/nsh/defconfig b/boards/mro/x21/nuttx-config/nsh/defconfig index 9d891cd2f7..27a31e3c53 100644 --- a/boards/mro/x21/nuttx-config/nsh/defconfig +++ b/boards/mro/x21/nuttx-config/nsh/defconfig @@ -133,6 +133,7 @@ CONFIG_NSH_MAXARGUMENTS=15 CONFIG_NSH_NESTDEPTH=8 CONFIG_NSH_QUOTE=y CONFIG_NSH_ROMFSETC=y +CONFIG_NSH_ROMFSRC=y CONFIG_NSH_ROMFSSECTSIZE=128 CONFIG_NSH_STRERROR=y CONFIG_NSH_VARS=y diff --git a/boards/nxp/fmuk66-e/default.px4board b/boards/nxp/fmuk66-e/default.px4board index ee40632563..722834569c 100644 --- a/boards/nxp/fmuk66-e/default.px4board +++ b/boards/nxp/fmuk66-e/default.px4board @@ -81,6 +81,8 @@ CONFIG_SYSTEMCMDS_MTD=y CONFIG_SYSTEMCMDS_NSHTERM=y CONFIG_SYSTEMCMDS_PARAM=y CONFIG_SYSTEMCMDS_PERF=y +CONFIG_SYSTEMCMDS_PX4LOG=y +CONFIG_SYSTEMCMDS_PX4LOG_TAIL=y CONFIG_SYSTEMCMDS_REBOOT=y CONFIG_SYSTEMCMDS_REFLECT=y CONFIG_SYSTEMCMDS_SD_BENCH=y diff --git a/boards/nxp/fmuk66-e/nuttx-config/nsh/defconfig b/boards/nxp/fmuk66-e/nuttx-config/nsh/defconfig index 6b9fa1a438..180b2a8e40 100644 --- a/boards/nxp/fmuk66-e/nuttx-config/nsh/defconfig +++ b/boards/nxp/fmuk66-e/nuttx-config/nsh/defconfig @@ -161,6 +161,7 @@ CONFIG_NSH_MAXARGUMENTS=15 CONFIG_NSH_NESTDEPTH=8 CONFIG_NSH_READLINE=y CONFIG_NSH_ROMFSETC=y +CONFIG_NSH_ROMFSRC=y CONFIG_NSH_ROMFSSECTSIZE=128 CONFIG_NSH_STRERROR=y CONFIG_NSH_VARS=y diff --git a/boards/nxp/fmuk66-e/nuttx-config/socketcan/defconfig b/boards/nxp/fmuk66-e/nuttx-config/socketcan/defconfig index 2d05953375..5f68b0cae4 100644 --- a/boards/nxp/fmuk66-e/nuttx-config/socketcan/defconfig +++ b/boards/nxp/fmuk66-e/nuttx-config/socketcan/defconfig @@ -162,6 +162,7 @@ CONFIG_NSH_MAXARGUMENTS=15 CONFIG_NSH_NESTDEPTH=8 CONFIG_NSH_READLINE=y CONFIG_NSH_ROMFSETC=y +CONFIG_NSH_ROMFSRC=y CONFIG_NSH_ROMFSSECTSIZE=128 CONFIG_NSH_STRERROR=y CONFIG_NSH_TELNETD_CLIENTSTACKSIZE=1280 diff --git a/boards/nxp/fmuk66-v3/default.px4board b/boards/nxp/fmuk66-v3/default.px4board index e4b2dd9462..eea62a6c0d 100644 --- a/boards/nxp/fmuk66-v3/default.px4board +++ b/boards/nxp/fmuk66-v3/default.px4board @@ -83,6 +83,8 @@ CONFIG_SYSTEMCMDS_MTD=y CONFIG_SYSTEMCMDS_NSHTERM=y CONFIG_SYSTEMCMDS_PARAM=y CONFIG_SYSTEMCMDS_PERF=y +CONFIG_SYSTEMCMDS_PX4LOG=y +CONFIG_SYSTEMCMDS_PX4LOG_TAIL=y CONFIG_SYSTEMCMDS_REBOOT=y CONFIG_SYSTEMCMDS_REFLECT=y CONFIG_SYSTEMCMDS_SD_BENCH=y diff --git a/boards/nxp/fmuk66-v3/nuttx-config/nsh/defconfig b/boards/nxp/fmuk66-v3/nuttx-config/nsh/defconfig index 23a497e7b0..a18fe97271 100644 --- a/boards/nxp/fmuk66-v3/nuttx-config/nsh/defconfig +++ b/boards/nxp/fmuk66-v3/nuttx-config/nsh/defconfig @@ -164,6 +164,7 @@ CONFIG_NSH_MAXARGUMENTS=15 CONFIG_NSH_NESTDEPTH=8 CONFIG_NSH_READLINE=y CONFIG_NSH_ROMFSETC=y +CONFIG_NSH_ROMFSRC=y CONFIG_NSH_ROMFSSECTSIZE=128 CONFIG_NSH_STRERROR=y CONFIG_NSH_VARS=y diff --git a/boards/nxp/fmuk66-v3/nuttx-config/socketcan/defconfig b/boards/nxp/fmuk66-v3/nuttx-config/socketcan/defconfig index 4638f1ee76..0104640f9c 100644 --- a/boards/nxp/fmuk66-v3/nuttx-config/socketcan/defconfig +++ b/boards/nxp/fmuk66-v3/nuttx-config/socketcan/defconfig @@ -161,6 +161,7 @@ CONFIG_NSH_MAXARGUMENTS=15 CONFIG_NSH_NESTDEPTH=8 CONFIG_NSH_READLINE=y CONFIG_NSH_ROMFSETC=y +CONFIG_NSH_ROMFSRC=y CONFIG_NSH_ROMFSSECTSIZE=128 CONFIG_NSH_STRERROR=y CONFIG_NSH_TELNETD_CLIENTSTACKSIZE=1280 diff --git a/boards/nxp/fmuk66-v3/nuttx-config/test/defconfig b/boards/nxp/fmuk66-v3/nuttx-config/test/defconfig index c428852e9b..082b7aa39e 100644 --- a/boards/nxp/fmuk66-v3/nuttx-config/test/defconfig +++ b/boards/nxp/fmuk66-v3/nuttx-config/test/defconfig @@ -162,6 +162,7 @@ CONFIG_NSH_MAXARGUMENTS=15 CONFIG_NSH_NESTDEPTH=8 CONFIG_NSH_READLINE=y CONFIG_NSH_ROMFSETC=y +CONFIG_NSH_ROMFSRC=y CONFIG_NSH_ROMFSSECTSIZE=128 CONFIG_NSH_STRERROR=y CONFIG_NSH_TELNETD_CLIENTSTACKSIZE=1280 diff --git a/boards/nxp/fmurt1062-v1/default.px4board b/boards/nxp/fmurt1062-v1/default.px4board index 7d04b986f1..ab817a7943 100644 --- a/boards/nxp/fmurt1062-v1/default.px4board +++ b/boards/nxp/fmurt1062-v1/default.px4board @@ -60,6 +60,8 @@ CONFIG_SYSTEMCMDS_MTD=y CONFIG_SYSTEMCMDS_NSHTERM=y CONFIG_SYSTEMCMDS_PARAM=y CONFIG_SYSTEMCMDS_PERF=y +CONFIG_SYSTEMCMDS_PX4LOG=y +CONFIG_SYSTEMCMDS_PX4LOG_TAIL=y CONFIG_SYSTEMCMDS_REBOOT=y CONFIG_SYSTEMCMDS_SD_BENCH=y CONFIG_SYSTEMCMDS_SD_STRESS=y diff --git a/boards/nxp/fmurt1062-v1/nuttx-config/nsh/defconfig b/boards/nxp/fmurt1062-v1/nuttx-config/nsh/defconfig index 106dc07237..824f963354 100644 --- a/boards/nxp/fmurt1062-v1/nuttx-config/nsh/defconfig +++ b/boards/nxp/fmurt1062-v1/nuttx-config/nsh/defconfig @@ -177,6 +177,7 @@ CONFIG_NSH_MAXARGUMENTS=15 CONFIG_NSH_NESTDEPTH=8 CONFIG_NSH_READLINE=y CONFIG_NSH_ROMFSETC=y +CONFIG_NSH_ROMFSRC=y CONFIG_NSH_ROMFSSECTSIZE=128 CONFIG_NSH_STRERROR=y CONFIG_NSH_VARS=y diff --git a/boards/nxp/fmurt1062-v1/src/board_config.h b/boards/nxp/fmurt1062-v1/src/board_config.h index 091b400418..9fac1853b4 100644 --- a/boards/nxp/fmurt1062-v1/src/board_config.h +++ b/boards/nxp/fmurt1062-v1/src/board_config.h @@ -432,7 +432,6 @@ GPIO_SAFETY_SWITCH_IN \ } -#define BOARD_ENABLE_CONSOLE_BUFFER __BEGIN_DECLS /**************************************************************************************************** diff --git a/boards/nxp/mr-canhubk3/default.px4board b/boards/nxp/mr-canhubk3/default.px4board index 277c62de78..33a70be38b 100644 --- a/boards/nxp/mr-canhubk3/default.px4board +++ b/boards/nxp/mr-canhubk3/default.px4board @@ -17,6 +17,8 @@ CONFIG_SYSTEMCMDS_LED_CONTROL=y CONFIG_SYSTEMCMDS_MFT=y CONFIG_SYSTEMCMDS_MTD=y CONFIG_SYSTEMCMDS_PARAM=y +CONFIG_SYSTEMCMDS_PX4LOG=y +CONFIG_SYSTEMCMDS_PX4LOG_TAIL=y CONFIG_SYSTEMCMDS_REBOOT=y CONFIG_SYSTEMCMDS_SD_BENCH=y CONFIG_SYSTEMCMDS_SD_STRESS=y diff --git a/boards/nxp/mr-canhubk3/nuttx-config/nsh/defconfig b/boards/nxp/mr-canhubk3/nuttx-config/nsh/defconfig index f5facd0fdd..88cdddfe94 100644 --- a/boards/nxp/mr-canhubk3/nuttx-config/nsh/defconfig +++ b/boards/nxp/mr-canhubk3/nuttx-config/nsh/defconfig @@ -196,6 +196,7 @@ CONFIG_NSH_MMCSDSPIPORTNO=1 CONFIG_NSH_NESTDEPTH=8 CONFIG_NSH_QUOTE=y CONFIG_NSH_ROMFSETC=y +CONFIG_NSH_ROMFSRC=y CONFIG_NSH_ROMFSSECTSIZE=128 CONFIG_NSH_STRERROR=y CONFIG_NSH_TELNET=y diff --git a/boards/nxp/mr-canhubk3/nuttx-config/sysview/defconfig b/boards/nxp/mr-canhubk3/nuttx-config/sysview/defconfig index 32169a8ae5..7955e003fd 100644 --- a/boards/nxp/mr-canhubk3/nuttx-config/sysview/defconfig +++ b/boards/nxp/mr-canhubk3/nuttx-config/sysview/defconfig @@ -197,6 +197,7 @@ CONFIG_NSH_MMCSDSPIPORTNO=1 CONFIG_NSH_NESTDEPTH=8 CONFIG_NSH_QUOTE=y CONFIG_NSH_ROMFSETC=y +CONFIG_NSH_ROMFSRC=y CONFIG_NSH_ROMFSSECTSIZE=128 CONFIG_NSH_STRERROR=y CONFIG_NSH_TELNET=y diff --git a/boards/nxp/mr-canhubk3/src/board_config.h b/boards/nxp/mr-canhubk3/src/board_config.h index 49a3162af6..1962dc1a41 100644 --- a/boards/nxp/mr-canhubk3/src/board_config.h +++ b/boards/nxp/mr-canhubk3/src/board_config.h @@ -91,7 +91,6 @@ __BEGIN_DECLS #define RC_SERIAL_SINGLEWIRE #define RC_SERIAL_INVERT_RX_ONLY -#define BOARD_ENABLE_CONSOLE_BUFFER /* * Hardfault log to progmem diff --git a/boards/nxp/ucans32k146/default.px4board b/boards/nxp/ucans32k146/default.px4board index eb28094dd9..f37a8cc71a 100644 --- a/boards/nxp/ucans32k146/default.px4board +++ b/boards/nxp/ucans32k146/default.px4board @@ -36,6 +36,8 @@ CONFIG_SYSTEMCMDS_LED_CONTROL=y CONFIG_SYSTEMCMDS_MFT=y CONFIG_SYSTEMCMDS_MTD=y CONFIG_SYSTEMCMDS_PARAM=y +CONFIG_SYSTEMCMDS_PX4LOG=y +CONFIG_SYSTEMCMDS_PX4LOG_TAIL=y CONFIG_SYSTEMCMDS_REBOOT=y CONFIG_SYSTEMCMDS_SYSTEM_TIME=y CONFIG_SYSTEMCMDS_TOP=y diff --git a/boards/nxp/ucans32k146/nuttx-config/nsh/defconfig b/boards/nxp/ucans32k146/nuttx-config/nsh/defconfig index b66b8e0498..553e2ffbf9 100644 --- a/boards/nxp/ucans32k146/nuttx-config/nsh/defconfig +++ b/boards/nxp/ucans32k146/nuttx-config/nsh/defconfig @@ -82,6 +82,7 @@ CONFIG_NSH_LINELEN=128 CONFIG_NSH_MAXARGUMENTS=15 CONFIG_NSH_NESTDEPTH=8 CONFIG_NSH_ROMFSETC=y +CONFIG_NSH_ROMFSRC=y CONFIG_NSH_ROMFSSECTSIZE=128 CONFIG_NSH_STRERROR=y CONFIG_NSH_VARS=y diff --git a/boards/omnibus/f4sd/default.px4board b/boards/omnibus/f4sd/default.px4board index 0b5b32c1cb..532cea8668 100644 --- a/boards/omnibus/f4sd/default.px4board +++ b/boards/omnibus/f4sd/default.px4board @@ -35,3 +35,5 @@ CONFIG_MODULES_SENSORS=y # CONFIG_SENSORS_VEHICLE_AIRSPEED is not set CONFIG_SYSTEMCMDS_HARDFAULT_LOG=y CONFIG_SYSTEMCMDS_PARAM=y +CONFIG_SYSTEMCMDS_PX4LOG=y +CONFIG_SYSTEMCMDS_PX4LOG_TAIL=y diff --git a/boards/omnibus/f4sd/nuttx-config/nsh/defconfig b/boards/omnibus/f4sd/nuttx-config/nsh/defconfig index 8cdd6c1e6f..fddb536ce5 100644 --- a/boards/omnibus/f4sd/nuttx-config/nsh/defconfig +++ b/boards/omnibus/f4sd/nuttx-config/nsh/defconfig @@ -92,6 +92,7 @@ CONFIG_NSH_MMCSDSPIPORTNO=2 CONFIG_NSH_NESTDEPTH=8 CONFIG_NSH_READLINE=y CONFIG_NSH_ROMFSETC=y +CONFIG_NSH_ROMFSRC=y CONFIG_NSH_ROMFSSECTSIZE=128 CONFIG_NSH_STRERROR=y CONFIG_NSH_VARS=y diff --git a/boards/omnibus/f4sd/src/board_config.h b/boards/omnibus/f4sd/src/board_config.h index 627a42e9c0..54bae5ab67 100644 --- a/boards/omnibus/f4sd/src/board_config.h +++ b/boards/omnibus/f4sd/src/board_config.h @@ -144,8 +144,7 @@ #define BOARD_HAS_ON_RESET 1 -#define BOARD_ENABLE_CONSOLE_BUFFER -#define BOARD_CONSOLE_BUFFER_SIZE (1024*3) + __BEGIN_DECLS diff --git a/boards/px4/fmu-v2/default.px4board b/boards/px4/fmu-v2/default.px4board index 5c414a109a..3217f8b983 100644 --- a/boards/px4/fmu-v2/default.px4board +++ b/boards/px4/fmu-v2/default.px4board @@ -42,6 +42,8 @@ CONFIG_SYSTEMCMDS_HARDFAULT_LOG=y CONFIG_SYSTEMCMDS_MFT=y CONFIG_SYSTEMCMDS_MTD=y CONFIG_SYSTEMCMDS_PARAM=y +CONFIG_SYSTEMCMDS_PX4LOG=y +CONFIG_SYSTEMCMDS_PX4LOG_TAIL=y CONFIG_SYSTEMCMDS_REBOOT=y CONFIG_SYSTEMCMDS_TUNE_CONTROL=y CONFIG_SYSTEMCMDS_VER=y diff --git a/boards/px4/fmu-v2/nuttx-config/nsh/defconfig b/boards/px4/fmu-v2/nuttx-config/nsh/defconfig index e03b0218f4..cce07497b6 100644 --- a/boards/px4/fmu-v2/nuttx-config/nsh/defconfig +++ b/boards/px4/fmu-v2/nuttx-config/nsh/defconfig @@ -128,6 +128,7 @@ CONFIG_NSH_MAXARGUMENTS=15 CONFIG_NSH_NESTDEPTH=8 CONFIG_NSH_QUOTE=y CONFIG_NSH_ROMFSETC=y +CONFIG_NSH_ROMFSRC=y CONFIG_NSH_ROMFSSECTSIZE=128 CONFIG_NSH_VARS=y CONFIG_PIPES=y diff --git a/boards/px4/fmu-v3/default.px4board b/boards/px4/fmu-v3/default.px4board index 993492bb7b..b4324a2c9d 100644 --- a/boards/px4/fmu-v3/default.px4board +++ b/boards/px4/fmu-v3/default.px4board @@ -90,6 +90,8 @@ CONFIG_SYSTEMCMDS_MTD=y CONFIG_SYSTEMCMDS_NSHTERM=y CONFIG_SYSTEMCMDS_PARAM=y CONFIG_SYSTEMCMDS_PERF=y +CONFIG_SYSTEMCMDS_PX4LOG=y +CONFIG_SYSTEMCMDS_PX4LOG_TAIL=y CONFIG_SYSTEMCMDS_REBOOT=y CONFIG_SYSTEMCMDS_REFLECT=y CONFIG_SYSTEMCMDS_SD_BENCH=y diff --git a/boards/px4/fmu-v3/nuttx-config/nsh/defconfig b/boards/px4/fmu-v3/nuttx-config/nsh/defconfig index c836579fe4..89dedc262a 100644 --- a/boards/px4/fmu-v3/nuttx-config/nsh/defconfig +++ b/boards/px4/fmu-v3/nuttx-config/nsh/defconfig @@ -133,6 +133,7 @@ CONFIG_NSH_MAXARGUMENTS=15 CONFIG_NSH_NESTDEPTH=8 CONFIG_NSH_QUOTE=y CONFIG_NSH_ROMFSETC=y +CONFIG_NSH_ROMFSRC=y CONFIG_NSH_ROMFSSECTSIZE=128 CONFIG_NSH_STRERROR=y CONFIG_NSH_VARS=y diff --git a/boards/px4/fmu-v4/default.px4board b/boards/px4/fmu-v4/default.px4board index 9e218b1eee..3cb97e5edf 100644 --- a/boards/px4/fmu-v4/default.px4board +++ b/boards/px4/fmu-v4/default.px4board @@ -91,6 +91,8 @@ CONFIG_SYSTEMCMDS_MTD=y CONFIG_SYSTEMCMDS_NSHTERM=y CONFIG_SYSTEMCMDS_PARAM=y CONFIG_SYSTEMCMDS_PERF=y +CONFIG_SYSTEMCMDS_PX4LOG=y +CONFIG_SYSTEMCMDS_PX4LOG_TAIL=y CONFIG_SYSTEMCMDS_REBOOT=y CONFIG_SYSTEMCMDS_REFLECT=y CONFIG_SYSTEMCMDS_SD_BENCH=y diff --git a/boards/px4/fmu-v4/nuttx-config/nsh/defconfig b/boards/px4/fmu-v4/nuttx-config/nsh/defconfig index a8ac1b9a34..f3b4a3ce50 100644 --- a/boards/px4/fmu-v4/nuttx-config/nsh/defconfig +++ b/boards/px4/fmu-v4/nuttx-config/nsh/defconfig @@ -132,6 +132,7 @@ CONFIG_NSH_MAXARGUMENTS=15 CONFIG_NSH_NESTDEPTH=8 CONFIG_NSH_QUOTE=y CONFIG_NSH_ROMFSETC=y +CONFIG_NSH_ROMFSRC=y CONFIG_NSH_ROMFSSECTSIZE=128 CONFIG_NSH_STRERROR=y CONFIG_NSH_VARS=y diff --git a/boards/px4/fmu-v4/nuttx-config/test/defconfig b/boards/px4/fmu-v4/nuttx-config/test/defconfig index aa3d5890a8..2b57c63dff 100644 --- a/boards/px4/fmu-v4/nuttx-config/test/defconfig +++ b/boards/px4/fmu-v4/nuttx-config/test/defconfig @@ -133,6 +133,7 @@ CONFIG_NSH_MAXARGUMENTS=15 CONFIG_NSH_NESTDEPTH=8 CONFIG_NSH_QUOTE=y CONFIG_NSH_ROMFSETC=y +CONFIG_NSH_ROMFSRC=y CONFIG_NSH_ROMFSSECTSIZE=128 CONFIG_NSH_STRERROR=y CONFIG_NSH_VARS=y diff --git a/boards/px4/fmu-v4pro/default.px4board b/boards/px4/fmu-v4pro/default.px4board index e08094c009..43e4652a5f 100644 --- a/boards/px4/fmu-v4pro/default.px4board +++ b/boards/px4/fmu-v4pro/default.px4board @@ -88,6 +88,8 @@ CONFIG_SYSTEMCMDS_MTD=y CONFIG_SYSTEMCMDS_NSHTERM=y CONFIG_SYSTEMCMDS_PARAM=y CONFIG_SYSTEMCMDS_PERF=y +CONFIG_SYSTEMCMDS_PX4LOG=y +CONFIG_SYSTEMCMDS_PX4LOG_TAIL=y CONFIG_SYSTEMCMDS_REBOOT=y CONFIG_SYSTEMCMDS_REFLECT=y CONFIG_SYSTEMCMDS_SD_BENCH=y diff --git a/boards/px4/fmu-v4pro/nuttx-config/nsh/defconfig b/boards/px4/fmu-v4pro/nuttx-config/nsh/defconfig index e8ecbaee38..114be1f007 100644 --- a/boards/px4/fmu-v4pro/nuttx-config/nsh/defconfig +++ b/boards/px4/fmu-v4pro/nuttx-config/nsh/defconfig @@ -132,6 +132,7 @@ CONFIG_NSH_MAXARGUMENTS=15 CONFIG_NSH_NESTDEPTH=8 CONFIG_NSH_QUOTE=y CONFIG_NSH_ROMFSETC=y +CONFIG_NSH_ROMFSRC=y CONFIG_NSH_ROMFSSECTSIZE=128 CONFIG_NSH_STRERROR=y CONFIG_NSH_VARS=y diff --git a/boards/px4/fmu-v4pro/nuttx-config/test/defconfig b/boards/px4/fmu-v4pro/nuttx-config/test/defconfig index 7825cb6c63..49ac5b2994 100644 --- a/boards/px4/fmu-v4pro/nuttx-config/test/defconfig +++ b/boards/px4/fmu-v4pro/nuttx-config/test/defconfig @@ -133,6 +133,7 @@ CONFIG_NSH_MAXARGUMENTS=15 CONFIG_NSH_NESTDEPTH=8 CONFIG_NSH_QUOTE=y CONFIG_NSH_ROMFSETC=y +CONFIG_NSH_ROMFSRC=y CONFIG_NSH_ROMFSSECTSIZE=128 CONFIG_NSH_STRERROR=y CONFIG_NSH_VARS=y diff --git a/boards/px4/fmu-v5/default.px4board b/boards/px4/fmu-v5/default.px4board index 63b9f857e7..a6d6d9568c 100644 --- a/boards/px4/fmu-v5/default.px4board +++ b/boards/px4/fmu-v5/default.px4board @@ -96,6 +96,8 @@ CONFIG_SYSTEMCMDS_MTD=y CONFIG_SYSTEMCMDS_NSHTERM=y CONFIG_SYSTEMCMDS_PARAM=y CONFIG_SYSTEMCMDS_PERF=y +CONFIG_SYSTEMCMDS_PX4LOG=y +CONFIG_SYSTEMCMDS_PX4LOG_TAIL=y CONFIG_SYSTEMCMDS_REBOOT=y CONFIG_SYSTEMCMDS_REFLECT=y CONFIG_SYSTEMCMDS_SD_BENCH=y diff --git a/boards/px4/fmu-v5/nuttx-config/cryptotest/defconfig b/boards/px4/fmu-v5/nuttx-config/cryptotest/defconfig index ff995b6cf5..f1254a69da 100644 --- a/boards/px4/fmu-v5/nuttx-config/cryptotest/defconfig +++ b/boards/px4/fmu-v5/nuttx-config/cryptotest/defconfig @@ -139,6 +139,7 @@ CONFIG_NSH_MAXARGUMENTS=15 CONFIG_NSH_NESTDEPTH=8 CONFIG_NSH_QUOTE=y CONFIG_NSH_ROMFSETC=y +CONFIG_NSH_ROMFSRC=y CONFIG_NSH_ROMFSSECTSIZE=128 CONFIG_NSH_STRERROR=y CONFIG_NSH_VARS=y diff --git a/boards/px4/fmu-v5/nuttx-config/cyphal/defconfig b/boards/px4/fmu-v5/nuttx-config/cyphal/defconfig index 9e3596c1f0..c2b26f5386 100644 --- a/boards/px4/fmu-v5/nuttx-config/cyphal/defconfig +++ b/boards/px4/fmu-v5/nuttx-config/cyphal/defconfig @@ -139,6 +139,7 @@ CONFIG_NSH_MAXARGUMENTS=15 CONFIG_NSH_NESTDEPTH=8 CONFIG_NSH_QUOTE=y CONFIG_NSH_ROMFSETC=y +CONFIG_NSH_ROMFSRC=y CONFIG_NSH_ROMFSSECTSIZE=128 CONFIG_NSH_STRERROR=y CONFIG_NSH_VARS=y diff --git a/boards/px4/fmu-v5/nuttx-config/debug/defconfig b/boards/px4/fmu-v5/nuttx-config/debug/defconfig index 74f4ecac3c..4a50826fda 100644 --- a/boards/px4/fmu-v5/nuttx-config/debug/defconfig +++ b/boards/px4/fmu-v5/nuttx-config/debug/defconfig @@ -183,6 +183,7 @@ CONFIG_NSH_MAXARGUMENTS=15 CONFIG_NSH_NESTDEPTH=8 CONFIG_NSH_QUOTE=y CONFIG_NSH_ROMFSETC=y +CONFIG_NSH_ROMFSRC=y CONFIG_NSH_ROMFSSECTSIZE=128 CONFIG_NSH_STRERROR=y CONFIG_NSH_VARS=y diff --git a/boards/px4/fmu-v5/nuttx-config/nsh/defconfig b/boards/px4/fmu-v5/nuttx-config/nsh/defconfig index b0453967b2..47433351fc 100644 --- a/boards/px4/fmu-v5/nuttx-config/nsh/defconfig +++ b/boards/px4/fmu-v5/nuttx-config/nsh/defconfig @@ -137,6 +137,7 @@ CONFIG_NSH_MAXARGUMENTS=15 CONFIG_NSH_NESTDEPTH=8 CONFIG_NSH_QUOTE=y CONFIG_NSH_ROMFSETC=y +CONFIG_NSH_ROMFSRC=y CONFIG_NSH_ROMFSSECTSIZE=128 CONFIG_NSH_STRERROR=y CONFIG_NSH_VARS=y diff --git a/boards/px4/fmu-v5/nuttx-config/protected/defconfig b/boards/px4/fmu-v5/nuttx-config/protected/defconfig index 1902014e3b..e1256e738b 100644 --- a/boards/px4/fmu-v5/nuttx-config/protected/defconfig +++ b/boards/px4/fmu-v5/nuttx-config/protected/defconfig @@ -142,6 +142,7 @@ CONFIG_NSH_MAXARGUMENTS=15 CONFIG_NSH_NESTDEPTH=8 CONFIG_NSH_QUOTE=y CONFIG_NSH_ROMFSETC=y +CONFIG_NSH_ROMFSRC=y CONFIG_NSH_ROMFSSECTSIZE=128 CONFIG_NSH_STRERROR=y CONFIG_NSH_VARS=y diff --git a/boards/px4/fmu-v5/nuttx-config/stackcheck/defconfig b/boards/px4/fmu-v5/nuttx-config/stackcheck/defconfig index c5450ab1f4..2d5729c6dd 100644 --- a/boards/px4/fmu-v5/nuttx-config/stackcheck/defconfig +++ b/boards/px4/fmu-v5/nuttx-config/stackcheck/defconfig @@ -138,6 +138,7 @@ CONFIG_NSH_MAXARGUMENTS=15 CONFIG_NSH_NESTDEPTH=8 CONFIG_NSH_QUOTE=y CONFIG_NSH_ROMFSETC=y +CONFIG_NSH_ROMFSRC=y CONFIG_NSH_ROMFSSECTSIZE=128 CONFIG_NSH_STRERROR=y CONFIG_NSH_VARS=y diff --git a/boards/px4/fmu-v5/nuttx-config/test/defconfig b/boards/px4/fmu-v5/nuttx-config/test/defconfig index 357c5b29b6..2f75b8014c 100644 --- a/boards/px4/fmu-v5/nuttx-config/test/defconfig +++ b/boards/px4/fmu-v5/nuttx-config/test/defconfig @@ -137,6 +137,7 @@ CONFIG_NSH_MAXARGUMENTS=15 CONFIG_NSH_NESTDEPTH=8 CONFIG_NSH_QUOTE=y CONFIG_NSH_ROMFSETC=y +CONFIG_NSH_ROMFSRC=y CONFIG_NSH_ROMFSSECTSIZE=128 CONFIG_NSH_STRERROR=y CONFIG_NSH_VARS=y diff --git a/boards/px4/fmu-v5/src/board_config.h b/boards/px4/fmu-v5/src/board_config.h index 8246664dec..9120821174 100644 --- a/boards/px4/fmu-v5/src/board_config.h +++ b/boards/px4/fmu-v5/src/board_config.h @@ -453,7 +453,6 @@ PX4_MAKE_GPIO_OUTPUT_CLEAR(GPIO_I2C4_SDA), \ } -#define BOARD_ENABLE_CONSOLE_BUFFER #define BOARD_NUM_IO_TIMERS 5 diff --git a/boards/px4/fmu-v5x/default.px4board b/boards/px4/fmu-v5x/default.px4board index 2be36f8fb0..b218009ac6 100644 --- a/boards/px4/fmu-v5x/default.px4board +++ b/boards/px4/fmu-v5x/default.px4board @@ -97,6 +97,8 @@ CONFIG_SYSTEMCMDS_NETMAN=y CONFIG_SYSTEMCMDS_NSHTERM=y CONFIG_SYSTEMCMDS_PARAM=y CONFIG_SYSTEMCMDS_PERF=y +CONFIG_SYSTEMCMDS_PX4LOG=y +CONFIG_SYSTEMCMDS_PX4LOG_TAIL=y CONFIG_SYSTEMCMDS_REBOOT=y CONFIG_SYSTEMCMDS_REFLECT=y CONFIG_SYSTEMCMDS_SD_BENCH=y diff --git a/boards/px4/fmu-v5x/nuttx-config/nsh/defconfig b/boards/px4/fmu-v5x/nuttx-config/nsh/defconfig index 5de6af261f..d79373adec 100644 --- a/boards/px4/fmu-v5x/nuttx-config/nsh/defconfig +++ b/boards/px4/fmu-v5x/nuttx-config/nsh/defconfig @@ -174,6 +174,7 @@ CONFIG_NSH_MAXARGUMENTS=15 CONFIG_NSH_NESTDEPTH=8 CONFIG_NSH_QUOTE=y CONFIG_NSH_ROMFSETC=y +CONFIG_NSH_ROMFSRC=y CONFIG_NSH_ROMFSSECTSIZE=128 CONFIG_NSH_STRERROR=y CONFIG_NSH_TELNET=y diff --git a/boards/px4/fmu-v5x/nuttx-config/test/defconfig b/boards/px4/fmu-v5x/nuttx-config/test/defconfig index 2b8361d327..b44c92d4eb 100644 --- a/boards/px4/fmu-v5x/nuttx-config/test/defconfig +++ b/boards/px4/fmu-v5x/nuttx-config/test/defconfig @@ -172,6 +172,7 @@ CONFIG_NSH_MAXARGUMENTS=15 CONFIG_NSH_NESTDEPTH=8 CONFIG_NSH_QUOTE=y CONFIG_NSH_ROMFSETC=y +CONFIG_NSH_ROMFSRC=y CONFIG_NSH_ROMFSSECTSIZE=128 CONFIG_NSH_STRERROR=y CONFIG_NSH_TELNET=y diff --git a/boards/px4/fmu-v5x/src/board_config.h b/boards/px4/fmu-v5x/src/board_config.h index 281c769f26..8a6753defb 100644 --- a/boards/px4/fmu-v5x/src/board_config.h +++ b/boards/px4/fmu-v5x/src/board_config.h @@ -443,7 +443,6 @@ PX4_MAKE_GPIO_OUTPUT_CLEAR(GPIO_I2C4_SDA), \ } -#define BOARD_ENABLE_CONSOLE_BUFFER #define BOARD_NUM_IO_TIMERS 5 diff --git a/boards/px4/fmu-v5x/src/init.cpp b/boards/px4/fmu-v5x/src/init.cpp index a6606761db..da75241955 100644 --- a/boards/px4/fmu-v5x/src/init.cpp +++ b/boards/px4/fmu-v5x/src/init.cpp @@ -76,6 +76,10 @@ #include #include +#ifndef MODULE_NAME +# define MODULE_NAME "init" +#endif + /**************************************************************************** * Pre-Processor Definitions ****************************************************************************/ @@ -116,7 +120,7 @@ __EXPORT void board_peripheral_reset(int ms) /* wait for the peripheral rail to reach GND */ usleep(ms * 1000); - syslog(LOG_DEBUG, "reset done, %d ms\n", ms); + PX4_DEBUG("reset done, %d ms\n", ms); /* re-enable power */ @@ -229,11 +233,10 @@ __EXPORT int board_app_initialize(uintptr_t arg) px4_platform_configure(); if (OK == board_determine_hw_info()) { - syslog(LOG_INFO, "[boot] Rev 0x%1x : Ver 0x%1x %s\n", board_get_hw_revision(), board_get_hw_version(), - board_get_hw_type_name()); + PX4_INFO("Rev 0x%1x : Ver 0x%1x %s", board_get_hw_revision(), board_get_hw_version(), board_get_hw_type_name()); } else { - syslog(LOG_ERR, "[boot] Failed to read HW revision and version\n"); + PX4_ERR("Failed to read HW revision and version"); } /* Configure the Actual SPI interfaces (after we determined the HW version) */ @@ -245,7 +248,7 @@ __EXPORT int board_app_initialize(uintptr_t arg) /* Configure the DMA allocator */ if (board_dma_alloc_init() < 0) { - syslog(LOG_ERR, "[boot] DMA alloc FAILED\n"); + PX4_ERR("DMA alloc FAILED"); } #if defined(SERIAL_HAVE_RXDMA) diff --git a/boards/px4/fmu-v5x/src/manifest.c b/boards/px4/fmu-v5x/src/manifest.c index 56f0009f50..8ed4b9260c 100644 --- a/boards/px4/fmu-v5x/src/manifest.c +++ b/boards/px4/fmu-v5x/src/manifest.c @@ -51,9 +51,13 @@ #include #include -#include #include "systemlib/px4_macros.h" +#include + +#ifndef MODULE_NAME +# define MODULE_NAME "init" +#endif /**************************************************************************** * Pre-Processor Definitions @@ -207,7 +211,7 @@ __EXPORT px4_hw_mft_item board_query_manifest(px4_hw_mft_item_id_t id) } if (boards_manifest == px4_hw_mft_list_uninitialized) { - syslog(LOG_ERR, "[boot] Board %08" PRIx32 " is not supported!\n", ver_rev); + PX4_ERR("Board %08" PRIx32 " is not supported!", ver_rev); } } diff --git a/boards/px4/fmu-v5x/src/sdio.c b/boards/px4/fmu-v5x/src/sdio.c index 869d757756..c1df356b35 100644 --- a/boards/px4/fmu-v5x/src/sdio.c +++ b/boards/px4/fmu-v5x/src/sdio.c @@ -52,6 +52,12 @@ #include "stm32_gpio.h" #include "stm32_sdmmc.h" +#include + +#ifndef MODULE_NAME +# define MODULE_NAME "init" +#endif + #ifdef CONFIG_MMCSD @@ -141,7 +147,7 @@ int stm32_sdio_initialize(void) sdio_dev = sdio_initialize(SDIO_SLOTNO); if (!sdio_dev) { - syslog(LOG_ERR, "[boot] Failed to initialize SDIO slot %d\n", SDIO_SLOTNO); + PX4_ERR("Failed to initialize SDIO slot %d", SDIO_SLOTNO); return -ENODEV; } @@ -152,7 +158,7 @@ int stm32_sdio_initialize(void) ret = mmcsd_slotinitialize(SDIO_MINOR, sdio_dev); if (ret != OK) { - syslog(LOG_ERR, "[boot] Failed to bind SDIO to the MMC/SD driver: %d\n", ret); + PX4_ERR("Failed to bind SDIO to the MMC/SD driver: %d", ret); return ret; } diff --git a/boards/px4/fmu-v6c/default.px4board b/boards/px4/fmu-v6c/default.px4board index 5051db9c2a..2cde3142fc 100644 --- a/boards/px4/fmu-v6c/default.px4board +++ b/boards/px4/fmu-v6c/default.px4board @@ -78,6 +78,8 @@ CONFIG_SYSTEMCMDS_MTD=y CONFIG_SYSTEMCMDS_NSHTERM=y CONFIG_SYSTEMCMDS_PARAM=y CONFIG_SYSTEMCMDS_PERF=y +CONFIG_SYSTEMCMDS_PX4LOG=y +CONFIG_SYSTEMCMDS_PX4LOG_TAIL=y CONFIG_SYSTEMCMDS_REBOOT=y CONFIG_SYSTEMCMDS_SD_BENCH=y CONFIG_SYSTEMCMDS_SYSTEM_TIME=y diff --git a/boards/px4/fmu-v6c/nuttx-config/nsh/defconfig b/boards/px4/fmu-v6c/nuttx-config/nsh/defconfig index 78963cf699..a38379c944 100644 --- a/boards/px4/fmu-v6c/nuttx-config/nsh/defconfig +++ b/boards/px4/fmu-v6c/nuttx-config/nsh/defconfig @@ -142,6 +142,7 @@ CONFIG_NSH_MAXARGUMENTS=15 CONFIG_NSH_NESTDEPTH=8 CONFIG_NSH_QUOTE=y CONFIG_NSH_ROMFSETC=y +CONFIG_NSH_ROMFSRC=y CONFIG_NSH_ROMFSSECTSIZE=128 CONFIG_NSH_STRERROR=y CONFIG_NSH_VARS=y diff --git a/boards/px4/fmu-v6c/src/board_config.h b/boards/px4/fmu-v6c/src/board_config.h index 78d299d53b..f6201f7cc6 100644 --- a/boards/px4/fmu-v6c/src/board_config.h +++ b/boards/px4/fmu-v6c/src/board_config.h @@ -267,7 +267,6 @@ GPIO_TONE_ALARM_IDLE, \ } -#define BOARD_ENABLE_CONSOLE_BUFFER #define PX4_I2C_BUS_MTD 4,5 diff --git a/boards/px4/fmu-v6u/default.px4board b/boards/px4/fmu-v6u/default.px4board index bb6f599f49..6fa7cad698 100644 --- a/boards/px4/fmu-v6u/default.px4board +++ b/boards/px4/fmu-v6u/default.px4board @@ -84,6 +84,8 @@ CONFIG_SYSTEMCMDS_MTD=y CONFIG_SYSTEMCMDS_NSHTERM=y CONFIG_SYSTEMCMDS_PARAM=y CONFIG_SYSTEMCMDS_PERF=y +CONFIG_SYSTEMCMDS_PX4LOG=y +CONFIG_SYSTEMCMDS_PX4LOG_TAIL=y CONFIG_SYSTEMCMDS_REBOOT=y CONFIG_SYSTEMCMDS_SD_BENCH=y CONFIG_SYSTEMCMDS_SD_STRESS=y diff --git a/boards/px4/fmu-v6u/nuttx-config/nsh/defconfig b/boards/px4/fmu-v6u/nuttx-config/nsh/defconfig index f716ae6932..e4365d87df 100644 --- a/boards/px4/fmu-v6u/nuttx-config/nsh/defconfig +++ b/boards/px4/fmu-v6u/nuttx-config/nsh/defconfig @@ -142,6 +142,7 @@ CONFIG_NSH_MAXARGUMENTS=15 CONFIG_NSH_NESTDEPTH=8 CONFIG_NSH_QUOTE=y CONFIG_NSH_ROMFSETC=y +CONFIG_NSH_ROMFSRC=y CONFIG_NSH_ROMFSSECTSIZE=128 CONFIG_NSH_STRERROR=y CONFIG_NSH_VARS=y diff --git a/boards/px4/fmu-v6u/src/board_config.h b/boards/px4/fmu-v6u/src/board_config.h index a61f2a5a57..8c23d2f45f 100644 --- a/boards/px4/fmu-v6u/src/board_config.h +++ b/boards/px4/fmu-v6u/src/board_config.h @@ -389,7 +389,6 @@ GPIO_nARMED_INIT \ } -#define BOARD_ENABLE_CONSOLE_BUFFER #define BOARD_NUM_IO_TIMERS 5 diff --git a/boards/px4/fmu-v6x/default.px4board b/boards/px4/fmu-v6x/default.px4board index dab4ca6ff5..2473b381d4 100644 --- a/boards/px4/fmu-v6x/default.px4board +++ b/boards/px4/fmu-v6x/default.px4board @@ -85,6 +85,8 @@ CONFIG_SYSTEMCMDS_NETMAN=y CONFIG_SYSTEMCMDS_NSHTERM=y CONFIG_SYSTEMCMDS_PARAM=y CONFIG_SYSTEMCMDS_PERF=y +CONFIG_SYSTEMCMDS_PX4LOG=y +CONFIG_SYSTEMCMDS_PX4LOG_TAIL=y CONFIG_SYSTEMCMDS_REBOOT=y CONFIG_SYSTEMCMDS_SYSTEM_TIME=y CONFIG_SYSTEMCMDS_TOP=y diff --git a/boards/px4/fmu-v6x/nuttx-config/nsh/defconfig b/boards/px4/fmu-v6x/nuttx-config/nsh/defconfig index edb5e8a0d8..321ee291a0 100644 --- a/boards/px4/fmu-v6x/nuttx-config/nsh/defconfig +++ b/boards/px4/fmu-v6x/nuttx-config/nsh/defconfig @@ -178,6 +178,7 @@ CONFIG_NSH_MAXARGUMENTS=15 CONFIG_NSH_NESTDEPTH=8 CONFIG_NSH_QUOTE=y CONFIG_NSH_ROMFSETC=y +CONFIG_NSH_ROMFSRC=y CONFIG_NSH_ROMFSSECTSIZE=128 CONFIG_NSH_STRERROR=y CONFIG_NSH_TELNET=y diff --git a/boards/px4/fmu-v6x/src/board_config.h b/boards/px4/fmu-v6x/src/board_config.h index fecd7efc9c..63a3433c6e 100644 --- a/boards/px4/fmu-v6x/src/board_config.h +++ b/boards/px4/fmu-v6x/src/board_config.h @@ -480,7 +480,6 @@ GPIO_nARMED_INIT \ } -#define BOARD_ENABLE_CONSOLE_BUFFER #define PX4_I2C_BUS_MTD 4,5 diff --git a/boards/px4/raspberrypi/default.px4board b/boards/px4/raspberrypi/default.px4board index 1f93c77beb..4c502ceb68 100644 --- a/boards/px4/raspberrypi/default.px4board +++ b/boards/px4/raspberrypi/default.px4board @@ -64,6 +64,8 @@ CONFIG_SYSTEMCMDS_DYN=y CONFIG_SYSTEMCMDS_LED_CONTROL=y CONFIG_SYSTEMCMDS_PARAM=y CONFIG_SYSTEMCMDS_PERF=y +CONFIG_SYSTEMCMDS_PX4LOG=y +CONFIG_SYSTEMCMDS_PX4LOG_TAIL=y CONFIG_SYSTEMCMDS_SD_BENCH=y CONFIG_SYSTEMCMDS_SHUTDOWN=y CONFIG_SYSTEMCMDS_SYSTEM_TIME=y diff --git a/boards/px4/sitl/default.px4board b/boards/px4/sitl/default.px4board index f85f30f424..43ca92d115 100644 --- a/boards/px4/sitl/default.px4board +++ b/boards/px4/sitl/default.px4board @@ -56,6 +56,8 @@ CONFIG_SYSTEMCMDS_FAILURE=y CONFIG_SYSTEMCMDS_LED_CONTROL=y CONFIG_SYSTEMCMDS_PARAM=y CONFIG_SYSTEMCMDS_PERF=y +CONFIG_SYSTEMCMDS_PX4LOG=y +CONFIG_SYSTEMCMDS_PX4LOG_TAIL=y CONFIG_SYSTEMCMDS_SD_BENCH=y CONFIG_SYSTEMCMDS_SHUTDOWN=y CONFIG_SYSTEMCMDS_SYSTEM_TIME=y diff --git a/boards/raspberrypi/pico/default.px4board b/boards/raspberrypi/pico/default.px4board index a5727267a1..60fa72bc3a 100644 --- a/boards/raspberrypi/pico/default.px4board +++ b/boards/raspberrypi/pico/default.px4board @@ -40,6 +40,8 @@ CONFIG_SYSTEMCMDS_LED_CONTROL=y CONFIG_SYSTEMCMDS_NSHTERM=y CONFIG_SYSTEMCMDS_PARAM=y CONFIG_SYSTEMCMDS_PERF=y +CONFIG_SYSTEMCMDS_PX4LOG=y +CONFIG_SYSTEMCMDS_PX4LOG_TAIL=y CONFIG_SYSTEMCMDS_REBOOT=y CONFIG_SYSTEMCMDS_REFLECT=y CONFIG_SYSTEMCMDS_TOP=y diff --git a/boards/raspberrypi/pico/nuttx-config/nsh/defconfig b/boards/raspberrypi/pico/nuttx-config/nsh/defconfig index 2efb22fc35..0afeed0a82 100644 --- a/boards/raspberrypi/pico/nuttx-config/nsh/defconfig +++ b/boards/raspberrypi/pico/nuttx-config/nsh/defconfig @@ -65,6 +65,7 @@ CONFIG_NSH_MAXARGUMENTS=15 CONFIG_NSH_NESTDEPTH=8 CONFIG_NSH_READLINE=y CONFIG_NSH_ROMFSETC=y +CONFIG_NSH_ROMFSRC=y CONFIG_NSH_ROMFSSECTSIZE=128 CONFIG_NSH_STRERROR=y CONFIG_NSH_USBCONSOLE=y diff --git a/boards/raspberrypi/pico/src/board_config.h b/boards/raspberrypi/pico/src/board_config.h index 581233e7ac..f6c675bedf 100644 --- a/boards/raspberrypi/pico/src/board_config.h +++ b/boards/raspberrypi/pico/src/board_config.h @@ -76,8 +76,7 @@ /* This board provides a DMA pool and APIs */ // Needs to be figured out #define BOARD_DMA_ALLOC_POOL_SIZE 2048 -#define BOARD_ENABLE_CONSOLE_BUFFER -#define BOARD_CONSOLE_BUFFER_SIZE (1024*3) + /* USB * diff --git a/boards/scumaker/pilotpi/default.px4board b/boards/scumaker/pilotpi/default.px4board index ca284cc29e..e1c4ba52e1 100644 --- a/boards/scumaker/pilotpi/default.px4board +++ b/boards/scumaker/pilotpi/default.px4board @@ -60,6 +60,8 @@ CONFIG_SYSTEMCMDS_DYN=y CONFIG_SYSTEMCMDS_LED_CONTROL=y CONFIG_SYSTEMCMDS_PARAM=y CONFIG_SYSTEMCMDS_PERF=y +CONFIG_SYSTEMCMDS_PX4LOG=y +CONFIG_SYSTEMCMDS_PX4LOG_TAIL=y CONFIG_SYSTEMCMDS_SD_BENCH=y CONFIG_SYSTEMCMDS_SHUTDOWN=y CONFIG_SYSTEMCMDS_TOPIC_LISTENER=y diff --git a/boards/sky-drones/smartap-airlink/default.px4board b/boards/sky-drones/smartap-airlink/default.px4board index d39723827d..ba25040636 100644 --- a/boards/sky-drones/smartap-airlink/default.px4board +++ b/boards/sky-drones/smartap-airlink/default.px4board @@ -86,6 +86,8 @@ CONFIG_SYSTEMCMDS_NETMAN=y CONFIG_SYSTEMCMDS_NSHTERM=y CONFIG_SYSTEMCMDS_PARAM=y CONFIG_SYSTEMCMDS_PERF=y +CONFIG_SYSTEMCMDS_PX4LOG=y +CONFIG_SYSTEMCMDS_PX4LOG_TAIL=y CONFIG_SYSTEMCMDS_REBOOT=y CONFIG_SYSTEMCMDS_REFLECT=y CONFIG_SYSTEMCMDS_SD_BENCH=y diff --git a/boards/sky-drones/smartap-airlink/nuttx-config/nsh/defconfig b/boards/sky-drones/smartap-airlink/nuttx-config/nsh/defconfig index 3efa0c136f..47025a9877 100644 --- a/boards/sky-drones/smartap-airlink/nuttx-config/nsh/defconfig +++ b/boards/sky-drones/smartap-airlink/nuttx-config/nsh/defconfig @@ -170,6 +170,7 @@ CONFIG_NSH_MAXARGUMENTS=15 CONFIG_NSH_NESTDEPTH=8 CONFIG_NSH_QUOTE=y CONFIG_NSH_ROMFSETC=y +CONFIG_NSH_ROMFSRC=y CONFIG_NSH_ROMFSSECTSIZE=128 CONFIG_NSH_STRERROR=y CONFIG_NSH_TELNET=y diff --git a/boards/sky-drones/smartap-airlink/src/board_config.h b/boards/sky-drones/smartap-airlink/src/board_config.h index ac21a1686c..4ae611363a 100644 --- a/boards/sky-drones/smartap-airlink/src/board_config.h +++ b/boards/sky-drones/smartap-airlink/src/board_config.h @@ -350,7 +350,6 @@ GPIO_nARMED_INIT \ } -#define BOARD_ENABLE_CONSOLE_BUFFER #define BOARD_NUM_IO_TIMERS 5 diff --git a/boards/spracing/h7extreme/default.px4board b/boards/spracing/h7extreme/default.px4board index 9e23359080..9546a2b9ca 100644 --- a/boards/spracing/h7extreme/default.px4board +++ b/boards/spracing/h7extreme/default.px4board @@ -49,6 +49,8 @@ CONFIG_SYSTEMCMDS_LED_CONTROL=y CONFIG_SYSTEMCMDS_NSHTERM=y CONFIG_SYSTEMCMDS_PARAM=y CONFIG_SYSTEMCMDS_PERF=y +CONFIG_SYSTEMCMDS_PX4LOG=y +CONFIG_SYSTEMCMDS_PX4LOG_TAIL=y CONFIG_SYSTEMCMDS_REBOOT=y CONFIG_SYSTEMCMDS_REFLECT=y CONFIG_SYSTEMCMDS_SD_BENCH=y diff --git a/boards/spracing/h7extreme/nuttx-config/nsh/defconfig b/boards/spracing/h7extreme/nuttx-config/nsh/defconfig index f478a92a2c..cb74e3bdb0 100644 --- a/boards/spracing/h7extreme/nuttx-config/nsh/defconfig +++ b/boards/spracing/h7extreme/nuttx-config/nsh/defconfig @@ -132,6 +132,7 @@ CONFIG_NSH_MAXARGUMENTS=15 CONFIG_NSH_NESTDEPTH=8 CONFIG_NSH_QUOTE=y CONFIG_NSH_ROMFSETC=y +CONFIG_NSH_ROMFSRC=y CONFIG_NSH_ROMFSSECTSIZE=128 CONFIG_NSH_STRERROR=y CONFIG_NSH_VARS=y diff --git a/boards/spracing/h7extreme/src/board_config.h b/boards/spracing/h7extreme/src/board_config.h index 9c1ea8e431..665c1eb839 100644 --- a/boards/spracing/h7extreme/src/board_config.h +++ b/boards/spracing/h7extreme/src/board_config.h @@ -129,7 +129,6 @@ GPIO_RSSI_IN, \ } -#define BOARD_ENABLE_CONSOLE_BUFFER #define BOARD_NUM_IO_TIMERS 3 diff --git a/boards/thepeach/k1/default.px4board b/boards/thepeach/k1/default.px4board index 3c08cf707a..bda16412e9 100644 --- a/boards/thepeach/k1/default.px4board +++ b/boards/thepeach/k1/default.px4board @@ -84,6 +84,8 @@ CONFIG_SYSTEMCMDS_MTD=y CONFIG_SYSTEMCMDS_NSHTERM=y CONFIG_SYSTEMCMDS_PARAM=y CONFIG_SYSTEMCMDS_PERF=y +CONFIG_SYSTEMCMDS_PX4LOG=y +CONFIG_SYSTEMCMDS_PX4LOG_TAIL=y CONFIG_SYSTEMCMDS_REBOOT=y CONFIG_SYSTEMCMDS_REFLECT=y CONFIG_SYSTEMCMDS_SD_BENCH=y diff --git a/boards/thepeach/k1/nuttx-config/nsh/defconfig b/boards/thepeach/k1/nuttx-config/nsh/defconfig index 3a63ed05bb..41eda0a175 100644 --- a/boards/thepeach/k1/nuttx-config/nsh/defconfig +++ b/boards/thepeach/k1/nuttx-config/nsh/defconfig @@ -133,6 +133,7 @@ CONFIG_NSH_MAXARGUMENTS=15 CONFIG_NSH_NESTDEPTH=8 CONFIG_NSH_QUOTE=y CONFIG_NSH_ROMFSETC=y +CONFIG_NSH_ROMFSRC=y CONFIG_NSH_ROMFSSECTSIZE=128 CONFIG_NSH_STRERROR=y CONFIG_NSH_VARS=y diff --git a/boards/thepeach/r1/default.px4board b/boards/thepeach/r1/default.px4board index 3c08cf707a..bda16412e9 100644 --- a/boards/thepeach/r1/default.px4board +++ b/boards/thepeach/r1/default.px4board @@ -84,6 +84,8 @@ CONFIG_SYSTEMCMDS_MTD=y CONFIG_SYSTEMCMDS_NSHTERM=y CONFIG_SYSTEMCMDS_PARAM=y CONFIG_SYSTEMCMDS_PERF=y +CONFIG_SYSTEMCMDS_PX4LOG=y +CONFIG_SYSTEMCMDS_PX4LOG_TAIL=y CONFIG_SYSTEMCMDS_REBOOT=y CONFIG_SYSTEMCMDS_REFLECT=y CONFIG_SYSTEMCMDS_SD_BENCH=y diff --git a/boards/thepeach/r1/nuttx-config/nsh/defconfig b/boards/thepeach/r1/nuttx-config/nsh/defconfig index 51a9be25a1..95c29d49bd 100644 --- a/boards/thepeach/r1/nuttx-config/nsh/defconfig +++ b/boards/thepeach/r1/nuttx-config/nsh/defconfig @@ -133,6 +133,7 @@ CONFIG_NSH_MAXARGUMENTS=15 CONFIG_NSH_NESTDEPTH=8 CONFIG_NSH_QUOTE=y CONFIG_NSH_ROMFSETC=y +CONFIG_NSH_ROMFSRC=y CONFIG_NSH_ROMFSSECTSIZE=128 CONFIG_NSH_STRERROR=y CONFIG_NSH_VARS=y diff --git a/boards/uvify/core/default.px4board b/boards/uvify/core/default.px4board index bdc591a281..d5e5f0bcbc 100644 --- a/boards/uvify/core/default.px4board +++ b/boards/uvify/core/default.px4board @@ -72,6 +72,8 @@ CONFIG_SYSTEMCMDS_MTD=y CONFIG_SYSTEMCMDS_NSHTERM=y CONFIG_SYSTEMCMDS_PARAM=y CONFIG_SYSTEMCMDS_PERF=y +CONFIG_SYSTEMCMDS_PX4LOG=y +CONFIG_SYSTEMCMDS_PX4LOG_TAIL=y CONFIG_SYSTEMCMDS_REBOOT=y CONFIG_SYSTEMCMDS_REFLECT=y CONFIG_SYSTEMCMDS_SD_BENCH=y diff --git a/boards/uvify/core/nuttx-config/nsh/defconfig b/boards/uvify/core/nuttx-config/nsh/defconfig index 0dcb89b2b3..1896b944ef 100644 --- a/boards/uvify/core/nuttx-config/nsh/defconfig +++ b/boards/uvify/core/nuttx-config/nsh/defconfig @@ -132,6 +132,7 @@ CONFIG_NSH_MAXARGUMENTS=15 CONFIG_NSH_NESTDEPTH=8 CONFIG_NSH_QUOTE=y CONFIG_NSH_ROMFSETC=y +CONFIG_NSH_ROMFSRC=y CONFIG_NSH_ROMFSSECTSIZE=128 CONFIG_NSH_STRERROR=y CONFIG_NSH_VARS=y diff --git a/boards/uvify/core/src/board_config.h b/boards/uvify/core/src/board_config.h index 22708b23e2..2069250f97 100644 --- a/boards/uvify/core/src/board_config.h +++ b/boards/uvify/core/src/board_config.h @@ -179,8 +179,7 @@ #define BOARD_HAS_ON_RESET 1 -#define BOARD_ENABLE_CONSOLE_BUFFER -#define BOARD_CONSOLE_BUFFER_SIZE (1024*3) + __BEGIN_DECLS diff --git a/boards/uvify/core/src/init.c b/boards/uvify/core/src/init.c index 6fb6034fba..f2ce8e04d3 100644 --- a/boards/uvify/core/src/init.c +++ b/boards/uvify/core/src/init.c @@ -121,7 +121,7 @@ __EXPORT void board_peripheral_reset(int ms) // Wait for the peripheral rail to reach GND. usleep(ms * 1000); - syslog(LOG_DEBUG, "reset done, %d ms\n", ms); + PX4_DEBUG("reset done, %d ms\n", ms); // Re-enable power. // Switch the peripheral rail back on. diff --git a/msg/LogMessage.msg b/msg/LogMessage.msg index 3ea1de23dd..d9e0125295 100644 --- a/msg/LogMessage.msg +++ b/msg/LogMessage.msg @@ -5,4 +5,4 @@ uint64 timestamp # time since system start (microseconds) uint8 severity # log level (same as in the linux kernel, starting with 0) char[127] text -uint8 ORB_QUEUE_LENGTH = 4 +uint8 ORB_QUEUE_LENGTH = 32 diff --git a/platforms/common/CMakeLists.txt b/platforms/common/CMakeLists.txt index a6e06b9d47..a18aeea02d 100644 --- a/platforms/common/CMakeLists.txt +++ b/platforms/common/CMakeLists.txt @@ -36,7 +36,6 @@ set(SRCS) if(NOT "${PX4_PLATFORM}" MATCHES "qurt" AND NOT "${PX4_BOARD}" MATCHES "io-v2" AND NOT "${PX4_BOARD_LABEL}" MATCHES "bootloader") list(APPEND SRCS px4_log.cpp - px4_log_history.cpp ) endif() diff --git a/platforms/common/i2c_spi_buses.cpp b/platforms/common/i2c_spi_buses.cpp index bc910c11de..9d116b0499 100644 --- a/platforms/common/i2c_spi_buses.cpp +++ b/platforms/common/i2c_spi_buses.cpp @@ -654,39 +654,28 @@ int I2CSPIDriverBase::module_start(const BusCLIArguments &cli, BusInstanceIterat #if defined(CONFIG_I2C) case BOARD_I2C_BUS: - PX4_INFO_RAW("%s #%i on I2C bus %d", instance->ItemName(), runtime_instance, iterator.bus()); - if (iterator.external()) { - PX4_INFO_RAW(" (external)"); - } + PX4_INFO("%s #%i on I2C bus %d (external) address 0x%X, rotation %d", instance->ItemName(), runtime_instance, + iterator.bus(), cli.i2c_address, cli.rotation); - if (cli.i2c_address != 0) { - PX4_INFO_RAW(" address 0x%X", cli.i2c_address); + } else { + PX4_INFO("%s #%i on I2C bus %d address 0x%X, rotation %d", instance->ItemName(), runtime_instance, iterator.bus(), + cli.i2c_address, cli.rotation); } - if (cli.rotation != 0) { - PX4_INFO_RAW(" rotation %d", cli.rotation); - } - - PX4_INFO_RAW("\n"); - break; #endif // CONFIG_I2C #if defined(CONFIG_SPI) case BOARD_SPI_BUS: - PX4_INFO_RAW("%s #%i on SPI bus %d", instance->ItemName(), runtime_instance, iterator.bus()); - if (iterator.external()) { - PX4_INFO_RAW(" (external, equal to '-b %i')", iterator.externalBusIndex()); - } + PX4_INFO("%s #%i on SPI bus %d rotation %d (external, equal to '-b %i')", instance->ItemName(), runtime_instance, + iterator.bus(), cli.rotation, iterator.externalBusIndex()); - if (cli.rotation != 0) { - PX4_INFO_RAW(" rotation %d", cli.rotation); + } else { + PX4_INFO("%s #%i on SPI bus %d rotation %d", instance->ItemName(), runtime_instance, iterator.bus(), cli.rotation); } - PX4_INFO_RAW("\n"); - break; #endif // CONFIG_SPI diff --git a/platforms/common/include/px4_platform_common/console_buffer.h b/platforms/common/include/px4_platform_common/console_buffer.h deleted file mode 100644 index 4cdc5cf636..0000000000 --- a/platforms/common/include/px4_platform_common/console_buffer.h +++ /dev/null @@ -1,99 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2019 PX4 Development Team. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * 3. Neither the name PX4 nor the names of its contributors may be - * used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************/ - -/** - * @file console_buffer.h - * This implements a simple console buffer to store the full bootup output. - * It can be printed via the 'dmesg' utility. - * The output of stdout is redirected to CONSOLE_BUFFER_DEVICE, which is stored - * to a circular buffer and output to stderr, so that everything is still printed - * to the original console. - */ - -#include - - -#define CONSOLE_BUFFER_DEVICE "/dev/console_buf" - -#ifdef BOARD_ENABLE_CONSOLE_BUFFER - -__BEGIN_DECLS - -/** - * Initialize the console buffer: register the CONSOLE_BUFFER_DEVICE - * @return 0 on success, <0 error otherwise - */ -int px4_console_buffer_init(); - -/** - * Print content of the console buffer to stdout - * @param follow if true keep waiting and print new content whenever the buffer - * is updated - */ -void px4_console_buffer_print(bool follow); - -/** - * Get the current used buffer size - */ -int px4_console_buffer_size(); - -/** - * Read (chunks) of the console buffer. - * Note that no lock is held between reading multiple chunks, so the buffer could get - * updated meanwhile. Use px4_console_buffer_size() to read no more than expected. - * @param buffer output buffer - * @param buffer_length output buffer length - * @param offset input and output argument for the offset. Initially set this to -1. - * @return number of bytes written to the buffer (or <0 on error) - */ -int px4_console_buffer_read(char *buffer, int buffer_length, int *offset); - -__END_DECLS - -#else - -static inline int px4_console_buffer_init() -{ - return 0; -} - -static inline int px4_console_buffer_size() -{ - return 0; -} - -static inline int px4_console_buffer_read(char *buffer, int buffer_length, int *offset) -{ - return 0; -} -#endif /* BOARD_ENABLE_CONSOLE_BUFFER */ diff --git a/platforms/common/include/px4_platform_common/log.h b/platforms/common/include/px4_platform_common/log.h index 3450b7e90b..6175d1dd53 100644 --- a/platforms/common/include/px4_platform_common/log.h +++ b/platforms/common/include/px4_platform_common/log.h @@ -130,7 +130,6 @@ __EXPORT void px4_log_modulename(int level, const char *moduleName, const char * __attribute__((format(printf, 3, 4))); __EXPORT void px4_log_raw(int level, const char *fmt, ...) __attribute__((format(printf, 2, 3))); -__EXPORT void px4_log_history(FILE *out); #if __GNUC__ // Allow empty format strings. diff --git a/platforms/common/include/px4_platform_common/log_history.h b/platforms/common/include/px4_platform_common/log_history.h deleted file mode 100644 index 4153412836..0000000000 --- a/platforms/common/include/px4_platform_common/log_history.h +++ /dev/null @@ -1,68 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2022 PX4 Development Team. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * 3. Neither the name PX4 nor the names of its contributors may be - * used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************/ - -#pragma once - -#include - -#if defined(BOARD_ENABLE_LOG_HISTORY) -#include -#include - -#ifndef BOARD_LOG_HISTORY_SIZE -#define BOARD_LOG_HISTORY_SIZE (1024*4) // default buffer size -#endif - -class LogHistory -{ -public: - LogHistory() { px4_sem_init(&_lock, 0, 1); } - ~LogHistory() { px4_sem_destroy(&_lock); } - - void write(const char *buffer); - void print(FILE *out); - -private: - void lock() { do {} while (px4_sem_wait(&_lock) != 0); } - void unlock() { px4_sem_post(&_lock); } - - int size(); - int read(char *buffer, int buffer_length, int *offset); - - char _log_history[BOARD_LOG_HISTORY_SIZE]; - int _head{0}; - int _tail{0}; - px4_sem_t _lock; -}; - -#endif diff --git a/platforms/common/include/px4_platform_common/module.h b/platforms/common/include/px4_platform_common/module.h index 63867df4e2..457f21fd39 100644 --- a/platforms/common/include/px4_platform_common/module.h +++ b/platforms/common/include/px4_platform_common/module.h @@ -284,7 +284,7 @@ public: ret = object->print_status(); } else { - PX4_INFO("not running"); + PX4_INFO_RAW("not running\n"); } unlock_module(); @@ -298,7 +298,7 @@ public: */ virtual int print_status() { - PX4_INFO("running"); + PX4_INFO_RAW("running\n"); return 0; } diff --git a/platforms/common/px4_log.cpp b/platforms/common/px4_log.cpp index 8e733b5ee4..b6881cb6a2 100644 --- a/platforms/common/px4_log.cpp +++ b/platforms/common/px4_log.cpp @@ -41,7 +41,6 @@ #endif #include -#include #if defined(__PX4_POSIX) #include #endif @@ -51,10 +50,6 @@ #include #include -#if defined(BOARD_ENABLE_LOG_HISTORY) -static LogHistory g_log_history; -#endif - static orb_advert_t orb_log_message_pub = nullptr; __EXPORT const char *__px4_log_level_str[_PX4_LOG_LEVEL_PANIC + 1] = { "DEBUG", "INFO", "WARN", "ERROR", "PANIC" }; @@ -81,104 +76,8 @@ __EXPORT void px4_log_modulename(int level, const char *module_name, const char { static constexpr ssize_t max_length = sizeof(log_message_s::text); - FILE *out = stdout; - -#if defined(PX4_LOG_COLORIZED_OUTPUT) - bool use_color = true; -#endif // PX4_LOG_COLORIZED_OUTPUT - -#if defined(__PX4_POSIX) - bool isatty_ = false; - out = get_stdout(&isatty_); - -#if defined(PX4_LOG_COLORIZED_OUTPUT) - use_color = isatty_; -#endif // PX4_LOG_COLORIZED_OUTPUT -#endif // PX4_POSIX - - if (level >= _PX4_LOG_LEVEL_INFO) { - char buf[max_length + 1]; // same length as log_message_s::text, but add newline - ssize_t pos = 0; - -#if defined(PX4_LOG_COLORIZED_OUTPUT) - - if (use_color) { - pos += sprintf(buf + pos, "%s", __px4_log_level_color[level]); - } - -#endif // PX4_LOG_COLORIZED_OUTPUT - - pos += snprintf(buf + pos, math::max(max_length - pos, (ssize_t)0), __px4__log_level_fmt, __px4_log_level_str[level]); - -#if defined(PX4_LOG_COLORIZED_OUTPUT) - - if (use_color) { - pos += snprintf(buf + pos, math::max(max_length - pos, (ssize_t)0), PX4_ANSI_COLOR_GRAY); - } - -#endif // PX4_LOG_COLORIZED_OUTPUT - - pos += snprintf(buf + pos, math::max(max_length - pos, (ssize_t)0), __px4__log_modulename_pfmt, module_name); - -#if defined(PX4_LOG_COLORIZED_OUTPUT) - - if (use_color) { - pos += snprintf(buf + pos, math::max(max_length - pos, (ssize_t)0), "%s", __px4_log_level_color[level]); - } - -#endif // PX4_LOG_COLORIZED_OUTPUT - - va_list argptr; - va_start(argptr, fmt); - pos += vsnprintf(buf + pos, math::max(max_length - pos, (ssize_t)0), fmt, argptr); - va_end(argptr); - -#if defined(PX4_LOG_COLORIZED_OUTPUT) - - if (use_color) { - // alway reset color - const ssize_t sz = math::min(pos, max_length - (ssize_t)strlen(PX4_ANSI_COLOR_RESET) - (ssize_t)1); - pos += sprintf(buf + sz, "%s\n", PX4_ANSI_COLOR_RESET); - - } else -#endif // PX4_LOG_COLORIZED_OUTPUT - { - pos += sprintf(buf + math::min(pos, max_length - (ssize_t)1), "\n"); - } - - // ensure NULL termination (buffer is max_length + 1) - buf[max_length] = 0; - - fputs(buf, out); - -#if defined(BOARD_ENABLE_LOG_HISTORY) - -#if defined(PX4_LOG_COLORIZED_OUTPUT) - - // No color formatting for log history - if (use_color) { - pos = snprintf(buf, max_length, __px4__log_level_fmt, __px4_log_level_str[level]); - pos += snprintf(buf + pos, math::max(max_length - pos, (ssize_t)0), __px4__log_modulename_pfmt, module_name); - va_start(argptr, fmt); - pos += vsnprintf(buf + pos, math::max(max_length - pos, (ssize_t)0), fmt, argptr); - va_end(argptr); - pos += sprintf(buf + math::min(pos, max_length - (ssize_t)1), "\n"); - buf[max_length] = 0; // ensure NULL termination - } - -#endif - g_log_history.write(buf); -#endif // BOARD_ENABLE_LOG_HISTORY - -#if defined(CONFIG_ARCH_BOARD_PX4_SITL) - // Without flushing it's tricky to see stdout output when PX4 is started by - // a script like for the MAVSDK tests. - fflush(out); -#endif // CONFIG_ARCH_BOARD_PX4_SITL - } - /* publish an orb log message */ - if (level >= _PX4_LOG_LEVEL_INFO && orb_log_message_pub) { //publish all messages + if (orb_log_message_pub) { //publish all messages log_message_s log_message; @@ -251,38 +150,5 @@ __EXPORT void px4_log_raw(int level, const char *fmt, ...) buf[max_length] = 0; fputs(buf, out); - -#if defined(BOARD_ENABLE_LOG_HISTORY) - -#if defined(PX4_LOG_COLORIZED_OUTPUT) - - // No color formatting for log history - if (use_color) { - va_start(argptr, fmt); - pos = vsnprintf(buf, max_length, fmt, argptr); - va_end(argptr); - - if (pos > max_length) { - // preserve newline if necessary - if (fmt[strlen(fmt) - 1] == '\n') { - buf[max_length - 1] = '\n'; - } - } - - buf[max_length] = 0; // ensure NULL termination - } - -#endif - g_log_history.write(buf); -#endif // BOARD_ENABLE_LOG_HISTORY } } - -__EXPORT void px4_log_history(FILE *out) -{ - -#if defined(BOARD_ENABLE_LOG_HISTORY) - - g_log_history.print(out); -#endif // BOARD_ENABLE_LOG_HISTORY -} diff --git a/platforms/common/px4_log_history.cpp b/platforms/common/px4_log_history.cpp deleted file mode 100644 index 2f63d98c54..0000000000 --- a/platforms/common/px4_log_history.cpp +++ /dev/null @@ -1,147 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2022 PX4 Development Team. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * 3. Neither the name PX4 nor the names of its contributors may be - * used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************/ - -#include - -#if defined(BOARD_ENABLE_LOG_HISTORY) -#include - -void LogHistory::print(FILE *out) -{ - const int buffer_length = 512; - char buffer[buffer_length]; - int offset = -1; - - int total_size_read = 0; - - do { - int read_size = read(buffer, buffer_length, &offset); - - if (read_size <= 0) { - break; - } - - fwrite(buffer, 1, read_size, out); - - if (read_size < buffer_length) { - break; - } - - total_size_read += read_size; - } while (total_size_read < BOARD_LOG_HISTORY_SIZE); -} - -// Log a null terminated string to the circular history buffer. -void LogHistory::write(const char *buffer) -{ - lock(); // same rule as for printf: this cannot be used from IRQ handlers - - int i = 0; - - while (buffer[i] != '\0') { - - _log_history[_tail] = buffer[i++]; - _tail = (_tail + 1) % BOARD_LOG_HISTORY_SIZE; - - if (_tail == _head) { - _head = (_head + 1) % BOARD_LOG_HISTORY_SIZE; - } - } - - unlock(); -} - -int LogHistory::size() -{ - lock(); - int size; - - if (_head <= _tail) { - size = _tail - _head; - - } else { - size = BOARD_LOG_HISTORY_SIZE - (_head - _tail); - } - - unlock(); - return size; -} - -int LogHistory::read(char *buffer, int buffer_length, int *offset) -{ - lock(); - - if (*offset == -1) { - *offset = _head; - } - - int size = 0; - - if (*offset < _tail) { - size = _tail - *offset; - - if (size > buffer_length) { - size = buffer_length; - } - - memcpy(buffer, _log_history + *offset, size); - - } else if (_tail < *offset) { - size = BOARD_LOG_HISTORY_SIZE - *offset; - - if (size > buffer_length) { - size = buffer_length; - } - - memcpy(buffer, _log_history + *offset, size); - buffer += size; - buffer_length -= size; - - int size_secondary = _tail; - - if (size_secondary > buffer_length) { - size_secondary = buffer_length; - } - - if (size_secondary > 0) { - memcpy(buffer, _log_history, size_secondary); - size += size_secondary; - } - } - - unlock(); - *offset = (*offset + size) % BOARD_LOG_HISTORY_SIZE; - return size; -} - -#endif diff --git a/platforms/common/shutdown.cpp b/platforms/common/shutdown.cpp index dcbd733ceb..1d869960f8 100644 --- a/platforms/common/shutdown.cpp +++ b/platforms/common/shutdown.cpp @@ -174,7 +174,7 @@ static void shutdown_worker(void *arg) if (delay_elapsed && ((done && shutdown_lock_counter == 0) || (now > (shutdown_time_us + shutdown_timeout_us)))) { if (shutdown_args & SHUTDOWN_ARG_REBOOT) { #if defined(CONFIG_BOARDCTL_RESET) - PX4_INFO_RAW("Reboot NOW."); + PX4_INFO("Reboot NOW."); boardctl(BOARDIOC_RESET, (shutdown_args & SHUTDOWN_ARG_TO_BOOTLOADER) ? 1 : 0); #else PX4_PANIC("board reset not available"); @@ -182,7 +182,7 @@ static void shutdown_worker(void *arg) } else { #if defined(BOARD_HAS_POWER_CONTROL) - PX4_INFO_RAW("Powering off NOW."); + PX4_INFO("Powering off NOW."); #if defined(CONFIG_BOARDCTL_POWEROFF) boardctl(BOARDIOC_POWEROFF, 0); #else @@ -190,7 +190,7 @@ static void shutdown_worker(void *arg) #endif #elif defined(__PX4_POSIX) // simply exit on posix if real shutdown (poweroff) not available - PX4_INFO_RAW("Exiting NOW."); + PX4_INFO("Exiting NOW."); system_exit(0); #else PX4_PANIC("board shutdown not available"); diff --git a/platforms/common/uORB/Subscription.hpp b/platforms/common/uORB/Subscription.hpp index 71c8809ad2..550bc0ad3a 100644 --- a/platforms/common/uORB/Subscription.hpp +++ b/platforms/common/uORB/Subscription.hpp @@ -183,6 +183,8 @@ public: ORB_ID orb_id() const { return _orb_id; } + void reset() { _last_generation = 0; } + protected: friend class SubscriptionCallback; diff --git a/platforms/common/uORB/SubscriptionBlocking.hpp b/platforms/common/uORB/SubscriptionBlocking.hpp index 7ec29e329b..d0941ca44c 100644 --- a/platforms/common/uORB/SubscriptionBlocking.hpp +++ b/platforms/common/uORB/SubscriptionBlocking.hpp @@ -161,6 +161,8 @@ public: return false; } + void reset() { _subscription.reset(); } + private: pthread_mutex_t _mutex = PTHREAD_MUTEX_INITIALIZER; diff --git a/platforms/nuttx/Debug/PX4 b/platforms/nuttx/Debug/PX4 index cc682edbe2..3719ee57cd 100644 --- a/platforms/nuttx/Debug/PX4 +++ b/platforms/nuttx/Debug/PX4 @@ -20,23 +20,6 @@ document px4 . Use 'help ' for more specific help. end - -define dmesg - if g_console_buffer - printf "PX4 dmesg:\n" - # TODO: respect head and tail - printf "%s\n", g_console_buffer._buffer - else - printf "PX4 dmesg unavailable\n" - end -end - -document dmesg -. dmesg -. Prints dmesg (if available). -end - - define _perf_print set $hdr = (struct perf_ctr_header *)$arg0 #printf "%p\n", $hdr diff --git a/platforms/nuttx/src/px4/common/CMakeLists.txt b/platforms/nuttx/src/px4/common/CMakeLists.txt index ab16e77a0e..5d0b7cf01a 100644 --- a/platforms/nuttx/src/px4/common/CMakeLists.txt +++ b/platforms/nuttx/src/px4/common/CMakeLists.txt @@ -39,7 +39,6 @@ if(NOT PX4_BOARD MATCHES "io-v2") board_dma_alloc.c board_fat_dma_alloc.c cdc_acm_check.cpp - console_buffer.cpp cpuload.cpp gpio.c print_load.cpp diff --git a/platforms/nuttx/src/px4/common/console_buffer.cpp b/platforms/nuttx/src/px4/common/console_buffer.cpp deleted file mode 100644 index c949421d26..0000000000 --- a/platforms/nuttx/src/px4/common/console_buffer.cpp +++ /dev/null @@ -1,239 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2019 PX4 Development Team. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * 3. Neither the name PX4 nor the names of its contributors may be - * used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include - -#ifdef BOARD_ENABLE_CONSOLE_BUFFER -#ifndef BOARD_CONSOLE_BUFFER_SIZE -# define BOARD_CONSOLE_BUFFER_SIZE (1024*4) // default buffer size -#endif - -static ssize_t console_buffer_write(struct file *filep, const char *buffer, size_t buflen); - - -class ConsoleBuffer -{ -public: - - void write(const char *buffer, size_t len); - - void print(bool follow); - - int size(); - - int read(char *buffer, int buffer_length, int *offset); - -private: - void lock() { do {} while (px4_sem_wait(&_lock) != 0); } - void unlock() { px4_sem_post(&_lock); } - - char _buffer[BOARD_CONSOLE_BUFFER_SIZE]; - int _head{0}; - int _tail{0}; - px4_sem_t _lock = SEM_INITIALIZER(1); -}; - -void ConsoleBuffer::print(bool follow) -{ - // print to stdout, but with a buffer in between to avoid nested locking and potential dead-locks - // (which could happen in combination with the MAVLink shell: dmesg writing to the pipe waiting - // mavlink to read, while mavlink calls printf, waiting for the console lock) - const int buffer_length = 512; - char buffer[buffer_length]; - int offset = -1; - - do { - - // print the full buffer or what's newly added - int total_size_read = 0; - - do { - int read_size = read(buffer, buffer_length, &offset); - - if (read_size <= 0) { - break; - } - - ::write(1, buffer, read_size); - - if (read_size < buffer_length) { - break; - } - - total_size_read += read_size; - } while (total_size_read < BOARD_CONSOLE_BUFFER_SIZE); - - - if (follow) { - usleep(10000); - } - } while (follow); -} - -void ConsoleBuffer::write(const char *buffer, size_t len) -{ - lock(); // same rule as for printf: this cannot be used from IRQ handlers - - for (size_t i = 0; i < len; ++i) { - _buffer[_tail] = buffer[i]; - _tail = (_tail + 1) % BOARD_CONSOLE_BUFFER_SIZE; - - if (_tail == _head) { - _head = (_head + 1) % BOARD_CONSOLE_BUFFER_SIZE; - } - } - - unlock(); -} - -int ConsoleBuffer::size() -{ - lock(); - int size; - - if (_head <= _tail) { - size = _tail - _head; - - } else { - size = BOARD_CONSOLE_BUFFER_SIZE - (_head - _tail); - } - - unlock(); - return size; -} - -int ConsoleBuffer::read(char *buffer, int buffer_length, int *offset) -{ - lock(); - - if (*offset == -1) { - *offset = _head; - } - - int size = 0; - - if (*offset < _tail) { - size = _tail - *offset; - - if (size > buffer_length) { - size = buffer_length; - } - - memcpy(buffer, _buffer + *offset, size); - - } else if (_tail < *offset) { - size = BOARD_CONSOLE_BUFFER_SIZE - *offset; - - if (size > buffer_length) { - size = buffer_length; - } - - memcpy(buffer, _buffer + *offset, size); - buffer += size; - buffer_length -= size; - - int size_secondary = _tail; - - if (size_secondary > buffer_length) { - size_secondary = buffer_length; - } - - if (size_secondary > 0) { - memcpy(buffer, _buffer, size_secondary); - size += size_secondary; - } - } - - unlock(); - *offset = (*offset + size) % BOARD_CONSOLE_BUFFER_SIZE; - return size; -} - -static ConsoleBuffer g_console_buffer; - - -void px4_console_buffer_print(bool follow) -{ - g_console_buffer.print(follow); -} - -ssize_t console_buffer_write(struct file *filep, const char *buffer, size_t len) -{ - g_console_buffer.write(buffer, len); - - // stderr still points to our original console and is available from everywhere, so we output to that. - // We could use up_putc() as well, but it is considerably less efficient. - // The drawback here is that a module writing to stderr bypasses the console buffer. - write(2, buffer, len); - fsync(2); - - return len; -} - -static const struct file_operations g_console_buffer_fops = { - NULL, /* open */ - NULL, /* close */ - NULL, /* read */ - console_buffer_write, /* write */ - NULL, /* seek */ - NULL /* ioctl */ -#ifndef CONFIG_DISABLE_POLL - , NULL /* poll */ -#endif -#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS - , NULL /* unlink */ -#endif -}; - -int px4_console_buffer_init() -{ - return register_driver(CONSOLE_BUFFER_DEVICE, &g_console_buffer_fops, 0666, NULL); -} - -int px4_console_buffer_size() -{ - return g_console_buffer.size(); -} - -int px4_console_buffer_read(char *buffer, int buffer_length, int *offset) -{ - return g_console_buffer.read(buffer, buffer_length, offset); -} - -#endif /* BOARD_ENABLE_CONSOLE_BUFFER */ diff --git a/platforms/nuttx/src/px4/common/console_buffer_usr.cpp b/platforms/nuttx/src/px4/common/console_buffer_usr.cpp deleted file mode 100644 index 83023f934d..0000000000 --- a/platforms/nuttx/src/px4/common/console_buffer_usr.cpp +++ /dev/null @@ -1,65 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2021 Technology Innovation Institute. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * 3. Neither the name PX4 nor the names of its contributors may be - * used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include - -#ifdef BOARD_ENABLE_CONSOLE_BUFFER -#ifndef BOARD_CONSOLE_BUFFER_SIZE -# define BOARD_CONSOLE_BUFFER_SIZE (1024*4) // default buffer size -#endif - - -// TODO: User side implementation of px4_console_buffer - -int px4_console_buffer_init() -{ - return 0; -} - -int px4_console_buffer_size() -{ - return 0; -} - -int px4_console_buffer_read(char *buffer, int buffer_length, int *offset) -{ - return 0; -} - -#endif /* BOARD_ENABLE_CONSOLE_BUFFER */ diff --git a/platforms/nuttx/src/px4/common/px4_init.cpp b/platforms/nuttx/src/px4/common/px4_init.cpp index fb371b9093..3fe494d8c6 100644 --- a/platforms/nuttx/src/px4/common/px4_init.cpp +++ b/platforms/nuttx/src/px4/common/px4_init.cpp @@ -35,7 +35,6 @@ #include #include #include -#include #include #include #include @@ -102,21 +101,6 @@ int px4_platform_init() kernel_ioctl_initialize(); #endif - int ret = px4_console_buffer_init(); - - if (ret < 0) { - return ret; - } - - // replace stdout with our buffered console - int fd_buf = open(CONSOLE_BUFFER_DEVICE, O_WRONLY); - - if (fd_buf >= 0) { - dup2(fd_buf, 1); - // keep stderr(2) untouched: the buffered console will use it to output to the original console - close(fd_buf); - } - #if defined(PX4_CRYPTO) PX4Crypto::px4_crypto_init(); #endif @@ -165,7 +149,7 @@ int px4_platform_init() #if defined(CONFIG_FS_PROCFS) int ret_mount_procfs = mount(nullptr, "/proc", "procfs", 0, nullptr); - if (ret < 0) { + if (ret_mount_procfs < 0) { syslog(LOG_ERR, "ERROR: Failed to mount procfs at /proc: %d\n", ret_mount_procfs); } diff --git a/platforms/nuttx/src/px4/common/px4_protected_layers.cmake b/platforms/nuttx/src/px4/common/px4_protected_layers.cmake index 7f76502e68..3f0a03a7de 100644 --- a/platforms/nuttx/src/px4/common/px4_protected_layers.cmake +++ b/platforms/nuttx/src/px4/common/px4_protected_layers.cmake @@ -5,7 +5,6 @@ add_library(px4_layer board_dma_alloc.c board_fat_dma_alloc.c tasks.cpp - console_buffer_usr.cpp cdc_acm_check.cpp ${PX4_SOURCE_DIR}/platforms/posix/src/px4/common/print_load.cpp ${PX4_SOURCE_DIR}/platforms/posix/src/px4/common/cpuload.cpp diff --git a/platforms/nuttx/src/px4/rpi/rpi_common/spi/spi.cpp b/platforms/nuttx/src/px4/rpi/rpi_common/spi/spi.cpp index 9b05e6542a..34758622f8 100644 --- a/platforms/nuttx/src/px4/rpi/rpi_common/spi/spi.cpp +++ b/platforms/nuttx/src/px4/rpi/rpi_common/spi/spi.cpp @@ -273,7 +273,7 @@ __EXPORT void board_spi_reset(int ms, int bus_mask) // wait for the sensor rail to reach GND usleep(ms * 1000); - syslog(LOG_DEBUG, "reset done, %d ms\n", ms); + PX4_DEBUG("reset done, %d ms\n", ms); /* re-enable power */ diff --git a/platforms/nuttx/src/px4/stm/stm32_common/spi/spi.cpp b/platforms/nuttx/src/px4/stm/stm32_common/spi/spi.cpp index 989a543893..0ab1ff64f4 100644 --- a/platforms/nuttx/src/px4/stm/stm32_common/spi/spi.cpp +++ b/platforms/nuttx/src/px4/stm/stm32_common/spi/spi.cpp @@ -34,6 +34,7 @@ #include #include #include +#include #include #include @@ -471,7 +472,7 @@ __EXPORT void board_spi_reset(int ms, int bus_mask) // wait for the sensor rail to reach GND usleep(ms * 1000); - syslog(LOG_DEBUG, "reset done, %d ms\n", ms); + PX4_DEBUG("reset done, %d ms\n", ms); /* re-enable power */ diff --git a/platforms/ros2/include/px4_platform_common/module.h b/platforms/ros2/include/px4_platform_common/module.h index 436c86ed92..9a14517c52 100644 --- a/platforms/ros2/include/px4_platform_common/module.h +++ b/platforms/ros2/include/px4_platform_common/module.h @@ -128,7 +128,7 @@ public: */ virtual int print_status() { - PX4_INFO("running"); + PX4_INFO_RAW("running"); return 0; } diff --git a/src/drivers/distance_sensor/broadcom/afbrs50/AFBRS50.cpp b/src/drivers/distance_sensor/broadcom/afbrs50/AFBRS50.cpp index b66eeeba3d..6d88cdbd55 100644 --- a/src/drivers/distance_sensor/broadcom/afbrs50/AFBRS50.cpp +++ b/src/drivers/distance_sensor/broadcom/afbrs50/AFBRS50.cpp @@ -145,7 +145,7 @@ int AFBRS50::init() uint8_t a = (value >> 24) & 0xFFU; uint8_t b = (value >> 16) & 0xFFU; uint8_t c = value & 0xFFFFU; - PX4_INFO_RAW("AFBR-S50 Chip ID: %u, API Version: %u v%d.%d.%d\n", (uint)id, (uint)value, a, b, c); + PX4_INFO("Chip ID: %u, API Version: %u v%d.%d.%d\n", (uint)id, (uint)value, a, b, c); argus_module_version_t mv = Argus_GetModuleVersion(_hnd); argus_laser_type_t lt = Argus_GetLaserType(_hnd); @@ -163,7 +163,7 @@ int AFBRS50::init() _px4_rangefinder.set_min_distance(_min_distance); _px4_rangefinder.set_max_distance(_max_distance); _px4_rangefinder.set_fov(math::radians(6.f)); - PX4_INFO_RAW("AFBR-S50MV85G\n"); + PX4_INFO("AFBR-S50MV85G"); break; case AFBR_S50LV85D_V1: @@ -171,11 +171,11 @@ int AFBRS50::init() if (lt == LASER_H_V2X) { _max_distance = 50.f; - PX4_INFO_RAW("AFBR-S50LX85D (v2)\n"); + PX4_INFO("AFBR-S50LX85D (v2)"); } else { _max_distance = 30.f; - PX4_INFO_RAW("AFBR-S50LV85D (v1)\n"); + PX4_INFO("AFBR-S50LV85D (v1)"); } _px4_rangefinder.set_min_distance(_min_distance); @@ -189,7 +189,7 @@ int AFBRS50::init() _px4_rangefinder.set_min_distance(_min_distance); _px4_rangefinder.set_max_distance(_max_distance); _px4_rangefinder.set_fov(math::radians(1.f)); - PX4_INFO_RAW("AFBR-S50MV68B (v1)\n"); + PX4_INFO("AFBR-S50MV68B (v1)"); break; case AFBR_S50MV85I_V1: @@ -198,7 +198,7 @@ int AFBRS50::init() _px4_rangefinder.set_min_distance(_min_distance); _px4_rangefinder.set_max_distance(_max_distance); _px4_rangefinder.set_fov(math::radians(6.f)); - PX4_INFO_RAW("AFBR-S50MV85I (v1)\n"); + PX4_INFO("AFBR-S50MV85I (v1)"); break; case AFBR_S50SV85K_V1: @@ -207,7 +207,7 @@ int AFBRS50::init() _px4_rangefinder.set_min_distance(_min_distance); _px4_rangefinder.set_max_distance(_max_distance); _px4_rangefinder.set_fov(math::radians(4.f)); - PX4_INFO_RAW("AFBR-S50SV85K (v1)\n"); + PX4_INFO("AFBR-S50SV85K (v1)"); break; default: diff --git a/src/modules/logger/logger.cpp b/src/modules/logger/logger.cpp index d2a6b906d7..dd0f810874 100644 --- a/src/modules/logger/logger.cpp +++ b/src/modules/logger/logger.cpp @@ -32,7 +32,6 @@ ****************************************************************************/ #include -#include #include "logged_topics.h" #include "logger.h" #include "messages.h" @@ -793,26 +792,7 @@ void Logger::run() // check for new events handle_event_updates(total_bytes); - // check for new logging message(s) - log_message_s log_message; - - if (_log_message_sub.update(&log_message)) { - const char *message = (const char *)log_message.text; - int message_len = strlen(message); - - if (message_len > 0) { - uint16_t write_msg_size = sizeof(ulog_message_logging_s) - sizeof(ulog_message_logging_s::message) - - ULOG_MSG_HEADER_LEN + message_len; - _msg_buffer[0] = (uint8_t)write_msg_size; - _msg_buffer[1] = (uint8_t)(write_msg_size >> 8); - _msg_buffer[2] = static_cast(ULogMessageType::LOGGING); - _msg_buffer[3] = log_message.severity + '0'; - memcpy(_msg_buffer + 4, &log_message.timestamp, sizeof(ulog_message_logging_s::timestamp)); - strncpy((char *)(_msg_buffer + 12), message, sizeof(ulog_message_logging_s::message)); - - write_message(LogType::Full, _msg_buffer, write_msg_size + ULOG_MSG_HEADER_LEN); - } - } + write_log_message(); // Add sync magic if (loop_time - _last_sync_time > 500_ms) { @@ -1421,12 +1401,14 @@ void Logger::start_log_file(LogType type) write_parameters(type); write_parameter_defaults(type); write_perf_data(PrintLoadReason::Preflight); - write_console_output(); write_events_file(LogType::Full); write_excluded_optional_topics(type); } write_all_add_logged_msg(type); + + write_log_message(); + _writer.set_need_reliable_transfer(false); _writer.unselect_write_backend(); _writer.notify(); @@ -1437,7 +1419,6 @@ void Logger::start_log_file(LogType type) } _statistics[(int)type].start_time_file = hrt_absolute_time(); - } void Logger::stop_log_file(LogType type) @@ -1479,10 +1460,12 @@ void Logger::start_log_mavlink() write_parameters(LogType::Full); write_parameter_defaults(LogType::Full); write_perf_data(PrintLoadReason::Preflight); - write_console_output(); write_events_file(LogType::Full); write_excluded_optional_topics(LogType::Full); write_all_add_logged_msg(LogType::Full); + + write_log_message(); + _writer.set_need_reliable_transfer(false); _writer.unselect_write_backend(); _writer.notify(); @@ -1620,26 +1603,28 @@ void Logger::write_load_output() _writer.set_need_reliable_transfer(false); } -void Logger::write_console_output() +void Logger::write_log_message() { - const int buffer_length = 220; - char buffer[buffer_length]; - int size = px4_console_buffer_size(); - int offset = -1; - bool first = true; + // check for new logging message(s) + log_message_s log_message; - while (size > 0) { - int read_size = px4_console_buffer_read(buffer, buffer_length - 1, &offset); + while (_log_message_sub.update(&log_message)) { + const char *message = (const char *)log_message.text; + int message_len = strlen(message); - if (read_size <= 0) { break; } + if (message_len > 0) { + uint16_t write_msg_size = sizeof(ulog_message_logging_s) - sizeof(ulog_message_logging_s::message) + - ULOG_MSG_HEADER_LEN + message_len; + _msg_buffer[0] = (uint8_t)write_msg_size; + _msg_buffer[1] = (uint8_t)(write_msg_size >> 8); + _msg_buffer[2] = static_cast(ULogMessageType::LOGGING); + _msg_buffer[3] = log_message.severity + '0'; + memcpy(_msg_buffer + 4, &log_message.timestamp, sizeof(ulog_message_logging_s::timestamp)); + strncpy((char *)(_msg_buffer + 12), message, sizeof(ulog_message_logging_s::message)); - buffer[math::min(read_size, size)] = '\0'; - write_info_multiple(LogType::Full, "boot_console_output", buffer, !first); - - size -= read_size; - first = false; + write_message(LogType::Full, _msg_buffer, write_msg_size + ULOG_MSG_HEADER_LEN); + } } - } void Logger::write_format(LogType type, const orb_metadata &meta, WrittenFormats &written_formats, diff --git a/src/modules/logger/logger.h b/src/modules/logger/logger.h index 65a9f1d179..da7fb40b2e 100644 --- a/src/modules/logger/logger.h +++ b/src/modules/logger/logger.h @@ -247,11 +247,7 @@ private: * write performance counters */ void write_perf_data(PrintLoadReason reason); - - /** - * write bootup console output - */ - void write_console_output(); + void write_log_message(); /** * callback to write the performance counters diff --git a/src/modules/mavlink/mavlink_main.cpp b/src/modules/mavlink/mavlink_main.cpp index 40f6cbf819..f578652f78 100644 --- a/src/modules/mavlink/mavlink_main.cpp +++ b/src/modules/mavlink/mavlink_main.cpp @@ -2173,12 +2173,6 @@ Mavlink::task_main(int argc, char *argv[]) PX4_ERR("%s already running", _device_name); return PX4_ERROR; } - - PX4_INFO("mode: %s, data rate: %d B/s on %s @ %dB", - mavlink_mode_str(_mode), _datarate, _device_name, _baudrate); - - /* flush stdout in case MAVLink is about to take it over */ - fflush(stdout); } #if defined(MAVLINK_UDP) @@ -2188,9 +2182,6 @@ Mavlink::task_main(int argc, char *argv[]) PX4_ERR("port %hu already occupied", _network_port); return PX4_ERROR; } - - PX4_INFO("mode: %s, data rate: %d B/s on udp port %hu remote port %hu", - mavlink_mode_str(_mode), _datarate, _network_port, _remote_port); } #endif // MAVLINK_UDP @@ -2303,6 +2294,20 @@ Mavlink::task_main(int argc, char *argv[]) _task_running.store(true); + if (get_protocol() == Protocol::SERIAL) { + PX4_INFO("starting, mode: %s, data rate: %d B/s on %s @ %dB", + mavlink_mode_str(_mode), _datarate, _device_name, _baudrate); + } + +#if defined(MAVLINK_UDP) + + if (get_protocol() == Protocol::UDP) { + PX4_INFO("starting, mode: %s, data rate: %d B/s on udp port %hu remote port %hu", + mavlink_mode_str(_mode), _datarate, _network_port, _remote_port); + } + +#endif // MAVLINK_UDP + while (!should_exit()) { /* main loop */ px4_usleep(_main_loop_delay); diff --git a/src/systemcmds/dmesg/Kconfig b/src/systemcmds/dmesg/Kconfig deleted file mode 100644 index c2ae39fb30..0000000000 --- a/src/systemcmds/dmesg/Kconfig +++ /dev/null @@ -1,12 +0,0 @@ -menuconfig SYSTEMCMDS_DMESG - bool "dmesg" - default n - ---help--- - Enable support for dmesg - -menuconfig USER_DMESG - bool "dmesg running as userspace module" - default n - depends on BOARD_PROTECTED && SYSTEMCMDS_DMESG - ---help--- - Put dmesg in userspace memory diff --git a/src/systemcmds/hardfault_log/hardfault_log.c b/src/systemcmds/hardfault_log/hardfault_log.c index 259c0f481c..c48fad6e54 100644 --- a/src/systemcmds/hardfault_log/hardfault_log.c +++ b/src/systemcmds/hardfault_log/hardfault_log.c @@ -216,17 +216,6 @@ static int format_fault_file_name(struct timespec *ts, char *buffer, unsigned in return ret; } -/**************************************************************************** - * identify - ****************************************************************************/ -static void identify(const char *caller) -{ - if (caller) { - syslog(LOG_INFO, "[%s] ", caller); - } -} - - /**************************************************************************** * hardfault_get_desc ****************************************************************************/ @@ -237,8 +226,7 @@ static int hardfault_get_desc(char *caller, dump_s *desc, bool silent) if (fd < 0) { if (!silent) { - identify(caller); - hfsyslog(LOG_INFO, "Failed to open Fault Log file [%s] (%d)\n", HARDFAULT_PATH, fd); + PX4_ERR("Failed to open Fault Log file [%s] (%d)", HARDFAULT_PATH, fd); } } else { @@ -249,8 +237,7 @@ static int hardfault_get_desc(char *caller, dump_s *desc, bool silent) ret = fd; } else { - identify(caller); - hfsyslog(LOG_INFO, "Failed to get Fault Log descriptor (%d)\n", rv); + PX4_ERR("Failed to get Fault Log descriptor (%d)", rv); } } @@ -261,7 +248,7 @@ static int hardfault_get_desc(char *caller, dump_s *desc, bool silent) /**************************************************************************** * hardfault_clear ****************************************************************************/ -static int hardfault_clear(char *caller, bool silent) +static int hardfault_clear(bool silent) { int ret = -ENOENT; int fd = open(HARDFAULT_PATH, O_RDONLY); @@ -269,8 +256,7 @@ static int hardfault_clear(char *caller, bool silent) if (fd < 0) { if (!silent) { - identify(caller); - hfsyslog(LOG_INFO, "Failed to open Fault Log file to clear [%s] (%d)\n", HARDFAULT_PATH, fd); + PX4_ERR("Failed to open Fault Log file to clear [%s] (%d)", HARDFAULT_PATH, fd); } } else { @@ -281,8 +267,7 @@ static int hardfault_clear(char *caller, bool silent) ret = fd; } else { - identify(caller); - hfsyslog(LOG_INFO, "Failed to clear progmem sector (%d)\n", rv); + PX4_ERR("Failed to clear progmem sector (%d)", rv); } } @@ -293,10 +278,8 @@ static int hardfault_clear(char *caller, bool silent) /**************************************************************************** * write_stack_detail ****************************************************************************/ -static int write_stack_detail(bool inValid, _stack_s *si, char *sp_name, - char *buffer, int max, int fd) +static int write_stack_detail(bool inValid, _stack_s *si, char *sp_name, char *buffer, int max, int fd) { - int n = 0; uint32_t sbot = si->top - si->size; n = snprintf(&buffer[n], max - n, " %s stack: \n", sp_name); @@ -731,8 +714,7 @@ static int hardfault_append_to_ulog(const char *caller, int fdin) return -ENOENT; } - identify(caller); - syslog(LOG_INFO, "Appending to ULog %s\n", ulog_file_name); + PX4_INFO("Appending to ULog %s", ulog_file_name); // get the ulog file size struct stat st; @@ -763,8 +745,7 @@ static int hardfault_append_to_ulog(const char *caller, int fdin) magic[6] = 0x35; if (read(ulog_fd, chunk, 8) != 8) { - identify(caller); - hfsyslog(LOG_INFO, "Reading ULog header failed\n"); + PX4_ERR("Reading ULog header failed"); return -EINVAL; } @@ -818,8 +799,7 @@ static int hardfault_append_to_ulog(const char *caller, int fdin) } if (!found) { - identify(caller); - hfsyslog(LOG_ERR, "Cannot append more data to ULog (no offsets left)\n"); + PX4_ERR("Cannot append more data to ULog (no offsets left)"); ret = -EINVAL; goto out; } @@ -864,8 +844,7 @@ static int hardfault_append_to_ulog(const char *caller, int fdin) num_read = read(fdin, chunk, max_read); if (num_read <= 0) { - identify(caller); - hfsyslog(LOG_ERR, "read() failed: %i, %i\n", num_read, errno); + PX4_ERR("read() failed: %i, %i", num_read, errno); ret = -1; goto out; } @@ -909,14 +888,12 @@ static int hardfault_commit(char *caller) int rv = close(fd); if (rv < 0) { - identify(caller); - hfsyslog(LOG_INFO, "Failed to Close Fault Log (%d)\n", rv); + PX4_ERR("Failed to Close Fault Log (%d)", rv); } else { if (state != OK) { - identify(caller); - hfsyslog(LOG_INFO, "Nothing to save\n"); + PX4_ERR("Nothing to save"); ret = -ENOENT; } else { @@ -926,31 +903,28 @@ static int hardfault_commit(char *caller) int fdout = open(path, O_RDWR | O_CREAT); if (fdout >= 0) { - identify(caller); - syslog(LOG_INFO, "Saving Fault Log file %s\n", path); + PX4_INFO("Saving Fault Log file %s", path); ret = hardfault_write(caller, fdout, HARDFAULT_FILE_FORMAT, false); - identify(caller); - hfsyslog(LOG_INFO, "Done saving Fault Log file\n"); + PX4_INFO("Done saving Fault Log file"); // now save the same data to the last ulog file by copying from the txt file // (not the fastest, but a simple way to do it). We also want to keep a separate // .txt file around, since that is a bit less prone to FS errors than the ULog if (ret == OK) { ret = hardfault_append_to_ulog(caller, fdout); - identify(caller); switch (ret) { case OK: - hfsyslog(LOG_INFO, "Successfully appended to ULog\n"); + PX4_INFO("Successfully appended to ULog"); break; case -ENOENT: - hfsyslog(LOG_INFO, "No ULog to append to\n"); + PX4_WARN("No ULog to append to"); ret = OK; break; default: - hfsyslog(LOG_INFO, "Failed to append to ULog (%i)\n", ret); + PX4_ERR("Failed to append to ULog (%i)", ret); break; } } @@ -989,8 +963,7 @@ static int hardfault_dowrite(char *caller, int infd, int outfd, ret = read(infd, info, sizeof(info_s)); if (ret < 0) { - identify(caller); - hfsyslog(LOG_INFO, "Failed to read Fault Log file [%s] (%d)\n", HARDFAULT_PATH, ret); + PX4_ERR("Failed to read Fault Log file [%s] (%d)", HARDFAULT_PATH, ret); ret = -EIO; } else { @@ -1083,13 +1056,11 @@ __EXPORT int hardfault_rearm(char *caller) int rv = unlink(HARDFAULT_PATH); if (rv < 0) { - identify(caller); - hfsyslog(LOG_INFO, "Failed to re arming Fault Log (%d)\n", rv); + PX4_ERR("Failed to re arming Fault Log (%d)", rv); ret = -EIO; } else { - identify(caller); - syslog(LOG_INFO, "Fault Log is Armed\n"); + PX4_INFO("Fault Log is Armed"); } return ret; @@ -1105,13 +1076,11 @@ __EXPORT int hardfault_check_status(char *caller) int ret = hardfault_get_desc(caller, &desc, true); if (ret < 0) { - identify(caller); - if (ret == -ENOENT) { - hfsyslog(LOG_INFO, "Fault Log is Armed\n"); + PX4_INFO("Fault Log is Armed"); } else { - hfsyslog(LOG_INFO, "Failed to open Fault Log file [%s] (%d)\n", HARDFAULT_PATH, ret); + PX4_ERR("Failed to open Fault Log file [%s] (%d)", HARDFAULT_PATH, ret); } } else { @@ -1120,20 +1089,17 @@ __EXPORT int hardfault_check_status(char *caller) int rv = close(fd); if (rv < 0) { - identify(caller); - hfsyslog(LOG_INFO, "Failed to Close Fault Log (%d)\n", rv); + PX4_ERR("Failed to Close Fault Log (%d)", rv); } else { ret = state; - identify(caller); - hfsyslog(LOG_INFO, "Fault Log info File No %" PRIu8 " Length %" PRIu16 " flags:0x%02" PRIx16 " state:%d\n", - desc.fileno, desc.len, desc.flags, state); + PX4_INFO("Fault Log info File No %" PRIu8 " Length %" PRIu16 " flags:0x%02" PRIx16 " state:%d", desc.fileno, desc.len, + desc.flags, state); if (state == OK) { char buf[TIME_FMT_LEN + 1]; format_fault_time(HEADER_TIME_FMT, &desc.lastwrite, buf, arraySize(buf)); - identify(caller); - hfsyslog(LOG_INFO, "Fault Logged on %s - Valid\n", buf); + PX4_INFO("Fault Logged on %s - Valid", buf); } else { rv = hardfault_rearm(caller); @@ -1158,8 +1124,7 @@ __EXPORT int hardfault_increment_reboot(char *caller, bool reset) int fd = open(HARDFAULT_REBOOT_PATH, O_RDWR | O_CREAT); if (fd < 0) { - identify(caller); - hfsyslog(LOG_INFO, "Failed to open Fault reboot count file [%s] (%d)\n", HARDFAULT_REBOOT_PATH, ret); + PX4_ERR("Failed to open Fault reboot count file [%s] (%d)", HARDFAULT_REBOOT_PATH, ret); } else { @@ -1226,17 +1191,14 @@ __EXPORT int hardfault_write(char *caller, int fd, int format, bool rearm) ret = close(hffd); if (ret < 0) { - identify(caller); - hfsyslog(LOG_INFO, "Failed to Close Fault Log (%d)\n", ret); - + PX4_ERR("Failed to Close Fault Log (%d)", ret); } if (rv == OK && rearm) { ret = hardfault_rearm(caller); if (ret < 0) { - identify(caller); - hfsyslog(LOG_INFO, "Failed to re-arm Fault Log (%d)\n", ret); + PX4_ERR("Failed to re-arm Fault Log (%d)", ret); } } @@ -1245,8 +1207,7 @@ __EXPORT int hardfault_write(char *caller, int fd, int format, bool rearm) } if (ret != OK) { - identify(caller); - hfsyslog(LOG_INFO, "Failed to Write Fault Log (%d)\n", ret); + PX4_ERR("Failed to Write Fault Log (%d)", ret); } } diff --git a/src/systemcmds/hist/Kconfig b/src/systemcmds/hist/Kconfig deleted file mode 100644 index fb742a456f..0000000000 --- a/src/systemcmds/hist/Kconfig +++ /dev/null @@ -1,5 +0,0 @@ -menuconfig SYSTEMCMDS_HIST - bool "hist" - default n - ---help--- - Enable support for hist diff --git a/src/systemcmds/hist/CMakeLists.txt b/src/systemcmds/px4log/CMakeLists.txt similarity index 91% rename from src/systemcmds/hist/CMakeLists.txt rename to src/systemcmds/px4log/CMakeLists.txt index d5237f6ab0..42da9422e0 100644 --- a/src/systemcmds/hist/CMakeLists.txt +++ b/src/systemcmds/px4log/CMakeLists.txt @@ -1,6 +1,6 @@ ############################################################################ # -# Copyright (c) 2022 PX4 Development Team. All rights reserved. +# Copyright (c) 2023 PX4 Development Team. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -31,8 +31,11 @@ # ############################################################################ px4_add_module( - MODULE systemcmds__hist - MAIN hist + MODULE systemcmds__px4log + MAIN px4log + STACK_MAIN 4096 SRCS - hist.cpp - ) + px4log.cpp + DEPENDS + systemlib +) diff --git a/src/systemcmds/px4log/Kconfig b/src/systemcmds/px4log/Kconfig new file mode 100644 index 0000000000..337b947d79 --- /dev/null +++ b/src/systemcmds/px4log/Kconfig @@ -0,0 +1,12 @@ +menuconfig SYSTEMCMDS_PX4LOG + bool "px4log" + default n + ---help--- + Enable support for px4log + +menuconfig USER_PX4LOG + bool "px4log running as userspace module" + default n + depends on BOARD_PROTECTED && SYSTEMCMDS_PX4LOG + ---help--- + Put px4log in userspace memory diff --git a/src/systemcmds/hist/hist.cpp b/src/systemcmds/px4log/px4log.cpp similarity index 60% rename from src/systemcmds/hist/hist.cpp rename to src/systemcmds/px4log/px4log.cpp index a81db44385..1a52fd74f0 100644 --- a/src/systemcmds/hist/hist.cpp +++ b/src/systemcmds/px4log/px4log.cpp @@ -1,6 +1,6 @@ /**************************************************************************** * - * Copyright (c) 2022 PX4 Development Team. All rights reserved. + * Copyright (c) 2023 PX4 Development Team. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -31,33 +31,58 @@ * ****************************************************************************/ +/** + * @file px4log.cpp + * Tool similar to UNIX logger command + * + */ + #include -#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include #include -#ifndef BOARD_ENABLE_LOG_HISTORY -#error "This module can only be used on boards that enable BOARD_ENABLE_LOG_HISTORY" -#endif +#include +#include +#include -extern "C" { - __EXPORT int hist_main(int argc, char *argv[]); -} +// static void print_usage() +// { +// PRINT_MODULE_DESCRIPTION("Monitor running processes and their CPU, stack usage, priority and state"); -static void usage() -{ - PRINT_MODULE_DESCRIPTION("Command-line tool to show the px4 message history. There are no arguments."); - PRINT_MODULE_USAGE_NAME_SIMPLE("hist", "command"); -} +// PRINT_MODULE_USAGE_NAME_SIMPLE("px4log", "command"); +// } - -int hist_main(int argc, char *argv[]) +extern "C" __EXPORT int px4log_main(int argc, char *argv[]) { if (argc > 1) { - usage(); - return 0; - } + uORB::Publication log_message_pub{ORB_ID(log_message)}; - px4_log_history(stdout); + static constexpr ssize_t kMaxLength = sizeof(log_message_s::text); + + log_message_s log_message{}; + log_message.severity = 6; // info + + ssize_t pos = 0; + + for (int i = 1; i < argc; i++) { + pos += snprintf((char *)log_message.text + pos, math::max(kMaxLength - pos, (ssize_t)0), "%s ", argv[i]); + } + + log_message.timestamp = hrt_absolute_time(); + + + + log_message_pub.publish(log_message); + } return 0; } diff --git a/src/systemcmds/dmesg/CMakeLists.txt b/src/systemcmds/px4log_tail/CMakeLists.txt similarity index 88% rename from src/systemcmds/dmesg/CMakeLists.txt rename to src/systemcmds/px4log_tail/CMakeLists.txt index 089bddcb8d..2d9d551e35 100644 --- a/src/systemcmds/dmesg/CMakeLists.txt +++ b/src/systemcmds/px4log_tail/CMakeLists.txt @@ -1,6 +1,6 @@ ############################################################################ # -# Copyright (c) 2019 PX4 Development Team. All rights reserved. +# Copyright (c) 2023 PX4 Development Team. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -31,8 +31,13 @@ # ############################################################################ px4_add_module( - MODULE systemcmds__dmesg - MAIN dmesg + MODULE systemcmds__px4log_tail + MAIN px4log_tail + STACK_MAIN 4096 + PRIORITY + "SCHED_PRIORITY_MIN + 1" SRCS - dmesg.cpp - ) + px4log_tail.cpp + DEPENDS + systemlib +) diff --git a/src/systemcmds/px4log_tail/Kconfig b/src/systemcmds/px4log_tail/Kconfig new file mode 100644 index 0000000000..1383d2749d --- /dev/null +++ b/src/systemcmds/px4log_tail/Kconfig @@ -0,0 +1,12 @@ +menuconfig SYSTEMCMDS_PX4LOG_TAIL + bool "px4log_tail" + default n + ---help--- + Enable support for px4log_tail + +menuconfig USER_PX4LOG_TAIL + bool "px4log_tail running as userspace module" + default n + depends on BOARD_PROTECTED && SYSTEMCMDS_PX4LOG_TAIL + ---help--- + Put px4log_tail in userspace memory diff --git a/src/systemcmds/dmesg/dmesg.cpp b/src/systemcmds/px4log_tail/px4log_tail.cpp similarity index 53% rename from src/systemcmds/dmesg/dmesg.cpp rename to src/systemcmds/px4log_tail/px4log_tail.cpp index 44e416f19b..da52c51a06 100644 --- a/src/systemcmds/dmesg/dmesg.cpp +++ b/src/systemcmds/px4log_tail/px4log_tail.cpp @@ -1,6 +1,6 @@ /**************************************************************************** * - * Copyright (c) 2019 PX4 Development Team. All rights reserved. + * Copyright (c) 2023 PX4 Development Team. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -31,65 +31,71 @@ * ****************************************************************************/ +/** + * @file px4log_tail.cpp + * Tool similar to UNIX logger command + * + */ + #include -#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include #include -#include -#ifndef BOARD_ENABLE_CONSOLE_BUFFER -#error "This module can only be used on boards that enable BOARD_ENABLE_CONSOLE_BUFFER" -#endif +#include +#include +#include -static void usage(); +using namespace time_literals; -extern "C" { - __EXPORT int dmesg_main(int argc, char *argv[]); -} +// static void print_usage() +// { +// PRINT_MODULE_DESCRIPTION("Monitor running processes and their CPU, stack usage, priority and state"); -int -dmesg_main(int argc, char *argv[]) +// PRINT_MODULE_USAGE_NAME_SIMPLE("px4log_tail", "command"); +// } + +static constexpr const char *__px4_log_level_color[_PX4_LOG_LEVEL_PANIC + 1] { + PX4_ANSI_COLOR_GREEN, // DEBUG + PX4_ANSI_COLOR_RESET, // INFO + PX4_ANSI_COLOR_YELLOW, // WARN + PX4_ANSI_COLOR_RED, // ERROR + PX4_ANSI_COLOR_RED // PANIC +}; + +extern "C" __EXPORT int px4log_tail_main(int argc, char *argv[]) { - int myoptind = 1; - int ch; - const char *myoptarg = nullptr; - bool follow = false; + uORB::SubscriptionBlocking sub{ORB_ID(log_message)}; + sub.reset(); + + while (true) { + log_message_s log_message; + + if (sub.updateBlocking(log_message, 1_s)) { + + if (log_message.severity == 4) { + // WARN + printf("%s%s%s\n", PX4_ANSI_COLOR_YELLOW, log_message.text, PX4_ANSI_COLOR_RESET); + + } else if (log_message.severity == 3) { + // ERROR + printf("%s%s%s\n", PX4_ANSI_COLOR_RED, log_message.text, PX4_ANSI_COLOR_RESET); + + } else { + printf("%s\n", log_message.text); + } - while ((ch = px4_getopt(argc, argv, "f", &myoptind, &myoptarg)) != EOF) { - switch (ch) { - case 'f': - follow = true; - break; - default: - usage(); - return -1; - break; } } - px4_console_buffer_print(follow); - return 0; } - -static void -usage() -{ - - PRINT_MODULE_DESCRIPTION( - R"DESCR_STR( -### Description - -Command-line tool to show bootup console messages. -Note that output from NuttX's work queues and syslog are not captured. - -### Examples - -Keep printing all messages in the background: -$ dmesg -f & -)DESCR_STR"); - - PRINT_MODULE_USAGE_NAME("dmesg", "system"); - PRINT_MODULE_USAGE_PARAM_FLAG('f', "Follow: wait for new messages", true); - -}