From 258fb27e146ad175ca89a84ebc9c340a53db0884 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Mon, 11 Aug 2014 14:54:18 +0200 Subject: Ensure that a failing dataman start does not abort boot --- ROMFS/px4fmu_common/init.d/rcS | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ROMFS/px4fmu_common/init.d/rcS b/ROMFS/px4fmu_common/init.d/rcS index 24b2a299a..72cd4b0e1 100644 --- a/ROMFS/px4fmu_common/init.d/rcS +++ b/ROMFS/px4fmu_common/init.d/rcS @@ -280,9 +280,11 @@ then nshterm /dev/ttyACM0 & # - # Start the datamanager + # Start the datamanager (and do not abort boot if it fails) # - dataman start + if dataman start + then + fi # # Start the Commander (needs to be this early for in-air-restarts) -- cgit v1.2.3 From 2ca89032409d0519e242006fa34ab26548fdd7e0 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Mon, 11 Aug 2014 14:56:13 +0200 Subject: If we failed loading params, reset them (if the file handle is valid the file is corrupted and there is no hope, if its just not present the reset command will not do anything) --- ROMFS/px4fmu_common/init.d/rcS | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ROMFS/px4fmu_common/init.d/rcS b/ROMFS/px4fmu_common/init.d/rcS index 72cd4b0e1..c9e6a27ca 100644 --- a/ROMFS/px4fmu_common/init.d/rcS +++ b/ROMFS/px4fmu_common/init.d/rcS @@ -83,9 +83,12 @@ then param select $PARAM_FILE if param load then - echo "[init] Params loaded: $PARAM_FILE" + echo "[param] Loaded: $PARAM_FILE" else - echo "[init] ERROR: Params loading failed: $PARAM_FILE" + echo "[param] FAILED loading $PARAM_FILE" + if param reset + then + fi fi # -- cgit v1.2.3 From 7d1cd7b994240d441a37b36f74598980f3f460db Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Mon, 11 Aug 2014 19:28:14 +0200 Subject: Fix NO RC handling (fixes #1263) --- src/drivers/px4io/px4io.cpp | 36 +++++++++++++++++++++++++++++------- 1 file changed, 29 insertions(+), 7 deletions(-) diff --git a/src/drivers/px4io/px4io.cpp b/src/drivers/px4io/px4io.cpp index d93009c47..bc0e6a221 100644 --- a/src/drivers/px4io/px4io.cpp +++ b/src/drivers/px4io/px4io.cpp @@ -135,6 +135,15 @@ public: */ virtual int init(); + /** + * Initialize the PX4IO class. + * + * Retrieve relevant initial system parameters. Initialize PX4IO registers. + * + * @param disable_rc_handling set to true to forbid override / RC handling on IO + */ + virtual int init(bool disable_rc_handling); + /** * Detect if a PX4IO is connected. * @@ -579,6 +588,12 @@ PX4IO::detect() return 0; } +int +PX4IO::init(bool rc_handling_disabled) { + _rc_handling_disabled = rc_handling_disabled; + init(); +} + int PX4IO::init() { @@ -778,6 +793,11 @@ PX4IO::init() if (_rc_handling_disabled) { ret = io_disable_rc_handling(); + if (ret != OK) { + log("failed disabling RC handling"); + return ret; + } + } else { /* publish RC config to IO */ ret = io_set_rc_config(); @@ -1175,6 +1195,7 @@ PX4IO::io_set_arming_state() int PX4IO::disable_rc_handling() { + _rc_handling_disabled = true; return io_disable_rc_handling(); } @@ -2613,24 +2634,25 @@ start(int argc, char *argv[]) errx(1, "driver alloc failed"); } - if (OK != g_dev->init()) { - delete g_dev; - g_dev = nullptr; - errx(1, "driver init failed"); - } + bool rc_handling_disabled = false; /* disable RC handling on request */ if (argc > 1) { if (!strcmp(argv[1], "norc")) { - if (g_dev->disable_rc_handling()) - warnx("Failed disabling RC handling"); + rc_handling_disabled = true; } else { warnx("unknown argument: %s", argv[1]); } } + if (OK != g_dev->init(rc_handling_disabled)) { + delete g_dev; + g_dev = nullptr; + errx(1, "driver init failed"); + } + #ifdef CONFIG_ARCH_BOARD_PX4FMU_V1 int dsm_vcc_ctl; -- cgit v1.2.3 From 0c0c8e943a2ec70a91386b65c17c563b6e40a782 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Tue, 12 Aug 2014 07:30:01 +0200 Subject: Fixed missing return value after last change set --- src/drivers/px4io/px4io.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/drivers/px4io/px4io.cpp b/src/drivers/px4io/px4io.cpp index bc0e6a221..32069cf09 100644 --- a/src/drivers/px4io/px4io.cpp +++ b/src/drivers/px4io/px4io.cpp @@ -142,7 +142,7 @@ public: * * @param disable_rc_handling set to true to forbid override / RC handling on IO */ - virtual int init(bool disable_rc_handling); + int init(bool disable_rc_handling); /** * Detect if a PX4IO is connected. @@ -591,7 +591,7 @@ PX4IO::detect() int PX4IO::init(bool rc_handling_disabled) { _rc_handling_disabled = rc_handling_disabled; - init(); + return init(); } int -- cgit v1.2.3 From 3f4aef60c88b1e570dd30bc47a13d5340073e9a9 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Tue, 12 Aug 2014 08:21:38 +0200 Subject: Increase timeout in an attempt to prevent timout python failure --- Tools/px_uploader.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tools/px_uploader.py b/Tools/px_uploader.py index cd7884f6d..d8f4884bc 100755 --- a/Tools/px_uploader.py +++ b/Tools/px_uploader.py @@ -180,7 +180,7 @@ class uploader(object): def __init__(self, portname, baudrate): # open the port, keep the default timeout short so we can poll quickly - self.port = serial.Serial(portname, baudrate, timeout=0.5) + self.port = serial.Serial(portname, baudrate, timeout=2.0) self.otp = b'' self.sn = b'' -- cgit v1.2.3