From 2328aecea8e669d718318f6b2e32e47f70477ce4 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Tue, 11 Nov 2014 16:38:11 +0100 Subject: Updated NuttX version --- NuttX | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NuttX b/NuttX index 11afcdfee..b79aa7fa1 160000 --- a/NuttX +++ b/NuttX @@ -1 +1 @@ -Subproject commit 11afcdfee6a3961952dd92f02c1abaa4756b115f +Subproject commit b79aa7fa11059d9006fe07194b2b45be1639aef7 -- cgit v1.2.3 From ca69e9c370d799206056235d86860046a492c1a7 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Wed, 12 Nov 2014 09:01:46 +0100 Subject: MTD: Update header locations --- src/systemcmds/mtd/24xxxx_mtd.c | 2 +- src/systemcmds/mtd/mtd.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/systemcmds/mtd/24xxxx_mtd.c b/src/systemcmds/mtd/24xxxx_mtd.c index f85ed8e2d..d0407f5aa 100644 --- a/src/systemcmds/mtd/24xxxx_mtd.c +++ b/src/systemcmds/mtd/24xxxx_mtd.c @@ -64,7 +64,7 @@ #include #include #include -#include +#include #include "systemlib/perf_counter.h" diff --git a/src/systemcmds/mtd/mtd.c b/src/systemcmds/mtd/mtd.c index a925cdd40..16bfb294f 100644 --- a/src/systemcmds/mtd/mtd.c +++ b/src/systemcmds/mtd/mtd.c @@ -51,8 +51,8 @@ #include #include -#include -#include +#include +#include #include #include -- cgit v1.2.3 From 996628a8d600265d9901b3b6126c693689798688 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Wed, 12 Nov 2014 09:02:11 +0100 Subject: tests: remove spurious, unneeded header --- src/systemcmds/tests/test_adc.c | 2 -- src/systemcmds/tests/test_hrt.c | 2 -- src/systemcmds/tests/test_jig_voltages.c | 2 -- src/systemcmds/tests/test_sensors.c | 2 -- src/systemcmds/tests/test_servo.c | 2 -- src/systemcmds/tests/tests_main.c | 2 -- 6 files changed, 12 deletions(-) diff --git a/src/systemcmds/tests/test_adc.c b/src/systemcmds/tests/test_adc.c index 9f6905239..32452da20 100644 --- a/src/systemcmds/tests/test_adc.c +++ b/src/systemcmds/tests/test_adc.c @@ -48,8 +48,6 @@ #include #include -#include - #include "tests.h" #include diff --git a/src/systemcmds/tests/test_hrt.c b/src/systemcmds/tests/test_hrt.c index 3ac99a5f6..2db43eaa7 100644 --- a/src/systemcmds/tests/test_hrt.c +++ b/src/systemcmds/tests/test_hrt.c @@ -54,8 +54,6 @@ #include #include -#include - #include "tests.h" /**************************************************************************** diff --git a/src/systemcmds/tests/test_jig_voltages.c b/src/systemcmds/tests/test_jig_voltages.c index 98a105cb3..70fd1f0e3 100644 --- a/src/systemcmds/tests/test_jig_voltages.c +++ b/src/systemcmds/tests/test_jig_voltages.c @@ -47,8 +47,6 @@ #include #include -#include - #include "tests.h" #include diff --git a/src/systemcmds/tests/test_sensors.c b/src/systemcmds/tests/test_sensors.c index f73f8b87a..8af1636a5 100644 --- a/src/systemcmds/tests/test_sensors.c +++ b/src/systemcmds/tests/test_sensors.c @@ -53,8 +53,6 @@ #include -#include - #include "tests.h" #include diff --git a/src/systemcmds/tests/test_servo.c b/src/systemcmds/tests/test_servo.c index ba6848522..fdf10e8ba 100644 --- a/src/systemcmds/tests/test_servo.c +++ b/src/systemcmds/tests/test_servo.c @@ -53,8 +53,6 @@ #include #include -#include - #include "tests.h" int test_servo(int argc, char *argv[]) diff --git a/src/systemcmds/tests/tests_main.c b/src/systemcmds/tests/tests_main.c index 0768c1d5a..2038340db 100644 --- a/src/systemcmds/tests/tests_main.c +++ b/src/systemcmds/tests/tests_main.c @@ -52,8 +52,6 @@ #include -#include - #include #include "tests.h" -- cgit v1.2.3 From d17d12df8d30d718c0ca2b7261152a313e048a33 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Wed, 12 Nov 2014 09:02:35 +0100 Subject: SPI Dev: Update header location --- src/drivers/device/spi.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/drivers/device/spi.h b/src/drivers/device/spi.h index 1d9837689..95b06cd1a 100644 --- a/src/drivers/device/spi.h +++ b/src/drivers/device/spi.h @@ -42,7 +42,7 @@ #include "device.h" -#include +#include namespace device __EXPORT { -- cgit v1.2.3 From 120f1e837292ed07da16571f0bfc4781a38778c8 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Wed, 12 Nov 2014 09:02:59 +0100 Subject: PX4IO: Update syslog API --- src/modules/px4iofirmware/px4io.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/modules/px4iofirmware/px4io.c b/src/modules/px4iofirmware/px4io.c index 14ee9cb40..c31342262 100644 --- a/src/modules/px4iofirmware/px4io.c +++ b/src/modules/px4iofirmware/px4io.c @@ -247,7 +247,7 @@ user_start(int argc, char *argv[]) #endif /* print some startup info */ - lowsyslog("\nPX4IO: starting\n"); + lowsyslog(LOG_INFO, "\nPX4IO: starting\n"); /* default all the LEDs to off while we start */ LED_AMBER(false); @@ -292,7 +292,7 @@ user_start(int argc, char *argv[]) perf_counter_t loop_perf = perf_alloc(PC_INTERVAL, "loop"); struct mallinfo minfo = mallinfo(); - lowsyslog("MEM: free %u, largest %u\n", minfo.mxordblk, minfo.fordblks); + lowsyslog(LOG_INFO, "MEM: free %u, largest %u\n", minfo.mxordblk, minfo.fordblks); /* initialize PWM limit lib */ pwm_limit_init(&pwm_limit); @@ -312,7 +312,7 @@ user_start(int argc, char *argv[]) */ if (minfo.mxordblk < 600) { - lowsyslog("ERR: not enough MEM"); + lowsyslog(LOG_ERR, "ERR: not enough MEM"); bool phase = false; while (true) { -- cgit v1.2.3 From 40e4197575d06e75ab84616aabcd869a4f0a105a Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Wed, 12 Nov 2014 09:03:21 +0100 Subject: SBUS on IO: Use new debug API --- src/modules/px4iofirmware/sbus.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/modules/px4iofirmware/sbus.c b/src/modules/px4iofirmware/sbus.c index d76ec55f0..fee9d656d 100644 --- a/src/modules/px4iofirmware/sbus.c +++ b/src/modules/px4iofirmware/sbus.c @@ -112,10 +112,8 @@ sbus_init(const char *device) partial_frame_count = 0; last_rx_time = hrt_absolute_time(); - debug("S.Bus: ready"); - } else { - debug("S.Bus: open failed"); + dbg("S.Bus: open failed"); } return sbus_fd; -- cgit v1.2.3 From 6535bfe3931429588753e95d971e2784c22470f5 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Wed, 12 Nov 2014 09:04:22 +0100 Subject: tone alarm: Update syslog API --- src/drivers/stm32/tone_alarm/tone_alarm.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/drivers/stm32/tone_alarm/tone_alarm.cpp b/src/drivers/stm32/tone_alarm/tone_alarm.cpp index 8b6847348..ea3c4b1bc 100644 --- a/src/drivers/stm32/tone_alarm/tone_alarm.cpp +++ b/src/drivers/stm32/tone_alarm/tone_alarm.cpp @@ -674,7 +674,7 @@ ToneAlarm::next_note() // tune looks bad (unexpected EOF, bad character, etc.) tune_error: - lowsyslog("tune error\n"); + lowsyslog(LOG_ERR, "tune error\n"); _repeat = false; // don't loop on error // stop (and potentially restart) the tune -- cgit v1.2.3 From 1efd99d1554674a87f8d3bf747625361d8fc3777 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Wed, 12 Nov 2014 09:04:55 +0100 Subject: ESC calib and PWM system commands: Remove spurious, unneeded headers --- src/systemcmds/esc_calib/esc_calib.c | 3 --- src/systemcmds/pwm/pwm.c | 4 ---- 2 files changed, 7 deletions(-) diff --git a/src/systemcmds/esc_calib/esc_calib.c b/src/systemcmds/esc_calib/esc_calib.c index aee26680c..3feec77e1 100644 --- a/src/systemcmds/esc_calib/esc_calib.c +++ b/src/systemcmds/esc_calib/esc_calib.c @@ -52,9 +52,6 @@ #include #include -#include -#include -#include #include #include diff --git a/src/systemcmds/pwm/pwm.c b/src/systemcmds/pwm/pwm.c index 620b0a6f6..1a6d07c4f 100644 --- a/src/systemcmds/pwm/pwm.c +++ b/src/systemcmds/pwm/pwm.c @@ -46,13 +46,9 @@ #include #include #include -#include #include #include -#include -#include -#include #include #include -- cgit v1.2.3 From 24509529aaf10cc152f483246d20fcd552d1ffd0 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Wed, 12 Nov 2014 09:05:48 +0100 Subject: IO driver serial layer: Update syslog API --- src/drivers/px4io/px4io_serial.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/drivers/px4io/px4io_serial.cpp b/src/drivers/px4io/px4io_serial.cpp index 42d87f7e5..16d917ef5 100644 --- a/src/drivers/px4io/px4io_serial.cpp +++ b/src/drivers/px4io/px4io_serial.cpp @@ -295,7 +295,7 @@ PX4IO_serial::ioctl(unsigned operation, unsigned &arg) case 1: /* XXX magic number - test operation */ switch (arg) { case 0: - lowsyslog("test 0\n"); + lowsyslog(LOG_INFO, "test 0\n"); /* kill DMA, this is a PIO test */ stm32_dmastop(_tx_dma); @@ -319,7 +319,7 @@ PX4IO_serial::ioctl(unsigned operation, unsigned &arg) fails++; if (count >= 5000) { - lowsyslog("==== test 1 : %u failures ====\n", fails); + lowsyslog(LOG_INFO, "==== test 1 : %u failures ====\n", fails); perf_print_counter(_pc_txns); perf_print_counter(_pc_dmasetup); perf_print_counter(_pc_retries); @@ -336,7 +336,7 @@ PX4IO_serial::ioctl(unsigned operation, unsigned &arg) return 0; } case 2: - lowsyslog("test 2\n"); + lowsyslog(LOG_INFO, "test 2\n"); return 0; } default: @@ -558,7 +558,7 @@ PX4IO_serial::_wait_complete() } /* we might? see this for EINTR */ - lowsyslog("unexpected ret %d/%d\n", ret, errno); + lowsyslog(LOG_ERR, "unexpected ret %d/%d\n", ret, errno); } /* reset DMA status */ -- cgit v1.2.3 From 1dda0a6aae237ae1b135fd8f78fd7de53144a6a1 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Wed, 12 Nov 2014 09:41:36 +0100 Subject: FMUv2: Update windows toolchain --- nuttx-configs/px4fmu-v2/nsh/setenv.sh | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/nuttx-configs/px4fmu-v2/nsh/setenv.sh b/nuttx-configs/px4fmu-v2/nsh/setenv.sh index 265520997..01f62bbe1 100755 --- a/nuttx-configs/px4fmu-v2/nsh/setenv.sh +++ b/nuttx-configs/px4fmu-v2/nsh/setenv.sh @@ -1,7 +1,7 @@ #!/bin/bash -# configs/stm3240g-eval/nsh/setenv.sh +# configs/px4fmu-v2_upstream/nsh/setenv.sh # -# Copyright (C) 2011 Gregory Nutt. All rights reserved. +# Copyright (C) 2014 Gregory Nutt. All rights reserved. # Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without @@ -47,15 +47,11 @@ if [ -z "${PATH_ORIG}" ]; then export PATH_ORIG="${PATH}" fi -# This the Cygwin path to the location where I installed the RIDE -# toolchain under windows. You will also have to edit this if you install -# the RIDE toolchain in any other location -#export TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/Raisonance/Ride/arm-gcc/bin" - # This the Cygwin path to the location where I installed the CodeSourcery # toolchain under windows. You will also have to edit this if you install # the CodeSourcery toolchain in any other location -export TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/CodeSourcery/Sourcery G++ Lite/bin" +#export TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/CodeSourcery/Sourcery G++ Lite/bin" +export TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/CodeSourcery/Sourcery_CodeBench_Lite_for_ARM_EABI/bin # This the Cygwin path to the location where I build the buildroot # toolchain. -- cgit v1.2.3 From 07d74b17c1f16110cd5aca4a8ae4913b2b36e535 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Wed, 12 Nov 2014 10:32:52 +0100 Subject: Add Kconfig file for FMUv2 --- nuttx-configs/px4fmu-v2/Kconfig | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 nuttx-configs/px4fmu-v2/Kconfig diff --git a/nuttx-configs/px4fmu-v2/Kconfig b/nuttx-configs/px4fmu-v2/Kconfig new file mode 100644 index 000000000..ae2bf3130 --- /dev/null +++ b/nuttx-configs/px4fmu-v2/Kconfig @@ -0,0 +1,4 @@ +# +# For a description of the syntax of this configuration file, +# see misc/tools/kconfig-language.txt. +# -- cgit v1.2.3 From 6d636b0b583d0c984583a700e18e1ff7261b1114 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Wed, 12 Nov 2014 10:46:43 +0100 Subject: FMUv1: Update driver API --- src/drivers/boards/px4fmu-v1/px4fmu_init.c | 57 ++++++++---------------------- src/drivers/boards/px4fmu-v1/px4fmu_spi.c | 2 +- 2 files changed, 16 insertions(+), 43 deletions(-) diff --git a/src/drivers/boards/px4fmu-v1/px4fmu_init.c b/src/drivers/boards/px4fmu-v1/px4fmu_init.c index 293021f8b..0e331a139 100644 --- a/src/drivers/boards/px4fmu-v1/px4fmu_init.c +++ b/src/drivers/boards/px4fmu-v1/px4fmu_init.c @@ -53,7 +53,7 @@ #include #include -#include +#include #include #include #include @@ -77,33 +77,6 @@ /* Debug ********************************************************************/ -#ifdef CONFIG_CPP_HAVE_VARARGS -# ifdef CONFIG_DEBUG -# define message(...) lowsyslog(__VA_ARGS__) -# else -# define message(...) printf(__VA_ARGS__) -# endif -#else -# ifdef CONFIG_DEBUG -# define message lowsyslog -# else -# define message printf -# endif -#endif - -/* - * Ideally we'd be able to get these from up_internal.h, - * but since we want to be able to disable the NuttX use - * of leds for system indication at will and there is no - * separate switch, we need to build independent of the - * CONFIG_ARCH_LEDS configuration switch. - */ -__BEGIN_DECLS -extern void led_init(void); -extern void led_on(int led); -extern void led_off(int led); -__END_DECLS - /**************************************************************************** * Protected Functions ****************************************************************************/ @@ -127,8 +100,8 @@ __EXPORT void stm32_boardinitialize(void) /* configure SPI interfaces */ stm32_spiinitialize(); - /* configure LEDs (empty call to NuttX' ledinit) */ - up_ledinit(); + /* configure LEDs */ + board_led_initialize(); } /**************************************************************************** @@ -202,8 +175,8 @@ __EXPORT int nsh_archinitialize(void) spi1 = up_spiinitialize(1); if (!spi1) { - message("[boot] FAILED to initialize SPI port 1\r\n"); - up_ledon(LED_AMBER); + syslog(LOG_ERR, "[boot] FAILED to initialize SPI port 1\r\n"); + board_led_on(LED_AMBER); return -ENODEV; } @@ -216,7 +189,7 @@ __EXPORT int nsh_archinitialize(void) SPI_SELECT(spi1, PX4_SPIDEV_MPU, false); up_udelay(20); - message("[boot] Successfully initialized SPI port 1\r\n"); + syslog(LOG_INFO, "[boot] Successfully initialized SPI port 1\r\n"); /* * If SPI2 is enabled in the defconfig, we loose some ADC pins as chip selects. @@ -232,10 +205,10 @@ __EXPORT int nsh_archinitialize(void) SPI_SELECT(spi2, PX4_SPIDEV_GYRO, false); SPI_SELECT(spi2, PX4_SPIDEV_ACCEL_MAG, false); - message("[boot] Initialized SPI port2 (ADC IN12/13 blocked)\n"); + syslog(LOG_INFO, "[boot] Initialized SPI port2 (ADC IN12/13 blocked)\n"); #else spi2 = NULL; - message("[boot] Enabling IN12/13 instead of SPI2\n"); + syslog(LOG_INFO, "[boot] Enabling IN12/13 instead of SPI2\n"); /* no SPI2, use pins for ADC */ stm32_configgpio(GPIO_ADC1_IN12); stm32_configgpio(GPIO_ADC1_IN13); // jumperable to MPU6000 DRDY on some boards @@ -243,27 +216,27 @@ __EXPORT int nsh_archinitialize(void) /* Get the SPI port for the microSD slot */ - message("[boot] Initializing SPI port 3\n"); + syslog(LOG_INFO, "[boot] Initializing SPI port 3\n"); spi3 = up_spiinitialize(3); if (!spi3) { - message("[boot] FAILED to initialize SPI port 3\n"); - up_ledon(LED_AMBER); + syslog(LOG_ERR, "[boot] FAILED to initialize SPI port 3\n"); + board_led_on(LED_AMBER); return -ENODEV; } - message("[boot] Successfully initialized SPI port 3\n"); + syslog(LOG_INFO, "[boot] Successfully initialized SPI port 3\n"); /* Now bind the SPI interface to the MMCSD driver */ result = mmcsd_spislotinitialize(CONFIG_NSH_MMCSDMINOR, CONFIG_NSH_MMCSDSLOTNO, spi3); if (result != OK) { - message("[boot] FAILED to bind SPI port 3 to the MMCSD driver\n"); - up_ledon(LED_AMBER); + syslog(LOG_ERR, "[boot] FAILED to bind SPI port 3 to the MMCSD driver\n"); + board_led_on(LED_AMBER); return -ENODEV; } - message("[boot] Successfully bound SPI port 3 to the MMCSD driver\n"); + syslog(LOG_INFO, "[boot] Successfully bound SPI port 3 to the MMCSD driver\n"); return OK; } diff --git a/src/drivers/boards/px4fmu-v1/px4fmu_spi.c b/src/drivers/boards/px4fmu-v1/px4fmu_spi.c index 17e6862f7..0a39f22db 100644 --- a/src/drivers/boards/px4fmu-v1/px4fmu_spi.c +++ b/src/drivers/boards/px4fmu-v1/px4fmu_spi.c @@ -47,7 +47,7 @@ #include #include -#include +#include #include #include "up_arch.h" -- cgit v1.2.3 From 38dff342030ba36961004629c2be8adb77aa9b26 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Wed, 12 Nov 2014 10:46:52 +0100 Subject: FMUv2: Update driver API --- src/drivers/boards/px4fmu-v2/px4fmu2_init.c | 42 +++++++++++------------------ src/drivers/boards/px4fmu-v2/px4fmu_spi.c | 2 +- 2 files changed, 17 insertions(+), 27 deletions(-) diff --git a/src/drivers/boards/px4fmu-v2/px4fmu2_init.c b/src/drivers/boards/px4fmu-v2/px4fmu2_init.c index 9b25c574a..ce1fa9f4e 100644 --- a/src/drivers/boards/px4fmu-v2/px4fmu2_init.c +++ b/src/drivers/boards/px4fmu-v2/px4fmu2_init.c @@ -53,12 +53,12 @@ #include #include -#include +#include #include #include #include #include -#include +#include #include #include "board_config.h" @@ -94,19 +94,6 @@ # endif #endif -/* - * Ideally we'd be able to get these from up_internal.h, - * but since we want to be able to disable the NuttX use - * of leds for system indication at will and there is no - * separate switch, we need to build independent of the - * CONFIG_ARCH_LEDS configuration switch. - */ -__BEGIN_DECLS -extern void led_init(void); -extern void led_on(int led); -extern void led_off(int led); -__END_DECLS - /**************************************************************************** * Protected Functions ****************************************************************************/ @@ -116,6 +103,8 @@ __END_DECLS # error microSD DMA support requires CONFIG_GRAN # endif +#ifdef CONFIG_FAT_DMAMEMORY + static GRAN_HANDLE dma_allocator; /* @@ -130,6 +119,7 @@ static GRAN_HANDLE dma_allocator; */ static uint8_t g_dma_heap[8192] __attribute__((aligned(64))); static perf_counter_t g_dma_perf; +#endif static void dma_alloc_init(void) @@ -139,7 +129,7 @@ dma_alloc_init(void) 7, /* 128B granule - must be > alignment (XXX bug?) */ 6); /* 64B alignment */ if (dma_allocator == NULL) { - message("[boot] DMA allocator setup FAILED"); + syslog(LOG_ERR, "[boot] DMA allocator setup FAILED"); } else { g_dma_perf = perf_alloc(PC_COUNT, "DMA allocations"); } @@ -192,7 +182,7 @@ stm32_boardinitialize(void) stm32_spiinitialize(); /* configure LEDs */ - up_ledinit(); + board_led_initialize(); } /**************************************************************************** @@ -281,8 +271,8 @@ __EXPORT int nsh_archinitialize(void) spi1 = up_spiinitialize(1); if (!spi1) { - message("[boot] FAILED to initialize SPI port 1\n"); - up_ledon(LED_AMBER); + syslog(LOG_ERR, "[boot] FAILED to initialize SPI port 1\n"); + board_led_on(LED_AMBER); return -ENODEV; } @@ -296,15 +286,15 @@ __EXPORT int nsh_archinitialize(void) SPI_SELECT(spi1, PX4_SPIDEV_MPU, false); up_udelay(20); - message("[boot] Initialized SPI port 1 (SENSORS)\n"); + syslog(LOG_INFO, "[boot] Initialized SPI port 1 (SENSORS)\n"); /* Get the SPI port for the FRAM */ spi2 = up_spiinitialize(2); if (!spi2) { - message("[boot] FAILED to initialize SPI port 2\n"); - up_ledon(LED_AMBER); + syslog(LOG_ERR, "[boot] FAILED to initialize SPI port 2\n"); + board_led_on(LED_AMBER); return -ENODEV; } @@ -317,7 +307,7 @@ __EXPORT int nsh_archinitialize(void) SPI_SETMODE(spi2, SPIDEV_MODE3); SPI_SELECT(spi2, SPIDEV_FLASH, false); - message("[boot] Initialized SPI port 2 (RAMTRON FRAM)\n"); + syslog(LOG_INFO, "[boot] Initialized SPI port 2 (RAMTRON FRAM)\n"); spi4 = up_spiinitialize(4); @@ -335,7 +325,7 @@ __EXPORT int nsh_archinitialize(void) sdio = sdio_initialize(CONFIG_NSH_MMCSDSLOTNO); if (!sdio) { - message("[boot] Failed to initialize SDIO slot %d\n", + syslog(LOG_ERR, "[boot] Failed to initialize SDIO slot %d\n", CONFIG_NSH_MMCSDSLOTNO); return -ENODEV; } @@ -343,14 +333,14 @@ __EXPORT int nsh_archinitialize(void) /* Now bind the SDIO interface to the MMC/SD driver */ int ret = mmcsd_slotinitialize(CONFIG_NSH_MMCSDMINOR, sdio); if (ret != OK) { - message("[boot] Failed to bind SDIO to the MMC/SD driver: %d\n", ret); + syslog(LOG_ERR, "[boot] Failed to bind SDIO to the MMC/SD driver: %d\n", ret); return ret; } /* Then let's guess and say that there is a card in the slot. There is no card detect GPIO. */ sdio_mediachange(sdio, true); - message("[boot] Initialized SDIO\n"); + syslog(LOG_INFO, "[boot] Initialized SDIO\n"); #endif return OK; diff --git a/src/drivers/boards/px4fmu-v2/px4fmu_spi.c b/src/drivers/boards/px4fmu-v2/px4fmu_spi.c index 27f193513..b98cd999b 100644 --- a/src/drivers/boards/px4fmu-v2/px4fmu_spi.c +++ b/src/drivers/boards/px4fmu-v2/px4fmu_spi.c @@ -47,7 +47,7 @@ #include #include -#include +#include #include #include -- cgit v1.2.3 From 64b4d758cb0d8466072825d02d75f97dcfe550dc Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Wed, 12 Nov 2014 10:47:08 +0100 Subject: Aerocore: update driver API --- src/drivers/boards/aerocore/aerocore_init.c | 10 +++++----- src/drivers/boards/aerocore/aerocore_spi.c | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/drivers/boards/aerocore/aerocore_init.c b/src/drivers/boards/aerocore/aerocore_init.c index 1ce235da8..e370fa983 100644 --- a/src/drivers/boards/aerocore/aerocore_init.c +++ b/src/drivers/boards/aerocore/aerocore_init.c @@ -53,11 +53,11 @@ #include #include -#include +#include #include #include #include -#include +#include #include #include "board_config.h" @@ -191,7 +191,7 @@ stm32_boardinitialize(void) stm32_spiinitialize(); /* configure LEDs */ - up_ledinit(); + board_led_initialize(); } /**************************************************************************** @@ -264,7 +264,7 @@ __EXPORT int nsh_archinitialize(void) spi3 = up_spiinitialize(3); if (!spi3) { message("[boot] FAILED to initialize SPI port 3\n"); - up_ledon(LED_AMBER); + board_led_on(LED_AMBER); return -ENODEV; } /* Default: 1MHz, 8 bits, Mode 3 */ @@ -281,7 +281,7 @@ __EXPORT int nsh_archinitialize(void) spi4 = up_spiinitialize(4); if (!spi4) { message("[boot] FAILED to initialize SPI port 4\n"); - up_ledon(LED_AMBER); + board_led_on(LED_AMBER); return -ENODEV; } /* Default: ~10MHz, 8 bits, Mode 3 */ diff --git a/src/drivers/boards/aerocore/aerocore_spi.c b/src/drivers/boards/aerocore/aerocore_spi.c index e329bd9d1..8577d4938 100644 --- a/src/drivers/boards/aerocore/aerocore_spi.c +++ b/src/drivers/boards/aerocore/aerocore_spi.c @@ -47,7 +47,7 @@ #include #include -#include +#include #include #include -- cgit v1.2.3 From dce6d083853a4f707bd5fb892b37e76844146376 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Wed, 12 Nov 2014 10:47:29 +0100 Subject: Modernize aerocore config --- nuttx-configs/aerocore/nsh/Make.defs | 1 + 1 file changed, 1 insertion(+) diff --git a/nuttx-configs/aerocore/nsh/Make.defs b/nuttx-configs/aerocore/nsh/Make.defs index 3808fc1cf..10cd651f5 100644 --- a/nuttx-configs/aerocore/nsh/Make.defs +++ b/nuttx-configs/aerocore/nsh/Make.defs @@ -35,6 +35,7 @@ include ${TOPDIR}/.config include ${TOPDIR}/tools/Config.mk +include ${TOPDIR}/arch/arm/src/armv7-m/Toolchain.defs # # We only support building with the ARM bare-metal toolchain from -- cgit v1.2.3 From d9feba631af76a1977c92557371c478b6b71c097 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Wed, 12 Nov 2014 10:47:43 +0100 Subject: Modernize FMUv1 config --- nuttx-configs/px4fmu-v1/nsh/Make.defs | 1 + 1 file changed, 1 insertion(+) diff --git a/nuttx-configs/px4fmu-v1/nsh/Make.defs b/nuttx-configs/px4fmu-v1/nsh/Make.defs index 4e08d28a2..0d3fbe546 100644 --- a/nuttx-configs/px4fmu-v1/nsh/Make.defs +++ b/nuttx-configs/px4fmu-v1/nsh/Make.defs @@ -35,6 +35,7 @@ include ${TOPDIR}/.config include ${TOPDIR}/tools/Config.mk +include ${TOPDIR}/arch/arm/src/armv7-m/Toolchain.defs # # We only support building with the ARM bare-metal toolchain from -- cgit v1.2.3 From deeb27c1229b4d26de7f360a11c04e1f62fac528 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Wed, 12 Nov 2014 10:48:16 +0100 Subject: Modernize FMUv2 config (using the upstream NuttX config) --- nuttx-configs/px4fmu-v2/Kconfig | 18 +++ nuttx-configs/px4fmu-v2/include/board.h | 163 ++++++++++++++-------- nuttx-configs/px4fmu-v2/nsh/Make.defs | 225 +++++++++++++++--------------- nuttx-configs/px4fmu-v2/scripts/ld.script | 10 +- nuttx-configs/px4fmu-v2/src/Makefile | 27 ++-- 5 files changed, 251 insertions(+), 192 deletions(-) diff --git a/nuttx-configs/px4fmu-v2/Kconfig b/nuttx-configs/px4fmu-v2/Kconfig index ae2bf3130..f9f0c5e6a 100644 --- a/nuttx-configs/px4fmu-v2/Kconfig +++ b/nuttx-configs/px4fmu-v2/Kconfig @@ -2,3 +2,21 @@ # For a description of the syntax of this configuration file, # see misc/tools/kconfig-language.txt. # + +if ARCH_BOARD_PX4FMU_V2 + +config BOARD_HAS_PROBES + bool "Board provides GPIO or other Hardware for signaling to timing analyze." + default y + ---help--- + This board provides GPIO FMU-CH1-6 as PROBE_1-6 to provide timing signals from selected drivers. + +config BOARD_USE_PROBES + bool "Enable the use the board provided GPIO FMU-CH1-6 as PROBE_1-6 to provide timing signals from selected drivers" + default n + depends on BOARD_HAS_PROBES + + ---help--- + Select to use GPIO FMU-CH1-6 to provide timing signals from selected drivers. + +endif diff --git a/nuttx-configs/px4fmu-v2/include/board.h b/nuttx-configs/px4fmu-v2/include/board.h index 3b3c6fa70..3c8671f53 100755 --- a/nuttx-configs/px4fmu-v2/include/board.h +++ b/nuttx-configs/px4fmu-v2/include/board.h @@ -1,5 +1,5 @@ /************************************************************************************ - * configs/px4fmu/include/board.h + * configs/px4fmu-v2_upstream/include/board.h * include/arch/board/board.h * * Copyright (C) 2009 Gregory Nutt. All rights reserved. @@ -34,8 +34,8 @@ * ************************************************************************************/ -#ifndef __ARCH_BOARD_BOARD_H -#define __ARCH_BOARD_BOARD_H +#ifndef __CONFIGS_PX4FMU_V2_UPSTREAM_INCLUDE_BOARD_H +#define __CONFIGS_PX4FMU_V2_UPSTREAM_INCLUDE_BOARD_H /************************************************************************************ * Included Files @@ -141,26 +141,26 @@ #define STM32_APB2_TIM1_CLKIN (2*STM32_PCLK2_FREQUENCY) #define STM32_APB2_TIM8_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM9_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM10_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM11_CLKIN (2*STM32_PCLK2_FREQUENCY) +#define STM32_APB2_TIM9_CLKIN (2*STM32_PCLK1_FREQUENCY) +#define STM32_APB2_TIM10_CLKIN (2*STM32_PCLK1_FREQUENCY) +#define STM32_APB2_TIM11_CLKIN (2*STM32_PCLK1_FREQUENCY) /* Timer Frequencies, if APBx is set to 1, frequency is same to APBx - * otherwise frequency is 2xAPBx. + * otherwise frequency is 2xAPBx. * Note: TIM1,8 are on APB2, others on APB1 */ #define STM32_TIM18_FREQUENCY (2*STM32_PCLK2_FREQUENCY) #define STM32_TIM27_FREQUENCY (2*STM32_PCLK1_FREQUENCY) -/* SDIO dividers. Note that slower clocking is required when DMA is disabled +/* SDIO dividers. Note that slower clocking is required when DMA is disabled * in order to avoid RX overrun/TX underrun errors due to delayed responses * to service FIFOs in interrupt driven mode. These values have not been * tuned!!! * * HCLK=72MHz, SDIOCLK=72MHz, SDIO_CK=HCLK/(178+2)=400 KHz */ - + #define SDIO_INIT_CLKDIV (178 << SDIO_CLKCR_CLKDIV_SHIFT) /* DMA ON: HCLK=72 MHz, SDIOCLK=72MHz, SDIO_CK=HCLK/(2+2)=18 MHz @@ -168,9 +168,9 @@ */ #ifdef CONFIG_SDIO_DMA -# define SDIO_MMCXFR_CLKDIV (2 << SDIO_CLKCR_CLKDIV_SHIFT) +# define SDIO_MMCXFR_CLKDIV (2 << SDIO_CLKCR_CLKDIV_SHIFT) #else -# define SDIO_MMCXFR_CLKDIV (3 << SDIO_CLKCR_CLKDIV_SHIFT) +# define SDIO_MMCXFR_CLKDIV (3 << SDIO_CLKCR_CLKDIV_SHIFT) #endif /* DMA ON: HCLK=72 MHz, SDIOCLK=72MHz, SDIO_CK=HCLK/(1+2)=24 MHz @@ -196,82 +196,124 @@ /* Alternate function pin selections ************************************************/ -/* - * UARTs. - */ -#define GPIO_USART1_RX GPIO_USART1_RX_1 /* console in from IO */ -#define GPIO_USART1_TX 0 /* USART1 is RX-only */ +/* UARTs */ + +#define GPIO_USART1_RX GPIO_USART1_RX_1 /* Console in from IO */ +#define GPIO_USART1_TX 0 /* USART1 is RX-only */ -#define GPIO_USART2_RX GPIO_USART2_RX_2 -#define GPIO_USART2_TX GPIO_USART2_TX_2 -#define GPIO_USART2_RTS GPIO_USART2_RTS_2 -#define GPIO_USART2_CTS GPIO_USART2_CTS_2 +#define GPIO_USART2_RX GPIO_USART2_RX_2 +#define GPIO_USART2_TX GPIO_USART2_TX_2 +#define GPIO_USART2_RTS GPIO_USART2_RTS_2 +#define GPIO_USART2_CTS GPIO_USART2_CTS_2 -#define GPIO_USART3_RX GPIO_USART3_RX_3 -#define GPIO_USART3_TX GPIO_USART3_TX_3 -#define GPIO_USART3_RTS GPIO_USART3_RTS_2 -#define GPIO_USART3_CTS GPIO_USART3_CTS_2 +#define GPIO_USART3_RX GPIO_USART3_RX_3 +#define GPIO_USART3_TX GPIO_USART3_TX_3 +#define GPIO_USART3_RTS GPIO_USART3_RTS_2 +#define GPIO_USART3_CTS GPIO_USART3_CTS_2 -#define GPIO_UART4_RX GPIO_UART4_RX_1 -#define GPIO_UART4_TX GPIO_UART4_TX_1 +#define GPIO_UART4_RX GPIO_UART4_RX_1 +#define GPIO_UART4_TX GPIO_UART4_TX_1 -#define GPIO_USART6_RX GPIO_USART6_RX_1 -#define GPIO_USART6_TX GPIO_USART6_TX_1 +#define GPIO_USART6_RX GPIO_USART6_RX_1 +#define GPIO_USART6_TX GPIO_USART6_TX_1 -#define GPIO_UART7_RX GPIO_UART7_RX_1 -#define GPIO_UART7_TX GPIO_UART7_TX_1 +#define GPIO_UART7_RX GPIO_UART7_RX_1 +#define GPIO_UART7_TX GPIO_UART7_TX_1 /* UART8 has no alternate pin config */ /* UART RX DMA configurations */ + #define DMAMAP_USART1_RX DMAMAP_USART1_RX_2 #define DMAMAP_USART6_RX DMAMAP_USART6_RX_2 -/* - * CAN +/* CAN * - * CAN1 is routed to the onboard transceiver. + * CAN1 is routed to the onboard transceiver. * CAN2 is routed to the expansion connector. */ -#define GPIO_CAN1_RX GPIO_CAN1_RX_3 -#define GPIO_CAN1_TX GPIO_CAN1_TX_3 -#define GPIO_CAN2_RX GPIO_CAN2_RX_1 -#define GPIO_CAN2_TX GPIO_CAN2_TX_2 -/* - * I2C +#define GPIO_CAN1_RX GPIO_CAN1_RX_3 +#define GPIO_CAN1_TX GPIO_CAN1_TX_3 +#define GPIO_CAN2_RX GPIO_CAN2_RX_1 +#define GPIO_CAN2_TX GPIO_CAN2_TX_2 + +/* I2C * * The optional _GPIO configurations allow the I2C driver to manually * reset the bus to clear stuck slaves. They match the pin configuration, * but are normally-high GPIOs. */ -#define GPIO_I2C1_SCL GPIO_I2C1_SCL_2 -#define GPIO_I2C1_SDA GPIO_I2C1_SDA_2 -#define GPIO_I2C1_SCL_GPIO (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN8) -#define GPIO_I2C1_SDA_GPIO (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN9) - -#define GPIO_I2C2_SCL GPIO_I2C2_SCL_1 -#define GPIO_I2C2_SDA GPIO_I2C2_SDA_1 -#define GPIO_I2C2_SCL_GPIO (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN10) -#define GPIO_I2C2_SDA_GPIO (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN11) - -/* - * SPI + +#define GPIO_I2C1_SCL GPIO_I2C1_SCL_2 +#define GPIO_I2C1_SDA GPIO_I2C1_SDA_2 +#define GPIO_I2C1_SCL_GPIO \ + (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN8) +#define GPIO_I2C1_SDA_GPIO \ + (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN9) + +#define GPIO_I2C2_SCL GPIO_I2C2_SCL_1 +#define GPIO_I2C2_SDA GPIO_I2C2_SDA_1 +#define GPIO_I2C2_SCL_GPIO \ + (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN10) +#define GPIO_I2C2_SDA_GPIO \ + (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN11) + +/* SPI * * There are sensors on SPI1, and SPI2 is connected to the FRAM. */ -#define GPIO_SPI1_MISO (GPIO_SPI1_MISO_1|GPIO_SPEED_50MHz) -#define GPIO_SPI1_MOSI (GPIO_SPI1_MOSI_1|GPIO_SPEED_50MHz) -#define GPIO_SPI1_SCK (GPIO_SPI1_SCK_1|GPIO_SPEED_50MHz) -#define GPIO_SPI2_MISO (GPIO_SPI2_MISO_1|GPIO_SPEED_50MHz) -#define GPIO_SPI2_MOSI (GPIO_SPI2_MOSI_1|GPIO_SPEED_50MHz) -#define GPIO_SPI2_SCK (GPIO_SPI2_SCK_2|GPIO_SPEED_50MHz) +#define GPIO_SPI1_MISO GPIO_SPI1_MISO_1 +#define GPIO_SPI1_MOSI GPIO_SPI1_MOSI_1 +#define GPIO_SPI1_SCK GPIO_SPI1_SCK_1 + +#define GPIO_SPI2_MISO GPIO_SPI2_MISO_1 +#define GPIO_SPI2_MOSI GPIO_SPI2_MOSI_1 +#define GPIO_SPI2_SCK GPIO_SPI2_SCK_2 #define GPIO_SPI4_MISO (GPIO_SPI4_MISO_1|GPIO_SPEED_50MHz) #define GPIO_SPI4_MOSI (GPIO_SPI4_MOSI_1|GPIO_SPEED_50MHz) #define GPIO_SPI4_SCK (GPIO_SPI4_SCK_1|GPIO_SPEED_50MHz) +/* LED Definitions. Needed if CONFIG_ARCH_LEDs is defined */ + +#define LED_STARTED 0 +#define LED_HEAPALLOCATE 0 +#define LED_IRQSENABLED 0 +#define LED_STACKCREATED 1 +#define LED_INIRQ 1 +#define LED_SIGNAL 1 +#define LED_ASSERTION 1 +#define LED_PANIC 1 + +/* Board provides GPIO or other Hardware for signaling to timing analyzer */ + +#if defined(CONFIG_BOARD_USE_PROBES) +# define PROBE_N(n) (1<<((n)-1)) +# define PROBE_1 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTE|GPIO_PIN14) +# define PROBE_2 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTE|GPIO_PIN13) +# define PROBE_3 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTE|GPIO_PIN11) +# define PROBE_4 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTE|GPIO_PIN9) +# define PROBE_5 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTD|GPIO_PIN13) +# define PROBE_6 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTD|GPIO_PIN14) + +# define PROBE_INIT(mask) \ + do { \ + if ((mask)& PROBE_N(1)) { stm32_configgpio(PROBE_1); } \ + if ((mask)& PROBE_N(2)) { stm32_configgpio(PROBE_2); } \ + if ((mask)& PROBE_N(3)) { stm32_configgpio(PROBE_3); } \ + if ((mask)& PROBE_N(4)) { stm32_configgpio(PROBE_4); } \ + if ((mask)& PROBE_N(5)) { stm32_configgpio(PROBE_5); } \ + if ((mask)& PROBE_N(6)) { stm32_configgpio(PROBE_6); } \ + } while(0) + +# define PROBE(n,s) do {stm32_gpiowrite(PROBE_##n,(s));}while(0) +# define PROBE_MARK(n) PROBE(n,false);PROBE(n,true) +#endif + + + /************************************************************************************ * Public Data ************************************************************************************/ @@ -281,7 +323,8 @@ #undef EXTERN #if defined(__cplusplus) #define EXTERN extern "C" -extern "C" { +extern "C" +{ #else #define EXTERN extern #endif @@ -299,7 +342,7 @@ extern "C" { * ************************************************************************************/ -EXTERN void stm32_boardinitialize(void); +void stm32_boardinitialize(void); #undef EXTERN #if defined(__cplusplus) @@ -307,4 +350,4 @@ EXTERN void stm32_boardinitialize(void); #endif #endif /* __ASSEMBLY__ */ -#endif /* __ARCH_BOARD_BOARD_H */ +#endif /* __CONFIGS_PX4FMU_V2_UPSTREAM_INCLUDE_BOARD_H */ diff --git a/nuttx-configs/px4fmu-v2/nsh/Make.defs b/nuttx-configs/px4fmu-v2/nsh/Make.defs index 5a1d5af2c..02e2db428 100644 --- a/nuttx-configs/px4fmu-v2/nsh/Make.defs +++ b/nuttx-configs/px4fmu-v2/nsh/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# configs/px4fmu-v2/nsh/Make.defs +# configs/px4fmu-v2_updstream/nsh/Make.defs # # Copyright (C) 2011 Gregory Nutt. All rights reserved. # Author: Gregory Nutt @@ -35,146 +35,145 @@ include ${TOPDIR}/.config include ${TOPDIR}/tools/Config.mk - -# -# We only support building with the ARM bare-metal toolchain from -# https://launchpad.net/gcc-arm-embedded on Windows, Linux or Mac OS. -# -CONFIG_ARMV7M_TOOLCHAIN := GNU_EABI - include ${TOPDIR}/arch/arm/src/armv7-m/Toolchain.defs -CC = $(CROSSDEV)gcc -CXX = $(CROSSDEV)g++ -CPP = $(CROSSDEV)gcc -E -LD = $(CROSSDEV)ld -AR = $(CROSSDEV)ar rcs -NM = $(CROSSDEV)nm -OBJCOPY = $(CROSSDEV)objcopy -OBJDUMP = $(CROSSDEV)objdump +CONFIG_ARMV7M_TOOLCHAIN := GNU_EABI + +CC = $(CROSSDEV)gcc +CXX = $(CROSSDEV)g++ +CPP = $(CROSSDEV)gcc -E +LD = $(CROSSDEV)ld +AR = $(CROSSDEV)ar rcs +NM = $(CROSSDEV)nm +OBJCOPY = $(CROSSDEV)objcopy +OBJDUMP = $(CROSSDEV)objdump MAXOPTIMIZATION = -Os -ARCHCPUFLAGS = -mcpu=cortex-m4 \ - -mthumb \ - -march=armv7e-m \ - -mfpu=fpv4-sp-d16 \ - -mfloat-abi=hard +ARCHCPUFLAGS = -mcpu=cortex-m4 \ + -mthumb \ + -march=armv7e-m \ + -mfpu=fpv4-sp-d16 \ + -mfloat-abi=hard -# enable precise stack overflow tracking ifeq ($(CONFIG_ARMV7M_STACKCHECK),y) -INSTRUMENTATIONDEFINES = -finstrument-functions -ffixed-r10 -endif +# enable precise stack overflow tracking +INSTRUMENTATIONDEFINES = -finstrument-functions \ + -ffixed-r10 +endif +# Pull in *just* libm from the toolchain ... this is grody -# pull in *just* libm from the toolchain ... this is grody -LIBM = "${shell $(CC) $(ARCHCPUFLAGS) -print-file-name=libm.a}" -EXTRA_LIBS += $(LIBM) +LIBM = "${shell $(CC) $(ARCHCPUFLAGS) -print-file-name=libm.a}" +EXTRA_LIBS += $(LIBM) -# use our linker script -LDSCRIPT = ld.script +# Use our linker script + +LDSCRIPT = ld.script ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/copydir.sh - DIRUNLINK = $(TOPDIR)/tools/unlink.sh - MKDEP = $(TOPDIR)/tools/mknulldeps.sh - ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" - ARCHXXINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" -isystem "${shell cygpath -w $(TOPDIR)/include/cxx}" - ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/$(LDSCRIPT)}" + DIRLINK = $(TOPDIR)/tools/copydir.sh + DIRUNLINK = $(TOPDIR)/tools/unlink.sh + MKDEP = $(TOPDIR)/tools/mknulldeps.sh + ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" + ARCHXXINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" -isystem "${shell cygpath -w $(TOPDIR)/include/cxx}" + ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/$(LDSCRIPT)}" else ifeq ($(PX4_WINTOOL),y) # Windows-native toolchains (MSYS) - DIRLINK = $(TOPDIR)/tools/copydir.sh - DIRUNLINK = $(TOPDIR)/tools/unlink.sh - MKDEP = $(TOPDIR)/tools/mknulldeps.sh - ARCHINCLUDES = -I. -isystem $(TOPDIR)/include - ARCHXXINCLUDES = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx - ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/$(LDSCRIPT) + DIRLINK = $(TOPDIR)/tools/copydir.sh + DIRUNLINK = $(TOPDIR)/tools/unlink.sh + MKDEP = $(TOPDIR)/tools/mknulldeps.sh + ARCHINCLUDES = -I. -isystem $(TOPDIR)/include + ARCHXXINCLUDES = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx + ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/$(LDSCRIPT) else - # Linux/Cygwin-native toolchain - MKDEP = $(TOPDIR)/tools/mkdeps.sh - ARCHINCLUDES = -I. -isystem $(TOPDIR)/include - ARCHXXINCLUDES = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx - ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/$(LDSCRIPT) + # Linux/Cygwin-native toolchain + MKDEP = $(TOPDIR)/tools/mkdeps.sh + ARCHINCLUDES = -I. -isystem $(TOPDIR)/include + ARCHXXINCLUDES = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx + ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/$(LDSCRIPT) endif endif -# tool versions -ARCHCCVERSION = ${shell $(CC) -v 2>&1 | sed -n '/^gcc version/p' | sed -e 's/^gcc version \([0-9\.]\)/\1/g' -e 's/[-\ ].*//g' -e '1q'} -ARCHCCMAJOR = ${shell echo $(ARCHCCVERSION) | cut -d'.' -f1} +# Tool versions + +ARCHCCVERSION = ${shell $(CC) -v 2>&1 | sed -n '/^gcc version/p' | sed -e 's/^gcc version \([0-9\.]\)/\1/g' -e 's/[-\ ].*//g' -e '1q'} +ARCHCCMAJOR = ${shell echo $(ARCHCCVERSION) | cut -d'.' -f1} -# optimisation flags -ARCHOPTIMIZATION = $(MAXOPTIMIZATION) \ - -fno-strict-aliasing \ - -fno-strength-reduce \ - -fomit-frame-pointer \ - -funsafe-math-optimizations \ - -fno-builtin-printf \ - -ffunction-sections \ - -fdata-sections +# Optimization flags + +ARCHOPTIMIZATION = $(MAXOPTIMIZATION) \ + -fno-strict-aliasing \ + -fno-strength-reduce \ + -fomit-frame-pointer \ + -funsafe-math-optimizations \ + -fno-builtin-printf \ + -ffunction-sections \ + -fdata-sections ifeq ("${CONFIG_DEBUG_SYMBOLS}","y") -ARCHOPTIMIZATION += -g +ARCHOPTIMIZATION += -g endif -ARCHCFLAGS = -std=gnu99 -ARCHCXXFLAGS = -fno-exceptions -fno-rtti -std=gnu++0x -ARCHWARNINGS = -Wall \ - -Wno-sign-compare \ - -Wextra \ - -Wdouble-promotion \ - -Wshadow \ - -Wfloat-equal \ - -Wframe-larger-than=1024 \ - -Wpointer-arith \ - -Wlogical-op \ - -Wmissing-declarations \ - -Wpacked \ - -Wno-unused-parameter +ARCHCFLAGS = -std=gnu99 +ARCHCXXFLAGS = -fno-exceptions -fno-rtti -std=gnu++0x +ARCHWARNINGS = -Wall \ + -Wno-sign-compare \ + -Wextra \ + -Wdouble-promotion \ + -Wshadow \ + -Wfloat-equal \ + -Wframe-larger-than=1024 \ + -Wpointer-arith \ + -Wlogical-op \ + -Wmissing-declarations \ + -Wpacked \ + -Wno-unused-parameter # -Wcast-qual - generates spurious noreturn attribute warnings, try again later # -Wconversion - would be nice, but too many "risky-but-safe" conversions in the code # -Wcast-align - would help catch bad casts in some cases, but generates too many false positives -ARCHCWARNINGS = $(ARCHWARNINGS) \ - -Wbad-function-cast \ - -Wstrict-prototypes \ - -Wold-style-declaration \ - -Wmissing-parameter-type \ - -Wmissing-prototypes \ - -Wnested-externs -ARCHWARNINGSXX = $(ARCHWARNINGS) \ - -Wno-psabi -ARCHDEFINES = -ARCHPICFLAGS = -fpic -msingle-pic-base -mpic-register=r10 - -# this seems to be the only way to add linker flags -EXTRA_LIBS += --warn-common \ - --gc-sections - -CFLAGS = $(ARCHCFLAGS) $(ARCHCWARNINGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(INSTRUMENTATIONDEFINES) $(ARCHDEFINES) $(EXTRADEFINES) -pipe -fno-common -CPICFLAGS = $(ARCHPICFLAGS) $(CFLAGS) -CXXFLAGS = $(ARCHCXXFLAGS) $(ARCHWARNINGSXX) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHXXINCLUDES) $(INSTRUMENTATIONDEFINES) $(ARCHDEFINES) $(EXTRADEFINES) -pipe -CXXPICFLAGS = $(ARCHPICFLAGS) $(CXXFLAGS) -CPPFLAGS = $(ARCHINCLUDES) $(INSTRUMENTATIONDEFINES) $(ARCHDEFINES) $(EXTRADEFINES) -AFLAGS = $(CFLAGS) -D__ASSEMBLY__ - -NXFLATLDFLAGS1 = -r -d -warn-common -NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections -LDNXFLATFLAGS = -e main -s 2048 - -OBJEXT = .o -LIBEXT = .a -EXEEXT = - - -# produce partially-linked $1 from files in $2 +ARCHCWARNINGS = $(ARCHWARNINGS) \ + -Wbad-function-cast \ + -Wstrict-prototypes \ + -Wold-style-declaration \ + -Wmissing-parameter-type \ + -Wmissing-prototypes \ + -Wnested-externs +ARCHWARNINGSXX = $(ARCHWARNINGS) \ + -Wno-psabi +ARCHDEFINES = +ARCHPICFLAGS = -fpic -msingle-pic-base -mpic-register=r10 + +# This seems to be the only way to add linker flags + +EXTRA_LIBS += --warn-common \ + --gc-sections + +CFLAGS = $(ARCHCFLAGS) $(ARCHCWARNINGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(INSTRUMENTATIONDEFINES) $(ARCHDEFINES) $(EXTRADEFINES) -pipe -fno-common +CPICFLAGS = $(ARCHPICFLAGS) $(CFLAGS) +CXXFLAGS = $(ARCHCXXFLAGS) $(ARCHWARNINGSXX) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHXXINCLUDES) $(INSTRUMENTATIONDEFINES) $(ARCHDEFINES) $(EXTRADEFINES) -pipe +CXXPICFLAGS = $(ARCHPICFLAGS) $(CXXFLAGS) +CPPFLAGS = $(ARCHINCLUDES) $(INSTRUMENTATIONDEFINES) $(ARCHDEFINES) $(EXTRADEFINES) +AFLAGS = $(CFLAGS) -D__ASSEMBLY__ + +NXFLATLDFLAGS1 = -r -d -warn-common +NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections +LDNXFLATFLAGS = -e main -s 2048 + +OBJEXT = .o +LIBEXT = .a +EXEEXT = + +# Produce partially-linked $1 from files in $2 + define PRELINK - @echo "PRELINK: $1" - $(Q) $(LD) -Ur -o $1 $2 && $(OBJCOPY) --localize-hidden $1 + @echo "PRELINK: $1" + $(Q) $(LD) -Ur -o $1 $2 && $(OBJCOPY) --localize-hidden $1 endef -HOSTCC = gcc -HOSTINCLUDES = -I. -HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe -HOSTLDFLAGS = - +HOSTCC = gcc +HOSTINCLUDES = -I. +HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe +HOSTLDFLAGS = diff --git a/nuttx-configs/px4fmu-v2/scripts/ld.script b/nuttx-configs/px4fmu-v2/scripts/ld.script index bec896d1c..c78db47e2 100644 --- a/nuttx-configs/px4fmu-v2/scripts/ld.script +++ b/nuttx-configs/px4fmu-v2/scripts/ld.script @@ -1,5 +1,5 @@ /**************************************************************************** - * configs/px4fmu/common/ld.script + * configs/px4fmu-v2_upstream/common/ld.script * * Copyright (C) 2011 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -61,7 +61,7 @@ OUTPUT_ARCH(arm) ENTRY(__start) /* treat __start as the anchor for dead code stripping */ EXTERN(_vectors) /* force the vectors to be included in the output */ -/* +/* * Ensure that abort() is present in the final object. The exception handling * code pulled in by libgcc.a requires it (and that code cannot be easily avoided). */ @@ -72,17 +72,17 @@ SECTIONS .text : { _stext = ABSOLUTE(.); *(.vectors) - *(.text .text.*) + *(.text .text.*) *(.fixup) *(.gnu.warning) - *(.rodata .rodata.*) + *(.rodata .rodata.*) *(.gnu.linkonce.t.*) *(.got) *(.gcc_except_table) *(.gnu.linkonce.r.*) _etext = ABSOLUTE(.); - /* + /* * This is a hack to make the newlib libm __errno() call * use the NuttX get_errno_ptr() function. */ diff --git a/nuttx-configs/px4fmu-v2/src/Makefile b/nuttx-configs/px4fmu-v2/src/Makefile index d4276f7fc..35ad52a2d 100644 --- a/nuttx-configs/px4fmu-v2/src/Makefile +++ b/nuttx-configs/px4fmu-v2/src/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# configs/px4fmu/src/Makefile +# configs/px4fmu-v2_upstream/src/Makefile # # Copyright (C) 2011 Gregory Nutt. All rights reserved. # Author: Gregory Nutt @@ -35,24 +35,24 @@ -include $(TOPDIR)/Make.defs -CFLAGS += -I$(TOPDIR)/sched +CFLAGS += -I$(TOPDIR)/sched -ASRCS = -AOBJS = $(ASRCS:.S=$(OBJEXT)) +ASRCS = +AOBJS = $(ASRCS:.S=$(OBJEXT)) -CSRCS = empty.c -COBJS = $(CSRCS:.c=$(OBJEXT)) +CSRCS = empty.c +COBJS = $(CSRCS:.c=$(OBJEXT)) -SRCS = $(ASRCS) $(CSRCS) -OBJS = $(AOBJS) $(COBJS) +SRCS = $(ASRCS) $(CSRCS) +OBJS = $(AOBJS) $(COBJS) -ARCH_SRCDIR = $(TOPDIR)/arch/$(CONFIG_ARCH)/src +ARCH_SRCDIR = $(TOPDIR)/arch/$(CONFIG_ARCH)/src ifeq ($(WINTOOL),y) - CFLAGS += -I "${shell cygpath -w $(ARCH_SRCDIR)/chip}" \ - -I "${shell cygpath -w $(ARCH_SRCDIR)/common}" \ - -I "${shell cygpath -w $(ARCH_SRCDIR)/armv7-m}" + CFLAGS += -I "${shell cygpath -w $(ARCH_SRCDIR)/chip}" \ + -I "${shell cygpath -w $(ARCH_SRCDIR)/common}" \ + -I "${shell cygpath -w $(ARCH_SRCDIR)/armv7-m}" else - CFLAGS += -I$(ARCH_SRCDIR)/chip -I$(ARCH_SRCDIR)/common -I$(ARCH_SRCDIR)/armv7-m + CFLAGS += -I$(ARCH_SRCDIR)/chip -I$(ARCH_SRCDIR)/common -I$(ARCH_SRCDIR)/armv7-m endif all: libboard$(LIBEXT) @@ -81,4 +81,3 @@ distclean: clean $(call DELFILE, .depend) -include Make.dep - -- cgit v1.2.3 From c77d024a295d7105cb789b265069f81f1906d85f Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Wed, 12 Nov 2014 10:48:35 +0100 Subject: PX4IOv1: Modernize config --- nuttx-configs/px4io-v1/nsh/Make.defs | 1 + nuttx-configs/px4io-v1/nsh/defconfig | 14 ++++++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/nuttx-configs/px4io-v1/nsh/Make.defs b/nuttx-configs/px4io-v1/nsh/Make.defs index 74f38c0cb..09a36ea6d 100644 --- a/nuttx-configs/px4io-v1/nsh/Make.defs +++ b/nuttx-configs/px4io-v1/nsh/Make.defs @@ -35,6 +35,7 @@ include ${TOPDIR}/.config include ${TOPDIR}/tools/Config.mk +include ${TOPDIR}/arch/arm/src/armv7-m/Toolchain.defs # # We only support building with the ARM bare-metal toolchain from diff --git a/nuttx-configs/px4io-v1/nsh/defconfig b/nuttx-configs/px4io-v1/nsh/defconfig index 385b8d6a8..a03166478 100755 --- a/nuttx-configs/px4io-v1/nsh/defconfig +++ b/nuttx-configs/px4io-v1/nsh/defconfig @@ -50,8 +50,8 @@ # CONFIG_ARCH_BOARD_name - for use in C code # CONFIG_ENDIAN_BIG - define if big endian (default is little endian) # CONFIG_BOARD_LOOPSPERMSEC - for delay loops -# CONFIG_DRAM_SIZE - Describes the installed DRAM. -# CONFIG_DRAM_START - The start address of DRAM (physical) +# CONFIG_RAM_SIZE - Describes the installed DRAM. +# CONFIG_RAM_START - The start address of DRAM (physical) # CONFIG_ARCH_IRQPRIO - The ST32F100CB supports interrupt prioritization # CONFIG_ARCH_INTERRUPTSTACK - This architecture supports an interrupt # stack. If defined, this symbol is the size of the interrupt @@ -80,9 +80,10 @@ CONFIG_ARCH_CHIP_STM32F100C8=y CONFIG_ARCH_BOARD_PX4IO_V1=y # CONFIG_ARCH_BOARD_CUSTOM is not set CONFIG_ARCH_BOARD="px4io-v1" +CONFIG_ARCH_BOARD_PX4IO_V1=y CONFIG_BOARD_LOOPSPERMSEC=2000 -CONFIG_DRAM_SIZE=0x00002000 -CONFIG_DRAM_START=0x20000000 +CONFIG_RAM_SIZE=0x00002000 +CONFIG_RAM_START=0x20000000 CONFIG_ARCH_INTERRUPTSTACK=n CONFIG_ARCH_STACKDUMP=y CONFIG_ARCH_BOOTLOADER=n @@ -201,6 +202,11 @@ SERIAL_HAVE_CONSOLE_DMA=y CONFIG_USART2_RXDMA=n CONFIG_USART3_RXDMA=y +# CONFIG_ARMV7M_TOOLCHAIN_CODEREDL is not set +# CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYL is not set +CONFIG_ARMV7M_TOOLCHAIN_GNU_EABIL=y +# CONFIG_ARMV7M_ITMSYSLOG is not set + # # General build options # -- cgit v1.2.3 From fd0735662a07bc3307cfd9c94962152934dddfbc Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Wed, 12 Nov 2014 10:48:51 +0100 Subject: PX4IOv2: Modernize config --- nuttx-configs/px4io-v2/nsh/Make.defs | 1 + nuttx-configs/px4io-v2/nsh/defconfig | 1418 ++++++++++++++++++++++------------ 2 files changed, 926 insertions(+), 493 deletions(-) diff --git a/nuttx-configs/px4io-v2/nsh/Make.defs b/nuttx-configs/px4io-v2/nsh/Make.defs index 287466db6..8705ed578 100644 --- a/nuttx-configs/px4io-v2/nsh/Make.defs +++ b/nuttx-configs/px4io-v2/nsh/Make.defs @@ -35,6 +35,7 @@ include ${TOPDIR}/.config include ${TOPDIR}/tools/Config.mk +include ${TOPDIR}/arch/arm/src/armv7-m/Toolchain.defs # # We only support building with the ARM bare-metal toolchain from diff --git a/nuttx-configs/px4io-v2/nsh/defconfig b/nuttx-configs/px4io-v2/nsh/defconfig index a9b847794..bfd6f9ba9 100755 --- a/nuttx-configs/px4io-v2/nsh/defconfig +++ b/nuttx-configs/px4io-v2/nsh/defconfig @@ -1,547 +1,979 @@ -############################################################################ -# configs/px4io/nsh/defconfig -# -# Copyright (C) 2012 PX4 Development Team. All rights reserved. -# Copyright (C) 2011-2012 Gregory Nutt. All rights reserved. -# Author: Gregory Nutt -# -# 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 NuttX 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. -# -############################################################################ -# -# architecture selection -# -# CONFIG_ARCH - identifies the arch subdirectory and, hence, the -# processor architecture. -# CONFIG_ARCH_family - for use in C code. This identifies the -# particular chip family that the architecture is implemented -# in. -# CONFIG_ARCH_architecture - for use in C code. This identifies the -# specific architecture within the chip family. -# CONFIG_ARCH_CHIP - Identifies the arch/*/chip subdirectory -# CONFIG_ARCH_CHIP_name - For use in C code -# CONFIG_ARCH_BOARD - identifies the configs subdirectory and, hence, -# the board that supports the particular chip or SoC. -# CONFIG_ARCH_BOARD_name - for use in C code -# CONFIG_ENDIAN_BIG - define if big endian (default is little endian) -# CONFIG_BOARD_LOOPSPERMSEC - for delay loops -# CONFIG_DRAM_SIZE - Describes the installed DRAM. -# CONFIG_DRAM_START - The start address of DRAM (physical) -# CONFIG_ARCH_IRQPRIO - The ST32F100CB supports interrupt prioritization -# CONFIG_ARCH_INTERRUPTSTACK - This architecture supports an interrupt -# stack. If defined, this symbol is the size of the interrupt -# stack in bytes. If not defined, the user task stacks will be -# used during interrupt handling. -# CONFIG_ARCH_STACKDUMP - Do stack dumps after assertions -# CONFIG_ARCH_BOOTLOADER - Set if you are using a bootloader. -# CONFIG_ARCH_LEDS - Use LEDs to show state. Unique to board architecture. -# CONFIG_ARCH_BUTTONS - Enable support for buttons. Unique to board architecture. -# CONFIG_ARCH_CALIBRATION - Enables some build in instrumentation that -# cause a 100 second delay during boot-up. This 100 second delay -# serves no purpose other than it allows you to calibrate -# CONFIG_BOARD_LOOPSPERMSEC. You simply use a stop watch to measure -# the 100 second delay then adjust CONFIG_BOARD_LOOPSPERMSEC until -# the delay actually is 100 seconds. -# CONFIG_ARCH_DMA - Support DMA initialization # -CONFIG_ARCH="arm" -CONFIG_ARCH_ARM=y -CONFIG_ARCH_CORTEXM3=y -CONFIG_ARCH_CHIP="stm32" -CONFIG_ARCH_CHIP_STM32F100C8=y -CONFIG_ARCH_BOARD="px4io-v2" -CONFIG_ARCH_BOARD_PX4IO_V2=y -CONFIG_BOARD_LOOPSPERMSEC=2000 -CONFIG_DRAM_SIZE=0x00002000 -CONFIG_DRAM_START=0x20000000 -CONFIG_ARCH_INTERRUPTSTACK=n -CONFIG_ARCH_STACKDUMP=y -CONFIG_ARCH_BOOTLOADER=n -CONFIG_ARCH_LEDS=n -CONFIG_ARCH_BUTTONS=n -CONFIG_ARCH_CALIBRATION=n -CONFIG_ARCH_DMA=y +# Automatically generated file; DO NOT EDIT. +# Nuttx/ Configuration +# + +# +# Build Setup +# +# CONFIG_EXPERIMENTAL is not set +# CONFIG_DEFAULT_SMALL is not set +CONFIG_HOST_LINUX=y +# CONFIG_HOST_OSX is not set +# CONFIG_HOST_WINDOWS is not set +# CONFIG_HOST_OTHER is not set + +# +# Build Configuration +# +CONFIG_APPS_DIR="../apps" +CONFIG_BUILD_FLAT=y +# CONFIG_BUILD_2PASS is not set + +# +# Binary Output Formats +# +# CONFIG_RRLOAD_BINARY is not set +# CONFIG_INTELHEX_BINARY is not set +# CONFIG_MOTOROLA_SREC is not set +CONFIG_RAW_BINARY=y +# CONFIG_UBOOT_UIMAGE is not set + +# +# Customize Header Files +# +# CONFIG_ARCH_STDINT_H is not set +# CONFIG_ARCH_STDBOOL_H is not set CONFIG_ARCH_MATH_H=y +# CONFIG_ARCH_FLOAT_H is not set +# CONFIG_ARCH_STDARG_H is not set -CONFIG_ARMV7M_CMNVECTOR=y -CONFIG_ARMV7M_STACKCHECK=n # -# JTAG Enable settings (by default JTAG-DP and SW-DP are disabled): +# Debug Options # -# CONFIG_STM32_DFU - Use the DFU bootloader, not JTAG +# CONFIG_DEBUG is not set +CONFIG_ARCH_HAVE_STACKCHECK=y +CONFIG_STACK_COLORATION=y +CONFIG_ARCH_HAVE_HEAPCHECK=y +CONFIG_DEBUG_SYMBOLS=y +CONFIG_ARCH_HAVE_CUSTOMOPT=y +# CONFIG_DEBUG_NOOPT is not set +# CONFIG_DEBUG_CUSTOMOPT is not set +CONFIG_DEBUG_FULLOPT=y + # -# JTAG Enable options: +# System Type # -# CONFIG_STM32_JTAG_FULL_ENABLE - Enables full SWJ (JTAG-DP + SW-DP) -# CONFIG_STM32_JTAG_NOJNTRST_ENABLE - Enables full SWJ (JTAG-DP + SW-DP) -# but without JNTRST. -# CONFIG_STM32_JTAG_SW_ENABLE - Set JTAG-DP disabled and SW-DP enabled +CONFIG_ARCH_ARM=y +# CONFIG_ARCH_AVR is not set +# CONFIG_ARCH_HC is not set +# CONFIG_ARCH_MIPS is not set +# CONFIG_ARCH_RGMP is not set +# CONFIG_ARCH_SH is not set +# CONFIG_ARCH_SIM is not set +# CONFIG_ARCH_X86 is not set +# CONFIG_ARCH_Z16 is not set +# CONFIG_ARCH_Z80 is not set +CONFIG_ARCH="arm" + # -CONFIG_STM32_DFU=n -CONFIG_STM32_JTAG_FULL_ENABLE=n -CONFIG_STM32_JTAG_NOJNTRST_ENABLE=n -CONFIG_STM32_JTAG_SW_ENABLE=y +# ARM Options +# +# CONFIG_ARCH_CHIP_A1X is not set +# CONFIG_ARCH_CHIP_C5471 is not set +# CONFIG_ARCH_CHIP_CALYPSO is not set +# CONFIG_ARCH_CHIP_DM320 is not set +# CONFIG_ARCH_CHIP_EFM32 is not set +# CONFIG_ARCH_CHIP_IMX is not set +# CONFIG_ARCH_CHIP_KINETIS is not set +# CONFIG_ARCH_CHIP_KL is not set +# CONFIG_ARCH_CHIP_LM is not set +# CONFIG_ARCH_CHIP_TIVA is not set +# CONFIG_ARCH_CHIP_LPC17XX is not set +# CONFIG_ARCH_CHIP_LPC214X is not set +# CONFIG_ARCH_CHIP_LPC2378 is not set +# CONFIG_ARCH_CHIP_LPC31XX is not set +# CONFIG_ARCH_CHIP_LPC43XX is not set +# CONFIG_ARCH_CHIP_NUC1XX is not set +# CONFIG_ARCH_CHIP_SAMA5 is not set +# CONFIG_ARCH_CHIP_SAMD is not set +# CONFIG_ARCH_CHIP_SAM34 is not set +CONFIG_ARCH_CHIP_STM32=y +# CONFIG_ARCH_CHIP_STR71X is not set +# CONFIG_ARCH_ARM7TDMI is not set +# CONFIG_ARCH_ARM926EJS is not set +# CONFIG_ARCH_ARM920T is not set +# CONFIG_ARCH_CORTEXM0 is not set +CONFIG_ARCH_CORTEXM3=y +# CONFIG_ARCH_CORTEXM4 is not set +# CONFIG_ARCH_CORTEXA5 is not set +# CONFIG_ARCH_CORTEXA8 is not set +CONFIG_ARCH_FAMILY="armv7-m" +CONFIG_ARCH_CHIP="stm32" +CONFIG_ARMV7M_USEBASEPRI=y +CONFIG_ARCH_HAVE_CMNVECTOR=y +CONFIG_ARMV7M_CMNVECTOR=y +# CONFIG_ARCH_HAVE_FPU is not set +# CONFIG_ARMV7M_MPU is not set # -# Individual subsystems can be enabled: +# ARMV7M Configuration Options # -# AHB: +# CONFIG_ARMV7M_TOOLCHAIN_BUILDROOT is not set +# CONFIG_ARMV7M_TOOLCHAIN_CODEREDL is not set +# CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYL is not set +CONFIG_ARMV7M_TOOLCHAIN_GNU_EABIL=y +# CONFIG_ARMV7M_STACKCHECK is not set +# CONFIG_ARMV7M_ITMSYSLOG is not set + +# +# STM32 Configuration Options +# +# CONFIG_ARCH_CHIP_STM32L151C6 is not set +# CONFIG_ARCH_CHIP_STM32L151C8 is not set +# CONFIG_ARCH_CHIP_STM32L151CB is not set +# CONFIG_ARCH_CHIP_STM32L151R6 is not set +# CONFIG_ARCH_CHIP_STM32L151R8 is not set +# CONFIG_ARCH_CHIP_STM32L151RB is not set +# CONFIG_ARCH_CHIP_STM32L151V6 is not set +# CONFIG_ARCH_CHIP_STM32L151V8 is not set +# CONFIG_ARCH_CHIP_STM32L151VB is not set +# CONFIG_ARCH_CHIP_STM32L152C6 is not set +# CONFIG_ARCH_CHIP_STM32L152C8 is not set +# CONFIG_ARCH_CHIP_STM32L152CB is not set +# CONFIG_ARCH_CHIP_STM32L152R6 is not set +# CONFIG_ARCH_CHIP_STM32L152R8 is not set +# CONFIG_ARCH_CHIP_STM32L152RB is not set +# CONFIG_ARCH_CHIP_STM32L152V6 is not set +# CONFIG_ARCH_CHIP_STM32L152V8 is not set +# CONFIG_ARCH_CHIP_STM32L152VB is not set +# CONFIG_ARCH_CHIP_STM32L162ZD is not set +CONFIG_ARCH_CHIP_STM32F100C8=y +# CONFIG_ARCH_CHIP_STM32F100CB is not set +# CONFIG_ARCH_CHIP_STM32F100R8 is not set +# CONFIG_ARCH_CHIP_STM32F100RB is not set +# CONFIG_ARCH_CHIP_STM32F100RC is not set +# CONFIG_ARCH_CHIP_STM32F100RD is not set +# CONFIG_ARCH_CHIP_STM32F100RE is not set +# CONFIG_ARCH_CHIP_STM32F100V8 is not set +# CONFIG_ARCH_CHIP_STM32F100VB is not set +# CONFIG_ARCH_CHIP_STM32F100VC is not set +# CONFIG_ARCH_CHIP_STM32F100VD is not set +# CONFIG_ARCH_CHIP_STM32F100VE is not set +# CONFIG_ARCH_CHIP_STM32F102CB is not set +# CONFIG_ARCH_CHIP_STM32F103T8 is not set +# CONFIG_ARCH_CHIP_STM32F103TB is not set +# CONFIG_ARCH_CHIP_STM32F103C4 is not set +# CONFIG_ARCH_CHIP_STM32F103C8 is not set +# CONFIG_ARCH_CHIP_STM32F103CB is not set +# CONFIG_ARCH_CHIP_STM32F103R8 is not set +# CONFIG_ARCH_CHIP_STM32F103RB is not set +# CONFIG_ARCH_CHIP_STM32F103RC is not set +# CONFIG_ARCH_CHIP_STM32F103RD is not set +# CONFIG_ARCH_CHIP_STM32F103RE is not set +# CONFIG_ARCH_CHIP_STM32F103RG is not set +# CONFIG_ARCH_CHIP_STM32F103V8 is not set +# CONFIG_ARCH_CHIP_STM32F103VB is not set +# CONFIG_ARCH_CHIP_STM32F103VC is not set +# CONFIG_ARCH_CHIP_STM32F103VE is not set +# CONFIG_ARCH_CHIP_STM32F103ZE is not set +# CONFIG_ARCH_CHIP_STM32F105VB is not set +# CONFIG_ARCH_CHIP_STM32F107VC is not set +# CONFIG_ARCH_CHIP_STM32F207IG is not set +# CONFIG_ARCH_CHIP_STM32F207ZE is not set +# CONFIG_ARCH_CHIP_STM32F302CB is not set +# CONFIG_ARCH_CHIP_STM32F302CC is not set +# CONFIG_ARCH_CHIP_STM32F302RB is not set +# CONFIG_ARCH_CHIP_STM32F302RC is not set +# CONFIG_ARCH_CHIP_STM32F302VB is not set +# CONFIG_ARCH_CHIP_STM32F302VC is not set +# CONFIG_ARCH_CHIP_STM32F303CB is not set +# CONFIG_ARCH_CHIP_STM32F303CC is not set +# CONFIG_ARCH_CHIP_STM32F303RB is not set +# CONFIG_ARCH_CHIP_STM32F303RC is not set +# CONFIG_ARCH_CHIP_STM32F303VB is not set +# CONFIG_ARCH_CHIP_STM32F303VC is not set +# CONFIG_ARCH_CHIP_STM32F401RE is not set +# CONFIG_ARCH_CHIP_STM32F411RE is not set +# CONFIG_ARCH_CHIP_STM32F405RG is not set +# CONFIG_ARCH_CHIP_STM32F405VG is not set +# CONFIG_ARCH_CHIP_STM32F405ZG is not set +# CONFIG_ARCH_CHIP_STM32F407VE is not set +# CONFIG_ARCH_CHIP_STM32F407VG is not set +# CONFIG_ARCH_CHIP_STM32F407ZE is not set +# CONFIG_ARCH_CHIP_STM32F407ZG is not set +# CONFIG_ARCH_CHIP_STM32F407IE is not set +# CONFIG_ARCH_CHIP_STM32F407IG is not set +# CONFIG_ARCH_CHIP_STM32F427V is not set +# CONFIG_ARCH_CHIP_STM32F427Z is not set +# CONFIG_ARCH_CHIP_STM32F427I is not set +# CONFIG_ARCH_CHIP_STM32F429V is not set +# CONFIG_ARCH_CHIP_STM32F429Z is not set +# CONFIG_ARCH_CHIP_STM32F429I is not set +# CONFIG_ARCH_CHIP_STM32F429B is not set +# CONFIG_ARCH_CHIP_STM32F429N is not set +# CONFIG_STM32_STM32L15XX is not set +# CONFIG_STM32_ENERGYLITE is not set +CONFIG_STM32_STM32F10XX=y +CONFIG_STM32_VALUELINE=y +# CONFIG_STM32_CONNECTIVITYLINE is not set +# CONFIG_STM32_PERFORMANCELINE is not set +# CONFIG_STM32_USBACCESSLINE is not set +# CONFIG_STM32_HIGHDENSITY is not set +# CONFIG_STM32_MEDIUMDENSITY is not set +# CONFIG_STM32_LOWDENSITY is not set +# CONFIG_STM32_STM32F20XX is not set +# CONFIG_STM32_STM32F207 is not set +# CONFIG_STM32_STM32F30XX is not set +# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F401 is not set +# CONFIG_STM32_STM32F411 is not set +# CONFIG_STM32_STM32F405 is not set +# CONFIG_STM32_STM32F407 is not set +# CONFIG_STM32_STM32F427 is not set +# CONFIG_STM32_STM32F429 is not set + +# +# STM32 Peripheral Support +# +# CONFIG_STM32_HAVE_CCM is not set +# CONFIG_STM32_HAVE_USBDEV is not set +# CONFIG_STM32_HAVE_OTGFS is not set +# CONFIG_STM32_HAVE_FSMC is not set +CONFIG_STM32_HAVE_USART3=y +CONFIG_STM32_HAVE_UART4=y +CONFIG_STM32_HAVE_UART5=y +# CONFIG_STM32_HAVE_USART6 is not set +# CONFIG_STM32_HAVE_UART7 is not set +# CONFIG_STM32_HAVE_UART8 is not set +CONFIG_STM32_HAVE_TIM1=y +CONFIG_STM32_HAVE_TIM5=y +CONFIG_STM32_HAVE_TIM6=y +CONFIG_STM32_HAVE_TIM7=y +# CONFIG_STM32_HAVE_TIM8 is not set +# CONFIG_STM32_HAVE_TIM9 is not set +# CONFIG_STM32_HAVE_TIM10 is not set +# CONFIG_STM32_HAVE_TIM11 is not set +CONFIG_STM32_HAVE_TIM12=y +CONFIG_STM32_HAVE_TIM13=y +CONFIG_STM32_HAVE_TIM14=y +CONFIG_STM32_HAVE_TIM15=y +CONFIG_STM32_HAVE_TIM16=y +CONFIG_STM32_HAVE_TIM17=y +CONFIG_STM32_HAVE_ADC2=y +# CONFIG_STM32_HAVE_ADC3 is not set +# CONFIG_STM32_HAVE_ADC4 is not set +# CONFIG_STM32_HAVE_CAN1 is not set +# CONFIG_STM32_HAVE_CAN2 is not set +# CONFIG_STM32_HAVE_RNG is not set +# CONFIG_STM32_HAVE_ETHMAC is not set +# CONFIG_STM32_HAVE_SPI2 is not set +# CONFIG_STM32_HAVE_SPI3 is not set +# CONFIG_STM32_HAVE_SPI4 is not set +# CONFIG_STM32_HAVE_SPI5 is not set +CONFIG_STM32_ADC1=y +# CONFIG_STM32_ADC2 is not set +# CONFIG_STM32_BKP is not set +# CONFIG_STM32_CEC is not set +# CONFIG_STM32_CRC is not set CONFIG_STM32_DMA1=y -CONFIG_STM32_DMA2=n -CONFIG_STM32_CRC=n -# APB1: -# Timers 2,3 and 4 are owned by the PWM driver -CONFIG_STM32_TIM2=n -CONFIG_STM32_TIM3=n -CONFIG_STM32_TIM4=n -CONFIG_STM32_TIM5=n -CONFIG_STM32_TIM6=n -CONFIG_STM32_TIM7=n -CONFIG_STM32_WWDG=n -CONFIG_STM32_SPI2=n +# CONFIG_STM32_DAC1 is not set +# CONFIG_STM32_DAC2 is not set +CONFIG_STM32_I2C1=y +# CONFIG_STM32_I2C2 is not set +# CONFIG_STM32_PWR is not set +# CONFIG_STM32_SPI1 is not set +# CONFIG_STM32_TIM1 is not set +# CONFIG_STM32_TIM2 is not set +# CONFIG_STM32_TIM3 is not set +# CONFIG_STM32_TIM4 is not set +# CONFIG_STM32_TIM5 is not set +# CONFIG_STM32_TIM6 is not set +# CONFIG_STM32_TIM7 is not set +# CONFIG_STM32_TIM12 is not set +# CONFIG_STM32_TIM13 is not set +# CONFIG_STM32_TIM14 is not set +# CONFIG_STM32_TIM15 is not set +# CONFIG_STM32_TIM16 is not set +# CONFIG_STM32_TIM17 is not set +CONFIG_STM32_USART1=y CONFIG_STM32_USART2=y CONFIG_STM32_USART3=y -CONFIG_STM32_I2C1=n -CONFIG_STM32_I2C2=n -CONFIG_STM32_BKP=n -CONFIG_STM32_PWR=n -CONFIG_STM32_DAC=n -# APB2: -# We use our own ADC driver, but leave this on for clocking purposes. -CONFIG_STM32_ADC1=y -CONFIG_STM32_ADC2=n -# TIM1 is owned by the HRT -CONFIG_STM32_TIM1=n -CONFIG_STM32_SPI1=n -CONFIG_STM32_TIM8=n -CONFIG_STM32_USART1=y -CONFIG_STM32_ADC3=n +# CONFIG_STM32_UART4 is not set +# CONFIG_STM32_UART5 is not set +# CONFIG_STM32_IWDG is not set +# CONFIG_STM32_WWDG is not set +CONFIG_STM32_ADC=y +CONFIG_STM32_I2C=y +# +# Alternate Pin Mapping +# +# CONFIG_STM32_I2C1_REMAP is not set +# CONFIG_STM32_USART1_REMAP is not set +# CONFIG_STM32_USART2_REMAP is not set +CONFIG_STM32_USART3_NO_REMAP=y +# CONFIG_STM32_USART3_FULL_REMAP is not set +# CONFIG_STM32_USART3_PARTIAL_REMAP is not set +# CONFIG_STM32_JTAG_DISABLE is not set +# CONFIG_STM32_JTAG_FULL_ENABLE is not set +# CONFIG_STM32_JTAG_NOJNTRST_ENABLE is not set +CONFIG_STM32_JTAG_SW_ENABLE=y +CONFIG_STM32_DISABLE_IDLE_SLEEP_DURING_DEBUG=y +# CONFIG_STM32_FORCEPOWER is not set +# CONFIG_ARCH_BOARD_STM32_CUSTOM_CLOCKCONFIG is not set +# CONFIG_STM32_DMACAPABLE is not set +CONFIG_STM32_USART=y # -# STM32F100 specific serial device driver settings +# U[S]ART Configuration # -# CONFIG_USARTn_SERIAL_CONSOLE - selects the USARTn for the -# console and ttys0 (default is the USART1). -# CONFIG_USARTn_RXBUFSIZE - Characters are buffered as received. -# This specific the size of the receive buffer -# CONFIG_USARTn_TXBUFSIZE - Characters are buffered before -# being sent. This specific the size of the transmit buffer -# CONFIG_USARTn_BAUD - The configure BAUD of the UART. Must be -# CONFIG_USARTn_BITS - The number of bits. Must be either 7 or 8. -# CONFIG_USARTn_PARTIY - 0=no parity, 1=odd parity, 2=even parity -# CONFIG_USARTn_2STOP - Two stop bits +# CONFIG_USART1_RS485 is not set +CONFIG_USART1_RXDMA=y +# CONFIG_USART2_RS485 is not set +# CONFIG_USART2_RXDMA is not set +# CONFIG_USART3_RS485 is not set +CONFIG_USART3_RXDMA=y +# CONFIG_SERIAL_DISABLE_REORDERING is not set +# CONFIG_STM32_FLOWCONTROL_BROKEN is not set +CONFIG_STM32_USART_SINGLEWIRE=y + # -CONFIG_SERIAL_TERMIOS=y -CONFIG_STANDARD_SERIAL=y +# I2C Configuration +# +# CONFIG_STM32_I2C_ALT is not set +# CONFIG_STM32_I2C_DYNTIMEO is not set +CONFIG_STM32_I2CTIMEOSEC=0 +CONFIG_STM32_I2CTIMEOMS=1 +CONFIG_STM32_I2CTIMEOTICKS=1 +# CONFIG_STM32_I2C_DUTY16_9 is not set -CONFIG_USART1_SERIAL_CONSOLE=y -CONFIG_USART2_SERIAL_CONSOLE=n -CONFIG_USART3_SERIAL_CONSOLE=n +# +# USB FS Host Configuration +# -CONFIG_USART1_TXBUFSIZE=64 -CONFIG_USART2_TXBUFSIZE=64 -CONFIG_USART3_TXBUFSIZE=64 +# +# USB HS Host Configuration +# -CONFIG_USART1_RXBUFSIZE=64 -CONFIG_USART2_RXBUFSIZE=64 -CONFIG_USART3_RXBUFSIZE=64 +# +# USB Host Debug Configuration +# -CONFIG_USART1_BAUD=115200 -CONFIG_USART2_BAUD=115200 -CONFIG_USART3_BAUD=115200 +# +# USB Device Configuration +# -CONFIG_USART1_BITS=8 -CONFIG_USART2_BITS=8 -CONFIG_USART3_BITS=8 +# +# Architecture Options +# +# CONFIG_ARCH_NOINTC is not set +# CONFIG_ARCH_VECNOTIRQ is not set +CONFIG_ARCH_DMA=y +CONFIG_ARCH_HAVE_IRQPRIO=y +# CONFIG_ARCH_L2CACHE is not set +# CONFIG_ARCH_HAVE_COHERENT_DCACHE is not set +# CONFIG_ARCH_HAVE_ADDRENV is not set +# CONFIG_ARCH_NEED_ADDRENV_MAPPING is not set +CONFIG_ARCH_HAVE_VFORK=y +# CONFIG_ARCH_HAVE_MMU is not set +CONFIG_ARCH_HAVE_MPU=y +# CONFIG_ARCH_NAND_HWECC is not set +# CONFIG_ARCH_HAVE_EXTCLK is not set +# CONFIG_ARCH_USE_MPU is not set +# CONFIG_ARCH_IRQPRIO is not set +CONFIG_ARCH_STACKDUMP=y +# CONFIG_ENDIAN_BIG is not set +# CONFIG_ARCH_IDLE_CUSTOM is not set +# CONFIG_ARCH_HAVE_RAMFUNCS is not set +CONFIG_ARCH_HAVE_RAMVECTORS=y +# CONFIG_ARCH_RAMVECTORS is not set -CONFIG_USART1_PARITY=0 -CONFIG_USART2_PARITY=0 -CONFIG_USART3_PARITY=0 +# +# Board Settings +# +CONFIG_BOARD_LOOPSPERMSEC=2000 +# CONFIG_ARCH_CALIBRATION is not set -CONFIG_USART1_2STOP=0 -CONFIG_USART2_2STOP=0 -CONFIG_USART3_2STOP=0 +# +# Interrupt options +# +CONFIG_ARCH_HAVE_INTERRUPTSTACK=y +CONFIG_ARCH_INTERRUPTSTACK=0 +CONFIG_ARCH_HAVE_HIPRI_INTERRUPT=y +# CONFIG_ARCH_HIPRI_INTERRUPT is not set -CONFIG_USART1_RXDMA=y -SERIAL_HAVE_CONSOLE_DMA=y -# Conflicts with I2C1 DMA -CONFIG_USART2_RXDMA=n -CONFIG_USART3_RXDMA=y +# +# Boot options +# +# CONFIG_BOOT_RUNFROMEXTSRAM is not set +CONFIG_BOOT_RUNFROMFLASH=y +# CONFIG_BOOT_RUNFROMISRAM is not set +# CONFIG_BOOT_RUNFROMSDRAM is not set +# CONFIG_BOOT_COPYTORAM is not set # -# PX4IO specific driver settings -# -# CONFIG_HRT_TIMER -# Enables the high-resolution timer. The board definition must -# set HRT_TIMER and HRT_TIMER_CHANNEL to the timer and capture/ -# compare channels to be used. -# CONFIG_HRT_PPM -# Enables R/C PPM input using the HRT. The board definition must -# set HRT_PPM_CHANNEL to the timer capture/compare channel to be -# used, and define GPIO_PPM_IN to configure the appropriate timer -# GPIO. -# CONFIG_PWM_SERVO -# Enables the PWM servo driver. The driver configuration must be -# supplied by the board support at initialisation time. -# Note that USART2 must be disabled on the PX4 board for this to -# be available. -# -# -CONFIG_HRT_TIMER=y -CONFIG_HRT_PPM=y - -# -# General build options -# -# CONFIG_RRLOAD_BINARY - make the rrload binary format used with -# BSPs from www.ridgerun.com using the tools/mkimage.sh script -# CONFIG_INTELHEX_BINARY - make the Intel HEX binary format -# used with many different loaders using the GNU objcopy program -# Should not be selected if you are not using the GNU toolchain. -# CONFIG_MOTOROLA_SREC - make the Motorola S-Record binary format -# used with many different loaders using the GNU objcopy program -# Should not be selected if you are not using the GNU toolchain. -# CONFIG_RAW_BINARY - make a raw binary format file used with many -# different loaders using the GNU objcopy program. This option -# should not be selected if you are not using the GNU toolchain. -# CONFIG_HAVE_LIBM - toolchain supports libm.a -# -CONFIG_RRLOAD_BINARY=n -CONFIG_INTELHEX_BINARY=n -CONFIG_MOTOROLA_SREC=n -CONFIG_RAW_BINARY=y -CONFIG_HAVE_LIBM=n - -# -# General OS setup -# -# CONFIG_APPS_DIR - Identifies the relative path to the directory -# that builds the application to link with NuttX. Default: ../apps -# CONFIG_DEBUG - enables built-in debug options -# CONFIG_DEBUG_VERBOSE - enables verbose debug output -# CONFIG_DEBUG_SYMBOLS - build without optimization and with -# debug symbols (needed for use with a debugger). -# CONFIG_HAVE_CXX - Enable support for C++ -# CONFIG_HAVE_CXXINITIALIZE - The platform-specific logic includes support -# for initialization of static C++ instances for this architecture -# and for the selected toolchain (via up_cxxinitialize()). -# CONFIG_MM_REGIONS - If the architecture includes multiple -# regions of memory to allocate from, this specifies the -# number of memory regions that the memory manager must -# handle and enables the API mm_addregion(start, end); -# CONFIG_ARCH_LOWPUTC - architecture supports low-level, boot -# time console output -# CONFIG_MSEC_PER_TICK - The default system timer is 100Hz -# or MSEC_PER_TICK=10. This setting may be defined to -# inform NuttX that the processor hardware is providing -# system timer interrupts at some interrupt interval other -# than 10 msec. -# CONFIG_RR_INTERVAL - The round robin timeslice will be set -# this number of milliseconds; Round robin scheduling can -# be disabled by setting this value to zero. -# CONFIG_SCHED_INSTRUMENTATION - enables instrumentation in -# scheduler to monitor system performance -# CONFIG_TASK_NAME_SIZE - Spcifies that maximum size of a -# task name to save in the TCB. Useful if scheduler -# instrumentation is selected. Set to zero to disable. -# CONFIG_START_YEAR, CONFIG_START_MONTH, CONFIG_START_DAY - -# Used to initialize the internal time logic. -# CONFIG_GREGORIAN_TIME - Enables Gregorian time conversions. -# You would only need this if you are concerned about accurate -# time conversions in the past or in the distant future. -# CONFIG_JULIAN_TIME - Enables Julian time conversions. You -# would only need this if you are concerned about accurate -# time conversion in the distand past. You must also define -# CONFIG_GREGORIAN_TIME in order to use Julian time. -# CONFIG_DEV_CONSOLE - Set if architecture-specific logic -# provides /dev/console. Enables stdout, stderr, stdin. -# CONFIG_DEV_LOWCONSOLE - Use the simple, low-level serial console -# driver (minimul support) -# CONFIG_MUTEX_TYPES: Set to enable support for recursive and -# errorcheck mutexes. Enables pthread_mutexattr_settype(). -# CONFIG_PRIORITY_INHERITANCE : Set to enable support for priority -# inheritance on mutexes and semaphores. -# CONFIG_SEM_PREALLOCHOLDERS: This setting is only used if priority -# inheritance is enabled. It defines the maximum number of -# different threads (minus one) that can take counts on a -# semaphore with priority inheritance support. This may be -# set to zero if priority inheritance is disabled OR if you -# are only using semaphores as mutexes (only one holder) OR -# if no more than two threads participate using a counting -# semaphore. -# CONFIG_SEM_NNESTPRIO. If priority inheritance is enabled, -# then this setting is the maximum number of higher priority -# threads (minus 1) than can be waiting for another thread -# to release a count on a semaphore. This value may be set -# to zero if no more than one thread is expected to wait for -# a semaphore. -# CONFIG_FDCLONE_DISABLE. Disable cloning of all file descriptors -# by task_create() when a new task is started. If set, all -# files/drivers will appear to be closed in the new task. -# CONFIG_FDCLONE_STDIO. Disable cloning of all but the first -# three file descriptors (stdin, stdout, stderr) by task_create() -# when a new task is started. If set, all files/drivers will -# appear to be closed in the new task except for stdin, stdout, -# and stderr. -# CONFIG_SDCLONE_DISABLE. Disable cloning of all socket -# desciptors by task_create() when a new task is started. If -# set, all sockets will appear to be closed in the new task. -# CONFIG_SCHED_WORKQUEUE. Create a dedicated "worker" thread to -# handle delayed processing from interrupt handlers. This feature -# is required for some drivers but, if there are not complaints, -# can be safely disabled. The worker thread also performs -# garbage collection -- completing any delayed memory deallocations -# from interrupt handlers. If the worker thread is disabled, -# then that clean will be performed by the IDLE thread instead -# (which runs at the lowest of priority and may not be appropriate -# if memory reclamation is of high priority). If CONFIG_SCHED_WORKQUEUE -# is enabled, then the following options can also be used: -# CONFIG_SCHED_WORKPRIORITY - The execution priority of the worker -# thread. Default: 50 -# CONFIG_SCHED_WORKPERIOD - How often the worker thread checks for -# work in units of microseconds. Default: 50*1000 (50 MS). -# CONFIG_SCHED_WORKSTACKSIZE - The stack size allocated for the worker -# thread. Default: CONFIG_IDLETHREAD_STACKSIZE. -# CONFIG_SIG_SIGWORK - The signal number that will be used to wake-up -# the worker thread. Default: 4 -# CONFIG_SCHED_WAITPID - Enable the waitpid() API -# CONFIG_SCHED_ATEXIT - Enabled the atexit() API +# Boot Memory Configuration # -CONFIG_USER_ENTRYPOINT="user_start" -#CONFIG_APPS_DIR= -CONFIG_DEBUG=n -CONFIG_DEBUG_VERBOSE=n -CONFIG_DEBUG_SYMBOLS=y -CONFIG_DEBUG_FS=n -CONFIG_DEBUG_GRAPHICS=n -CONFIG_DEBUG_LCD=n -CONFIG_DEBUG_USB=n -CONFIG_DEBUG_NET=n -CONFIG_DEBUG_RTC=n -CONFIG_DEBUG_ANALOG=n -CONFIG_DEBUG_PWM=n -CONFIG_DEBUG_CAN=n -CONFIG_DEBUG_I2C=n -CONFIG_DEBUG_INPUT=n - -CONFIG_MSEC_PER_TICK=1 -CONFIG_HAVE_CXX=y -CONFIG_HAVE_CXXINITIALIZE=y -CONFIG_MM_REGIONS=1 -CONFIG_MM_SMALL=y -CONFIG_ARCH_LOWPUTC=y -CONFIG_RR_INTERVAL=0 -CONFIG_SCHED_INSTRUMENTATION=n -CONFIG_TASK_NAME_SIZE=8 -CONFIG_START_YEAR=1970 -CONFIG_START_MONTH=1 -CONFIG_START_DAY=1 -CONFIG_GREGORIAN_TIME=n -CONFIG_JULIAN_TIME=n -# this eats ~1KiB of RAM ... work out why -CONFIG_DEV_CONSOLE=y -CONFIG_DEV_LOWCONSOLE=n -CONFIG_MUTEX_TYPES=n -CONFIG_PRIORITY_INHERITANCE=n -CONFIG_SEM_PREALLOCHOLDERS=0 -CONFIG_SEM_NNESTPRIO=0 -CONFIG_FDCLONE_DISABLE=y -CONFIG_FDCLONE_STDIO=y -CONFIG_SDCLONE_DISABLE=y -CONFIG_SCHED_WORKQUEUE=n -CONFIG_SCHED_WORKPRIORITY=50 -CONFIG_SCHED_WORKPERIOD=50000 -CONFIG_SCHED_WORKSTACKSIZE=1024 -CONFIG_SIG_SIGWORK=4 -CONFIG_SCHED_WAITPID=n -CONFIG_SCHED_ATEXIT=n - -# -# The following can be used to disable categories of -# APIs supported by the OS. If the compiler supports -# weak functions, then it should not be necessary to -# disable functions unless you want to restrict usage -# of those APIs. -# -# There are certain dependency relationships in these -# features. -# -# o mq_notify logic depends on signals to awaken tasks -# waiting for queues to become full or empty. -# o pthread_condtimedwait() depends on signals to wake -# up waiting tasks. -# -CONFIG_DISABLE_CLOCK=n +CONFIG_RAM_START=0x20000000 +CONFIG_RAM_SIZE=8192 +# CONFIG_ARCH_HAVE_SDRAM is not set + +# +# Board Selection +# +CONFIG_ARCH_BOARD_PX4IO_V2=y +# CONFIG_ARCH_BOARD_CUSTOM is not set +CONFIG_ARCH_BOARD="px4io-v2" + +# +# Custom Board Configuration +# +CONFIG_ARCH_BOARD_CUSTOM_DIR="" +# CONFIG_BOARD_CUSTOM_LEDS is not set +# CONFIG_BOARD_CUSTOM_BUTTONS is not set + +# +# Common Board Options +# + +# +# Board-Specific Options +# + +# +# RTOS Features +# +CONFIG_DISABLE_OS_API=y CONFIG_DISABLE_POSIX_TIMERS=y CONFIG_DISABLE_PTHREAD=y CONFIG_DISABLE_SIGNALS=y CONFIG_DISABLE_MQUEUE=y -CONFIG_DISABLE_MOUNTPOINT=y CONFIG_DISABLE_ENVIRON=y -CONFIG_DISABLE_POLL=y # -# Misc libc settings -# -# CONFIG_NOPRINTF_FIELDWIDTH - sprintf-related logic is a -# little smaller if we do not support fieldwidthes -# -CONFIG_NOPRINTF_FIELDWIDTH=n - -# -# Allow for architecture optimized implementations -# -# The architecture can provide optimized versions of the -# following to improve system performance -# -CONFIG_ARCH_MEMCPY=n -CONFIG_ARCH_MEMCMP=n -CONFIG_ARCH_MEMMOVE=n -CONFIG_ARCH_MEMSET=n -CONFIG_ARCH_STRCMP=n -CONFIG_ARCH_STRCPY=n -CONFIG_ARCH_STRNCPY=n -CONFIG_ARCH_STRLEN=n -CONFIG_ARCH_STRNLEN=n -CONFIG_ARCH_BZERO=n - -# -# Sizes of configurable things (0 disables) -# -# CONFIG_MAX_TASKS - The maximum number of simultaneously -# active tasks. This value must be a power of two. -# CONFIG_MAX_TASK_ARGS - This controls the maximum number of -# of parameters that a task may receive (i.e., maxmum value -# of 'argc') -# CONFIG_NPTHREAD_KEYS - The number of items of thread- -# specific data that can be retained -# CONFIG_NFILE_DESCRIPTORS - The maximum number of file -# descriptors (one for each open) -# CONFIG_NFILE_STREAMS - The maximum number of streams that -# can be fopen'ed -# CONFIG_NAME_MAX - The maximum size of a file name. -# CONFIG_STDIO_BUFFER_SIZE - Size of the buffer to allocate -# on fopen. (Only if CONFIG_NFILE_STREAMS > 0) -# CONFIG_STDIO_LINEBUFFER - If standard C buffered I/O is enabled -# (CONFIG_STDIO_BUFFER_SIZE > 0), then this option may be added -# to force automatic, line-oriented flushing the output buffer -# for putc(), fputc(), putchar(), puts(), fputs(), printf(), -# fprintf(), and vfprintf(). When a newline is encountered in -# the output string, the output buffer will be flushed. This -# (slightly) increases the NuttX footprint but supports the kind -# of behavior that people expect for printf(). -# CONFIG_NUNGET_CHARS - Number of characters that can be -# buffered by ungetc() (Only if CONFIG_NFILE_STREAMS > 0) -# CONFIG_PREALLOC_MQ_MSGS - The number of pre-allocated message -# structures. The system manages a pool of preallocated -# message structures to minimize dynamic allocations -# CONFIG_MQ_MAXMSGSIZE - Message structures are allocated with -# a fixed payload size given by this settin (does not include -# other message structure overhead. -# CONFIG_MAX_WDOGPARMS - Maximum number of parameters that -# can be passed to a watchdog handler -# CONFIG_PREALLOC_WDOGS - The number of pre-allocated watchdog -# structures. The system manages a pool of preallocated -# watchdog structures to minimize dynamic allocations -# CONFIG_PREALLOC_TIMERS - The number of pre-allocated POSIX -# timer structures. The system manages a pool of preallocated -# timer structures to minimize dynamic allocations. Set to -# zero for all dynamic allocations. +# Clocks and Timers # -CONFIG_MAX_TASKS=4 -CONFIG_MAX_TASK_ARGS=4 -CONFIG_NPTHREAD_KEYS=2 -CONFIG_NFILE_DESCRIPTORS=8 -CONFIG_NFILE_STREAMS=0 -CONFIG_NAME_MAX=12 -CONFIG_STDIO_BUFFER_SIZE=32 -CONFIG_STDIO_LINEBUFFER=n -CONFIG_NUNGET_CHARS=2 -CONFIG_PREALLOC_MQ_MSGS=4 -CONFIG_MQ_MAXMSGSIZE=32 +CONFIG_USEC_PER_TICK=1000 +# CONFIG_SYSTEM_TIME64 is not set +# CONFIG_CLOCK_MONOTONIC is not set +# CONFIG_JULIAN_TIME is not set +CONFIG_START_YEAR=1970 +CONFIG_START_MONTH=1 +CONFIG_START_DAY=1 CONFIG_MAX_WDOGPARMS=2 -CONFIG_PREALLOC_WDOGS=4 +CONFIG_PREALLOC_WDOGS=6 +CONFIG_WDOG_INTRESERVE=2 CONFIG_PREALLOC_TIMERS=0 +# +# Tasks and Scheduling +# +# CONFIG_INIT_NONE is not set +CONFIG_INIT_ENTRYPOINT=y +# CONFIG_INIT_FILEPATH is not set +CONFIG_USER_ENTRYPOINT="user_start" +CONFIG_RR_INTERVAL=0 +CONFIG_TASK_NAME_SIZE=8 +CONFIG_MAX_TASKS=4 +# CONFIG_SCHED_HAVE_PARENT is not set +# CONFIG_SCHED_WAITPID is not set # -# Settings for apps/nshlib +# Performance Monitoring +# +# CONFIG_SCHED_CPULOAD is not set +# CONFIG_SCHED_INSTRUMENTATION is not set + # -# CONFIG_NSH_BUILTIN_APPS - Support external registered, -# "named" applications that can be executed from the NSH -# command line (see apps/README.txt for more information). -# CONFIG_NSH_FILEIOSIZE - Size of a static I/O buffer -# CONFIG_NSH_STRERROR - Use strerror(errno) -# CONFIG_NSH_LINELEN - Maximum length of one command line -# CONFIG_NSH_NESTDEPTH - Max number of nested if-then[-else]-fi -# CONFIG_NSH_DISABLESCRIPT - Disable scripting support -# CONFIG_NSH_DISABLEBG - Disable background commands -# CONFIG_NSH_ROMFSETC - Use startup script in /etc -# CONFIG_NSH_CONSOLE - Use serial console front end -# CONFIG_NSH_TELNET - Use telnetd console front end -# CONFIG_NSH_ARCHINIT - Platform provides architecture -# specific initialization (nsh_archinitialize()). +# Files and I/O # +CONFIG_DEV_CONSOLE=y +CONFIG_FDCLONE_DISABLE=y +CONFIG_FDCLONE_STDIO=y +CONFIG_SDCLONE_DISABLE=y +CONFIG_NFILE_DESCRIPTORS=8 +CONFIG_NFILE_STREAMS=0 +CONFIG_NAME_MAX=12 +# CONFIG_PRIORITY_INHERITANCE is not set -# Disable NSH completely -CONFIG_NSH_CONSOLE=n +# +# RTOS hooks +# +# CONFIG_BOARD_INITIALIZE is not set +# CONFIG_SCHED_STARTHOOK is not set +# CONFIG_SCHED_ATEXIT is not set +# CONFIG_SCHED_ONEXIT is not set + +# +# Work Queue Support +# # # Stack and heap information # -# CONFIG_BOOT_RUNFROMFLASH - Some configurations support XIP -# operation from FLASH but must copy initialized .data sections to RAM. -# (should also be =n for the STM3210E-EVAL which always runs from flash) -# CONFIG_BOOT_COPYTORAM - Some configurations boot in FLASH -# but copy themselves entirely into RAM for better performance. -# CONFIG_CUSTOM_STACK - The up_ implementation will handle -# all stack operations outside of the nuttx model. -# CONFIG_STACK_POINTER - The initial stack pointer (arm7tdmi only) -# CONFIG_IDLETHREAD_STACKSIZE - The size of the initial stack. -# This is the thread that (1) performs the inital boot of the system up -# to the point where user_start() is spawned, and (2) there after is the -# IDLE thread that executes only when there is no other thread ready to -# run. -# CONFIG_USERMAIN_STACKSIZE - The size of the stack to allocate -# for the main user thread that begins at the user_start() entry point. -# CONFIG_PTHREAD_STACK_MIN - Minimum pthread stack size -# CONFIG_PTHREAD_STACK_DEFAULT - Default pthread stack size -# CONFIG_HEAP_BASE - The beginning of the heap -# CONFIG_HEAP_SIZE - The size of the heap -# -CONFIG_BOOT_RUNFROMFLASH=n -CONFIG_BOOT_COPYTORAM=n -CONFIG_CUSTOM_STACK=n -CONFIG_STACK_POINTER= CONFIG_IDLETHREAD_STACKSIZE=1024 CONFIG_USERMAIN_STACKSIZE=1200 CONFIG_PTHREAD_STACK_MIN=512 CONFIG_PTHREAD_STACK_DEFAULT=1024 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= +# CONFIG_LIB_SYSCALL is not set + +# +# Device Drivers +# +CONFIG_DISABLE_POLL=y +# CONFIG_DEV_NULL is not set +# CONFIG_DEV_ZERO is not set +# CONFIG_LOOP is not set + +# +# Buffering +# +# CONFIG_DRVR_WRITEBUFFER is not set +# CONFIG_DRVR_READAHEAD is not set +# CONFIG_RAMDISK is not set +# CONFIG_CAN is not set +# CONFIG_ARCH_HAVE_PWM_PULSECOUNT is not set +# CONFIG_PWM is not set +CONFIG_ARCH_HAVE_I2CRESET=y +# CONFIG_I2C is not set +# CONFIG_SPI is not set +# CONFIG_I2S is not set +# CONFIG_RTC is not set +# CONFIG_WATCHDOG is not set +# CONFIG_TIMER is not set +# CONFIG_ANALOG is not set +# CONFIG_AUDIO_DEVICES is not set +# CONFIG_VIDEO_DEVICES is not set +# CONFIG_BCH is not set +# CONFIG_INPUT is not set +# CONFIG_LCD is not set +# CONFIG_MMCSD is not set +# CONFIG_MTD is not set +# CONFIG_EEPROM is not set +# CONFIG_PIPES is not set +# CONFIG_PM is not set +# CONFIG_POWER is not set +# CONFIG_SENSORS is not set +# CONFIG_SERCOMM_CONSOLE is not set +CONFIG_SERIAL=y +# CONFIG_DEV_LOWCONSOLE is not set +# CONFIG_16550_UART is not set +# CONFIG_ARCH_HAVE_UART is not set +# CONFIG_ARCH_HAVE_UART0 is not set +# CONFIG_ARCH_HAVE_UART1 is not set +# CONFIG_ARCH_HAVE_UART2 is not set +# CONFIG_ARCH_HAVE_UART3 is not set +# CONFIG_ARCH_HAVE_UART4 is not set +# CONFIG_ARCH_HAVE_UART5 is not set +# CONFIG_ARCH_HAVE_UART6 is not set +# CONFIG_ARCH_HAVE_UART7 is not set +# CONFIG_ARCH_HAVE_UART8 is not set +# CONFIG_ARCH_HAVE_SCI0 is not set +# CONFIG_ARCH_HAVE_SCI1 is not set +# CONFIG_ARCH_HAVE_USART0 is not set +CONFIG_ARCH_HAVE_USART1=y +CONFIG_ARCH_HAVE_USART2=y +CONFIG_ARCH_HAVE_USART3=y +# CONFIG_ARCH_HAVE_USART4 is not set +# CONFIG_ARCH_HAVE_USART5 is not set +# CONFIG_ARCH_HAVE_USART6 is not set +# CONFIG_ARCH_HAVE_USART7 is not set +# CONFIG_ARCH_HAVE_USART8 is not set +# CONFIG_ARCH_HAVE_OTHER_UART is not set + +# +# USART Configuration +# +CONFIG_USART1_ISUART=y +CONFIG_USART2_ISUART=y +CONFIG_USART3_ISUART=y +CONFIG_MCU_SERIAL=y +CONFIG_STANDARD_SERIAL=y +# CONFIG_SERIAL_IFLOWCONTROL is not set +# CONFIG_SERIAL_OFLOWCONTROL is not set +CONFIG_ARCH_HAVE_SERIAL_TERMIOS=y +CONFIG_SERIAL_TERMIOS=y +CONFIG_USART1_SERIAL_CONSOLE=y +# CONFIG_USART2_SERIAL_CONSOLE is not set +# CONFIG_USART3_SERIAL_CONSOLE is not set +# CONFIG_OTHER_SERIAL_CONSOLE is not set +# CONFIG_NO_SERIAL_CONSOLE is not set + +# +# USART1 Configuration +# +CONFIG_USART1_RXBUFSIZE=64 +CONFIG_USART1_TXBUFSIZE=64 +CONFIG_USART1_BAUD=115200 +CONFIG_USART1_BITS=8 +CONFIG_USART1_PARITY=0 +CONFIG_USART1_2STOP=0 +# CONFIG_USART1_IFLOWCONTROL is not set +# CONFIG_USART1_OFLOWCONTROL is not set + +# +# USART2 Configuration +# +CONFIG_USART2_RXBUFSIZE=64 +CONFIG_USART2_TXBUFSIZE=64 +CONFIG_USART2_BAUD=115200 +CONFIG_USART2_BITS=8 +CONFIG_USART2_PARITY=0 +CONFIG_USART2_2STOP=0 +# CONFIG_USART2_IFLOWCONTROL is not set +# CONFIG_USART2_OFLOWCONTROL is not set + +# +# USART3 Configuration +# +CONFIG_USART3_RXBUFSIZE=64 +CONFIG_USART3_TXBUFSIZE=64 +CONFIG_USART3_BAUD=115200 +CONFIG_USART3_BITS=8 +CONFIG_USART3_PARITY=0 +CONFIG_USART3_2STOP=0 +# CONFIG_USART3_IFLOWCONTROL is not set +# CONFIG_USART3_OFLOWCONTROL is not set +# CONFIG_USBDEV is not set +# CONFIG_USBHOST is not set +# CONFIG_WIRELESS is not set + +# +# System Logging Device Options +# + +# +# System Logging +# +# CONFIG_RAMLOG is not set + +# +# Networking Support +# +# CONFIG_ARCH_HAVE_NET is not set +# CONFIG_ARCH_HAVE_PHY is not set +# CONFIG_NET is not set + +# +# Crypto API +# +# CONFIG_CRYPTO is not set + +# +# File Systems +# + +# +# File system configuration +# +CONFIG_DISABLE_MOUNTPOINT=y +CONFIG_DISABLE_PSEUDOFS_OPERATIONS=y +# CONFIG_FS_READABLE is not set +# CONFIG_FS_WRITABLE is not set +# CONFIG_FS_NAMED_SEMAPHORES is not set +# CONFIG_FS_RAMMAP is not set +# CONFIG_FS_PROCFS is not set + +# +# System Logging +# +# CONFIG_SYSLOG is not set +# CONFIG_SYSLOG_TIMESTAMP is not set + +# +# Graphics Support +# +# CONFIG_NX is not set + +# +# Memory Management +# +CONFIG_MM_SMALL=y +CONFIG_MM_REGIONS=1 +# CONFIG_ARCH_HAVE_HEAP2 is not set +# CONFIG_GRAN is not set + +# +# Audio Support +# +# CONFIG_AUDIO is not set + +# +# Binary Loader +# +# CONFIG_BINFMT_DISABLE is not set +# CONFIG_NXFLAT is not set +# CONFIG_ELF is not set +# CONFIG_BUILTIN is not set +# CONFIG_PIC is not set +# CONFIG_SYMTAB_ORDEREDBYNAME is not set + +# +# Library Routines +# + +# +# Standard C Library Options +# +CONFIG_STDIO_BUFFER_SIZE=32 +# CONFIG_STDIO_LINEBUFFER is not set +CONFIG_NUNGET_CHARS=2 +# CONFIG_NOPRINTF_FIELDWIDTH is not set +# CONFIG_LIBC_FLOATINGPOINT is not set +# CONFIG_LIBC_IOCTL_VARIADIC is not set +CONFIG_LIB_RAND_ORDER=1 +# CONFIG_EOL_IS_CR is not set +# CONFIG_EOL_IS_LF is not set +# CONFIG_EOL_IS_BOTH_CRLF is not set +CONFIG_EOL_IS_EITHER_CRLF=y +# CONFIG_LIBC_EXECFUNCS is not set +CONFIG_POSIX_SPAWN_PROXY_STACKSIZE=1024 +CONFIG_TASK_SPAWN_DEFAULT_STACKSIZE=1024 +# CONFIG_LIBC_STRERROR is not set +# CONFIG_LIBC_PERROR_STDOUT is not set +CONFIG_ARCH_LOWPUTC=y +CONFIG_LIB_SENDFILE_BUFSIZE=512 +# CONFIG_ARCH_ROMGETC is not set +# CONFIG_ARCH_OPTIMIZED_FUNCTIONS is not set + +# +# Non-standard Library Support +# +# CONFIG_LIB_KBDCODEC is not set +# CONFIG_LIB_SLCDCODEC is not set + +# +# Basic CXX Support +# +CONFIG_C99_BOOL8=y +CONFIG_HAVE_CXX=y +CONFIG_HAVE_CXXINITIALIZE=y +# CONFIG_CXX_NEWLONG is not set + +# +# uClibc++ Standard C++ Library +# +# CONFIG_UCLIBCXX is not set + +# +# Application Configuration +# + +# +# Built-In Applications +# + +# +# Examples +# +# CONFIG_EXAMPLES_BUTTONS is not set +# CONFIG_EXAMPLES_CAN is not set +# CONFIG_EXAMPLES_CONFIGDATA is not set +# CONFIG_EXAMPLES_CPUHOG is not set +# CONFIG_EXAMPLES_CXXTEST is not set +# CONFIG_EXAMPLES_DHCPD is not set +# CONFIG_EXAMPLES_ELF is not set +# CONFIG_EXAMPLES_FTPC is not set +# CONFIG_EXAMPLES_FTPD is not set +# CONFIG_EXAMPLES_HELLO is not set +# CONFIG_EXAMPLES_HELLOXX is not set +# CONFIG_EXAMPLES_JSON is not set +# CONFIG_EXAMPLES_HIDKBD is not set +# CONFIG_EXAMPLES_KEYPADTEST is not set +# CONFIG_EXAMPLES_IGMP is not set +# CONFIG_EXAMPLES_MM is not set +# CONFIG_EXAMPLES_MODBUS is not set +# CONFIG_EXAMPLES_MOUNT is not set +# CONFIG_EXAMPLES_NRF24L01TERM is not set +# CONFIG_EXAMPLES_NSH is not set +# CONFIG_EXAMPLES_NULL is not set +# CONFIG_EXAMPLES_NX is not set +# CONFIG_EXAMPLES_NXTERM is not set +# CONFIG_EXAMPLES_NXFFS is not set +# CONFIG_EXAMPLES_NXFLAT is not set +# CONFIG_EXAMPLES_NXHELLO is not set +# CONFIG_EXAMPLES_NXIMAGE is not set +# CONFIG_EXAMPLES_NXLINES is not set +# CONFIG_EXAMPLES_NXTEXT is not set +# CONFIG_EXAMPLES_OSTEST is not set +# CONFIG_EXAMPLES_PIPE is not set +# CONFIG_EXAMPLES_POLL is not set +# CONFIG_EXAMPLES_POSIXSPAWN is not set +# CONFIG_EXAMPLES_QENCODER is not set +# CONFIG_EXAMPLES_RGMP is not set +# CONFIG_EXAMPLES_ROMFS is not set +# CONFIG_EXAMPLES_SENDMAIL is not set +# CONFIG_EXAMPLES_SERIALBLASTER is not set +# CONFIG_EXAMPLES_SERIALRX is not set +# CONFIG_EXAMPLES_SERLOOP is not set +# CONFIG_EXAMPLES_SLCD is not set +# CONFIG_EXAMPLES_SMART is not set +# CONFIG_EXAMPLES_TCPECHO is not set +# CONFIG_EXAMPLES_TELNETD is not set +# CONFIG_EXAMPLES_THTTPD is not set +# CONFIG_EXAMPLES_TIFF is not set +# CONFIG_EXAMPLES_TOUCHSCREEN is not set +# CONFIG_EXAMPLES_UDP is not set +# CONFIG_EXAMPLES_WEBSERVER is not set +# CONFIG_EXAMPLES_USBSERIAL is not set +# CONFIG_EXAMPLES_USBTERM is not set +# CONFIG_EXAMPLES_WATCHDOG is not set + +# +# Graphics Support +# +# CONFIG_TIFF is not set +# CONFIG_GRAPHICS_TRAVELER is not set + +# +# Interpreters +# +# CONFIG_INTERPRETERS_FICL is not set +# CONFIG_INTERPRETERS_PCODE is not set + +# +# Network Utilities +# + +# +# Networking Utilities +# +# CONFIG_NETUTILS_CODECS is not set +# CONFIG_NETUTILS_DHCPD is not set +# CONFIG_NETUTILS_FTPC is not set +# CONFIG_NETUTILS_FTPD is not set +# CONFIG_NETUTILS_JSON is not set +# CONFIG_NETUTILS_SMTP is not set +# CONFIG_NETUTILS_TFTPC is not set +# CONFIG_NETUTILS_THTTPD is not set +# CONFIG_NETUTILS_NETLIB is not set +# CONFIG_NETUTILS_WEBCLIENT is not set + +# +# FreeModBus +# +# CONFIG_MODBUS is not set + +# +# NSH Library +# +# CONFIG_NSH_LIBRARY is not set + +# +# NxWidgets/NxWM +# + +# +# Platform-specific Support +# +# CONFIG_PLATFORM_CONFIGDATA is not set + +# +# System Libraries and NSH Add-Ons +# + +# +# Custom Free Memory Command +# +# CONFIG_SYSTEM_FREE is not set + +# +# EMACS-like Command Line Editor +# +# CONFIG_SYSTEM_CLE is not set + +# +# CU Minimal Terminal +# +# CONFIG_SYSTEM_CUTERM is not set + +# +# FLASH Program Installation +# +# CONFIG_SYSTEM_INSTALL is not set + +# +# FLASH Erase-all Command +# + +# +# Intel HEX to binary conversion +# +# CONFIG_SYSTEM_HEX2BIN is not set + +# +# I2C tool +# + +# +# INI File Parser +# +# CONFIG_SYSTEM_INIFILE is not set + +# +# NxPlayer media player library / command Line +# + +# +# RAM test +# +# CONFIG_SYSTEM_RAMTEST is not set + +# +# readline() +# +# CONFIG_SYSTEM_READLINE is not set + +# +# P-Code Support +# + +# +# PHY Tool +# + +# +# Power Off +# +# CONFIG_SYSTEM_POWEROFF is not set + +# +# RAMTRON +# +# CONFIG_SYSTEM_RAMTRON is not set + +# +# SD Card +# +# CONFIG_SYSTEM_SDCARD is not set + +# +# Sudoku +# +# CONFIG_SYSTEM_SUDOKU is not set + +# +# Sysinfo +# +# CONFIG_SYSTEM_SYSINFO is not set + +# +# VI Work-Alike Editor +# +# CONFIG_SYSTEM_VI is not set + +# +# Stack Monitor +# + +# +# USB CDC/ACM Device Commands +# + +# +# USB Composite Device Commands +# + +# +# USB Mass Storage Device Commands +# + +# +# USB Monitor +# + +# +# Zmodem Commands +# +# CONFIG_SYSTEM_ZMODEM is not set -- cgit v1.2.3 From 8790ad336f11938224828c341a4ab751d2431fab Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Thu, 27 Nov 2014 17:18:26 +0100 Subject: Aerocore: CMD args --- nuttx-configs/aerocore/nsh/defconfig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nuttx-configs/aerocore/nsh/defconfig b/nuttx-configs/aerocore/nsh/defconfig index 29dff64aa..fab7dbbd2 100644 --- a/nuttx-configs/aerocore/nsh/defconfig +++ b/nuttx-configs/aerocore/nsh/defconfig @@ -863,7 +863,9 @@ CONFIG_NSH_CODECS_BUFSIZE=128 CONFIG_NSH_FILEIOSIZE=512 CONFIG_NSH_STRERROR=y CONFIG_NSH_LINELEN=128 +CONFIG_NSH_CMDPARMS=y CONFIG_NSH_MAXARGUMENTS=12 +CONFIG_NSH_ARGCAT=y CONFIG_NSH_NESTDEPTH=8 # CONFIG_NSH_DISABLESCRIPT is not set # CONFIG_NSH_DISABLEBG is not set -- cgit v1.2.3 From a49805e48a1b6046815c09aa2fd3ea95f12d8bca Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Thu, 27 Nov 2014 17:18:45 +0100 Subject: Add param cmd to test config --- makefiles/config_px4fmu-v2_test.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/makefiles/config_px4fmu-v2_test.mk b/makefiles/config_px4fmu-v2_test.mk index 22563838b..66005389a 100644 --- a/makefiles/config_px4fmu-v2_test.mk +++ b/makefiles/config_px4fmu-v2_test.mk @@ -37,7 +37,7 @@ MODULES += systemcmds/mtd MODULES += systemcmds/ver MODULES += systemcmds/top MODULES += modules/sensors - +MODULES += systemcmds/param # # System commands # -- cgit v1.2.3 From 15299ae28b797ed048f741531c96f4a66df87712 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Thu, 27 Nov 2014 18:36:42 +0100 Subject: Add top to test build --- makefiles/config_px4fmu-v2_test.mk | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/makefiles/config_px4fmu-v2_test.mk b/makefiles/config_px4fmu-v2_test.mk index 66005389a..1e677f0da 100644 --- a/makefiles/config_px4fmu-v2_test.mk +++ b/makefiles/config_px4fmu-v2_test.mk @@ -29,15 +29,8 @@ MODULES += drivers/roboclaw MODULES += drivers/airspeed MODULES += drivers/ets_airspeed MODULES += drivers/meas_airspeed -MODULES += systemcmds/perf -MODULES += systemcmds/reboot -MODULES += systemcmds/tests -MODULES += systemcmds/nshterm -MODULES += systemcmds/mtd -MODULES += systemcmds/ver -MODULES += systemcmds/top MODULES += modules/sensors -MODULES += systemcmds/param + # # System commands # @@ -56,6 +49,7 @@ MODULES += systemcmds/nshterm MODULES += systemcmds/mtd MODULES += systemcmds/dumpfile MODULES += systemcmds/ver +MODULES += systemcmds/tests # # Example modules -- cgit v1.2.3 From c03ddbafe5a3dbec4a14de831358af6b2a04407b Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Wed, 24 Dec 2014 05:06:27 -1000 Subject: Added some common macros to support runtime and compile time defensive programming --- src/modules/sdlog2/sdlog2.c | 6 +++ src/modules/systemlib/px4_macros.h | 96 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 102 insertions(+) create mode 100644 src/modules/systemlib/px4_macros.h diff --git a/src/modules/sdlog2/sdlog2.c b/src/modules/sdlog2/sdlog2.c index 7017a65ad..261c495ea 100644 --- a/src/modules/sdlog2/sdlog2.c +++ b/src/modules/sdlog2/sdlog2.c @@ -56,6 +56,7 @@ #include #include #include +#include #include #include #include @@ -1089,6 +1090,11 @@ int sdlog2_thread_main(int argc, char *argv[]) int encoders_sub; } subs; + /* Make sure we have enough file descriptors to support this many subscriptions + * taking into account stdin,stdout and std err + */ + CCASSERT((sizeof(subs) / sizeof (int)) < CONFIG_NFILE_DESCRIPTORS-3); + subs.cmd_sub = orb_subscribe(ORB_ID(vehicle_command)); subs.status_sub = orb_subscribe(ORB_ID(vehicle_status)); subs.vtol_status_sub = orb_subscribe(ORB_ID(vtol_vehicle_status)); diff --git a/src/modules/systemlib/px4_macros.h b/src/modules/systemlib/px4_macros.h new file mode 100644 index 000000000..32eaf266d --- /dev/null +++ b/src/modules/systemlib/px4_macros.h @@ -0,0 +1,96 @@ +/**************************************************************************** + * + * Copyright (C) 2014 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 px4_macros.h + * + * A set of useful macros for enhanced runtime and compile time + * error detection and warning suppression. + * + * Define NO_BLOAT to reduce bloat from file name inclusion. + * + * The arraySize() will compute the size of an array regardless + * it's type + * + * INVALID_CASE(c) should be used is case statements to ferret out + * unintended behavior + * + * UNUSED(var) will suppress compile time warnings of unused + * variables + * + * CCASSERT(predicate) Will generate a compile time error it the + * predicate is false + */ + +#ifndef _PX4_MACROS_H +#define _PX4_MACROS_H + + +#if !defined(arraySize) +#define arraySize(a) (sizeof((a))/sizeof((a[0]))) +#endif + +#if !defined(NO_BLOAT) +#if defined(__BASE_FILE__) +#define _FILE_NAME_ __BASE_FILE__ +#else +#define _FILE_NAME_ __FILE__ +#endif +#else +#define _FILE_NAME_ "" +#endif + +#if !defined(INVALID_CASE) +#define INVALID_CASE(c) printf("Invalid Case %d, %s:%d",(c),__BASE_FILE__,__LINE__) /* todo use PANIC */ +#endif + +#if !defined(UNUSED) +#define UNUSED(var) (void)(var) +#endif + +#if !defined(CAT) +#if !defined(_CAT) +#define _CAT(a, b) a ## b +#endif +#define CAT(a, b) _CAT(a, b) +#endif + +#if !defined(CCASSERT) +#define CCASSERT(predicate) _x_CCASSERT_LINE(predicate, __LINE__) +#if !defined(_x_CCASSERT_LINE) +#define _x_CCASSERT_LINE(predicate, line) typedef char CAT(constraint_violated_on_line_,line)[2*((predicate)!=0)-1]; +#endif +#endif + + +#endif /* _PX4_MACROS_H */ -- cgit v1.2.3 From 6cb0c50315c2207efa0fd9bef0f540edaba88daf Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Thu, 25 Dec 2014 06:34:23 -1000 Subject: Added the ability to apply PX4 specific patches to Nuttx At the moment this entails adding NuttX/nuttx/arch/arm/include/math.h --- Makefile | 33 ++- makefiles/setup.mk | 10 +- nuttx-patches/math.patch | 590 +++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 624 insertions(+), 9 deletions(-) create mode 100644 nuttx-patches/math.patch diff --git a/Makefile b/Makefile index 201187e02..23fbf8f08 100644 --- a/Makefile +++ b/Makefile @@ -161,7 +161,7 @@ $(foreach config,$(FMU_CONFIGS),$(eval $(call FMU_DEP,$(config)))) # NUTTX_ARCHIVES = $(foreach board,$(BOARDS),$(ARCHIVE_DIR)$(board).export) .PHONY: archives -archives: checksubmodules $(NUTTX_ARCHIVES) +archives: checksubmodules nuttxpatches $(NUTTX_ARCHIVES) # We cannot build these parallel; note that we also force -j1 for the # sub-make invocations. @@ -185,6 +185,29 @@ $(NUTTX_ARCHIVES): $(ARCHIVE_DIR)%.export: $(NUTTX_SRC) $(Q) $(COPY) $(NUTTX_SRC)nuttx-export.zip $@ $(Q) (cd $(NUTTX_SRC)/configs && $(RMDIR) $(board)) +NUTTX_PATCHES := $(wildcard $(PX4_NUTTX_PATCH_DIR)*.patch) +NUTTX_PATCHED = $(NUTTX_SRC).patchedpx4common + +.PHONY: nuttxpatches +nuttxpatches: + $(Q) if [ ! -f $(NUTTX_PATCHED) ]; then \ + for patch in $(NUTTX_PATCHES); \ + do \ + $(PATCH) -p0 -N < $$patch; \ + done \ + fi + $(Q) $(TOUCH) $(NUTTX_PATCHED) + +.PHONY: cleannuttxpatches +cleannuttxpatches: + $(Q) if [ ! -f $(NUTTX_PATCHED) ]; then \ + for patch in $(NUTTX_PATCHES); \ + do \ + $(PATCH) -p0 -N -R < $$patch; \ + done \ + fi + $(Q) $(TOUCH) $(NUTTX_PATCHED) + # # The user can run the NuttX 'menuconfig' tool for a single board configuration with # make BOARDS= menuconfig @@ -278,11 +301,11 @@ clean: $(Q) $(REMOVE) $(IMAGE_DIR)*.px4 .PHONY: distclean -distclean: clean +distclean: clean cleannuttxpatches @echo > /dev/null - $(Q) $(REMOVE) $(ARCHIVE_DIR)*.export - $(Q) $(MAKE) -C $(NUTTX_SRC) -r $(MQUIET) distclean - $(Q) (cd $(NUTTX_SRC)/configs && $(FIND) . -maxdepth 1 -type l -delete) + $(Q) $(REMOVE) $(ARCHIVE_DIR)*.export > /dev/null + $(Q) $(MAKE) -C $(NUTTX_SRC) -r $(MQUIET) distclean > /dev/null + $(Q) (cd $(NUTTX_SRC)/configs && $(FIND) . -maxdepth 1 -type l -delete) > /dev/null # # Print some help text diff --git a/makefiles/setup.mk b/makefiles/setup.mk index 351b9f1b7..07890d927 100644 --- a/makefiles/setup.mk +++ b/makefiles/setup.mk @@ -55,6 +55,7 @@ export ROMFS_SRC = $(abspath $(PX4_BASE)/ROMFS)/ export IMAGE_DIR = $(abspath $(PX4_BASE)/Images)/ export BUILD_DIR = $(abspath $(PX4_BASE)/Build)/ export ARCHIVE_DIR = $(abspath $(PX4_BASE)/Archives)/ +export PX4_NUTTX_PATCH_DIR = $(abspath $(PX4_BASE)/nuttx-patches)/ # # Default include paths @@ -68,21 +69,22 @@ export INCLUDE_DIRS := $(PX4_MODULE_SRC) \ # # Tools # -export MKFW = $(PX4_BASE)/Tools/px_mkfw.py +export MKFW = $(PX4_BASE)/Tools/px_mkfw.py export UPLOADER = $(PX4_BASE)/Tools/px_uploader.py -export COPY = cp +export COPY = cp export COPYDIR = cp -Rf export REMOVE = rm -f export RMDIR = rm -rf export GENROMFS = genromfs export TOUCH = touch export MKDIR = mkdir -export FIND = find -export ECHO = echo +export FIND = find +export ECHO = echo export UNZIP_CMD = unzip export PYTHON = python export OPENOCD = openocd export GREP = grep +export PATCH = patch # # Host-specific paths, hacks and fixups diff --git a/nuttx-patches/math.patch b/nuttx-patches/math.patch new file mode 100644 index 000000000..6b60e2cae --- /dev/null +++ b/nuttx-patches/math.patch @@ -0,0 +1,590 @@ +diff -ruN NuttX/nuttx/arch/arm/include/m.math,h /tmp/NuttX/nuttx/arch/arm/include/m.math,h +--- NuttX/nuttx/arch/arm/include/m.math,h 2014-12-25 06:02:40.565856919 -1000 ++++ NuttX/nuttx/arch/arm/include/m.math,h 1969-12-31 14:00:00.000000000 -1000 +@@ -1,585 +0,0 @@ +-#ifndef _MATH_H_ +- +-#define _MATH_H_ +- +-#include +-#include "_ansi.h" +- +-_BEGIN_STD_C +- +-/* Natural log of 2 */ +-#define _M_LN2 0.693147180559945309417 +- +-#if defined(__GNUC__) && \ +- ( (__GNUC__ >= 4) || \ +- ( (__GNUC__ >= 3) && defined(__GNUC_MINOR__) && (__GNUC_MINOR__ >= 3) ) ) +- +- /* gcc >= 3.3 implicitly defines builtins for HUGE_VALx values. */ +- +-# ifndef HUGE_VAL +-# define HUGE_VAL (__builtin_huge_val()) +-# endif +- +-# ifndef HUGE_VALF +-# define HUGE_VALF (__builtin_huge_valf()) +-# endif +- +-# ifndef HUGE_VALL +-# define HUGE_VALL (__builtin_huge_vall()) +-# endif +- +-# ifndef INFINITY +-# define INFINITY (__builtin_inff()) +-# endif +- +-# ifndef NAN +-# define NAN (__builtin_nanf("")) +-# endif +- +-#else /* !gcc >= 3.3 */ +- +- /* No builtins. Use fixed defines instead. (All 3 HUGE plus the INFINITY +- * and NAN macros are required to be constant expressions. Using a variable-- +- * even a static const--does not meet this requirement, as it cannot be +- * evaluated at translation time.) +- * The infinities are done using numbers that are far in excess of +- * something that would be expected to be encountered in a floating-point +- * implementation. (A more certain way uses values from float.h, but that is +- * avoided because system includes are not supposed to include each other.) +- * This method might produce warnings from some compilers. (It does in +- * newer GCCs, but not for ones that would hit this #else.) If this happens, +- * please report details to the Newlib mailing list. */ +- +- #ifndef HUGE_VAL +- #define HUGE_VAL (1.0e999999999) +- #endif +- +- #ifndef HUGE_VALF +- #define HUGE_VALF (1.0e999999999F) +- #endif +- +- #if !defined(HUGE_VALL) && defined(_HAVE_LONG_DOUBLE) +- #define HUGE_VALL (1.0e999999999L) +- #endif +- +- #if !defined(INFINITY) +- #define INFINITY (HUGE_VALF) +- #endif +- +- #if !defined(NAN) +- #if defined(__GNUC__) && defined(__cplusplus) +- /* Exception: older g++ versions warn about the divide by 0 used in the +- * normal case (even though older gccs do not). This trick suppresses the +- * warning, but causes errors for plain gcc, so is only used in the one +- * special case. */ +- static const union { __ULong __i[1]; float __d; } __Nanf = {0x7FC00000}; +- #define NAN (__Nanf.__d) +- #else +- #define NAN (0.0F/0.0F) +- #endif +- #endif +- +-#endif /* !gcc >= 3.3 */ +- +-/* Reentrant ANSI C functions. */ +- +-#ifndef __math_68881 +-extern double atan _PARAMS((double)); +-extern double cos _PARAMS((double)); +-extern double sin _PARAMS((double)); +-extern double tan _PARAMS((double)); +-extern double tanh _PARAMS((double)); +-extern double frexp _PARAMS((double, int *)); +-extern double modf _PARAMS((double, double *)); +-extern double ceil _PARAMS((double)); +-extern double fabs _PARAMS((double)); +-extern double floor _PARAMS((double)); +-#endif /* ! defined (__math_68881) */ +- +-/* Non reentrant ANSI C functions. */ +- +-#ifndef _REENT_ONLY +-#ifndef __math_68881 +-extern double acos _PARAMS((double)); +-extern double asin _PARAMS((double)); +-extern double atan2 _PARAMS((double, double)); +-extern double cosh _PARAMS((double)); +-extern double sinh _PARAMS((double)); +-extern double exp _PARAMS((double)); +-extern double ldexp _PARAMS((double, int)); +-extern double log _PARAMS((double)); +-extern double log10 _PARAMS((double)); +-extern double pow _PARAMS((double, double)); +-extern double sqrt _PARAMS((double)); +-extern double fmod _PARAMS((double, double)); +-#endif /* ! defined (__math_68881) */ +-#endif /* ! defined (_REENT_ONLY) */ +- +-#if !defined(__STRICT_ANSI__) || defined(__cplusplus) || __STDC_VERSION__ >= 199901L +- +-/* ISO C99 types and macros. */ +- +-#ifndef FLT_EVAL_METHOD +-#define FLT_EVAL_METHOD 0 +-typedef float float_t; +-typedef double double_t; +-#endif /* FLT_EVAL_METHOD */ +- +-#define FP_NAN 0 +-#define FP_INFINITE 1 +-#define FP_ZERO 2 +-#define FP_SUBNORMAL 3 +-#define FP_NORMAL 4 +- +-#ifndef FP_ILOGB0 +-# define FP_ILOGB0 (-INT_MAX) +-#endif +-#ifndef FP_ILOGBNAN +-# define FP_ILOGBNAN INT_MAX +-#endif +- +-#ifndef MATH_ERRNO +-# define MATH_ERRNO 1 +-#endif +-#ifndef MATH_ERREXCEPT +-# define MATH_ERREXCEPT 2 +-#endif +-#ifndef math_errhandling +-# define math_errhandling MATH_ERRNO +-#endif +- +-extern int __isinff (float x); +-extern int __isinfd (double x); +-extern int __isnanf (float x); +-extern int __isnand (double x); +-extern int __fpclassifyf (float x); +-extern int __fpclassifyd (double x); +-extern int __signbitf (float x); +-extern int __signbitd (double x); +- +-#define fpclassify(__x) \ +- ((sizeof(__x) == sizeof(float)) ? __fpclassifyf(__x) : \ +- __fpclassifyd(__x)) +- +-#ifndef isfinite +- #define isfinite(__y) \ +- (__extension__ ({int __cy = fpclassify(__y); \ +- __cy != FP_INFINITE && __cy != FP_NAN;})) +-#endif +- +-/* Note: isinf and isnan were once functions in newlib that took double +- * arguments. C99 specifies that these names are reserved for macros +- * supporting multiple floating point types. Thus, they are +- * now defined as macros. Implementations of the old functions +- * taking double arguments still exist for compatibility purposes +- * (prototypes for them are in ). */ +-#ifndef isinf +- #define isinf(y) (fpclassify(y) == FP_INFINITE) +-#endif +- +-#ifndef isnan +- #define isnan(y) (fpclassify(y) == FP_NAN) +-#endif +- +-#define isnormal(y) (fpclassify(y) == FP_NORMAL) +-#define signbit(__x) \ +- ((sizeof(__x) == sizeof(float)) ? __signbitf(__x) : \ +- __signbitd(__x)) +- +-#define isgreater(x,y) \ +- (__extension__ ({__typeof__(x) __x = (x); __typeof__(y) __y = (y); \ +- !isunordered(__x,__y) && (__x > __y);})) +-#define isgreaterequal(x,y) \ +- (__extension__ ({__typeof__(x) __x = (x); __typeof__(y) __y = (y); \ +- !isunordered(__x,__y) && (__x >= __y);})) +-#define isless(x,y) \ +- (__extension__ ({__typeof__(x) __x = (x); __typeof__(y) __y = (y); \ +- !isunordered(__x,__y) && (__x < __y);})) +-#define islessequal(x,y) \ +- (__extension__ ({__typeof__(x) __x = (x); __typeof__(y) __y = (y); \ +- !isunordered(__x,__y) && (__x <= __y);})) +-#define islessgreater(x,y) \ +- (__extension__ ({__typeof__(x) __x = (x); __typeof__(y) __y = (y); \ +- !isunordered(__x,__y) && (__x < __y || __x > __y);})) +- +-#define isunordered(a,b) \ +- (__extension__ ({__typeof__(a) __a = (a); __typeof__(b) __b = (b); \ +- fpclassify(__a) == FP_NAN || fpclassify(__b) == FP_NAN;})) +- +-/* Non ANSI double precision functions. */ +- +-extern double infinity _PARAMS((void)); +-extern double nan _PARAMS((const char *)); +-extern int finite _PARAMS((double)); +-extern double copysign _PARAMS((double, double)); +-extern double logb _PARAMS((double)); +-extern int ilogb _PARAMS((double)); +- +-extern double asinh _PARAMS((double)); +-extern double cbrt _PARAMS((double)); +-extern double nextafter _PARAMS((double, double)); +-extern double rint _PARAMS((double)); +-extern double scalbn _PARAMS((double, int)); +- +-extern double exp2 _PARAMS((double)); +-extern double scalbln _PARAMS((double, long int)); +-extern double tgamma _PARAMS((double)); +-extern double nearbyint _PARAMS((double)); +-extern long int lrint _PARAMS((double)); +-extern long long int llrint _PARAMS((double)); +-extern double round _PARAMS((double)); +-extern long int lround _PARAMS((double)); +-extern long long int llround _PARAMS((double)); +-extern double trunc _PARAMS((double)); +-extern double remquo _PARAMS((double, double, int *)); +-extern double fdim _PARAMS((double, double)); +-extern double fmax _PARAMS((double, double)); +-extern double fmin _PARAMS((double, double)); +-extern double fma _PARAMS((double, double, double)); +- +-#ifndef __math_68881 +-extern double log1p _PARAMS((double)); +-extern double expm1 _PARAMS((double)); +-#endif /* ! defined (__math_68881) */ +- +-#ifndef _REENT_ONLY +-extern double acosh _PARAMS((double)); +-extern double atanh _PARAMS((double)); +-extern double remainder _PARAMS((double, double)); +-extern double gamma _PARAMS((double)); +-extern double lgamma _PARAMS((double)); +-extern double erf _PARAMS((double)); +-extern double erfc _PARAMS((double)); +-extern double log2 _PARAMS((double)); +-#if !defined(__cplusplus) +-#define log2(x) (log (x) / _M_LN2) +-#endif +- +-#ifndef __math_68881 +-extern double hypot _PARAMS((double, double)); +-#endif +- +-#endif /* ! defined (_REENT_ONLY) */ +- +-/* Single precision versions of ANSI functions. */ +- +-extern float atanf _PARAMS((float)); +-extern float cosf _PARAMS((float)); +-extern float sinf _PARAMS((float)); +-extern float tanf _PARAMS((float)); +-extern float tanhf _PARAMS((float)); +-extern float frexpf _PARAMS((float, int *)); +-extern float modff _PARAMS((float, float *)); +-extern float ceilf _PARAMS((float)); +-extern float fabsf _PARAMS((float)); +-extern float floorf _PARAMS((float)); +- +-#ifndef _REENT_ONLY +-extern float acosf _PARAMS((float)); +-extern float asinf _PARAMS((float)); +-extern float atan2f _PARAMS((float, float)); +-extern float coshf _PARAMS((float)); +-extern float sinhf _PARAMS((float)); +-extern float expf _PARAMS((float)); +-extern float ldexpf _PARAMS((float, int)); +-extern float logf _PARAMS((float)); +-extern float log10f _PARAMS((float)); +-extern float powf _PARAMS((float, float)); +-extern float sqrtf _PARAMS((float)); +-extern float fmodf _PARAMS((float, float)); +-#endif /* ! defined (_REENT_ONLY) */ +- +-/* Other single precision functions. */ +- +-extern float exp2f _PARAMS((float)); +-extern float scalblnf _PARAMS((float, long int)); +-extern float tgammaf _PARAMS((float)); +-extern float nearbyintf _PARAMS((float)); +-extern long int lrintf _PARAMS((float)); +-extern long long llrintf _PARAMS((float)); +-extern float roundf _PARAMS((float)); +-extern long int lroundf _PARAMS((float)); +-extern long long int llroundf _PARAMS((float)); +-extern float truncf _PARAMS((float)); +-extern float remquof _PARAMS((float, float, int *)); +-extern float fdimf _PARAMS((float, float)); +-extern float fmaxf _PARAMS((float, float)); +-extern float fminf _PARAMS((float, float)); +-extern float fmaf _PARAMS((float, float, float)); +- +-extern float infinityf _PARAMS((void)); +-extern float nanf _PARAMS((const char *)); +-extern int finitef _PARAMS((float)); +-extern float copysignf _PARAMS((float, float)); +-extern float logbf _PARAMS((float)); +-extern int ilogbf _PARAMS((float)); +- +-extern float asinhf _PARAMS((float)); +-extern float cbrtf _PARAMS((float)); +-extern float nextafterf _PARAMS((float, float)); +-extern float rintf _PARAMS((float)); +-extern float scalbnf _PARAMS((float, int)); +-extern float log1pf _PARAMS((float)); +-extern float expm1f _PARAMS((float)); +- +-#ifndef _REENT_ONLY +-extern float acoshf _PARAMS((float)); +-extern float atanhf _PARAMS((float)); +-extern float remainderf _PARAMS((float, float)); +-extern float gammaf _PARAMS((float)); +-extern float lgammaf _PARAMS((float)); +-extern float erff _PARAMS((float)); +-extern float erfcf _PARAMS((float)); +-extern float log2f _PARAMS((float)); +-#if !defined(__cplusplus) +-#define log2f(x) (logf (x) / (float_t) _M_LN2) +-#endif +-extern float hypotf _PARAMS((float, float)); +-#endif /* ! defined (_REENT_ONLY) */ +- +-/* On platforms where long double equals double. */ +-#ifdef _LDBL_EQ_DBL +-/* Reentrant ANSI C functions. */ +-#ifndef __math_68881 +-extern long double atanl _PARAMS((long double)); +-extern long double cosl _PARAMS((long double)); +-extern long double sinl _PARAMS((long double)); +-extern long double tanl _PARAMS((long double)); +-extern long double tanhl _PARAMS((long double)); +-extern long double frexpl _PARAMS((long double value, int *)); +-extern long double modfl _PARAMS((long double, long double *)); +-extern long double ceill _PARAMS((long double)); +-extern long double fabsl _PARAMS((long double)); +-extern long double floorl _PARAMS((long double)); +-extern long double log1pl _PARAMS((long double)); +-extern long double expm1l _PARAMS((long double)); +-#endif /* ! defined (__math_68881) */ +-/* Non reentrant ANSI C functions. */ +-#ifndef _REENT_ONLY +-#ifndef __math_68881 +-extern long double acosl _PARAMS((long double)); +-extern long double asinl _PARAMS((long double)); +-extern long double atan2l _PARAMS((long double, long double)); +-extern long double coshl _PARAMS((long double)); +-extern long double sinhl _PARAMS((long double)); +-extern long double expl _PARAMS((long double)); +-extern long double ldexpl _PARAMS((long double, int)); +-extern long double logl _PARAMS((long double)); +-extern long double log2l _PARAMS((long double)); +-extern long double log10l _PARAMS((long double)); +-extern long double powl _PARAMS((long double, long double)); +-extern long double sqrtl _PARAMS((long double)); +-extern long double fmodl _PARAMS((long double, long double)); +-extern long double hypotl _PARAMS((long double, long double)); +-#endif /* ! defined (__math_68881) */ +-#endif /* ! defined (_REENT_ONLY) */ +-extern long double copysignl _PARAMS((long double, long double)); +-extern long double nanl _PARAMS((const char *)); +-extern int ilogbl _PARAMS((long double)); +-extern long double asinhl _PARAMS((long double)); +-extern long double cbrtl _PARAMS((long double)); +-extern long double nextafterl _PARAMS((long double, long double)); +-extern long double rintl _PARAMS((long double)); +-extern long double scalbnl _PARAMS((long double, int)); +-extern long double exp2l _PARAMS((long double)); +-extern long double scalblnl _PARAMS((long double, long)); +-extern long double tgammal _PARAMS((long double)); +-extern long double nearbyintl _PARAMS((long double)); +-extern long int lrintl _PARAMS((long double)); +-extern long long int llrintl _PARAMS((long double)); +-extern long double roundl _PARAMS((long double)); +-extern long lroundl _PARAMS((long double)); +-extern long long int llroundl _PARAMS((long double)); +-extern long double truncl _PARAMS((long double)); +-extern long double remquol _PARAMS((long double, long double, int *)); +-extern long double fdiml _PARAMS((long double, long double)); +-extern long double fmaxl _PARAMS((long double, long double)); +-extern long double fminl _PARAMS((long double, long double)); +-extern long double fmal _PARAMS((long double, long double, long double)); +-#ifndef _REENT_ONLY +-extern long double acoshl _PARAMS((long double)); +-extern long double atanhl _PARAMS((long double)); +-extern long double remainderl _PARAMS((long double, long double)); +-extern long double lgammal _PARAMS((long double)); +-extern long double erfl _PARAMS((long double)); +-extern long double erfcl _PARAMS((long double)); +-#endif /* ! defined (_REENT_ONLY) */ +-#else /* !_LDBL_EQ_DBL */ +-#ifdef __i386__ +-/* Other long double precision functions. */ +-extern _LONG_DOUBLE rintl _PARAMS((_LONG_DOUBLE)); +-extern long int lrintl _PARAMS((_LONG_DOUBLE)); +-extern long long llrintl _PARAMS((_LONG_DOUBLE)); +-#endif /* __i386__ */ +-#endif /* !_LDBL_EQ_DBL */ +- +-#endif /* !defined (__STRICT_ANSI__) || defined(__cplusplus) || __STDC_VERSION__ >= 199901L */ +- +-#if !defined (__STRICT_ANSI__) || defined(__cplusplus) +- +-extern double drem _PARAMS((double, double)); +-extern void sincos _PARAMS((double, double *, double *)); +-extern double gamma_r _PARAMS((double, int *)); +-extern double lgamma_r _PARAMS((double, int *)); +- +-extern double y0 _PARAMS((double)); +-extern double y1 _PARAMS((double)); +-extern double yn _PARAMS((int, double)); +-extern double j0 _PARAMS((double)); +-extern double j1 _PARAMS((double)); +-extern double jn _PARAMS((int, double)); +- +-extern float dremf _PARAMS((float, float)); +-extern void sincosf _PARAMS((float, float *, float *)); +-extern float gammaf_r _PARAMS((float, int *)); +-extern float lgammaf_r _PARAMS((float, int *)); +- +-extern float y0f _PARAMS((float)); +-extern float y1f _PARAMS((float)); +-extern float ynf _PARAMS((int, float)); +-extern float j0f _PARAMS((float)); +-extern float j1f _PARAMS((float)); +-extern float jnf _PARAMS((int, float)); +- +-/* GNU extensions */ +-# ifndef exp10 +-extern double exp10 _PARAMS((double)); +-# endif +-# ifndef pow10 +-extern double pow10 _PARAMS((double)); +-# endif +-# ifndef exp10f +-extern float exp10f _PARAMS((float)); +-# endif +-# ifndef pow10f +-extern float pow10f _PARAMS((float)); +-# endif +- +-#endif /* !defined (__STRICT_ANSI__) || defined(__cplusplus) */ +- +-#ifndef __STRICT_ANSI__ +- +-/* The gamma functions use a global variable, signgam. */ +-#ifndef _REENT_ONLY +-#define signgam (*__signgam()) +-extern int *__signgam _PARAMS((void)); +-#endif /* ! defined (_REENT_ONLY) */ +- +-#define __signgam_r(ptr) _REENT_SIGNGAM(ptr) +- +-/* The exception structure passed to the matherr routine. */ +-/* We have a problem when using C++ since `exception' is a reserved +- name in C++. */ +-#ifdef __cplusplus +-struct __exception +-#else +-struct exception +-#endif +-{ +- int type; +- char *name; +- double arg1; +- double arg2; +- double retval; +- int err; +-}; +- +-#ifdef __cplusplus +-extern int matherr _PARAMS((struct __exception *e)); +-#else +-extern int matherr _PARAMS((struct exception *e)); +-#endif +- +-/* Values for the type field of struct exception. */ +- +-#define DOMAIN 1 +-#define SING 2 +-#define OVERFLOW 3 +-#define UNDERFLOW 4 +-#define TLOSS 5 +-#define PLOSS 6 +- +-/* Useful constants. */ +- +-#define MAXFLOAT 3.40282347e+38F +- +-#define M_E 2.7182818284590452354 +-#define M_LOG2E 1.4426950408889634074 +-#define M_LOG10E 0.43429448190325182765 +-#define M_LN2 _M_LN2 +-#define M_LN10 2.30258509299404568402 +-#define M_PI 3.14159265358979323846 +-#define M_TWOPI (M_PI * 2.0) +-#define M_PI_2 1.57079632679489661923 +-#define M_PI_4 0.78539816339744830962 +-#define M_3PI_4 2.3561944901923448370E0 +-#define M_SQRTPI 1.77245385090551602792981 +-#define M_1_PI 0.31830988618379067154 +-#define M_2_PI 0.63661977236758134308 +-#define M_2_SQRTPI 1.12837916709551257390 +-#define M_DEG_TO_RAD 0.01745329251994 +-#define M_RAD_TO_DEG 57.2957795130823 +-#define M_SQRT2 1.41421356237309504880 +-#define M_SQRT1_2 0.70710678118654752440 +-#define M_LN2LO 1.9082149292705877000E-10 +-#define M_LN2HI 6.9314718036912381649E-1 +-#define M_SQRT3 1.73205080756887719000 +-#define M_IVLN10 0.43429448190325182765 /* 1 / log(10) */ +-#define M_LOG2_E _M_LN2 +-#define M_INVLN2 1.4426950408889633870E0 /* 1 / log(2) */ +- +- +-#define M_E_F 2.7182818284590452354f +-#define M_LOG2E_F 1.4426950408889634074f +-#define M_LOG10E_F 0.43429448190325182765f +-#define M_LN2_F _M_LN2_F +-#define M_LN10_F 2.30258509299404568402f +-#define M_PI_F 3.14159265358979323846f +-#define M_TWOPI_F (M_PI_F * 2.0f) +-#define M_PI_2_F 1.57079632679489661923f +-#define M_PI_4_F 0.78539816339744830962f +-#define M_3PI_4_F 2.3561944901923448370E0f +-#define M_SQRTPI_F 1.77245385090551602792981f +-#define M_1_PI_F 0.31830988618379067154f +-#define M_2_PI_F 0.63661977236758134308f +-#define M_2_SQRTPI_F 1.12837916709551257390f +-#define M_DEG_TO_RAD_F 0.01745329251994f +-#define M_RAD_TO_DEG_F 57.2957795130823f +-#define M_SQRT2_F 1.41421356237309504880f +-#define M_SQRT1_2_F 0.70710678118654752440f +-#define M_LN2LO_F 1.9082149292705877000E-10f +-#define M_LN2HI_F 6.9314718036912381649E-1f +-#define M_SQRT3_F 1.73205080756887719000f +-#define M_IVLN10_F 0.43429448190325182765f /* 1 / log(10) */ +-#define M_LOG2_E_F _M_LN2_F +-#define M_INVLN2_F 1.4426950408889633870E0f /* 1 / log(2) */ +- +-/* Global control over fdlibm error handling. */ +- +-enum __fdlibm_version +-{ +- __fdlibm_ieee = -1, +- __fdlibm_svid, +- __fdlibm_xopen, +- __fdlibm_posix +-}; +- +-#define _LIB_VERSION_TYPE enum __fdlibm_version +-#define _LIB_VERSION __fdlib_version +- +-extern __IMPORT _LIB_VERSION_TYPE _LIB_VERSION; +- +-#define _IEEE_ __fdlibm_ieee +-#define _SVID_ __fdlibm_svid +-#define _XOPEN_ __fdlibm_xopen +-#define _POSIX_ __fdlibm_posix +- +-#endif /* ! defined (__STRICT_ANSI__) */ +- +-_END_STD_C +- +-#ifdef __FAST_MATH__ +-#include +-#endif +- +-#endif /* _MATH_H_ */ +\ No newline at end of file -- cgit v1.2.3 From dd20b42143b5348718132b51626d9cabf282e1c6 Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Thu, 25 Dec 2014 15:18:43 -1000 Subject: Updated configs --- nuttx-configs/px4fmu-v1/nsh/defconfig | 4 ++++ nuttx-configs/px4fmu-v2/nsh/defconfig | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/nuttx-configs/px4fmu-v1/nsh/defconfig b/nuttx-configs/px4fmu-v1/nsh/defconfig index 86ed041ff..302066584 100644 --- a/nuttx-configs/px4fmu-v1/nsh/defconfig +++ b/nuttx-configs/px4fmu-v1/nsh/defconfig @@ -256,6 +256,10 @@ CONFIG_STM32_DMACAPABLE=y # CONFIG_STM32_TIM4_ADC is not set # CONFIG_STM32_TIM5_ADC is not set CONFIG_STM32_USART=y +CONFIG_STM32_FLOWCONTROL_BROKEN=y +CONFIG_SERIAL_IFLOWCONTROL_DEASSERT_WATERMARK=16 +CONFIG_SERIAL_IFLOWCONTROL_ASSERT_WATERMARK=32 + # # U[S]ART Configuration diff --git a/nuttx-configs/px4fmu-v2/nsh/defconfig b/nuttx-configs/px4fmu-v2/nsh/defconfig index 6a1aec22b..164aca32d 100644 --- a/nuttx-configs/px4fmu-v2/nsh/defconfig +++ b/nuttx-configs/px4fmu-v2/nsh/defconfig @@ -280,6 +280,9 @@ CONFIG_STM32_DISABLE_IDLE_SLEEP_DURING_DEBUG=y # CONFIG_ARCH_BOARD_STM32_CUSTOM_CLOCKCONFIG is not set # CONFIG_STM32_CCMEXCLUDE is not set CONFIG_STM32_DMACAPABLE=y +CONFIG_STM32_FLOWCONTROL_BROKEN=y +CONFIG_SERIAL_IFLOWCONTROL_DEASSERT_WATERMARK=16 +CONFIG_SERIAL_IFLOWCONTROL_ASSERT_WATERMARK=32 # CONFIG_STM32_TIM1_PWM is not set # CONFIG_STM32_TIM3_PWM is not set # CONFIG_STM32_TIM4_PWM is not set @@ -894,6 +897,7 @@ CONFIG_EXAMPLES_NSH=y # Interpreters # # CONFIG_INTERPRETERS_FICL is not set +# CONFIG_INTERPRETERS_BAS is not set # CONFIG_INTERPRETERS_PCODE is not set # -- cgit v1.2.3 From e69b285bfc26e3d1f19365aa1f5937c6bb5788a2 Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Thu, 25 Dec 2014 16:37:01 -1000 Subject: Fixed typos --- Makefile | 12 ++++++------ nuttx-patches/math.patch | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 23fbf8f08..1f273aa88 100644 --- a/Makefile +++ b/Makefile @@ -190,23 +190,23 @@ NUTTX_PATCHED = $(NUTTX_SRC).patchedpx4common .PHONY: nuttxpatches nuttxpatches: - $(Q) if [ ! -f $(NUTTX_PATCHED) ]; then \ + $(Q) -if [ ! -f $(NUTTX_PATCHED) ]; then \ for patch in $(NUTTX_PATCHES); \ do \ - $(PATCH) -p0 -N < $$patch; \ + $(PATCH) -p0 -N -R < $$patch >/dev/null; \ done \ fi $(Q) $(TOUCH) $(NUTTX_PATCHED) .PHONY: cleannuttxpatches cleannuttxpatches: - $(Q) if [ ! -f $(NUTTX_PATCHED) ]; then \ + $(Q) -if [ -f $(NUTTX_PATCHED) ]; then \ for patch in $(NUTTX_PATCHES); \ do \ - $(PATCH) -p0 -N -R < $$patch; \ + $(PATCH) -p0 -N < $$patch >/dev/null; \ done \ fi - $(Q) $(TOUCH) $(NUTTX_PATCHED) + $(Q) $(REMOVE) $(NUTTX_PATCHED) # # The user can run the NuttX 'menuconfig' tool for a single board configuration with @@ -301,7 +301,7 @@ clean: $(Q) $(REMOVE) $(IMAGE_DIR)*.px4 .PHONY: distclean -distclean: clean cleannuttxpatches +distclean: cleannuttxpatches clean @echo > /dev/null $(Q) $(REMOVE) $(ARCHIVE_DIR)*.export > /dev/null $(Q) $(MAKE) -C $(NUTTX_SRC) -r $(MQUIET) distclean > /dev/null diff --git a/nuttx-patches/math.patch b/nuttx-patches/math.patch index 6b60e2cae..a93b2daf6 100644 --- a/nuttx-patches/math.patch +++ b/nuttx-patches/math.patch @@ -1,6 +1,6 @@ -diff -ruN NuttX/nuttx/arch/arm/include/m.math,h /tmp/NuttX/nuttx/arch/arm/include/m.math,h ---- NuttX/nuttx/arch/arm/include/m.math,h 2014-12-25 06:02:40.565856919 -1000 -+++ NuttX/nuttx/arch/arm/include/m.math,h 1969-12-31 14:00:00.000000000 -1000 +diff -ruN NuttX/nuttx/arch/arm/include/math.h NuttX/nuttx/arch/arm/include/math.h +--- NuttX/nuttx/arch/arm/include/math.h 2014-12-25 06:02:40.565856919 -1000 ++++ NuttX/nuttx/arch/arm/include/math.h 1969-12-31 14:00:00.000000000 -1000 @@ -1,585 +0,0 @@ -#ifndef _MATH_H_ - -- cgit v1.2.3 From 4203c287ddf71bf3d873459778d60b26cdd1169f Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Thu, 25 Dec 2014 17:54:02 -1000 Subject: better nameing and direction --- Makefile | 4 +- nuttx-patches/math.h.patch | 583 ++++++++++++++++++++++++++++++++++++++++++++ nuttx-patches/math.patch | 590 --------------------------------------------- 3 files changed, 585 insertions(+), 592 deletions(-) create mode 100644 nuttx-patches/math.h.patch delete mode 100644 nuttx-patches/math.patch diff --git a/Makefile b/Makefile index 1f273aa88..b72583e6e 100644 --- a/Makefile +++ b/Makefile @@ -193,7 +193,7 @@ nuttxpatches: $(Q) -if [ ! -f $(NUTTX_PATCHED) ]; then \ for patch in $(NUTTX_PATCHES); \ do \ - $(PATCH) -p0 -N -R < $$patch >/dev/null; \ + $(PATCH) -p0 -N < $$patch >/dev/null; \ done \ fi $(Q) $(TOUCH) $(NUTTX_PATCHED) @@ -203,7 +203,7 @@ cleannuttxpatches: $(Q) -if [ -f $(NUTTX_PATCHED) ]; then \ for patch in $(NUTTX_PATCHES); \ do \ - $(PATCH) -p0 -N < $$patch >/dev/null; \ + $(PATCH) -p0 -N -R < $$patch >/dev/null; \ done \ fi $(Q) $(REMOVE) $(NUTTX_PATCHED) diff --git a/nuttx-patches/math.h.patch b/nuttx-patches/math.h.patch new file mode 100644 index 000000000..e09120f9c --- /dev/null +++ b/nuttx-patches/math.h.patch @@ -0,0 +1,583 @@ +diff -ruN NuttX/nuttx/arch/arm/include/math.h NuttX/nuttx/arch/arm/include/math.h +--- NuttX/nuttx/arch/arm/include/math.h 1969-12-31 14:00:00.000000000 -1000 ++++ NuttX/nuttx/arch/arm/include/math.h 2014-12-25 17:33:53.404950574 -1000 +@@ -0,0 +1,579 @@ ++#ifndef _MATH_H_ ++ ++#define _MATH_H_ ++ ++#include ++#include "_ansi.h" ++ ++_BEGIN_STD_C ++ ++/* Natural log of 2 */ ++#define _M_LN2 0.693147180559945309417 ++ ++#if defined(__GNUC__) && \ ++ ( (__GNUC__ >= 4) || \ ++ ( (__GNUC__ >= 3) && defined(__GNUC_MINOR__) && (__GNUC_MINOR__ >= 3) ) ) ++ ++ /* gcc >= 3.3 implicitly defines builtins for HUGE_VALx values. */ ++ ++# ifndef HUGE_VAL ++# define HUGE_VAL (__builtin_huge_val()) ++# endif ++ ++# ifndef HUGE_VALF ++# define HUGE_VALF (__builtin_huge_valf()) ++# endif ++ ++# ifndef HUGE_VALL ++# define HUGE_VALL (__builtin_huge_vall()) ++# endif ++ ++# ifndef INFINITY ++# define INFINITY (__builtin_inff()) ++# endif ++ ++# ifndef NAN ++# define NAN (__builtin_nanf("")) ++# endif ++ ++#else /* !gcc >= 3.3 */ ++ ++ /* No builtins. Use fixed defines instead. (All 3 HUGE plus the INFINITY ++ * * and NAN macros are required to be constant expressions. Using a variable-- ++ * * even a static const--does not meet this requirement, as it cannot be ++ * * evaluated at translation time.) ++ * * The infinities are done using numbers that are far in excess of ++ * * something that would be expected to be encountered in a floating-point ++ * * implementation. (A more certain way uses values from float.h, but that is ++ * * avoided because system includes are not supposed to include each other.) ++ * * This method might produce warnings from some compilers. (It does in ++ * * newer GCCs, but not for ones that would hit this #else.) If this happens, ++ * * please report details to the Newlib mailing list. */ ++ ++ #ifndef HUGE_VAL ++ #define HUGE_VAL (1.0e999999999) ++ #endif ++ ++ #ifndef HUGE_VALF ++ #define HUGE_VALF (1.0e999999999F) ++ #endif ++ ++ #if !defined(HUGE_VALL) && defined(_HAVE_LONG_DOUBLE) ++ #define HUGE_VALL (1.0e999999999L) ++ #endif ++ ++ #if !defined(INFINITY) ++ #define INFINITY (HUGE_VALF) ++ #endif ++ ++ #if !defined(NAN) ++ #if defined(__GNUC__) && defined(__cplusplus) ++ /* Exception: older g++ versions warn about the divide by 0 used in the ++ * * normal case (even though older gccs do not). This trick suppresses the ++ * * warning, but causes errors for plain gcc, so is only used in the one ++ * * special case. */ ++ static const union { __ULong __i[1]; float __d; } __Nanf = {0x7FC00000}; ++ #define NAN (__Nanf.__d) ++ #else ++ #define NAN (0.0F/0.0F) ++ #endif ++ #endif ++ ++#endif /* !gcc >= 3.3 */ ++ ++/* Reentrant ANSI C functions. */ ++ ++#ifndef __math_68881 ++extern double atan _PARAMS((double)); ++extern double cos _PARAMS((double)); ++extern double sin _PARAMS((double)); ++extern double tan _PARAMS((double)); ++extern double tanh _PARAMS((double)); ++extern double frexp _PARAMS((double, int *)); ++extern double modf _PARAMS((double, double *)); ++extern double ceil _PARAMS((double)); ++extern double fabs _PARAMS((double)); ++extern double floor _PARAMS((double)); ++#endif /* ! defined (__math_68881) */ ++ ++/* Non reentrant ANSI C functions. */ ++ ++#ifndef _REENT_ONLY ++#ifndef __math_68881 ++extern double acos _PARAMS((double)); ++extern double asin _PARAMS((double)); ++extern double atan2 _PARAMS((double, double)); ++extern double cosh _PARAMS((double)); ++extern double sinh _PARAMS((double)); ++extern double exp _PARAMS((double)); ++extern double ldexp _PARAMS((double, int)); ++extern double log _PARAMS((double)); ++extern double log10 _PARAMS((double)); ++extern double pow _PARAMS((double, double)); ++extern double sqrt _PARAMS((double)); ++extern double fmod _PARAMS((double, double)); ++#endif /* ! defined (__math_68881) */ ++#endif /* ! defined (_REENT_ONLY) */ ++ ++#if !defined(__STRICT_ANSI__) || defined(__cplusplus) || __STDC_VERSION__ >= 199901L ++ ++/* ISO C99 types and macros. */ ++ ++#ifndef FLT_EVAL_METHOD ++#define FLT_EVAL_METHOD 0 ++typedef float float_t; ++typedef double double_t; ++#endif /* FLT_EVAL_METHOD */ ++ ++#define FP_NAN 0 ++#define FP_INFINITE 1 ++#define FP_ZERO 2 ++#define FP_SUBNORMAL 3 ++#define FP_NORMAL 4 ++ ++#ifndef FP_ILOGB0 ++# define FP_ILOGB0 (-INT_MAX) ++#endif ++#ifndef FP_ILOGBNAN ++# define FP_ILOGBNAN INT_MAX ++#endif ++ ++#ifndef MATH_ERRNO ++# define MATH_ERRNO 1 ++#endif ++#ifndef MATH_ERREXCEPT ++# define MATH_ERREXCEPT 2 ++#endif ++#ifndef math_errhandling ++# define math_errhandling MATH_ERRNO ++#endif ++ ++extern int __isinff (float x); ++extern int __isinfd (double x); ++extern int __isnanf (float x); ++extern int __isnand (double x); ++extern int __fpclassifyf (float x); ++extern int __fpclassifyd (double x); ++extern int __signbitf (float x); ++extern int __signbitd (double x); ++ ++#define fpclassify(__x) \ ++ ((sizeof(__x) == sizeof(float)) ? __fpclassifyf(__x) : \ ++ __fpclassifyd(__x)) ++ ++#ifndef isfinite ++ #define isfinite(__y) \ ++ (__extension__ ({int __cy = fpclassify(__y); \ ++ __cy != FP_INFINITE && __cy != FP_NAN;})) ++#endif ++ ++/* Note: isinf and isnan were once functions in newlib that took double ++ * * arguments. C99 specifies that these names are reserved for macros ++ * * supporting multiple floating point types. Thus, they are ++ * * now defined as macros. Implementations of the old functions ++ * * taking double arguments still exist for compatibility purposes ++ * * (prototypes for them are in ). */ ++#ifndef isinf ++ #define isinf(y) (fpclassify(y) == FP_INFINITE) ++#endif ++ ++#ifndef isnan ++ #define isnan(y) (fpclassify(y) == FP_NAN) ++#endif ++ ++#define isnormal(y) (fpclassify(y) == FP_NORMAL) ++#define signbit(__x) \ ++ ((sizeof(__x) == sizeof(float)) ? __signbitf(__x) : \ ++ __signbitd(__x)) ++ ++#define isgreater(x,y) \ ++ (__extension__ ({__typeof__(x) __x = (x); __typeof__(y) __y = (y); \ ++ !isunordered(__x,__y) && (__x > __y);})) ++#define isgreaterequal(x,y) \ ++ (__extension__ ({__typeof__(x) __x = (x); __typeof__(y) __y = (y); \ ++ !isunordered(__x,__y) && (__x >= __y);})) ++#define isless(x,y) \ ++ (__extension__ ({__typeof__(x) __x = (x); __typeof__(y) __y = (y); \ ++ !isunordered(__x,__y) && (__x < __y);})) ++#define islessequal(x,y) \ ++ (__extension__ ({__typeof__(x) __x = (x); __typeof__(y) __y = (y); \ ++ !isunordered(__x,__y) && (__x <= __y);})) ++#define islessgreater(x,y) \ ++ (__extension__ ({__typeof__(x) __x = (x); __typeof__(y) __y = (y); \ ++ !isunordered(__x,__y) && (__x < __y || __x > __y);})) ++ ++#define isunordered(a,b) \ ++ (__extension__ ({__typeof__(a) __a = (a); __typeof__(b) __b = (b); \ ++ fpclassify(__a) == FP_NAN || fpclassify(__b) == FP_NAN;})) ++ ++/* Non ANSI double precision functions. */ ++ ++extern double infinity _PARAMS((void)); ++extern double nan _PARAMS((const char *)); ++extern int finite _PARAMS((double)); ++extern double copysign _PARAMS((double, double)); ++extern double logb _PARAMS((double)); ++extern int ilogb _PARAMS((double)); ++ ++extern double asinh _PARAMS((double)); ++extern double cbrt _PARAMS((double)); ++extern double nextafter _PARAMS((double, double)); ++extern double rint _PARAMS((double)); ++extern double scalbn _PARAMS((double, int)); ++ ++extern double exp2 _PARAMS((double)); ++extern double scalbln _PARAMS((double, long int)); ++extern double tgamma _PARAMS((double)); ++extern double nearbyint _PARAMS((double)); ++extern long int lrint _PARAMS((double)); ++extern _LONG_LONG_TYPE int llrint _PARAMS((double)); ++extern double round _PARAMS((double)); ++extern long int lround _PARAMS((double)); ++extern long long int llround _PARAMS((double)); ++extern double trunc _PARAMS((double)); ++extern double remquo _PARAMS((double, double, int *)); ++extern double fdim _PARAMS((double, double)); ++extern double fmax _PARAMS((double, double)); ++extern double fmin _PARAMS((double, double)); ++extern double fma _PARAMS((double, double, double)); ++ ++#ifndef __math_68881 ++extern double log1p _PARAMS((double)); ++extern double expm1 _PARAMS((double)); ++#endif /* ! defined (__math_68881) */ ++ ++#ifndef _REENT_ONLY ++extern double acosh _PARAMS((double)); ++extern double atanh _PARAMS((double)); ++extern double remainder _PARAMS((double, double)); ++extern double gamma _PARAMS((double)); ++extern double lgamma _PARAMS((double)); ++extern double erf _PARAMS((double)); ++extern double erfc _PARAMS((double)); ++extern double log2 _PARAMS((double)); ++ ++#ifndef __math_68881 ++extern double hypot _PARAMS((double, double)); ++#endif ++ ++#endif /* ! defined (_REENT_ONLY) */ ++ ++/* Single precision versions of ANSI functions. */ ++ ++extern float atanf _PARAMS((float)); ++extern float cosf _PARAMS((float)); ++extern float sinf _PARAMS((float)); ++extern float tanf _PARAMS((float)); ++extern float tanhf _PARAMS((float)); ++extern float frexpf _PARAMS((float, int *)); ++extern float modff _PARAMS((float, float *)); ++extern float ceilf _PARAMS((float)); ++extern float fabsf _PARAMS((float)); ++extern float floorf _PARAMS((float)); ++ ++#ifndef _REENT_ONLY ++extern float acosf _PARAMS((float)); ++extern float asinf _PARAMS((float)); ++extern float atan2f _PARAMS((float, float)); ++extern float coshf _PARAMS((float)); ++extern float sinhf _PARAMS((float)); ++extern float expf _PARAMS((float)); ++extern float ldexpf _PARAMS((float, int)); ++extern float logf _PARAMS((float)); ++extern float log10f _PARAMS((float)); ++extern float powf _PARAMS((float, float)); ++extern float sqrtf _PARAMS((float)); ++extern float fmodf _PARAMS((float, float)); ++#endif /* ! defined (_REENT_ONLY) */ ++ ++/* Other single precision functions. */ ++ ++extern float exp2f _PARAMS((float)); ++extern float scalblnf _PARAMS((float, long int)); ++extern float tgammaf _PARAMS((float)); ++extern float nearbyintf _PARAMS((float)); ++extern long int lrintf _PARAMS((float)); ++extern _LONG_LONG_TYPE llrintf _PARAMS((float)); ++extern float roundf _PARAMS((float)); ++extern long int lroundf _PARAMS((float)); ++extern long long int llroundf _PARAMS((float)); ++extern float truncf _PARAMS((float)); ++extern float remquof _PARAMS((float, float, int *)); ++extern float fdimf _PARAMS((float, float)); ++extern float fmaxf _PARAMS((float, float)); ++extern float fminf _PARAMS((float, float)); ++extern float fmaf _PARAMS((float, float, float)); ++ ++extern float infinityf _PARAMS((void)); ++extern float nanf _PARAMS((const char *)); ++extern int finitef _PARAMS((float)); ++extern float copysignf _PARAMS((float, float)); ++extern float logbf _PARAMS((float)); ++extern int ilogbf _PARAMS((float)); ++ ++extern float asinhf _PARAMS((float)); ++extern float cbrtf _PARAMS((float)); ++extern float nextafterf _PARAMS((float, float)); ++extern float rintf _PARAMS((float)); ++extern float scalbnf _PARAMS((float, int)); ++extern float log1pf _PARAMS((float)); ++extern float expm1f _PARAMS((float)); ++ ++#ifndef _REENT_ONLY ++extern float acoshf _PARAMS((float)); ++extern float atanhf _PARAMS((float)); ++extern float remainderf _PARAMS((float, float)); ++extern float gammaf _PARAMS((float)); ++extern float lgammaf _PARAMS((float)); ++extern float erff _PARAMS((float)); ++extern float erfcf _PARAMS((float)); ++extern float log2f _PARAMS((float)); ++extern float hypotf _PARAMS((float, float)); ++#endif /* ! defined (_REENT_ONLY) */ ++ ++/* On platforms where long double equals double. */ ++#ifdef _LDBL_EQ_DBL ++/* Reentrant ANSI C functions. */ ++#ifndef __math_68881 ++extern long double atanl _PARAMS((long double)); ++extern long double cosl _PARAMS((long double)); ++extern long double sinl _PARAMS((long double)); ++extern long double tanl _PARAMS((long double)); ++extern long double tanhl _PARAMS((long double)); ++extern long double frexpl _PARAMS((long double value, int *)); ++extern long double modfl _PARAMS((long double, long double *)); ++extern long double ceill _PARAMS((long double)); ++extern long double fabsl _PARAMS((long double)); ++extern long double floorl _PARAMS((long double)); ++extern long double log1pl _PARAMS((long double)); ++extern long double expm1l _PARAMS((long double)); ++#endif /* ! defined (__math_68881) */ ++/* Non reentrant ANSI C functions. */ ++#ifndef _REENT_ONLY ++#ifndef __math_68881 ++extern long double acosl _PARAMS((long double)); ++extern long double asinl _PARAMS((long double)); ++extern long double atan2l _PARAMS((long double, long double)); ++extern long double coshl _PARAMS((long double)); ++extern long double sinhl _PARAMS((long double)); ++extern long double expl _PARAMS((long double)); ++extern long double ldexpl _PARAMS((long double, int)); ++extern long double logl _PARAMS((long double)); ++extern long double log2l _PARAMS((long double)); ++extern long double log10l _PARAMS((long double)); ++extern long double powl _PARAMS((long double, long double)); ++extern long double sqrtl _PARAMS((long double)); ++extern long double fmodl _PARAMS((long double, long double)); ++extern long double hypotl _PARAMS((long double, long double)); ++#endif /* ! defined (__math_68881) */ ++#endif /* ! defined (_REENT_ONLY) */ ++extern long double copysignl _PARAMS((long double, long double)); ++extern long double nanl _PARAMS((const char *)); ++extern int ilogbl _PARAMS((long double)); ++extern long double asinhl _PARAMS((long double)); ++extern long double cbrtl _PARAMS((long double)); ++extern long double nextafterl _PARAMS((long double, long double)); ++extern long double rintl _PARAMS((long double)); ++extern long double scalbnl _PARAMS((long double, int)); ++extern long double exp2l _PARAMS((long double)); ++extern long double scalblnl _PARAMS((long double, long)); ++extern long double tgammal _PARAMS((long double)); ++extern long double nearbyintl _PARAMS((long double)); ++extern long int lrintl _PARAMS((long double)); ++extern long long int llrintl _PARAMS((long double)); ++extern long double roundl _PARAMS((long double)); ++extern long lroundl _PARAMS((long double)); ++extern _LONG_LONG_TYPE int llroundl _PARAMS((long double)); ++extern long double truncl _PARAMS((long double)); ++extern long double remquol _PARAMS((long double, long double, int *)); ++extern long double fdiml _PARAMS((long double, long double)); ++extern long double fmaxl _PARAMS((long double, long double)); ++extern long double fminl _PARAMS((long double, long double)); ++extern long double fmal _PARAMS((long double, long double, long double)); ++#ifndef _REENT_ONLY ++extern long double acoshl _PARAMS((long double)); ++extern long double atanhl _PARAMS((long double)); ++extern long double remainderl _PARAMS((long double, long double)); ++extern long double lgammal _PARAMS((long double)); ++extern long double erfl _PARAMS((long double)); ++extern long double erfcl _PARAMS((long double)); ++#endif /* ! defined (_REENT_ONLY) */ ++#else /* !_LDBL_EQ_DBL */ ++#ifdef __i386__ ++/* Other long double precision functions. */ ++extern _LONG_DOUBLE rintl _PARAMS((_LONG_DOUBLE)); ++extern long int lrintl _PARAMS((_LONG_DOUBLE)); ++extern _LONG_LONG_TYPE llrintl _PARAMS((_LONG_DOUBLE)); ++#endif /* __i386__ */ ++#endif /* !_LDBL_EQ_DBL */ ++ ++#endif /* !defined (__STRICT_ANSI__) || defined(__cplusplus) || __STDC_VERSION__ >= 199901L */ ++ ++#if !defined (__STRICT_ANSI__) || defined(__cplusplus) ++ ++extern double drem _PARAMS((double, double)); ++extern void sincos _PARAMS((double, double *, double *)); ++extern double gamma_r _PARAMS((double, int *)); ++extern double lgamma_r _PARAMS((double, int *)); ++ ++extern double y0 _PARAMS((double)); ++extern double y1 _PARAMS((double)); ++extern double yn _PARAMS((int, double)); ++extern double j0 _PARAMS((double)); ++extern double j1 _PARAMS((double)); ++extern double jn _PARAMS((int, double)); ++ ++extern float dremf _PARAMS((float, float)); ++extern void sincosf _PARAMS((float, float *, float *)); ++extern float gammaf_r _PARAMS((float, int *)); ++extern float lgammaf_r _PARAMS((float, int *)); ++ ++extern float y0f _PARAMS((float)); ++extern float y1f _PARAMS((float)); ++extern float ynf _PARAMS((int, float)); ++extern float j0f _PARAMS((float)); ++extern float j1f _PARAMS((float)); ++extern float jnf _PARAMS((int, float)); ++ ++/* GNU extensions */ ++# ifndef exp10 ++extern double exp10 _PARAMS((double)); ++# endif ++# ifndef pow10 ++extern double pow10 _PARAMS((double)); ++# endif ++# ifndef exp10f ++extern float exp10f _PARAMS((float)); ++# endif ++# ifndef pow10f ++extern float pow10f _PARAMS((float)); ++# endif ++ ++#endif /* !defined (__STRICT_ANSI__) || defined(__cplusplus) */ ++ ++#ifndef __STRICT_ANSI__ ++ ++/* The gamma functions use a global variable, signgam. */ ++#ifndef _REENT_ONLY ++#define signgam (*__signgam()) ++extern int *__signgam _PARAMS((void)); ++#endif /* ! defined (_REENT_ONLY) */ ++ ++#define __signgam_r(ptr) _REENT_SIGNGAM(ptr) ++ ++/* The exception structure passed to the matherr routine. */ ++/* We have a problem when using C++ since `exception' is a reserved ++ * name in C++. */ ++#ifdef __cplusplus ++struct __exception ++#else ++struct exception ++#endif ++{ ++ int type; ++ char *name; ++ double arg1; ++ double arg2; ++ double retval; ++ int err; ++}; ++ ++#ifdef __cplusplus ++extern int matherr _PARAMS((struct __exception *e)); ++#else ++extern int matherr _PARAMS((struct exception *e)); ++#endif ++ ++/* Values for the type field of struct exception. */ ++ ++#define DOMAIN 1 ++#define SING 2 ++#define OVERFLOW 3 ++#define UNDERFLOW 4 ++#define TLOSS 5 ++#define PLOSS 6 ++ ++/* Useful constants. */ ++ ++#define MAXFLOAT 3.40282347e+38F ++ ++#define M_E 2.7182818284590452354 ++#define M_LOG2E 1.4426950408889634074 ++#define M_LOG10E 0.43429448190325182765 ++#define M_LN2 _M_LN2 ++#define M_LN10 2.30258509299404568402 ++#define M_PI 3.14159265358979323846 ++#define M_TWOPI (M_PI * 2.0) ++#define M_PI_2 1.57079632679489661923 ++#define M_PI_4 0.78539816339744830962 ++#define M_3PI_4 2.3561944901923448370E0 ++#define M_SQRTPI 1.77245385090551602792981 ++#define M_1_PI 0.31830988618379067154 ++#define M_2_PI 0.63661977236758134308 ++#define M_2_SQRTPI 1.12837916709551257390 ++#define M_DEG_TO_RAD 0.01745329251994 ++#define M_RAD_TO_DEG 57.2957795130823 ++#define M_SQRT2 1.41421356237309504880 ++#define M_SQRT1_2 0.70710678118654752440 ++#define M_LN2LO 1.9082149292705877000E-10 ++#define M_LN2HI 6.9314718036912381649E-1 ++#define M_SQRT3 1.73205080756887719000 ++#define M_IVLN10 0.43429448190325182765 /* 1 / log(10) */ ++#define M_LOG2_E _M_LN2 ++#define M_INVLN2 1.4426950408889633870E0 /* 1 / log(2) */ ++ ++ ++#define M_E_F 2.7182818284590452354f ++#define M_LOG2E_F 1.4426950408889634074f ++#define M_LOG10E_F 0.43429448190325182765f ++#define M_LN2_F _M_LN2_F ++#define M_LN10_F 2.30258509299404568402f ++#define M_PI_F 3.14159265358979323846f ++#define M_TWOPI_F (M_PI_F * 2.0f) ++#define M_PI_2_F 1.57079632679489661923f ++#define M_PI_4_F 0.78539816339744830962f ++#define M_3PI_4_F 2.3561944901923448370E0f ++#define M_SQRTPI_F 1.77245385090551602792981f ++#define M_1_PI_F 0.31830988618379067154f ++#define M_2_PI_F 0.63661977236758134308f ++#define M_2_SQRTPI_F 1.12837916709551257390f ++#define M_DEG_TO_RAD_F 0.01745329251994f ++#define M_RAD_TO_DEG_F 57.2957795130823f ++#define M_SQRT2_F 1.41421356237309504880f ++#define M_SQRT1_2_F 0.70710678118654752440f ++#define M_LN2LO_F 1.9082149292705877000E-10f ++#define M_LN2HI_F 6.9314718036912381649E-1f ++#define M_SQRT3_F 1.73205080756887719000f ++#define M_IVLN10_F 0.43429448190325182765f /* 1 / log(10) */ ++#define M_LOG2_E_F _M_LN2_F ++#define M_INVLN2_F 1.4426950408889633870E0f /* 1 / log(2) */ ++ ++/* Global control over fdlibm error handling. */ ++ ++enum __fdlibm_version ++{ ++ __fdlibm_ieee = -1, ++ __fdlibm_svid, ++ __fdlibm_xopen, ++ __fdlibm_posix ++}; ++ ++#define _LIB_VERSION_TYPE enum __fdlibm_version ++#define _LIB_VERSION __fdlib_version ++ ++extern __IMPORT _LIB_VERSION_TYPE _LIB_VERSION; ++ ++#define _IEEE_ __fdlibm_ieee ++#define _SVID_ __fdlibm_svid ++#define _XOPEN_ __fdlibm_xopen ++#define _POSIX_ __fdlibm_posix ++ ++#endif /* ! defined (__STRICT_ANSI__) */ ++ ++_END_STD_C ++ ++#ifdef __FAST_MATH__ ++#include ++#endif ++ ++#endif /* _MATH_H_ */ diff --git a/nuttx-patches/math.patch b/nuttx-patches/math.patch deleted file mode 100644 index a93b2daf6..000000000 --- a/nuttx-patches/math.patch +++ /dev/null @@ -1,590 +0,0 @@ -diff -ruN NuttX/nuttx/arch/arm/include/math.h NuttX/nuttx/arch/arm/include/math.h ---- NuttX/nuttx/arch/arm/include/math.h 2014-12-25 06:02:40.565856919 -1000 -+++ NuttX/nuttx/arch/arm/include/math.h 1969-12-31 14:00:00.000000000 -1000 -@@ -1,585 +0,0 @@ --#ifndef _MATH_H_ -- --#define _MATH_H_ -- --#include --#include "_ansi.h" -- --_BEGIN_STD_C -- --/* Natural log of 2 */ --#define _M_LN2 0.693147180559945309417 -- --#if defined(__GNUC__) && \ -- ( (__GNUC__ >= 4) || \ -- ( (__GNUC__ >= 3) && defined(__GNUC_MINOR__) && (__GNUC_MINOR__ >= 3) ) ) -- -- /* gcc >= 3.3 implicitly defines builtins for HUGE_VALx values. */ -- --# ifndef HUGE_VAL --# define HUGE_VAL (__builtin_huge_val()) --# endif -- --# ifndef HUGE_VALF --# define HUGE_VALF (__builtin_huge_valf()) --# endif -- --# ifndef HUGE_VALL --# define HUGE_VALL (__builtin_huge_vall()) --# endif -- --# ifndef INFINITY --# define INFINITY (__builtin_inff()) --# endif -- --# ifndef NAN --# define NAN (__builtin_nanf("")) --# endif -- --#else /* !gcc >= 3.3 */ -- -- /* No builtins. Use fixed defines instead. (All 3 HUGE plus the INFINITY -- * and NAN macros are required to be constant expressions. Using a variable-- -- * even a static const--does not meet this requirement, as it cannot be -- * evaluated at translation time.) -- * The infinities are done using numbers that are far in excess of -- * something that would be expected to be encountered in a floating-point -- * implementation. (A more certain way uses values from float.h, but that is -- * avoided because system includes are not supposed to include each other.) -- * This method might produce warnings from some compilers. (It does in -- * newer GCCs, but not for ones that would hit this #else.) If this happens, -- * please report details to the Newlib mailing list. */ -- -- #ifndef HUGE_VAL -- #define HUGE_VAL (1.0e999999999) -- #endif -- -- #ifndef HUGE_VALF -- #define HUGE_VALF (1.0e999999999F) -- #endif -- -- #if !defined(HUGE_VALL) && defined(_HAVE_LONG_DOUBLE) -- #define HUGE_VALL (1.0e999999999L) -- #endif -- -- #if !defined(INFINITY) -- #define INFINITY (HUGE_VALF) -- #endif -- -- #if !defined(NAN) -- #if defined(__GNUC__) && defined(__cplusplus) -- /* Exception: older g++ versions warn about the divide by 0 used in the -- * normal case (even though older gccs do not). This trick suppresses the -- * warning, but causes errors for plain gcc, so is only used in the one -- * special case. */ -- static const union { __ULong __i[1]; float __d; } __Nanf = {0x7FC00000}; -- #define NAN (__Nanf.__d) -- #else -- #define NAN (0.0F/0.0F) -- #endif -- #endif -- --#endif /* !gcc >= 3.3 */ -- --/* Reentrant ANSI C functions. */ -- --#ifndef __math_68881 --extern double atan _PARAMS((double)); --extern double cos _PARAMS((double)); --extern double sin _PARAMS((double)); --extern double tan _PARAMS((double)); --extern double tanh _PARAMS((double)); --extern double frexp _PARAMS((double, int *)); --extern double modf _PARAMS((double, double *)); --extern double ceil _PARAMS((double)); --extern double fabs _PARAMS((double)); --extern double floor _PARAMS((double)); --#endif /* ! defined (__math_68881) */ -- --/* Non reentrant ANSI C functions. */ -- --#ifndef _REENT_ONLY --#ifndef __math_68881 --extern double acos _PARAMS((double)); --extern double asin _PARAMS((double)); --extern double atan2 _PARAMS((double, double)); --extern double cosh _PARAMS((double)); --extern double sinh _PARAMS((double)); --extern double exp _PARAMS((double)); --extern double ldexp _PARAMS((double, int)); --extern double log _PARAMS((double)); --extern double log10 _PARAMS((double)); --extern double pow _PARAMS((double, double)); --extern double sqrt _PARAMS((double)); --extern double fmod _PARAMS((double, double)); --#endif /* ! defined (__math_68881) */ --#endif /* ! defined (_REENT_ONLY) */ -- --#if !defined(__STRICT_ANSI__) || defined(__cplusplus) || __STDC_VERSION__ >= 199901L -- --/* ISO C99 types and macros. */ -- --#ifndef FLT_EVAL_METHOD --#define FLT_EVAL_METHOD 0 --typedef float float_t; --typedef double double_t; --#endif /* FLT_EVAL_METHOD */ -- --#define FP_NAN 0 --#define FP_INFINITE 1 --#define FP_ZERO 2 --#define FP_SUBNORMAL 3 --#define FP_NORMAL 4 -- --#ifndef FP_ILOGB0 --# define FP_ILOGB0 (-INT_MAX) --#endif --#ifndef FP_ILOGBNAN --# define FP_ILOGBNAN INT_MAX --#endif -- --#ifndef MATH_ERRNO --# define MATH_ERRNO 1 --#endif --#ifndef MATH_ERREXCEPT --# define MATH_ERREXCEPT 2 --#endif --#ifndef math_errhandling --# define math_errhandling MATH_ERRNO --#endif -- --extern int __isinff (float x); --extern int __isinfd (double x); --extern int __isnanf (float x); --extern int __isnand (double x); --extern int __fpclassifyf (float x); --extern int __fpclassifyd (double x); --extern int __signbitf (float x); --extern int __signbitd (double x); -- --#define fpclassify(__x) \ -- ((sizeof(__x) == sizeof(float)) ? __fpclassifyf(__x) : \ -- __fpclassifyd(__x)) -- --#ifndef isfinite -- #define isfinite(__y) \ -- (__extension__ ({int __cy = fpclassify(__y); \ -- __cy != FP_INFINITE && __cy != FP_NAN;})) --#endif -- --/* Note: isinf and isnan were once functions in newlib that took double -- * arguments. C99 specifies that these names are reserved for macros -- * supporting multiple floating point types. Thus, they are -- * now defined as macros. Implementations of the old functions -- * taking double arguments still exist for compatibility purposes -- * (prototypes for them are in ). */ --#ifndef isinf -- #define isinf(y) (fpclassify(y) == FP_INFINITE) --#endif -- --#ifndef isnan -- #define isnan(y) (fpclassify(y) == FP_NAN) --#endif -- --#define isnormal(y) (fpclassify(y) == FP_NORMAL) --#define signbit(__x) \ -- ((sizeof(__x) == sizeof(float)) ? __signbitf(__x) : \ -- __signbitd(__x)) -- --#define isgreater(x,y) \ -- (__extension__ ({__typeof__(x) __x = (x); __typeof__(y) __y = (y); \ -- !isunordered(__x,__y) && (__x > __y);})) --#define isgreaterequal(x,y) \ -- (__extension__ ({__typeof__(x) __x = (x); __typeof__(y) __y = (y); \ -- !isunordered(__x,__y) && (__x >= __y);})) --#define isless(x,y) \ -- (__extension__ ({__typeof__(x) __x = (x); __typeof__(y) __y = (y); \ -- !isunordered(__x,__y) && (__x < __y);})) --#define islessequal(x,y) \ -- (__extension__ ({__typeof__(x) __x = (x); __typeof__(y) __y = (y); \ -- !isunordered(__x,__y) && (__x <= __y);})) --#define islessgreater(x,y) \ -- (__extension__ ({__typeof__(x) __x = (x); __typeof__(y) __y = (y); \ -- !isunordered(__x,__y) && (__x < __y || __x > __y);})) -- --#define isunordered(a,b) \ -- (__extension__ ({__typeof__(a) __a = (a); __typeof__(b) __b = (b); \ -- fpclassify(__a) == FP_NAN || fpclassify(__b) == FP_NAN;})) -- --/* Non ANSI double precision functions. */ -- --extern double infinity _PARAMS((void)); --extern double nan _PARAMS((const char *)); --extern int finite _PARAMS((double)); --extern double copysign _PARAMS((double, double)); --extern double logb _PARAMS((double)); --extern int ilogb _PARAMS((double)); -- --extern double asinh _PARAMS((double)); --extern double cbrt _PARAMS((double)); --extern double nextafter _PARAMS((double, double)); --extern double rint _PARAMS((double)); --extern double scalbn _PARAMS((double, int)); -- --extern double exp2 _PARAMS((double)); --extern double scalbln _PARAMS((double, long int)); --extern double tgamma _PARAMS((double)); --extern double nearbyint _PARAMS((double)); --extern long int lrint _PARAMS((double)); --extern long long int llrint _PARAMS((double)); --extern double round _PARAMS((double)); --extern long int lround _PARAMS((double)); --extern long long int llround _PARAMS((double)); --extern double trunc _PARAMS((double)); --extern double remquo _PARAMS((double, double, int *)); --extern double fdim _PARAMS((double, double)); --extern double fmax _PARAMS((double, double)); --extern double fmin _PARAMS((double, double)); --extern double fma _PARAMS((double, double, double)); -- --#ifndef __math_68881 --extern double log1p _PARAMS((double)); --extern double expm1 _PARAMS((double)); --#endif /* ! defined (__math_68881) */ -- --#ifndef _REENT_ONLY --extern double acosh _PARAMS((double)); --extern double atanh _PARAMS((double)); --extern double remainder _PARAMS((double, double)); --extern double gamma _PARAMS((double)); --extern double lgamma _PARAMS((double)); --extern double erf _PARAMS((double)); --extern double erfc _PARAMS((double)); --extern double log2 _PARAMS((double)); --#if !defined(__cplusplus) --#define log2(x) (log (x) / _M_LN2) --#endif -- --#ifndef __math_68881 --extern double hypot _PARAMS((double, double)); --#endif -- --#endif /* ! defined (_REENT_ONLY) */ -- --/* Single precision versions of ANSI functions. */ -- --extern float atanf _PARAMS((float)); --extern float cosf _PARAMS((float)); --extern float sinf _PARAMS((float)); --extern float tanf _PARAMS((float)); --extern float tanhf _PARAMS((float)); --extern float frexpf _PARAMS((float, int *)); --extern float modff _PARAMS((float, float *)); --extern float ceilf _PARAMS((float)); --extern float fabsf _PARAMS((float)); --extern float floorf _PARAMS((float)); -- --#ifndef _REENT_ONLY --extern float acosf _PARAMS((float)); --extern float asinf _PARAMS((float)); --extern float atan2f _PARAMS((float, float)); --extern float coshf _PARAMS((float)); --extern float sinhf _PARAMS((float)); --extern float expf _PARAMS((float)); --extern float ldexpf _PARAMS((float, int)); --extern float logf _PARAMS((float)); --extern float log10f _PARAMS((float)); --extern float powf _PARAMS((float, float)); --extern float sqrtf _PARAMS((float)); --extern float fmodf _PARAMS((float, float)); --#endif /* ! defined (_REENT_ONLY) */ -- --/* Other single precision functions. */ -- --extern float exp2f _PARAMS((float)); --extern float scalblnf _PARAMS((float, long int)); --extern float tgammaf _PARAMS((float)); --extern float nearbyintf _PARAMS((float)); --extern long int lrintf _PARAMS((float)); --extern long long llrintf _PARAMS((float)); --extern float roundf _PARAMS((float)); --extern long int lroundf _PARAMS((float)); --extern long long int llroundf _PARAMS((float)); --extern float truncf _PARAMS((float)); --extern float remquof _PARAMS((float, float, int *)); --extern float fdimf _PARAMS((float, float)); --extern float fmaxf _PARAMS((float, float)); --extern float fminf _PARAMS((float, float)); --extern float fmaf _PARAMS((float, float, float)); -- --extern float infinityf _PARAMS((void)); --extern float nanf _PARAMS((const char *)); --extern int finitef _PARAMS((float)); --extern float copysignf _PARAMS((float, float)); --extern float logbf _PARAMS((float)); --extern int ilogbf _PARAMS((float)); -- --extern float asinhf _PARAMS((float)); --extern float cbrtf _PARAMS((float)); --extern float nextafterf _PARAMS((float, float)); --extern float rintf _PARAMS((float)); --extern float scalbnf _PARAMS((float, int)); --extern float log1pf _PARAMS((float)); --extern float expm1f _PARAMS((float)); -- --#ifndef _REENT_ONLY --extern float acoshf _PARAMS((float)); --extern float atanhf _PARAMS((float)); --extern float remainderf _PARAMS((float, float)); --extern float gammaf _PARAMS((float)); --extern float lgammaf _PARAMS((float)); --extern float erff _PARAMS((float)); --extern float erfcf _PARAMS((float)); --extern float log2f _PARAMS((float)); --#if !defined(__cplusplus) --#define log2f(x) (logf (x) / (float_t) _M_LN2) --#endif --extern float hypotf _PARAMS((float, float)); --#endif /* ! defined (_REENT_ONLY) */ -- --/* On platforms where long double equals double. */ --#ifdef _LDBL_EQ_DBL --/* Reentrant ANSI C functions. */ --#ifndef __math_68881 --extern long double atanl _PARAMS((long double)); --extern long double cosl _PARAMS((long double)); --extern long double sinl _PARAMS((long double)); --extern long double tanl _PARAMS((long double)); --extern long double tanhl _PARAMS((long double)); --extern long double frexpl _PARAMS((long double value, int *)); --extern long double modfl _PARAMS((long double, long double *)); --extern long double ceill _PARAMS((long double)); --extern long double fabsl _PARAMS((long double)); --extern long double floorl _PARAMS((long double)); --extern long double log1pl _PARAMS((long double)); --extern long double expm1l _PARAMS((long double)); --#endif /* ! defined (__math_68881) */ --/* Non reentrant ANSI C functions. */ --#ifndef _REENT_ONLY --#ifndef __math_68881 --extern long double acosl _PARAMS((long double)); --extern long double asinl _PARAMS((long double)); --extern long double atan2l _PARAMS((long double, long double)); --extern long double coshl _PARAMS((long double)); --extern long double sinhl _PARAMS((long double)); --extern long double expl _PARAMS((long double)); --extern long double ldexpl _PARAMS((long double, int)); --extern long double logl _PARAMS((long double)); --extern long double log2l _PARAMS((long double)); --extern long double log10l _PARAMS((long double)); --extern long double powl _PARAMS((long double, long double)); --extern long double sqrtl _PARAMS((long double)); --extern long double fmodl _PARAMS((long double, long double)); --extern long double hypotl _PARAMS((long double, long double)); --#endif /* ! defined (__math_68881) */ --#endif /* ! defined (_REENT_ONLY) */ --extern long double copysignl _PARAMS((long double, long double)); --extern long double nanl _PARAMS((const char *)); --extern int ilogbl _PARAMS((long double)); --extern long double asinhl _PARAMS((long double)); --extern long double cbrtl _PARAMS((long double)); --extern long double nextafterl _PARAMS((long double, long double)); --extern long double rintl _PARAMS((long double)); --extern long double scalbnl _PARAMS((long double, int)); --extern long double exp2l _PARAMS((long double)); --extern long double scalblnl _PARAMS((long double, long)); --extern long double tgammal _PARAMS((long double)); --extern long double nearbyintl _PARAMS((long double)); --extern long int lrintl _PARAMS((long double)); --extern long long int llrintl _PARAMS((long double)); --extern long double roundl _PARAMS((long double)); --extern long lroundl _PARAMS((long double)); --extern long long int llroundl _PARAMS((long double)); --extern long double truncl _PARAMS((long double)); --extern long double remquol _PARAMS((long double, long double, int *)); --extern long double fdiml _PARAMS((long double, long double)); --extern long double fmaxl _PARAMS((long double, long double)); --extern long double fminl _PARAMS((long double, long double)); --extern long double fmal _PARAMS((long double, long double, long double)); --#ifndef _REENT_ONLY --extern long double acoshl _PARAMS((long double)); --extern long double atanhl _PARAMS((long double)); --extern long double remainderl _PARAMS((long double, long double)); --extern long double lgammal _PARAMS((long double)); --extern long double erfl _PARAMS((long double)); --extern long double erfcl _PARAMS((long double)); --#endif /* ! defined (_REENT_ONLY) */ --#else /* !_LDBL_EQ_DBL */ --#ifdef __i386__ --/* Other long double precision functions. */ --extern _LONG_DOUBLE rintl _PARAMS((_LONG_DOUBLE)); --extern long int lrintl _PARAMS((_LONG_DOUBLE)); --extern long long llrintl _PARAMS((_LONG_DOUBLE)); --#endif /* __i386__ */ --#endif /* !_LDBL_EQ_DBL */ -- --#endif /* !defined (__STRICT_ANSI__) || defined(__cplusplus) || __STDC_VERSION__ >= 199901L */ -- --#if !defined (__STRICT_ANSI__) || defined(__cplusplus) -- --extern double drem _PARAMS((double, double)); --extern void sincos _PARAMS((double, double *, double *)); --extern double gamma_r _PARAMS((double, int *)); --extern double lgamma_r _PARAMS((double, int *)); -- --extern double y0 _PARAMS((double)); --extern double y1 _PARAMS((double)); --extern double yn _PARAMS((int, double)); --extern double j0 _PARAMS((double)); --extern double j1 _PARAMS((double)); --extern double jn _PARAMS((int, double)); -- --extern float dremf _PARAMS((float, float)); --extern void sincosf _PARAMS((float, float *, float *)); --extern float gammaf_r _PARAMS((float, int *)); --extern float lgammaf_r _PARAMS((float, int *)); -- --extern float y0f _PARAMS((float)); --extern float y1f _PARAMS((float)); --extern float ynf _PARAMS((int, float)); --extern float j0f _PARAMS((float)); --extern float j1f _PARAMS((float)); --extern float jnf _PARAMS((int, float)); -- --/* GNU extensions */ --# ifndef exp10 --extern double exp10 _PARAMS((double)); --# endif --# ifndef pow10 --extern double pow10 _PARAMS((double)); --# endif --# ifndef exp10f --extern float exp10f _PARAMS((float)); --# endif --# ifndef pow10f --extern float pow10f _PARAMS((float)); --# endif -- --#endif /* !defined (__STRICT_ANSI__) || defined(__cplusplus) */ -- --#ifndef __STRICT_ANSI__ -- --/* The gamma functions use a global variable, signgam. */ --#ifndef _REENT_ONLY --#define signgam (*__signgam()) --extern int *__signgam _PARAMS((void)); --#endif /* ! defined (_REENT_ONLY) */ -- --#define __signgam_r(ptr) _REENT_SIGNGAM(ptr) -- --/* The exception structure passed to the matherr routine. */ --/* We have a problem when using C++ since `exception' is a reserved -- name in C++. */ --#ifdef __cplusplus --struct __exception --#else --struct exception --#endif --{ -- int type; -- char *name; -- double arg1; -- double arg2; -- double retval; -- int err; --}; -- --#ifdef __cplusplus --extern int matherr _PARAMS((struct __exception *e)); --#else --extern int matherr _PARAMS((struct exception *e)); --#endif -- --/* Values for the type field of struct exception. */ -- --#define DOMAIN 1 --#define SING 2 --#define OVERFLOW 3 --#define UNDERFLOW 4 --#define TLOSS 5 --#define PLOSS 6 -- --/* Useful constants. */ -- --#define MAXFLOAT 3.40282347e+38F -- --#define M_E 2.7182818284590452354 --#define M_LOG2E 1.4426950408889634074 --#define M_LOG10E 0.43429448190325182765 --#define M_LN2 _M_LN2 --#define M_LN10 2.30258509299404568402 --#define M_PI 3.14159265358979323846 --#define M_TWOPI (M_PI * 2.0) --#define M_PI_2 1.57079632679489661923 --#define M_PI_4 0.78539816339744830962 --#define M_3PI_4 2.3561944901923448370E0 --#define M_SQRTPI 1.77245385090551602792981 --#define M_1_PI 0.31830988618379067154 --#define M_2_PI 0.63661977236758134308 --#define M_2_SQRTPI 1.12837916709551257390 --#define M_DEG_TO_RAD 0.01745329251994 --#define M_RAD_TO_DEG 57.2957795130823 --#define M_SQRT2 1.41421356237309504880 --#define M_SQRT1_2 0.70710678118654752440 --#define M_LN2LO 1.9082149292705877000E-10 --#define M_LN2HI 6.9314718036912381649E-1 --#define M_SQRT3 1.73205080756887719000 --#define M_IVLN10 0.43429448190325182765 /* 1 / log(10) */ --#define M_LOG2_E _M_LN2 --#define M_INVLN2 1.4426950408889633870E0 /* 1 / log(2) */ -- -- --#define M_E_F 2.7182818284590452354f --#define M_LOG2E_F 1.4426950408889634074f --#define M_LOG10E_F 0.43429448190325182765f --#define M_LN2_F _M_LN2_F --#define M_LN10_F 2.30258509299404568402f --#define M_PI_F 3.14159265358979323846f --#define M_TWOPI_F (M_PI_F * 2.0f) --#define M_PI_2_F 1.57079632679489661923f --#define M_PI_4_F 0.78539816339744830962f --#define M_3PI_4_F 2.3561944901923448370E0f --#define M_SQRTPI_F 1.77245385090551602792981f --#define M_1_PI_F 0.31830988618379067154f --#define M_2_PI_F 0.63661977236758134308f --#define M_2_SQRTPI_F 1.12837916709551257390f --#define M_DEG_TO_RAD_F 0.01745329251994f --#define M_RAD_TO_DEG_F 57.2957795130823f --#define M_SQRT2_F 1.41421356237309504880f --#define M_SQRT1_2_F 0.70710678118654752440f --#define M_LN2LO_F 1.9082149292705877000E-10f --#define M_LN2HI_F 6.9314718036912381649E-1f --#define M_SQRT3_F 1.73205080756887719000f --#define M_IVLN10_F 0.43429448190325182765f /* 1 / log(10) */ --#define M_LOG2_E_F _M_LN2_F --#define M_INVLN2_F 1.4426950408889633870E0f /* 1 / log(2) */ -- --/* Global control over fdlibm error handling. */ -- --enum __fdlibm_version --{ -- __fdlibm_ieee = -1, -- __fdlibm_svid, -- __fdlibm_xopen, -- __fdlibm_posix --}; -- --#define _LIB_VERSION_TYPE enum __fdlibm_version --#define _LIB_VERSION __fdlib_version -- --extern __IMPORT _LIB_VERSION_TYPE _LIB_VERSION; -- --#define _IEEE_ __fdlibm_ieee --#define _SVID_ __fdlibm_svid --#define _XOPEN_ __fdlibm_xopen --#define _POSIX_ __fdlibm_posix -- --#endif /* ! defined (__STRICT_ANSI__) */ -- --_END_STD_C -- --#ifdef __FAST_MATH__ --#include --#endif -- --#endif /* _MATH_H_ */ -\ No newline at end of file -- cgit v1.2.3 From f19ce380157b08b836365de8e8e7ab05632be249 Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Fri, 26 Dec 2014 13:27:47 -1000 Subject: repointed NuttX submodule --- .gitmodules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitmodules b/.gitmodules index c869803b7..926453587 100644 --- a/.gitmodules +++ b/.gitmodules @@ -3,7 +3,7 @@ url = git://github.com/mavlink/c_library.git [submodule "NuttX"] path = NuttX - url = git://github.com/PX4/NuttX.git + url = git://github.com/PX4-Works/NuttX.git [submodule "uavcan"] path = src/lib/uavcan url = git://github.com/pavel-kirienko/uavcan.git -- cgit v1.2.3 From 5078f3a914b5a2640d5f109ee980ecfb2a76d000 Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Fri, 26 Dec 2014 15:22:56 -1000 Subject: Update configs with latest upstream setting --- nuttx-configs/px4fmu-v1/nsh/defconfig | 7 +++---- nuttx-configs/px4fmu-v2/nsh/defconfig | 3 --- nuttx-configs/px4io-v1/nsh/defconfig | 1 + 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/nuttx-configs/px4fmu-v1/nsh/defconfig b/nuttx-configs/px4fmu-v1/nsh/defconfig index 302066584..bca2c1134 100644 --- a/nuttx-configs/px4fmu-v1/nsh/defconfig +++ b/nuttx-configs/px4fmu-v1/nsh/defconfig @@ -256,10 +256,6 @@ CONFIG_STM32_DMACAPABLE=y # CONFIG_STM32_TIM4_ADC is not set # CONFIG_STM32_TIM5_ADC is not set CONFIG_STM32_USART=y -CONFIG_STM32_FLOWCONTROL_BROKEN=y -CONFIG_SERIAL_IFLOWCONTROL_DEASSERT_WATERMARK=16 -CONFIG_SERIAL_IFLOWCONTROL_ASSERT_WATERMARK=32 - # # U[S]ART Configuration @@ -291,6 +287,7 @@ CONFIG_STM32_USART_SINGLEWIRE=y # CONFIG_STM32_I2C_DYNTIMEO is not set CONFIG_STM32_I2CTIMEOSEC=0 CONFIG_STM32_I2CTIMEOMS=10 +CONFIG_STM32_I2CTIMEOTICKS=10 # CONFIG_STM32_I2C_DUTY16_9 is not set # @@ -500,6 +497,8 @@ CONFIG_MTD_BYTE_WRITE=y # CONFIG_MTD_M25P is not set # CONFIG_MTD_SMART is not set # CONFIG_MTD_RAMTRON is not set +CONFIG_RAMTRON_WRITEWAIT=y +CONFIG_RAMTRON_SETSPEED=y # CONFIG_MTD_SST25 is not set # CONFIG_MTD_SST39FV is not set # CONFIG_MTD_W25 is not set diff --git a/nuttx-configs/px4fmu-v2/nsh/defconfig b/nuttx-configs/px4fmu-v2/nsh/defconfig index 164aca32d..23db04547 100644 --- a/nuttx-configs/px4fmu-v2/nsh/defconfig +++ b/nuttx-configs/px4fmu-v2/nsh/defconfig @@ -280,9 +280,6 @@ CONFIG_STM32_DISABLE_IDLE_SLEEP_DURING_DEBUG=y # CONFIG_ARCH_BOARD_STM32_CUSTOM_CLOCKCONFIG is not set # CONFIG_STM32_CCMEXCLUDE is not set CONFIG_STM32_DMACAPABLE=y -CONFIG_STM32_FLOWCONTROL_BROKEN=y -CONFIG_SERIAL_IFLOWCONTROL_DEASSERT_WATERMARK=16 -CONFIG_SERIAL_IFLOWCONTROL_ASSERT_WATERMARK=32 # CONFIG_STM32_TIM1_PWM is not set # CONFIG_STM32_TIM3_PWM is not set # CONFIG_STM32_TIM4_PWM is not set diff --git a/nuttx-configs/px4io-v1/nsh/defconfig b/nuttx-configs/px4io-v1/nsh/defconfig index a03166478..29d45fbe9 100755 --- a/nuttx-configs/px4io-v1/nsh/defconfig +++ b/nuttx-configs/px4io-v1/nsh/defconfig @@ -136,6 +136,7 @@ CONFIG_STM32_I2C1=y CONFIG_STM32_I2C2=n CONFIG_STM32_I2CTIMEOSEC=0 CONFIG_STM32_I2CTIMEOMS=1 +CONFIG_STM32_I2CTIMEOTICKS=1 CONFIG_STM32_BKP=n CONFIG_STM32_PWR=n CONFIG_STM32_DAC=n -- cgit v1.2.3 From 3c9f6db5ed8e2ac2501ccd780b7ef172b32feee1 Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Sat, 27 Dec 2014 13:57:27 -1000 Subject: Updated Configs to use the new handshake thresholds --- nuttx-configs/px4fmu-v1/nsh/defconfig | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/nuttx-configs/px4fmu-v1/nsh/defconfig b/nuttx-configs/px4fmu-v1/nsh/defconfig index bca2c1134..842993532 100644 --- a/nuttx-configs/px4fmu-v1/nsh/defconfig +++ b/nuttx-configs/px4fmu-v1/nsh/defconfig @@ -273,6 +273,7 @@ CONFIG_USART6_RXDMA=y # CONFIG_USART7_RXDMA is not set # CONFIG_USART8_RXDMA is not set CONFIG_SERIAL_DISABLE_REORDERING=y +CONFIG_STM32_FLOWCONTROL_BROKEN=y CONFIG_STM32_USART_SINGLEWIRE=y # @@ -552,6 +553,9 @@ CONFIG_USART6_2STOP=0 # CONFIG_USART6_OFLOWCONTROL is not set CONFIG_SERIAL_IFLOWCONTROL=y CONFIG_SERIAL_OFLOWCONTROL=y +CONFIG_SERIAL_IFLOWCONTROL_WATERMARKS=y +CONFIG_SERIAL_IFLOWCONTROL_LOWER_WATERMARK=10 +CONFIG_SERIAL_IFLOWCONTROL_UPPER_WATERMARK=90 CONFIG_USBDEV=y # -- cgit v1.2.3 From 29ad56037cc2c4b413962621bfa993d9020e5285 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Sun, 28 Dec 2014 21:07:42 +0100 Subject: Removed stale appconfig files --- nuttx-configs/aerocore/nsh/appconfig | 42 ---------------------------- nuttx-configs/px4fmu-v2/nsh/appconfig | 52 ----------------------------------- nuttx-configs/px4io-v1/nsh/appconfig | 32 --------------------- nuttx-configs/px4io-v2/nsh/appconfig | 32 --------------------- 4 files changed, 158 deletions(-) delete mode 100644 nuttx-configs/aerocore/nsh/appconfig delete mode 100644 nuttx-configs/px4fmu-v2/nsh/appconfig delete mode 100644 nuttx-configs/px4io-v1/nsh/appconfig delete mode 100644 nuttx-configs/px4io-v2/nsh/appconfig diff --git a/nuttx-configs/aerocore/nsh/appconfig b/nuttx-configs/aerocore/nsh/appconfig deleted file mode 100644 index 2850dac06..000000000 --- a/nuttx-configs/aerocore/nsh/appconfig +++ /dev/null @@ -1,42 +0,0 @@ -############################################################################ -# configs/aerocore/nsh/appconfig -# -# Copyright (C) 2011 Gregory Nutt. All rights reserved. -# Author: Gregory Nutt -# -# 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 NuttX 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. -# -############################################################################ - -# Path to example in apps/examples containing the user_start entry point - -CONFIGURED_APPS += examples/nsh - -# The NSH application library -CONFIGURED_APPS += nshlib -CONFIGURED_APPS += system/readline diff --git a/nuttx-configs/px4fmu-v2/nsh/appconfig b/nuttx-configs/px4fmu-v2/nsh/appconfig deleted file mode 100644 index 0e18aa8ef..000000000 --- a/nuttx-configs/px4fmu-v2/nsh/appconfig +++ /dev/null @@ -1,52 +0,0 @@ -############################################################################ -# configs/px4fmu/nsh/appconfig -# -# Copyright (C) 2011 Gregory Nutt. All rights reserved. -# Author: Gregory Nutt -# -# 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 NuttX 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. -# -############################################################################ - -# Path to example in apps/examples containing the user_start entry point - -CONFIGURED_APPS += examples/nsh - -# The NSH application library -CONFIGURED_APPS += nshlib -CONFIGURED_APPS += system/readline - -ifeq ($(CONFIG_CAN),y) -#CONFIGURED_APPS += examples/can -endif - -#ifeq ($(CONFIG_USBDEV),y) -#ifeq ($(CONFIG_CDCACM),y) -CONFIGURED_APPS += examples/cdcacm -#endif -#endif diff --git a/nuttx-configs/px4io-v1/nsh/appconfig b/nuttx-configs/px4io-v1/nsh/appconfig deleted file mode 100644 index 48a41bcdb..000000000 --- a/nuttx-configs/px4io-v1/nsh/appconfig +++ /dev/null @@ -1,32 +0,0 @@ -############################################################################ -# -# Copyright (C) 2012 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. -# -############################################################################ diff --git a/nuttx-configs/px4io-v2/nsh/appconfig b/nuttx-configs/px4io-v2/nsh/appconfig deleted file mode 100644 index 48a41bcdb..000000000 --- a/nuttx-configs/px4io-v2/nsh/appconfig +++ /dev/null @@ -1,32 +0,0 @@ -############################################################################ -# -# Copyright (C) 2012 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. -# -############################################################################ -- cgit v1.2.3 From 71ad1877b2a23e1a901f68b663b2e9f0c79c7fbe Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Sun, 28 Dec 2014 10:48:21 -1000 Subject: Update .gitmodules Back to PX4 --- .gitmodules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitmodules b/.gitmodules index 926453587..c869803b7 100644 --- a/.gitmodules +++ b/.gitmodules @@ -3,7 +3,7 @@ url = git://github.com/mavlink/c_library.git [submodule "NuttX"] path = NuttX - url = git://github.com/PX4-Works/NuttX.git + url = git://github.com/PX4/NuttX.git [submodule "uavcan"] path = src/lib/uavcan url = git://github.com/pavel-kirienko/uavcan.git -- cgit v1.2.3 From 91e88c5b88a730eb6881e7661444f6320c6c5e83 Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Mon, 29 Dec 2014 15:06:09 -1000 Subject: Fixes the warning from missing protptypes. It is not a proper fix but it is consistent with the other platform xxx_init.c files The issues is there multiple definition is the tree for led_on() and led_off() (void led_on|off(int) and int led_on|off(int)) --- src/drivers/boards/px4fmu-v1/px4fmu_init.c | 6 ++++++ src/drivers/boards/px4fmu-v2/px4fmu2_init.c | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/src/drivers/boards/px4fmu-v1/px4fmu_init.c b/src/drivers/boards/px4fmu-v1/px4fmu_init.c index 0e331a139..0e22aaee0 100644 --- a/src/drivers/boards/px4fmu-v1/px4fmu_init.c +++ b/src/drivers/boards/px4fmu-v1/px4fmu_init.c @@ -69,6 +69,12 @@ #include +/* todo: This is constant but not proper */ +__BEGIN_DECLS +extern void led_off(int led); +__END_DECLS + + /**************************************************************************** * Pre-Processor Definitions ****************************************************************************/ diff --git a/src/drivers/boards/px4fmu-v2/px4fmu2_init.c b/src/drivers/boards/px4fmu-v2/px4fmu2_init.c index ce1fa9f4e..36ef53e2a 100644 --- a/src/drivers/boards/px4fmu-v2/px4fmu2_init.c +++ b/src/drivers/boards/px4fmu-v2/px4fmu2_init.c @@ -72,6 +72,11 @@ #include #include +/* todo: This is constant but not proper */ +__BEGIN_DECLS +extern void led_off(int led); +__END_DECLS + /**************************************************************************** * Pre-Processor Definitions ****************************************************************************/ -- cgit v1.2.3 From 8b17e0c759f0d80e84f058ade149ab790ad8bc14 Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Mon, 29 Dec 2014 15:14:18 -1000 Subject: Cleanup CCASSERT: Use built-in static_assert if it is available and supperss the unused typedef waning or (-Werror) --- src/modules/systemlib/px4_macros.h | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/modules/systemlib/px4_macros.h b/src/modules/systemlib/px4_macros.h index 32eaf266d..956355b2c 100644 --- a/src/modules/systemlib/px4_macros.h +++ b/src/modules/systemlib/px4_macros.h @@ -51,6 +51,7 @@ * CCASSERT(predicate) Will generate a compile time error it the * predicate is false */ +#include #ifndef _PX4_MACROS_H #define _PX4_MACROS_H @@ -86,10 +87,14 @@ #endif #if !defined(CCASSERT) -#define CCASSERT(predicate) _x_CCASSERT_LINE(predicate, __LINE__) -#if !defined(_x_CCASSERT_LINE) -#define _x_CCASSERT_LINE(predicate, line) typedef char CAT(constraint_violated_on_line_,line)[2*((predicate)!=0)-1]; -#endif +#if defined(static_assert) +# define CCASSERT(predicate) static_assert(predicate) +# else +# define CCASSERT(predicate) _x_CCASSERT_LINE(predicate, __LINE__) +# if !defined(_x_CCASSERT_LINE) +# define _x_CCASSERT_LINE(predicate, line) typedef char CAT(constraint_violated_on_line_,line)[2*((predicate)!=0)-1] __attribute__ ((unused)) ; +# endif +# endif #endif -- cgit v1.2.3 From 63c24ebce78eeb20942e578d543b7df9ccdb8345 Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Mon, 29 Dec 2014 15:16:28 -1000 Subject: Brought lowsyslog usage up to current API --- src/modules/px4iofirmware/px4io.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/px4iofirmware/px4io.h b/src/modules/px4iofirmware/px4io.h index 93a33490f..04fa94ae9 100644 --- a/src/modules/px4iofirmware/px4io.h +++ b/src/modules/px4iofirmware/px4io.h @@ -63,7 +63,7 @@ #ifdef DEBUG # include -# define debug(fmt, args...) lowsyslog(fmt "\n", ##args) +# define debug(fmt, args...) lowsyslog(LOG_DEBUG,fmt "\n", ##args) #else # define debug(fmt, args...) do {} while(0) #endif -- cgit v1.2.3 From cb05ad942695ae936c566131dba66251c2788595 Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Mon, 5 Jan 2015 07:39:53 -1000 Subject: Added conditional for SPI 2 Buss --- src/drivers/boards/px4fmu-v1/px4fmu_spi.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/drivers/boards/px4fmu-v1/px4fmu_spi.c b/src/drivers/boards/px4fmu-v1/px4fmu_spi.c index 0a39f22db..a47498e95 100644 --- a/src/drivers/boards/px4fmu-v1/px4fmu_spi.c +++ b/src/drivers/boards/px4fmu-v1/px4fmu_spi.c @@ -121,6 +121,8 @@ __EXPORT uint8_t stm32_spi1status(FAR struct spi_dev_s *dev, enum spi_dev_e devi return SPI_STATUS_PRESENT; } + +#ifdef CONFIG_STM32_SPI2 __EXPORT void stm32_spi2select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { /* SPI select is active low, so write !selected to select the device */ @@ -138,6 +140,7 @@ __EXPORT uint8_t stm32_spi2status(FAR struct spi_dev_s *dev, enum spi_dev_e devi { return SPI_STATUS_PRESENT; } +#endif __EXPORT void stm32_spi3select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) -- cgit v1.2.3 From 681ff7276f8aeafd4962da06dff5fd20c71c0829 Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Mon, 5 Jan 2015 07:44:27 -1000 Subject: Updated with pragmas to remove shadow warning (errors with -Werror) Make file will not create rej files on distclean --- Makefile | 2 +- nuttx-patches/Fixed-Shadow-wanings.patch | 62 ++++++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+), 1 deletion(-) create mode 100755 nuttx-patches/Fixed-Shadow-wanings.patch diff --git a/Makefile b/Makefile index b72583e6e..d5ece137b 100644 --- a/Makefile +++ b/Makefile @@ -203,7 +203,7 @@ cleannuttxpatches: $(Q) -if [ -f $(NUTTX_PATCHED) ]; then \ for patch in $(NUTTX_PATCHES); \ do \ - $(PATCH) -p0 -N -R < $$patch >/dev/null; \ + $(PATCH) -p0 -N -R -r - < $$patch >/dev/null; \ done \ fi $(Q) $(REMOVE) $(NUTTX_PATCHED) diff --git a/nuttx-patches/Fixed-Shadow-wanings.patch b/nuttx-patches/Fixed-Shadow-wanings.patch new file mode 100755 index 000000000..3c0ab5f7c --- /dev/null +++ b/nuttx-patches/Fixed-Shadow-wanings.patch @@ -0,0 +1,62 @@ +diff --git NuttX/nuttx/include/signal.h NuttX/nuttx/include/signal.h +index ffb77e0..cca6a15 100644 +--- NuttX/nuttx/include/signal.h ++++ NuttX/nuttx/include/signal.h +@@ -260,8 +260,11 @@ int sigfillset(FAR sigset_t *set); + int sigaddset(FAR sigset_t *set, int signo); + int sigdelset(FAR sigset_t *set, int signo); + int sigismember(FAR const sigset_t *set, int signo); ++#pragma GCC diagnostic push ++#pragma GCC diagnostic ignored "-Wshadow" + int sigaction(int sig, FAR const struct sigaction *act, + FAR struct sigaction *oact); ++#pragma GCC diagnostic pop + int sigprocmask(int how, FAR const sigset_t *set, FAR sigset_t *oset); + int sigpending(FAR sigset_t *set); + int sigsuspend(FAR const sigset_t *sigmask); +diff --git NuttX/nuttx/include/stdio.h NuttX/nuttx/include/stdio.h +index cb16366..6ff12bb 100644 +--- NuttX/nuttx/include/stdio.h ++++ NuttX/nuttx/include/stdio.h +@@ -180,7 +180,11 @@ int vdprintf(int fd, FAR const char *fmt, va_list ap); + + /* Operations on paths */ + ++#pragma GCC diagnostic push ++#pragma GCC diagnostic ignored "-Wshadow" ++struct statfs; /* Forward Decleration */ + int statfs(FAR const char *path, FAR struct statfs *buf); ++#pragma GCC diagnostic pop + FAR char *tmpnam(FAR char *s); + FAR char *tempnam(FAR const char *dir, FAR const char *pfx); + +diff --git NuttX/nuttx/include/stdlib.h NuttX/nuttx/include/stdlib.h +index 16a3f93..dbf94df 100644 +--- NuttX/nuttx/include/stdlib.h ++++ NuttX/nuttx/include/stdlib.h +@@ -191,7 +191,10 @@ void qsort(void *base, size_t nmemb, size_t size, + int(*compar)(const void *, const void *)); + + #ifdef CONFIG_CAN_PASS_STRUCTS ++#pragma GCC diagnostic push ++#pragma GCC diagnostic ignored "-Wshadow" + struct mallinfo mallinfo(void); ++#pragma GCC diagnostic pop + #else + int mallinfo(struct mallinfo *info); + #endif +diff --git NuttX/nuttx/include/sys/stat.h NuttX/nuttx/include/sys/stat.h +index 4fe9f5c..b66b9a0 100644 +--- NuttX/nuttx/include/sys/stat.h ++++ NuttX/nuttx/include/sys/stat.h +@@ -130,7 +130,10 @@ extern "C" + + int mkdir(FAR const char *pathname, mode_t mode); + int mkfifo(FAR const char *pathname, mode_t mode); ++#pragma GCC diagnostic push ++#pragma GCC diagnostic ignored "-Wshadow" + int stat(const char *path, FAR struct stat *buf); ++#pragma GCC diagnostic pop + int fstat(int fd, FAR struct stat *buf); + + #undef EXTERN -- cgit v1.2.3 From 1fad53ce6ec44ed361cd5a3f1e9b8d9776a500ae Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Tue, 6 Jan 2015 19:12:56 +0100 Subject: IOv1: Freshen config --- nuttx-configs/px4io-v1/nsh/defconfig | 1387 ++++++++++++++++++++++------------ 1 file changed, 909 insertions(+), 478 deletions(-) diff --git a/nuttx-configs/px4io-v1/nsh/defconfig b/nuttx-configs/px4io-v1/nsh/defconfig index 29d45fbe9..7f2842b9c 100755 --- a/nuttx-configs/px4io-v1/nsh/defconfig +++ b/nuttx-configs/px4io-v1/nsh/defconfig @@ -1,545 +1,976 @@ -############################################################################ -# configs/px4io-v1/nsh/defconfig -# -# Copyright (C) 2012 PX4 Development Team. All rights reserved. -# Copyright (C) 2011-2012 Gregory Nutt. All rights reserved. -# Author: Gregory Nutt -# -# 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 NuttX 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. -# -############################################################################ -# -# architecture selection -# -# CONFIG_ARCH - identifies the arch subdirectory and, hence, the -# processor architecture. -# CONFIG_ARCH_family - for use in C code. This identifies the -# particular chip family that the architecture is implemented -# in. -# CONFIG_ARCH_architecture - for use in C code. This identifies the -# specific architecture within the chip family. -# CONFIG_ARCH_CHIP - Identifies the arch/*/chip subdirectory -# CONFIG_ARCH_CHIP_name - For use in C code -# CONFIG_ARCH_BOARD - identifies the configs subdirectory and, hence, -# the board that supports the particular chip or SoC. -# CONFIG_ARCH_BOARD_name - for use in C code -# CONFIG_ENDIAN_BIG - define if big endian (default is little endian) -# CONFIG_BOARD_LOOPSPERMSEC - for delay loops -# CONFIG_RAM_SIZE - Describes the installed DRAM. -# CONFIG_RAM_START - The start address of DRAM (physical) -# CONFIG_ARCH_IRQPRIO - The ST32F100CB supports interrupt prioritization -# CONFIG_ARCH_INTERRUPTSTACK - This architecture supports an interrupt -# stack. If defined, this symbol is the size of the interrupt -# stack in bytes. If not defined, the user task stacks will be -# used during interrupt handling. -# CONFIG_ARCH_STACKDUMP - Do stack dumps after assertions -# CONFIG_ARCH_BOOTLOADER - Set if you are using a bootloader. -# CONFIG_ARCH_LEDS - Use LEDs to show state. Unique to board architecture. -# CONFIG_ARCH_BUTTONS - Enable support for buttons. Unique to board architecture. -# CONFIG_ARCH_CALIBRATION - Enables some build in instrumentation that -# cause a 100 second delay during boot-up. This 100 second delay -# serves no purpose other than it allows you to calibrate -# CONFIG_BOARD_LOOPSPERMSEC. You simply use a stop watch to measure -# the 100 second delay then adjust CONFIG_BOARD_LOOPSPERMSEC until -# the delay actually is 100 seconds. -# CONFIG_ARCH_DMA - Support DMA initialization # -CONFIG_ARCH="arm" -CONFIG_ARCH_ARM=y -CONFIG_ARCH_CORTEXM3=y -CONFIG_ARCH_CHIP="stm32" -CONFIG_ARCH_CHIP_STM32F100C8=y +# Automatically generated file; DO NOT EDIT. +# Nuttx/ Configuration # -# Board Selection + # -CONFIG_ARCH_BOARD_PX4IO_V1=y -# CONFIG_ARCH_BOARD_CUSTOM is not set -CONFIG_ARCH_BOARD="px4io-v1" -CONFIG_ARCH_BOARD_PX4IO_V1=y -CONFIG_BOARD_LOOPSPERMSEC=2000 -CONFIG_RAM_SIZE=0x00002000 -CONFIG_RAM_START=0x20000000 -CONFIG_ARCH_INTERRUPTSTACK=n -CONFIG_ARCH_STACKDUMP=y -CONFIG_ARCH_BOOTLOADER=n -CONFIG_ARCH_LEDS=n -CONFIG_ARCH_BUTTONS=n -CONFIG_ARCH_CALIBRATION=n -CONFIG_ARCH_DMA=y +# Build Setup +# +# CONFIG_EXPERIMENTAL is not set +# CONFIG_DEFAULT_SMALL is not set +CONFIG_HOST_LINUX=y +# CONFIG_HOST_OSX is not set +# CONFIG_HOST_WINDOWS is not set +# CONFIG_HOST_OTHER is not set + +# +# Build Configuration +# +CONFIG_APPS_DIR="../apps" +CONFIG_BUILD_FLAT=y +# CONFIG_BUILD_2PASS is not set + +# +# Binary Output Formats +# +# CONFIG_RRLOAD_BINARY is not set +# CONFIG_INTELHEX_BINARY is not set +# CONFIG_MOTOROLA_SREC is not set +CONFIG_RAW_BINARY=y +# CONFIG_UBOOT_UIMAGE is not set + +# +# Customize Header Files +# +# CONFIG_ARCH_STDINT_H is not set +# CONFIG_ARCH_STDBOOL_H is not set CONFIG_ARCH_MATH_H=y +# CONFIG_ARCH_FLOAT_H is not set +# CONFIG_ARCH_STDARG_H is not set -CONFIG_ARMV7M_CMNVECTOR=y -CONFIG_ARMV7M_STACKCHECK=n +# +# Debug Options +# +# CONFIG_DEBUG is not set +CONFIG_ARCH_HAVE_STACKCHECK=y +CONFIG_ARCH_HAVE_HEAPCHECK=y +CONFIG_DEBUG_SYMBOLS=y +CONFIG_ARCH_HAVE_CUSTOMOPT=y +# CONFIG_DEBUG_NOOPT is not set +# CONFIG_DEBUG_CUSTOMOPT is not set +CONFIG_DEBUG_FULLOPT=y # -# JTAG Enable settings (by default JTAG-DP and SW-DP are disabled): +# System Type # -# CONFIG_STM32_DFU - Use the DFU bootloader, not JTAG +CONFIG_ARCH_ARM=y +# CONFIG_ARCH_AVR is not set +# CONFIG_ARCH_HC is not set +# CONFIG_ARCH_MIPS is not set +# CONFIG_ARCH_RGMP is not set +# CONFIG_ARCH_SH is not set +# CONFIG_ARCH_SIM is not set +# CONFIG_ARCH_X86 is not set +# CONFIG_ARCH_Z16 is not set +# CONFIG_ARCH_Z80 is not set +CONFIG_ARCH="arm" + # -# JTAG Enable options: +# ARM Options +# +# CONFIG_ARCH_CHIP_A1X is not set +# CONFIG_ARCH_CHIP_C5471 is not set +# CONFIG_ARCH_CHIP_CALYPSO is not set +# CONFIG_ARCH_CHIP_DM320 is not set +# CONFIG_ARCH_CHIP_EFM32 is not set +# CONFIG_ARCH_CHIP_IMX is not set +# CONFIG_ARCH_CHIP_KINETIS is not set +# CONFIG_ARCH_CHIP_KL is not set +# CONFIG_ARCH_CHIP_LM is not set +# CONFIG_ARCH_CHIP_TIVA is not set +# CONFIG_ARCH_CHIP_LPC17XX is not set +# CONFIG_ARCH_CHIP_LPC214X is not set +# CONFIG_ARCH_CHIP_LPC2378 is not set +# CONFIG_ARCH_CHIP_LPC31XX is not set +# CONFIG_ARCH_CHIP_LPC43XX is not set +# CONFIG_ARCH_CHIP_NUC1XX is not set +# CONFIG_ARCH_CHIP_SAMA5 is not set +# CONFIG_ARCH_CHIP_SAMD is not set +# CONFIG_ARCH_CHIP_SAM34 is not set +CONFIG_ARCH_CHIP_STM32=y +# CONFIG_ARCH_CHIP_STR71X is not set +# CONFIG_ARCH_ARM7TDMI is not set +# CONFIG_ARCH_ARM926EJS is not set +# CONFIG_ARCH_ARM920T is not set +# CONFIG_ARCH_CORTEXM0 is not set +CONFIG_ARCH_CORTEXM3=y +# CONFIG_ARCH_CORTEXM4 is not set +# CONFIG_ARCH_CORTEXA5 is not set +# CONFIG_ARCH_CORTEXA8 is not set +CONFIG_ARCH_FAMILY="armv7-m" +CONFIG_ARCH_CHIP="stm32" +CONFIG_ARMV7M_USEBASEPRI=y +CONFIG_ARCH_HAVE_CMNVECTOR=y +CONFIG_ARMV7M_CMNVECTOR=y +# CONFIG_ARCH_HAVE_FPU is not set +# CONFIG_ARMV7M_MPU is not set + # -# CONFIG_STM32_JTAG_FULL_ENABLE - Enables full SWJ (JTAG-DP + SW-DP) -# CONFIG_STM32_JTAG_NOJNTRST_ENABLE - Enables full SWJ (JTAG-DP + SW-DP) -# but without JNTRST. -# CONFIG_STM32_JTAG_SW_ENABLE - Set JTAG-DP disabled and SW-DP enabled +# ARMV7M Configuration Options # -CONFIG_STM32_DFU=n -CONFIG_STM32_JTAG_FULL_ENABLE=y -CONFIG_STM32_JTAG_NOJNTRST_ENABLE=n -CONFIG_STM32_JTAG_SW_ENABLE=n +# CONFIG_ARMV7M_TOOLCHAIN_BUILDROOT is not set +# CONFIG_ARMV7M_TOOLCHAIN_CODEREDL is not set +# CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYL is not set +CONFIG_ARMV7M_TOOLCHAIN_GNU_EABIL=y +# CONFIG_ARMV7M_STACKCHECK is not set +# CONFIG_ARMV7M_ITMSYSLOG is not set # -# Individual subsystems can be enabled: +# STM32 Configuration Options +# +# CONFIG_ARCH_CHIP_STM32L151C6 is not set +# CONFIG_ARCH_CHIP_STM32L151C8 is not set +# CONFIG_ARCH_CHIP_STM32L151CB is not set +# CONFIG_ARCH_CHIP_STM32L151R6 is not set +# CONFIG_ARCH_CHIP_STM32L151R8 is not set +# CONFIG_ARCH_CHIP_STM32L151RB is not set +# CONFIG_ARCH_CHIP_STM32L151V6 is not set +# CONFIG_ARCH_CHIP_STM32L151V8 is not set +# CONFIG_ARCH_CHIP_STM32L151VB is not set +# CONFIG_ARCH_CHIP_STM32L152C6 is not set +# CONFIG_ARCH_CHIP_STM32L152C8 is not set +# CONFIG_ARCH_CHIP_STM32L152CB is not set +# CONFIG_ARCH_CHIP_STM32L152R6 is not set +# CONFIG_ARCH_CHIP_STM32L152R8 is not set +# CONFIG_ARCH_CHIP_STM32L152RB is not set +# CONFIG_ARCH_CHIP_STM32L152V6 is not set +# CONFIG_ARCH_CHIP_STM32L152V8 is not set +# CONFIG_ARCH_CHIP_STM32L152VB is not set +# CONFIG_ARCH_CHIP_STM32L162ZD is not set +CONFIG_ARCH_CHIP_STM32F100C8=y +# CONFIG_ARCH_CHIP_STM32F100CB is not set +# CONFIG_ARCH_CHIP_STM32F100R8 is not set +# CONFIG_ARCH_CHIP_STM32F100RB is not set +# CONFIG_ARCH_CHIP_STM32F100RC is not set +# CONFIG_ARCH_CHIP_STM32F100RD is not set +# CONFIG_ARCH_CHIP_STM32F100RE is not set +# CONFIG_ARCH_CHIP_STM32F100V8 is not set +# CONFIG_ARCH_CHIP_STM32F100VB is not set +# CONFIG_ARCH_CHIP_STM32F100VC is not set +# CONFIG_ARCH_CHIP_STM32F100VD is not set +# CONFIG_ARCH_CHIP_STM32F100VE is not set +# CONFIG_ARCH_CHIP_STM32F102CB is not set +# CONFIG_ARCH_CHIP_STM32F103T8 is not set +# CONFIG_ARCH_CHIP_STM32F103TB is not set +# CONFIG_ARCH_CHIP_STM32F103C4 is not set +# CONFIG_ARCH_CHIP_STM32F103C8 is not set +# CONFIG_ARCH_CHIP_STM32F103CB is not set +# CONFIG_ARCH_CHIP_STM32F103R8 is not set +# CONFIG_ARCH_CHIP_STM32F103RB is not set +# CONFIG_ARCH_CHIP_STM32F103RC is not set +# CONFIG_ARCH_CHIP_STM32F103RD is not set +# CONFIG_ARCH_CHIP_STM32F103RE is not set +# CONFIG_ARCH_CHIP_STM32F103RG is not set +# CONFIG_ARCH_CHIP_STM32F103V8 is not set +# CONFIG_ARCH_CHIP_STM32F103VB is not set +# CONFIG_ARCH_CHIP_STM32F103VC is not set +# CONFIG_ARCH_CHIP_STM32F103VE is not set +# CONFIG_ARCH_CHIP_STM32F103ZE is not set +# CONFIG_ARCH_CHIP_STM32F105VB is not set +# CONFIG_ARCH_CHIP_STM32F107VC is not set +# CONFIG_ARCH_CHIP_STM32F207IG is not set +# CONFIG_ARCH_CHIP_STM32F207ZE is not set +# CONFIG_ARCH_CHIP_STM32F302CB is not set +# CONFIG_ARCH_CHIP_STM32F302CC is not set +# CONFIG_ARCH_CHIP_STM32F302RB is not set +# CONFIG_ARCH_CHIP_STM32F302RC is not set +# CONFIG_ARCH_CHIP_STM32F302VB is not set +# CONFIG_ARCH_CHIP_STM32F302VC is not set +# CONFIG_ARCH_CHIP_STM32F303CB is not set +# CONFIG_ARCH_CHIP_STM32F303CC is not set +# CONFIG_ARCH_CHIP_STM32F303RB is not set +# CONFIG_ARCH_CHIP_STM32F303RC is not set +# CONFIG_ARCH_CHIP_STM32F303VB is not set +# CONFIG_ARCH_CHIP_STM32F303VC is not set +# CONFIG_ARCH_CHIP_STM32F401RE is not set +# CONFIG_ARCH_CHIP_STM32F411RE is not set +# CONFIG_ARCH_CHIP_STM32F405RG is not set +# CONFIG_ARCH_CHIP_STM32F405VG is not set +# CONFIG_ARCH_CHIP_STM32F405ZG is not set +# CONFIG_ARCH_CHIP_STM32F407VE is not set +# CONFIG_ARCH_CHIP_STM32F407VG is not set +# CONFIG_ARCH_CHIP_STM32F407ZE is not set +# CONFIG_ARCH_CHIP_STM32F407ZG is not set +# CONFIG_ARCH_CHIP_STM32F407IE is not set +# CONFIG_ARCH_CHIP_STM32F407IG is not set +# CONFIG_ARCH_CHIP_STM32F427V is not set +# CONFIG_ARCH_CHIP_STM32F427Z is not set +# CONFIG_ARCH_CHIP_STM32F427I is not set +# CONFIG_ARCH_CHIP_STM32F429V is not set +# CONFIG_ARCH_CHIP_STM32F429Z is not set +# CONFIG_ARCH_CHIP_STM32F429I is not set +# CONFIG_ARCH_CHIP_STM32F429B is not set +# CONFIG_ARCH_CHIP_STM32F429N is not set +# CONFIG_STM32_STM32L15XX is not set +# CONFIG_STM32_ENERGYLITE is not set +CONFIG_STM32_STM32F10XX=y +CONFIG_STM32_VALUELINE=y +# CONFIG_STM32_CONNECTIVITYLINE is not set +# CONFIG_STM32_PERFORMANCELINE is not set +# CONFIG_STM32_USBACCESSLINE is not set +# CONFIG_STM32_HIGHDENSITY is not set +# CONFIG_STM32_MEDIUMDENSITY is not set +# CONFIG_STM32_LOWDENSITY is not set +# CONFIG_STM32_STM32F20XX is not set +# CONFIG_STM32_STM32F207 is not set +# CONFIG_STM32_STM32F30XX is not set +# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F401 is not set +# CONFIG_STM32_STM32F411 is not set +# CONFIG_STM32_STM32F405 is not set +# CONFIG_STM32_STM32F407 is not set +# CONFIG_STM32_STM32F427 is not set +# CONFIG_STM32_STM32F429 is not set + # -# AHB: +# STM32 Peripheral Support +# +# CONFIG_STM32_HAVE_CCM is not set +# CONFIG_STM32_HAVE_USBDEV is not set +# CONFIG_STM32_HAVE_OTGFS is not set +# CONFIG_STM32_HAVE_FSMC is not set +CONFIG_STM32_HAVE_USART3=y +CONFIG_STM32_HAVE_UART4=y +CONFIG_STM32_HAVE_UART5=y +# CONFIG_STM32_HAVE_USART6 is not set +# CONFIG_STM32_HAVE_UART7 is not set +# CONFIG_STM32_HAVE_UART8 is not set +CONFIG_STM32_HAVE_TIM1=y +CONFIG_STM32_HAVE_TIM5=y +CONFIG_STM32_HAVE_TIM6=y +CONFIG_STM32_HAVE_TIM7=y +# CONFIG_STM32_HAVE_TIM8 is not set +# CONFIG_STM32_HAVE_TIM9 is not set +# CONFIG_STM32_HAVE_TIM10 is not set +# CONFIG_STM32_HAVE_TIM11 is not set +CONFIG_STM32_HAVE_TIM12=y +CONFIG_STM32_HAVE_TIM13=y +CONFIG_STM32_HAVE_TIM14=y +CONFIG_STM32_HAVE_TIM15=y +CONFIG_STM32_HAVE_TIM16=y +CONFIG_STM32_HAVE_TIM17=y +CONFIG_STM32_HAVE_ADC2=y +# CONFIG_STM32_HAVE_ADC3 is not set +# CONFIG_STM32_HAVE_ADC4 is not set +# CONFIG_STM32_HAVE_CAN1 is not set +# CONFIG_STM32_HAVE_CAN2 is not set +# CONFIG_STM32_HAVE_RNG is not set +# CONFIG_STM32_HAVE_ETHMAC is not set +# CONFIG_STM32_HAVE_SPI2 is not set +# CONFIG_STM32_HAVE_SPI3 is not set +# CONFIG_STM32_HAVE_SPI4 is not set +# CONFIG_STM32_HAVE_SPI5 is not set +CONFIG_STM32_ADC1=y +# CONFIG_STM32_ADC2 is not set +# CONFIG_STM32_BKP is not set +# CONFIG_STM32_CEC is not set +# CONFIG_STM32_CRC is not set CONFIG_STM32_DMA1=y -CONFIG_STM32_DMA2=n -CONFIG_STM32_CRC=n -# APB1: -# Timers 2,3 and 4 are owned by the PWM driver -CONFIG_STM32_TIM2=n -CONFIG_STM32_TIM3=n -CONFIG_STM32_TIM4=n -CONFIG_STM32_TIM5=n -CONFIG_STM32_TIM6=n -CONFIG_STM32_TIM7=n -CONFIG_STM32_WWDG=n -CONFIG_STM32_SPI2=n +# CONFIG_STM32_DAC1 is not set +# CONFIG_STM32_DAC2 is not set +CONFIG_STM32_I2C1=y +# CONFIG_STM32_I2C2 is not set +# CONFIG_STM32_PWR is not set +# CONFIG_STM32_SPI1 is not set +# CONFIG_STM32_TIM1 is not set +# CONFIG_STM32_TIM2 is not set +# CONFIG_STM32_TIM3 is not set +# CONFIG_STM32_TIM4 is not set +# CONFIG_STM32_TIM5 is not set +# CONFIG_STM32_TIM6 is not set +# CONFIG_STM32_TIM7 is not set +# CONFIG_STM32_TIM12 is not set +# CONFIG_STM32_TIM13 is not set +# CONFIG_STM32_TIM14 is not set +# CONFIG_STM32_TIM15 is not set +# CONFIG_STM32_TIM16 is not set +# CONFIG_STM32_TIM17 is not set +CONFIG_STM32_USART1=y CONFIG_STM32_USART2=y CONFIG_STM32_USART3=y -CONFIG_STM32_I2C1=y -CONFIG_STM32_I2C2=n +# CONFIG_STM32_UART4 is not set +# CONFIG_STM32_UART5 is not set +# CONFIG_STM32_IWDG is not set +# CONFIG_STM32_WWDG is not set +CONFIG_STM32_ADC=y +CONFIG_STM32_I2C=y + +# +# Alternate Pin Mapping +# +# CONFIG_STM32_I2C1_REMAP is not set +# CONFIG_STM32_USART1_REMAP is not set +# CONFIG_STM32_USART2_REMAP is not set +CONFIG_STM32_USART3_NO_REMAP=y +# CONFIG_STM32_USART3_FULL_REMAP is not set +# CONFIG_STM32_USART3_PARTIAL_REMAP is not set +# CONFIG_STM32_JTAG_DISABLE is not set +# CONFIG_STM32_JTAG_FULL_ENABLE is not set +# CONFIG_STM32_JTAG_NOJNTRST_ENABLE is not set +CONFIG_STM32_JTAG_SW_ENABLE=y +CONFIG_STM32_DISABLE_IDLE_SLEEP_DURING_DEBUG=y +# CONFIG_STM32_FORCEPOWER is not set +# CONFIG_ARCH_BOARD_STM32_CUSTOM_CLOCKCONFIG is not set +# CONFIG_STM32_DMACAPABLE is not set +CONFIG_STM32_USART=y + +# +# U[S]ART Configuration +# +# CONFIG_USART1_RS485 is not set +CONFIG_USART1_RXDMA=y +# CONFIG_USART2_RS485 is not set +# CONFIG_USART2_RXDMA is not set +# CONFIG_USART3_RS485 is not set +CONFIG_USART3_RXDMA=y +# CONFIG_SERIAL_DISABLE_REORDERING is not set +# CONFIG_STM32_FLOWCONTROL_BROKEN is not set +CONFIG_STM32_USART_SINGLEWIRE=y + +# +# I2C Configuration +# +# CONFIG_STM32_I2C_ALT is not set +# CONFIG_STM32_I2C_DYNTIMEO is not set CONFIG_STM32_I2CTIMEOSEC=0 CONFIG_STM32_I2CTIMEOMS=1 CONFIG_STM32_I2CTIMEOTICKS=1 -CONFIG_STM32_BKP=n -CONFIG_STM32_PWR=n -CONFIG_STM32_DAC=n -# APB2: -# We use our own ADC driver, but leave this on for clocking purposes. -CONFIG_STM32_ADC1=y -CONFIG_STM32_ADC2=n -# TIM1 is owned by the HRT -CONFIG_STM32_TIM1=n -CONFIG_STM32_SPI1=n -CONFIG_STM32_TIM8=n -CONFIG_STM32_USART1=y -CONFIG_STM32_ADC3=n +# CONFIG_STM32_I2C_DUTY16_9 is not set +# +# USB FS Host Configuration +# # -# STM32F100 specific serial device driver settings +# USB HS Host Configuration # -# CONFIG_USARTn_SERIAL_CONSOLE - selects the USARTn for the -# console and ttys0 (default is the USART1). -# CONFIG_USARTn_RXBUFSIZE - Characters are buffered as received. -# This specific the size of the receive buffer -# CONFIG_USARTn_TXBUFSIZE - Characters are buffered before -# being sent. This specific the size of the transmit buffer -# CONFIG_USARTn_BAUD - The configure BAUD of the UART. Must be -# CONFIG_USARTn_BITS - The number of bits. Must be either 7 or 8. -# CONFIG_USARTn_PARTIY - 0=no parity, 1=odd parity, 2=even parity -# CONFIG_USARTn_2STOP - Two stop bits + +# +# USB Host Debug Configuration # -CONFIG_SERIAL_TERMIOS=y -CONFIG_STANDARD_SERIAL=y -CONFIG_USART1_SERIAL_CONSOLE=y -CONFIG_USART2_SERIAL_CONSOLE=n -CONFIG_USART3_SERIAL_CONSOLE=n +# +# USB Device Configuration +# -CONFIG_USART1_TXBUFSIZE=64 -CONFIG_USART2_TXBUFSIZE=64 -CONFIG_USART3_TXBUFSIZE=64 +# +# Architecture Options +# +# CONFIG_ARCH_NOINTC is not set +# CONFIG_ARCH_VECNOTIRQ is not set +CONFIG_ARCH_DMA=y +CONFIG_ARCH_HAVE_IRQPRIO=y +# CONFIG_ARCH_L2CACHE is not set +# CONFIG_ARCH_HAVE_COHERENT_DCACHE is not set +# CONFIG_ARCH_HAVE_ADDRENV is not set +# CONFIG_ARCH_NEED_ADDRENV_MAPPING is not set +CONFIG_ARCH_HAVE_VFORK=y +# CONFIG_ARCH_HAVE_MMU is not set +CONFIG_ARCH_HAVE_MPU=y +# CONFIG_ARCH_NAND_HWECC is not set +# CONFIG_ARCH_HAVE_EXTCLK is not set +# CONFIG_ARCH_USE_MPU is not set +# CONFIG_ARCH_IRQPRIO is not set +CONFIG_ARCH_STACKDUMP=y +# CONFIG_ENDIAN_BIG is not set +# CONFIG_ARCH_IDLE_CUSTOM is not set +# CONFIG_ARCH_HAVE_RAMFUNCS is not set +CONFIG_ARCH_HAVE_RAMVECTORS=y +# CONFIG_ARCH_RAMVECTORS is not set -CONFIG_USART1_RXBUFSIZE=64 -CONFIG_USART2_RXBUFSIZE=64 -CONFIG_USART3_RXBUFSIZE=64 +# +# Board Settings +# +CONFIG_BOARD_LOOPSPERMSEC=2000 +# CONFIG_ARCH_CALIBRATION is not set -CONFIG_USART1_BAUD=115200 -CONFIG_USART2_BAUD=115200 -CONFIG_USART3_BAUD=115200 +# +# Interrupt options +# +CONFIG_ARCH_HAVE_INTERRUPTSTACK=y +CONFIG_ARCH_INTERRUPTSTACK=0 +CONFIG_ARCH_HAVE_HIPRI_INTERRUPT=y +# CONFIG_ARCH_HIPRI_INTERRUPT is not set -CONFIG_USART1_BITS=8 -CONFIG_USART2_BITS=8 -CONFIG_USART3_BITS=8 +# +# Boot options +# +# CONFIG_BOOT_RUNFROMEXTSRAM is not set +CONFIG_BOOT_RUNFROMFLASH=y +# CONFIG_BOOT_RUNFROMISRAM is not set +# CONFIG_BOOT_RUNFROMSDRAM is not set +# CONFIG_BOOT_COPYTORAM is not set -CONFIG_USART1_PARITY=0 -CONFIG_USART2_PARITY=0 -CONFIG_USART3_PARITY=0 +# +# Boot Memory Configuration +# +CONFIG_RAM_START=0x20000000 +CONFIG_RAM_SIZE=8192 +# CONFIG_ARCH_HAVE_SDRAM is not set -CONFIG_USART1_2STOP=0 -CONFIG_USART2_2STOP=0 -CONFIG_USART3_2STOP=0 +# +# Board Selection +# +CONFIG_ARCH_BOARD_CUSTOM=y -CONFIG_USART1_RXDMA=y -SERIAL_HAVE_CONSOLE_DMA=y -# Conflicts with I2C1 DMA -CONFIG_USART2_RXDMA=n -CONFIG_USART3_RXDMA=y +# +# Custom Board Configuration +# +CONFIG_ARCH_BOARD_CUSTOM_DIR="" +# CONFIG_BOARD_CUSTOM_LEDS is not set +# CONFIG_BOARD_CUSTOM_BUTTONS is not set -# CONFIG_ARMV7M_TOOLCHAIN_CODEREDL is not set -# CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYL is not set -CONFIG_ARMV7M_TOOLCHAIN_GNU_EABIL=y -# CONFIG_ARMV7M_ITMSYSLOG is not set +# +# Common Board Options +# # -# General build options -# -# CONFIG_RRLOAD_BINARY - make the rrload binary format used with -# BSPs from www.ridgerun.com using the tools/mkimage.sh script -# CONFIG_INTELHEX_BINARY - make the Intel HEX binary format -# used with many different loaders using the GNU objcopy program -# Should not be selected if you are not using the GNU toolchain. -# CONFIG_MOTOROLA_SREC - make the Motorola S-Record binary format -# used with many different loaders using the GNU objcopy program -# Should not be selected if you are not using the GNU toolchain. -# CONFIG_RAW_BINARY - make a raw binary format file used with many -# different loaders using the GNU objcopy program. This option -# should not be selected if you are not using the GNU toolchain. -# CONFIG_HAVE_LIBM - toolchain supports libm.a -# -CONFIG_RRLOAD_BINARY=n -CONFIG_INTELHEX_BINARY=n -CONFIG_MOTOROLA_SREC=n -CONFIG_RAW_BINARY=y -CONFIG_HAVE_LIBM=n - -# -# General OS setup -# -# CONFIG_APPS_DIR - Identifies the relative path to the directory -# that builds the application to link with NuttX. Default: ../apps -# CONFIG_DEBUG - enables built-in debug options -# CONFIG_DEBUG_VERBOSE - enables verbose debug output -# CONFIG_DEBUG_SYMBOLS - build without optimization and with -# debug symbols (needed for use with a debugger). -# CONFIG_HAVE_CXX - Enable support for C++ -# CONFIG_HAVE_CXXINITIALIZE - The platform-specific logic includes support -# for initialization of static C++ instances for this architecture -# and for the selected toolchain (via up_cxxinitialize()). -# CONFIG_MM_REGIONS - If the architecture includes multiple -# regions of memory to allocate from, this specifies the -# number of memory regions that the memory manager must -# handle and enables the API mm_addregion(start, end); -# CONFIG_ARCH_LOWPUTC - architecture supports low-level, boot -# time console output -# CONFIG_MSEC_PER_TICK - The default system timer is 100Hz -# or MSEC_PER_TICK=10. This setting may be defined to -# inform NuttX that the processor hardware is providing -# system timer interrupts at some interrupt interval other -# than 10 msec. -# CONFIG_RR_INTERVAL - The round robin timeslice will be set -# this number of milliseconds; Round robin scheduling can -# be disabled by setting this value to zero. -# CONFIG_SCHED_INSTRUMENTATION - enables instrumentation in -# scheduler to monitor system performance -# CONFIG_TASK_NAME_SIZE - Spcifies that maximum size of a -# task name to save in the TCB. Useful if scheduler -# instrumentation is selected. Set to zero to disable. -# CONFIG_START_YEAR, CONFIG_START_MONTH, CONFIG_START_DAY - -# Used to initialize the internal time logic. -# CONFIG_GREGORIAN_TIME - Enables Gregorian time conversions. -# You would only need this if you are concerned about accurate -# time conversions in the past or in the distant future. -# CONFIG_JULIAN_TIME - Enables Julian time conversions. You -# would only need this if you are concerned about accurate -# time conversion in the distand past. You must also define -# CONFIG_GREGORIAN_TIME in order to use Julian time. -# CONFIG_DEV_CONSOLE - Set if architecture-specific logic -# provides /dev/console. Enables stdout, stderr, stdin. -# CONFIG_DEV_LOWCONSOLE - Use the simple, low-level serial console -# driver (minimul support) -# CONFIG_MUTEX_TYPES: Set to enable support for recursive and -# errorcheck mutexes. Enables pthread_mutexattr_settype(). -# CONFIG_PRIORITY_INHERITANCE : Set to enable support for priority -# inheritance on mutexes and semaphores. -# CONFIG_SEM_PREALLOCHOLDERS: This setting is only used if priority -# inheritance is enabled. It defines the maximum number of -# different threads (minus one) that can take counts on a -# semaphore with priority inheritance support. This may be -# set to zero if priority inheritance is disabled OR if you -# are only using semaphores as mutexes (only one holder) OR -# if no more than two threads participate using a counting -# semaphore. -# CONFIG_SEM_NNESTPRIO. If priority inheritance is enabled, -# then this setting is the maximum number of higher priority -# threads (minus 1) than can be waiting for another thread -# to release a count on a semaphore. This value may be set -# to zero if no more than one thread is expected to wait for -# a semaphore. -# CONFIG_FDCLONE_DISABLE. Disable cloning of all file descriptors -# by task_create() when a new task is started. If set, all -# files/drivers will appear to be closed in the new task. -# CONFIG_FDCLONE_STDIO. Disable cloning of all but the first -# three file descriptors (stdin, stdout, stderr) by task_create() -# when a new task is started. If set, all files/drivers will -# appear to be closed in the new task except for stdin, stdout, -# and stderr. -# CONFIG_SDCLONE_DISABLE. Disable cloning of all socket -# desciptors by task_create() when a new task is started. If -# set, all sockets will appear to be closed in the new task. -# CONFIG_SCHED_WORKQUEUE. Create a dedicated "worker" thread to -# handle delayed processing from interrupt handlers. This feature -# is required for some drivers but, if there are not complaints, -# can be safely disabled. The worker thread also performs -# garbage collection -- completing any delayed memory deallocations -# from interrupt handlers. If the worker thread is disabled, -# then that clean will be performed by the IDLE thread instead -# (which runs at the lowest of priority and may not be appropriate -# if memory reclamation is of high priority). If CONFIG_SCHED_WORKQUEUE -# is enabled, then the following options can also be used: -# CONFIG_SCHED_WORKPRIORITY - The execution priority of the worker -# thread. Default: 50 -# CONFIG_SCHED_WORKPERIOD - How often the worker thread checks for -# work in units of microseconds. Default: 50*1000 (50 MS). -# CONFIG_SCHED_WORKSTACKSIZE - The stack size allocated for the worker -# thread. Default: CONFIG_IDLETHREAD_STACKSIZE. -# CONFIG_SIG_SIGWORK - The signal number that will be used to wake-up -# the worker thread. Default: 4 -# CONFIG_SCHED_WAITPID - Enable the waitpid() API -# CONFIG_SCHED_ATEXIT - Enabled the atexit() API +# Board-Specific Options # -CONFIG_USER_ENTRYPOINT="user_start" -#CONFIG_APPS_DIR= -CONFIG_DEBUG=n -CONFIG_DEBUG_VERBOSE=n -CONFIG_DEBUG_SYMBOLS=y -CONFIG_DEBUG_FS=n -CONFIG_DEBUG_GRAPHICS=n -CONFIG_DEBUG_LCD=n -CONFIG_DEBUG_USB=n -CONFIG_DEBUG_NET=n -CONFIG_DEBUG_RTC=n -CONFIG_DEBUG_ANALOG=n -CONFIG_DEBUG_PWM=n -CONFIG_DEBUG_CAN=n -CONFIG_DEBUG_I2C=n -CONFIG_DEBUG_INPUT=n - -CONFIG_MSEC_PER_TICK=1 -CONFIG_HAVE_CXX=y -CONFIG_HAVE_CXXINITIALIZE=y -CONFIG_MM_REGIONS=1 -CONFIG_MM_SMALL=y -CONFIG_ARCH_LOWPUTC=y -CONFIG_RR_INTERVAL=0 -CONFIG_SCHED_INSTRUMENTATION=n -CONFIG_TASK_NAME_SIZE=8 -CONFIG_START_YEAR=1970 -CONFIG_START_MONTH=1 -CONFIG_START_DAY=1 -CONFIG_GREGORIAN_TIME=n -CONFIG_JULIAN_TIME=n -# this eats ~1KiB of RAM ... work out why -CONFIG_DEV_CONSOLE=y -CONFIG_DEV_LOWCONSOLE=n -CONFIG_MUTEX_TYPES=n -CONFIG_PRIORITY_INHERITANCE=n -CONFIG_SEM_PREALLOCHOLDERS=0 -CONFIG_SEM_NNESTPRIO=0 -CONFIG_FDCLONE_DISABLE=y -CONFIG_FDCLONE_STDIO=y -CONFIG_SDCLONE_DISABLE=y -CONFIG_SCHED_WORKQUEUE=n -CONFIG_SCHED_WORKPRIORITY=50 -CONFIG_SCHED_WORKPERIOD=50000 -CONFIG_SCHED_WORKSTACKSIZE=1024 -CONFIG_SIG_SIGWORK=4 -CONFIG_SCHED_WAITPID=n -CONFIG_SCHED_ATEXIT=n - -# -# The following can be used to disable categories of -# APIs supported by the OS. If the compiler supports -# weak functions, then it should not be necessary to -# disable functions unless you want to restrict usage -# of those APIs. -# -# There are certain dependency relationships in these -# features. -# -# o mq_notify logic depends on signals to awaken tasks -# waiting for queues to become full or empty. -# o pthread_condtimedwait() depends on signals to wake -# up waiting tasks. -# -CONFIG_DISABLE_CLOCK=n + +# +# RTOS Features +# +CONFIG_DISABLE_OS_API=y CONFIG_DISABLE_POSIX_TIMERS=y CONFIG_DISABLE_PTHREAD=y CONFIG_DISABLE_SIGNALS=y CONFIG_DISABLE_MQUEUE=y -CONFIG_DISABLE_MOUNTPOINT=y CONFIG_DISABLE_ENVIRON=y -CONFIG_DISABLE_POLL=y # -# Misc libc settings -# -# CONFIG_NOPRINTF_FIELDWIDTH - sprintf-related logic is a -# little smaller if we do not support fieldwidthes -# -CONFIG_NOPRINTF_FIELDWIDTH=n - -# -# Allow for architecture optimized implementations -# -# The architecture can provide optimized versions of the -# following to improve system performance -# -CONFIG_ARCH_MEMCPY=n -CONFIG_ARCH_MEMCMP=n -CONFIG_ARCH_MEMMOVE=n -CONFIG_ARCH_MEMSET=n -CONFIG_ARCH_STRCMP=n -CONFIG_ARCH_STRCPY=n -CONFIG_ARCH_STRNCPY=n -CONFIG_ARCH_STRLEN=n -CONFIG_ARCH_STRNLEN=n -CONFIG_ARCH_BZERO=n - -# -# Sizes of configurable things (0 disables) -# -# CONFIG_MAX_TASKS - The maximum number of simultaneously -# active tasks. This value must be a power of two. -# CONFIG_MAX_TASK_ARGS - This controls the maximum number of -# of parameters that a task may receive (i.e., maxmum value -# of 'argc') -# CONFIG_NPTHREAD_KEYS - The number of items of thread- -# specific data that can be retained -# CONFIG_NFILE_DESCRIPTORS - The maximum number of file -# descriptors (one for each open) -# CONFIG_NFILE_STREAMS - The maximum number of streams that -# can be fopen'ed -# CONFIG_NAME_MAX - The maximum size of a file name. -# CONFIG_STDIO_BUFFER_SIZE - Size of the buffer to allocate -# on fopen. (Only if CONFIG_NFILE_STREAMS > 0) -# CONFIG_STDIO_LINEBUFFER - If standard C buffered I/O is enabled -# (CONFIG_STDIO_BUFFER_SIZE > 0), then this option may be added -# to force automatic, line-oriented flushing the output buffer -# for putc(), fputc(), putchar(), puts(), fputs(), printf(), -# fprintf(), and vfprintf(). When a newline is encountered in -# the output string, the output buffer will be flushed. This -# (slightly) increases the NuttX footprint but supports the kind -# of behavior that people expect for printf(). -# CONFIG_NUNGET_CHARS - Number of characters that can be -# buffered by ungetc() (Only if CONFIG_NFILE_STREAMS > 0) -# CONFIG_PREALLOC_MQ_MSGS - The number of pre-allocated message -# structures. The system manages a pool of preallocated -# message structures to minimize dynamic allocations -# CONFIG_MQ_MAXMSGSIZE - Message structures are allocated with -# a fixed payload size given by this settin (does not include -# other message structure overhead. -# CONFIG_MAX_WDOGPARMS - Maximum number of parameters that -# can be passed to a watchdog handler -# CONFIG_PREALLOC_WDOGS - The number of pre-allocated watchdog -# structures. The system manages a pool of preallocated -# watchdog structures to minimize dynamic allocations -# CONFIG_PREALLOC_TIMERS - The number of pre-allocated POSIX -# timer structures. The system manages a pool of preallocated -# timer structures to minimize dynamic allocations. Set to -# zero for all dynamic allocations. +# Clocks and Timers # -CONFIG_MAX_TASKS=4 -CONFIG_MAX_TASK_ARGS=4 -CONFIG_NPTHREAD_KEYS=2 -CONFIG_NFILE_DESCRIPTORS=8 -CONFIG_NFILE_STREAMS=0 -CONFIG_NAME_MAX=12 -CONFIG_STDIO_BUFFER_SIZE=32 -CONFIG_STDIO_LINEBUFFER=n -CONFIG_NUNGET_CHARS=2 -CONFIG_PREALLOC_MQ_MSGS=4 -CONFIG_MQ_MAXMSGSIZE=32 +CONFIG_USEC_PER_TICK=1000 +# CONFIG_SYSTEM_TIME64 is not set +# CONFIG_CLOCK_MONOTONIC is not set +# CONFIG_JULIAN_TIME is not set +CONFIG_START_YEAR=1970 +CONFIG_START_MONTH=1 +CONFIG_START_DAY=1 CONFIG_MAX_WDOGPARMS=2 CONFIG_PREALLOC_WDOGS=4 +CONFIG_WDOG_INTRESERVE=4 CONFIG_PREALLOC_TIMERS=0 +# +# Tasks and Scheduling +# +# CONFIG_INIT_NONE is not set +CONFIG_INIT_ENTRYPOINT=y +# CONFIG_INIT_FILEPATH is not set +CONFIG_USER_ENTRYPOINT="user_start" +CONFIG_RR_INTERVAL=0 +CONFIG_TASK_NAME_SIZE=8 +CONFIG_MAX_TASKS=4 +# CONFIG_SCHED_HAVE_PARENT is not set +# CONFIG_SCHED_WAITPID is not set # -# Settings for apps/nshlib +# Performance Monitoring +# +# CONFIG_SCHED_CPULOAD is not set +# CONFIG_SCHED_INSTRUMENTATION is not set + # -# CONFIG_NSH_BUILTIN_APPS - Support external registered, -# "named" applications that can be executed from the NSH -# command line (see apps/README.txt for more information). -# CONFIG_NSH_FILEIOSIZE - Size of a static I/O buffer -# CONFIG_NSH_STRERROR - Use strerror(errno) -# CONFIG_NSH_LINELEN - Maximum length of one command line -# CONFIG_NSH_NESTDEPTH - Max number of nested if-then[-else]-fi -# CONFIG_NSH_DISABLESCRIPT - Disable scripting support -# CONFIG_NSH_DISABLEBG - Disable background commands -# CONFIG_NSH_ROMFSETC - Use startup script in /etc -# CONFIG_NSH_CONSOLE - Use serial console front end -# CONFIG_NSH_TELNET - Use telnetd console front end -# CONFIG_NSH_ARCHINIT - Platform provides architecture -# specific initialization (nsh_archinitialize()). +# Files and I/O # +CONFIG_DEV_CONSOLE=y +CONFIG_FDCLONE_DISABLE=y +CONFIG_FDCLONE_STDIO=y +CONFIG_SDCLONE_DISABLE=y +CONFIG_NFILE_DESCRIPTORS=8 +CONFIG_NFILE_STREAMS=0 +CONFIG_NAME_MAX=12 +# CONFIG_PRIORITY_INHERITANCE is not set -# Disable NSH completely -CONFIG_NSH_CONSOLE=n +# +# RTOS hooks +# +# CONFIG_BOARD_INITIALIZE is not set +# CONFIG_SCHED_STARTHOOK is not set +# CONFIG_SCHED_ATEXIT is not set +# CONFIG_SCHED_ONEXIT is not set + +# +# Work Queue Support +# # # Stack and heap information # -# CONFIG_BOOT_RUNFROMFLASH - Some configurations support XIP -# operation from FLASH but must copy initialized .data sections to RAM. -# (should also be =n for the STM3210E-EVAL which always runs from flash) -# CONFIG_BOOT_COPYTORAM - Some configurations boot in FLASH -# but copy themselves entirely into RAM for better performance. -# CONFIG_CUSTOM_STACK - The up_ implementation will handle -# all stack operations outside of the nuttx model. -# CONFIG_STACK_POINTER - The initial stack pointer (arm7tdmi only) -# CONFIG_IDLETHREAD_STACKSIZE - The size of the initial stack. -# This is the thread that (1) performs the inital boot of the system up -# to the point where user_start() is spawned, and (2) there after is the -# IDLE thread that executes only when there is no other thread ready to -# run. -# CONFIG_USERMAIN_STACKSIZE - The size of the stack to allocate -# for the main user thread that begins at the user_start() entry point. -# CONFIG_PTHREAD_STACK_MIN - Minimum pthread stack size -# CONFIG_PTHREAD_STACK_DEFAULT - Default pthread stack size -# CONFIG_HEAP_BASE - The beginning of the heap -# CONFIG_HEAP_SIZE - The size of the heap -# -CONFIG_BOOT_RUNFROMFLASH=n -CONFIG_BOOT_COPYTORAM=n -CONFIG_CUSTOM_STACK=n -CONFIG_STACK_POINTER= CONFIG_IDLETHREAD_STACKSIZE=1024 CONFIG_USERMAIN_STACKSIZE=1200 CONFIG_PTHREAD_STACK_MIN=512 CONFIG_PTHREAD_STACK_DEFAULT=1024 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= +# CONFIG_LIB_SYSCALL is not set + +# +# Device Drivers +# +CONFIG_DISABLE_POLL=y +# CONFIG_DEV_NULL is not set +# CONFIG_DEV_ZERO is not set +# CONFIG_LOOP is not set + +# +# Buffering +# +# CONFIG_DRVR_WRITEBUFFER is not set +# CONFIG_DRVR_READAHEAD is not set +# CONFIG_RAMDISK is not set +# CONFIG_CAN is not set +# CONFIG_ARCH_HAVE_PWM_PULSECOUNT is not set +# CONFIG_PWM is not set +CONFIG_ARCH_HAVE_I2CRESET=y +# CONFIG_I2C is not set +# CONFIG_SPI is not set +# CONFIG_I2S is not set +# CONFIG_RTC is not set +# CONFIG_WATCHDOG is not set +# CONFIG_TIMER is not set +# CONFIG_ANALOG is not set +# CONFIG_AUDIO_DEVICES is not set +# CONFIG_VIDEO_DEVICES is not set +# CONFIG_BCH is not set +# CONFIG_INPUT is not set +# CONFIG_LCD is not set +# CONFIG_MMCSD is not set +# CONFIG_MTD is not set +# CONFIG_EEPROM is not set +# CONFIG_PIPES is not set +# CONFIG_PM is not set +# CONFIG_POWER is not set +# CONFIG_SENSORS is not set +# CONFIG_SERCOMM_CONSOLE is not set +CONFIG_SERIAL=y +# CONFIG_DEV_LOWCONSOLE is not set +# CONFIG_16550_UART is not set +# CONFIG_ARCH_HAVE_UART is not set +# CONFIG_ARCH_HAVE_UART0 is not set +# CONFIG_ARCH_HAVE_UART1 is not set +# CONFIG_ARCH_HAVE_UART2 is not set +# CONFIG_ARCH_HAVE_UART3 is not set +# CONFIG_ARCH_HAVE_UART4 is not set +# CONFIG_ARCH_HAVE_UART5 is not set +# CONFIG_ARCH_HAVE_UART6 is not set +# CONFIG_ARCH_HAVE_UART7 is not set +# CONFIG_ARCH_HAVE_UART8 is not set +# CONFIG_ARCH_HAVE_SCI0 is not set +# CONFIG_ARCH_HAVE_SCI1 is not set +# CONFIG_ARCH_HAVE_USART0 is not set +CONFIG_ARCH_HAVE_USART1=y +CONFIG_ARCH_HAVE_USART2=y +CONFIG_ARCH_HAVE_USART3=y +# CONFIG_ARCH_HAVE_USART4 is not set +# CONFIG_ARCH_HAVE_USART5 is not set +# CONFIG_ARCH_HAVE_USART6 is not set +# CONFIG_ARCH_HAVE_USART7 is not set +# CONFIG_ARCH_HAVE_USART8 is not set +# CONFIG_ARCH_HAVE_OTHER_UART is not set + +# +# USART Configuration +# +CONFIG_USART1_ISUART=y +CONFIG_USART2_ISUART=y +CONFIG_USART3_ISUART=y +CONFIG_MCU_SERIAL=y +CONFIG_STANDARD_SERIAL=y +# CONFIG_SERIAL_IFLOWCONTROL is not set +# CONFIG_SERIAL_OFLOWCONTROL is not set +CONFIG_ARCH_HAVE_SERIAL_TERMIOS=y +CONFIG_SERIAL_TERMIOS=y +CONFIG_USART1_SERIAL_CONSOLE=y +# CONFIG_USART2_SERIAL_CONSOLE is not set +# CONFIG_USART3_SERIAL_CONSOLE is not set +# CONFIG_OTHER_SERIAL_CONSOLE is not set +# CONFIG_NO_SERIAL_CONSOLE is not set + +# +# USART1 Configuration +# +CONFIG_USART1_RXBUFSIZE=64 +CONFIG_USART1_TXBUFSIZE=64 +CONFIG_USART1_BAUD=115200 +CONFIG_USART1_BITS=8 +CONFIG_USART1_PARITY=0 +CONFIG_USART1_2STOP=0 +# CONFIG_USART1_IFLOWCONTROL is not set +# CONFIG_USART1_OFLOWCONTROL is not set + +# +# USART2 Configuration +# +CONFIG_USART2_RXBUFSIZE=64 +CONFIG_USART2_TXBUFSIZE=64 +CONFIG_USART2_BAUD=115200 +CONFIG_USART2_BITS=8 +CONFIG_USART2_PARITY=0 +CONFIG_USART2_2STOP=0 +# CONFIG_USART2_IFLOWCONTROL is not set +# CONFIG_USART2_OFLOWCONTROL is not set + +# +# USART3 Configuration +# +CONFIG_USART3_RXBUFSIZE=64 +CONFIG_USART3_TXBUFSIZE=64 +CONFIG_USART3_BAUD=115200 +CONFIG_USART3_BITS=8 +CONFIG_USART3_PARITY=0 +CONFIG_USART3_2STOP=0 +# CONFIG_USART3_IFLOWCONTROL is not set +# CONFIG_USART3_OFLOWCONTROL is not set +# CONFIG_USBDEV is not set +# CONFIG_USBHOST is not set +# CONFIG_WIRELESS is not set + +# +# System Logging Device Options +# + +# +# System Logging +# +# CONFIG_RAMLOG is not set + +# +# Networking Support +# +# CONFIG_ARCH_HAVE_NET is not set +# CONFIG_ARCH_HAVE_PHY is not set +# CONFIG_NET is not set + +# +# Crypto API +# +# CONFIG_CRYPTO is not set + +# +# File Systems +# + +# +# File system configuration +# +CONFIG_DISABLE_MOUNTPOINT=y +CONFIG_DISABLE_PSEUDOFS_OPERATIONS=y +# CONFIG_FS_READABLE is not set +# CONFIG_FS_WRITABLE is not set +# CONFIG_FS_NAMED_SEMAPHORES is not set +# CONFIG_FS_RAMMAP is not set +# CONFIG_FS_PROCFS is not set + +# +# System Logging +# +# CONFIG_SYSLOG is not set +# CONFIG_SYSLOG_TIMESTAMP is not set + +# +# Graphics Support +# +# CONFIG_NX is not set + +# +# Memory Management +# +CONFIG_MM_SMALL=y +CONFIG_MM_REGIONS=1 +# CONFIG_ARCH_HAVE_HEAP2 is not set +# CONFIG_GRAN is not set + +# +# Audio Support +# +# CONFIG_AUDIO is not set + +# +# Binary Loader +# +# CONFIG_BINFMT_DISABLE is not set +# CONFIG_NXFLAT is not set +# CONFIG_ELF is not set +# CONFIG_BUILTIN is not set +# CONFIG_PIC is not set +# CONFIG_SYMTAB_ORDEREDBYNAME is not set + +# +# Library Routines +# + +# +# Standard C Library Options +# +CONFIG_STDIO_BUFFER_SIZE=32 +# CONFIG_STDIO_LINEBUFFER is not set +CONFIG_NUNGET_CHARS=2 +# CONFIG_NOPRINTF_FIELDWIDTH is not set +# CONFIG_LIBC_FLOATINGPOINT is not set +# CONFIG_LIBC_IOCTL_VARIADIC is not set +CONFIG_LIB_RAND_ORDER=1 +# CONFIG_EOL_IS_CR is not set +# CONFIG_EOL_IS_LF is not set +# CONFIG_EOL_IS_BOTH_CRLF is not set +CONFIG_EOL_IS_EITHER_CRLF=y +# CONFIG_LIBC_EXECFUNCS is not set +CONFIG_POSIX_SPAWN_PROXY_STACKSIZE=1024 +CONFIG_TASK_SPAWN_DEFAULT_STACKSIZE=1024 +# CONFIG_LIBC_STRERROR is not set +# CONFIG_LIBC_PERROR_STDOUT is not set +CONFIG_ARCH_LOWPUTC=y +CONFIG_LIB_SENDFILE_BUFSIZE=512 +# CONFIG_ARCH_ROMGETC is not set +# CONFIG_ARCH_OPTIMIZED_FUNCTIONS is not set + +# +# Non-standard Library Support +# +# CONFIG_LIB_KBDCODEC is not set +# CONFIG_LIB_SLCDCODEC is not set + +# +# Basic CXX Support +# +CONFIG_C99_BOOL8=y +CONFIG_HAVE_CXX=y +CONFIG_HAVE_CXXINITIALIZE=y +# CONFIG_CXX_NEWLONG is not set + +# +# uClibc++ Standard C++ Library +# +# CONFIG_UCLIBCXX is not set + +# +# Application Configuration +# + +# +# Built-In Applications +# + +# +# Examples +# +# CONFIG_EXAMPLES_BUTTONS is not set +# CONFIG_EXAMPLES_CAN is not set +# CONFIG_EXAMPLES_CONFIGDATA is not set +# CONFIG_EXAMPLES_CPUHOG is not set +# CONFIG_EXAMPLES_CXXTEST is not set +# CONFIG_EXAMPLES_DHCPD is not set +# CONFIG_EXAMPLES_ELF is not set +# CONFIG_EXAMPLES_FTPC is not set +# CONFIG_EXAMPLES_FTPD is not set +# CONFIG_EXAMPLES_HELLO is not set +# CONFIG_EXAMPLES_HELLOXX is not set +# CONFIG_EXAMPLES_JSON is not set +# CONFIG_EXAMPLES_HIDKBD is not set +# CONFIG_EXAMPLES_KEYPADTEST is not set +# CONFIG_EXAMPLES_IGMP is not set +# CONFIG_EXAMPLES_MM is not set +# CONFIG_EXAMPLES_MODBUS is not set +# CONFIG_EXAMPLES_MOUNT is not set +# CONFIG_EXAMPLES_NRF24L01TERM is not set +# CONFIG_EXAMPLES_NSH is not set +# CONFIG_EXAMPLES_NULL is not set +# CONFIG_EXAMPLES_NX is not set +# CONFIG_EXAMPLES_NXTERM is not set +# CONFIG_EXAMPLES_NXFFS is not set +# CONFIG_EXAMPLES_NXFLAT is not set +# CONFIG_EXAMPLES_NXHELLO is not set +# CONFIG_EXAMPLES_NXIMAGE is not set +# CONFIG_EXAMPLES_NXLINES is not set +# CONFIG_EXAMPLES_NXTEXT is not set +# CONFIG_EXAMPLES_OSTEST is not set +# CONFIG_EXAMPLES_PIPE is not set +# CONFIG_EXAMPLES_POLL is not set +# CONFIG_EXAMPLES_POSIXSPAWN is not set +# CONFIG_EXAMPLES_QENCODER is not set +# CONFIG_EXAMPLES_RGMP is not set +# CONFIG_EXAMPLES_ROMFS is not set +# CONFIG_EXAMPLES_SENDMAIL is not set +# CONFIG_EXAMPLES_SERIALBLASTER is not set +# CONFIG_EXAMPLES_SERIALRX is not set +# CONFIG_EXAMPLES_SERLOOP is not set +# CONFIG_EXAMPLES_SLCD is not set +# CONFIG_EXAMPLES_SMART is not set +# CONFIG_EXAMPLES_TCPECHO is not set +# CONFIG_EXAMPLES_TELNETD is not set +# CONFIG_EXAMPLES_THTTPD is not set +# CONFIG_EXAMPLES_TIFF is not set +# CONFIG_EXAMPLES_TOUCHSCREEN is not set +# CONFIG_EXAMPLES_UDP is not set +# CONFIG_EXAMPLES_WEBSERVER is not set +# CONFIG_EXAMPLES_USBSERIAL is not set +# CONFIG_EXAMPLES_USBTERM is not set +# CONFIG_EXAMPLES_WATCHDOG is not set + +# +# Graphics Support +# +# CONFIG_TIFF is not set +# CONFIG_GRAPHICS_TRAVELER is not set + +# +# Interpreters +# +# CONFIG_INTERPRETERS_FICL is not set +# CONFIG_INTERPRETERS_PCODE is not set + +# +# Network Utilities +# + +# +# Networking Utilities +# +# CONFIG_NETUTILS_CODECS is not set +# CONFIG_NETUTILS_DHCPD is not set +# CONFIG_NETUTILS_FTPC is not set +# CONFIG_NETUTILS_FTPD is not set +# CONFIG_NETUTILS_JSON is not set +# CONFIG_NETUTILS_SMTP is not set +# CONFIG_NETUTILS_TFTPC is not set +# CONFIG_NETUTILS_THTTPD is not set +# CONFIG_NETUTILS_NETLIB is not set +# CONFIG_NETUTILS_WEBCLIENT is not set + +# +# FreeModBus +# +# CONFIG_MODBUS is not set # # NSH Library # # CONFIG_NSH_LIBRARY is not set -# CONFIG_NSH_BUILTIN_APPS is not set + +# +# NxWidgets/NxWM +# + +# +# Platform-specific Support +# +# CONFIG_PLATFORM_CONFIGDATA is not set + +# +# System Libraries and NSH Add-Ons +# + +# +# Custom Free Memory Command +# +# CONFIG_SYSTEM_FREE is not set + +# +# EMACS-like Command Line Editor +# +# CONFIG_SYSTEM_CLE is not set + +# +# CU Minimal Terminal +# +# CONFIG_SYSTEM_CUTERM is not set + +# +# FLASH Program Installation +# +# CONFIG_SYSTEM_INSTALL is not set + +# +# FLASH Erase-all Command +# + +# +# Intel HEX to binary conversion +# +# CONFIG_SYSTEM_HEX2BIN is not set + +# +# I2C tool +# + +# +# INI File Parser +# +# CONFIG_SYSTEM_INIFILE is not set + +# +# NxPlayer media player library / command Line +# + +# +# RAM test +# +# CONFIG_SYSTEM_RAMTEST is not set + +# +# readline() +# +# CONFIG_SYSTEM_READLINE is not set + +# +# P-Code Support +# + +# +# PHY Tool +# + +# +# Power Off +# +# CONFIG_SYSTEM_POWEROFF is not set + +# +# RAMTRON +# +# CONFIG_SYSTEM_RAMTRON is not set + +# +# SD Card +# +# CONFIG_SYSTEM_SDCARD is not set + +# +# Sudoku +# +# CONFIG_SYSTEM_SUDOKU is not set + +# +# Sysinfo +# +# CONFIG_SYSTEM_SYSINFO is not set + +# +# VI Work-Alike Editor +# +# CONFIG_SYSTEM_VI is not set + +# +# Stack Monitor +# + +# +# USB CDC/ACM Device Commands +# + +# +# USB Composite Device Commands +# + +# +# USB Mass Storage Device Commands +# + +# +# USB Monitor +# + +# +# Zmodem Commands +# +# CONFIG_SYSTEM_ZMODEM is not set -- cgit v1.2.3 From d95ac392298a6532d5fe25c58ee3b293e0ea12d6 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Tue, 6 Jan 2015 19:49:25 +0100 Subject: NuttX configs: Re-add missing board configs --- nuttx-configs/px4io-v1/nsh/defconfig | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/nuttx-configs/px4io-v1/nsh/defconfig b/nuttx-configs/px4io-v1/nsh/defconfig index 7f2842b9c..f962046c0 100755 --- a/nuttx-configs/px4io-v1/nsh/defconfig +++ b/nuttx-configs/px4io-v1/nsh/defconfig @@ -411,7 +411,9 @@ CONFIG_RAM_SIZE=8192 # # Board Selection # -CONFIG_ARCH_BOARD_CUSTOM=y +CONFIG_ARCH_BOARD_PX4IO_V1=y +# CONFIG_ARCH_BOARD_CUSTOM is not set +CONFIG_ARCH_BOARD="px4io-v1" # # Custom Board Configuration -- cgit v1.2.3 From d273679dafb55ca4f40e58b9eb086bcb2ce1bd68 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Tue, 6 Jan 2015 20:17:11 +0100 Subject: Set the interrupt reserve watchdogs to a smaller number --- nuttx-configs/px4io-v1/nsh/defconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nuttx-configs/px4io-v1/nsh/defconfig b/nuttx-configs/px4io-v1/nsh/defconfig index f962046c0..54161dc77 100755 --- a/nuttx-configs/px4io-v1/nsh/defconfig +++ b/nuttx-configs/px4io-v1/nsh/defconfig @@ -451,8 +451,8 @@ CONFIG_START_YEAR=1970 CONFIG_START_MONTH=1 CONFIG_START_DAY=1 CONFIG_MAX_WDOGPARMS=2 -CONFIG_PREALLOC_WDOGS=4 -CONFIG_WDOG_INTRESERVE=4 +CONFIG_PREALLOC_WDOGS=6 +CONFIG_WDOG_INTRESERVE=2 CONFIG_PREALLOC_TIMERS=0 # -- cgit v1.2.3 From 042b32d4878d6ee5c743dbd4ac43049e43509293 Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Wed, 7 Jan 2015 09:35:41 -1000 Subject: Added Probes --- nuttx-configs/px4fmu-v2/nsh/defconfig | 1 - 1 file changed, 1 deletion(-) diff --git a/nuttx-configs/px4fmu-v2/nsh/defconfig b/nuttx-configs/px4fmu-v2/nsh/defconfig index 23db04547..6a1aec22b 100644 --- a/nuttx-configs/px4fmu-v2/nsh/defconfig +++ b/nuttx-configs/px4fmu-v2/nsh/defconfig @@ -894,7 +894,6 @@ CONFIG_EXAMPLES_NSH=y # Interpreters # # CONFIG_INTERPRETERS_FICL is not set -# CONFIG_INTERPRETERS_BAS is not set # CONFIG_INTERPRETERS_PCODE is not set # -- cgit v1.2.3 From 6911e162e63f12f403d8c66267804fa5d5e950f3 Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Wed, 7 Jan 2015 16:04:55 -1000 Subject: Probes in board.h but disabled and with Configuation for SDIO fix --- nuttx-configs/px4fmu-v2/nsh/defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/nuttx-configs/px4fmu-v2/nsh/defconfig b/nuttx-configs/px4fmu-v2/nsh/defconfig index 6a1aec22b..05c652523 100644 --- a/nuttx-configs/px4fmu-v2/nsh/defconfig +++ b/nuttx-configs/px4fmu-v2/nsh/defconfig @@ -493,6 +493,7 @@ CONFIG_MMCSD_NSLOTS=1 CONFIG_MMCSD_MULTIBLOCK_DISABLE=y # CONFIG_MMCSD_MMCSUPPORT is not set # CONFIG_MMCSD_HAVECARDDETECT is not set +CONFIG_MMCSD_HAVE_SDIOWAIT_WRCOMPLETE=y # CONFIG_MMCSD_SPI is not set CONFIG_MMCSD_SDIO=y # CONFIG_SDIO_MUXBUS is not set -- cgit v1.2.3 From 60043fc9b0cbe560a284ea72db8b3ed8623f6987 Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Wed, 14 Jan 2015 07:09:10 -1000 Subject: updated to latest upstream --- nuttx-configs/px4fmu-v2/nsh/defconfig | 1 - 1 file changed, 1 deletion(-) diff --git a/nuttx-configs/px4fmu-v2/nsh/defconfig b/nuttx-configs/px4fmu-v2/nsh/defconfig index 05c652523..6a1aec22b 100644 --- a/nuttx-configs/px4fmu-v2/nsh/defconfig +++ b/nuttx-configs/px4fmu-v2/nsh/defconfig @@ -493,7 +493,6 @@ CONFIG_MMCSD_NSLOTS=1 CONFIG_MMCSD_MULTIBLOCK_DISABLE=y # CONFIG_MMCSD_MMCSUPPORT is not set # CONFIG_MMCSD_HAVECARDDETECT is not set -CONFIG_MMCSD_HAVE_SDIOWAIT_WRCOMPLETE=y # CONFIG_MMCSD_SPI is not set CONFIG_MMCSD_SDIO=y # CONFIG_SDIO_MUXBUS is not set -- cgit v1.2.3 From e3e5fd5cf758e1fa7d4aaeb30e9fff06cefb6d5d Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Wed, 14 Jan 2015 16:33:02 -1000 Subject: Allows CONFIG_ARMV7M_STACKCHECK to be not set --- makefiles/toolchain_gnu-arm-eabi.mk | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/makefiles/toolchain_gnu-arm-eabi.mk b/makefiles/toolchain_gnu-arm-eabi.mk index 2c5302812..853885a3b 100644 --- a/makefiles/toolchain_gnu-arm-eabi.mk +++ b/makefiles/toolchain_gnu-arm-eabi.mk @@ -1,5 +1,5 @@ # -# Copyright (C) 2012-2014 PX4 Development Team. All rights reserved. +# Copyright (c) 2012-2015 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 @@ -80,12 +80,23 @@ ARCHCPUFLAGS_CORTEXM3 = -mcpu=cortex-m3 \ -march=armv7-m \ -mfloat-abi=soft +# +# Tool to test a Nuttx Config value from config.h +# + +NUTTX_CONFIG_H=$(WORK_DIR)nuttx-export/include/nuttx/config.h +define check_nuttx_config +$(strip $(shell $(GREP) -q $1 $2;echo $$?;)) +endef +nuttx_config_true:="0" +nuttx_config_2true:="0 0" + +# # Enabling stack checks if OS was build with them # -TEST_FILE_STACKCHECK=$(WORK_DIR)nuttx-export/include/nuttx/config.h -TEST_VALUE_STACKCHECK=CONFIG_ARMV7M_STACKCHECK\ 1 -ENABLE_STACK_CHECKS=$(shell $(GREP) -q "$(TEST_VALUE_STACKCHECK)" $(TEST_FILE_STACKCHECK); echo $$?;) -ifeq ("$(ENABLE_STACK_CHECKS)","0") + +ENABLE_STACK_CHECKS=$(call check_nuttx_config ,"CONFIG_ARMV7M_STACKCHECK 1", $(NUTTX_CONFIG_H)) +ifeq ("$(ENABLE_STACK_CHECKS)",$(nuttx_config_true)) ARCHINSTRUMENTATIONDEFINES_CORTEXM4F = -finstrument-functions -ffixed-r10 ARCHINSTRUMENTATIONDEFINES_CORTEXM4 = -finstrument-functions -ffixed-r10 ARCHINSTRUMENTATIONDEFINES_CORTEXM3 = @@ -328,3 +339,4 @@ define BIN_TO_OBJ --rename-section .data=.rodata $(Q) $(REMOVE) $2.c $2.c.o endef + -- cgit v1.2.3 From 61e35e5f7ca58bdc4624860ca64d2f1451bf15a3 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Thu, 22 Jan 2015 08:49:12 +0100 Subject: Fix up math.h for GCC 4.9 --- nuttx-patches/math.h.patch | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/nuttx-patches/math.h.patch b/nuttx-patches/math.h.patch index e09120f9c..18650027e 100644 --- a/nuttx-patches/math.h.patch +++ b/nuttx-patches/math.h.patch @@ -230,7 +230,7 @@ diff -ruN NuttX/nuttx/arch/arm/include/math.h NuttX/nuttx/arch/arm/include/math. +extern double tgamma _PARAMS((double)); +extern double nearbyint _PARAMS((double)); +extern long int lrint _PARAMS((double)); -+extern _LONG_LONG_TYPE int llrint _PARAMS((double)); ++extern long long int llrint _PARAMS((double)); +extern double round _PARAMS((double)); +extern long int lround _PARAMS((double)); +extern long long int llround _PARAMS((double)); @@ -297,7 +297,7 @@ diff -ruN NuttX/nuttx/arch/arm/include/math.h NuttX/nuttx/arch/arm/include/math. +extern float tgammaf _PARAMS((float)); +extern float nearbyintf _PARAMS((float)); +extern long int lrintf _PARAMS((float)); -+extern _LONG_LONG_TYPE llrintf _PARAMS((float)); ++extern long long llrintf _PARAMS((float)); +extern float roundf _PARAMS((float)); +extern long int lroundf _PARAMS((float)); +extern long long int llroundf _PARAMS((float)); @@ -387,7 +387,7 @@ diff -ruN NuttX/nuttx/arch/arm/include/math.h NuttX/nuttx/arch/arm/include/math. +extern long long int llrintl _PARAMS((long double)); +extern long double roundl _PARAMS((long double)); +extern long lroundl _PARAMS((long double)); -+extern _LONG_LONG_TYPE int llroundl _PARAMS((long double)); ++extern long long int llroundl _PARAMS((long double)); +extern long double truncl _PARAMS((long double)); +extern long double remquol _PARAMS((long double, long double, int *)); +extern long double fdiml _PARAMS((long double, long double)); @@ -407,7 +407,7 @@ diff -ruN NuttX/nuttx/arch/arm/include/math.h NuttX/nuttx/arch/arm/include/math. +/* Other long double precision functions. */ +extern _LONG_DOUBLE rintl _PARAMS((_LONG_DOUBLE)); +extern long int lrintl _PARAMS((_LONG_DOUBLE)); -+extern _LONG_LONG_TYPE llrintl _PARAMS((_LONG_DOUBLE)); ++extern long long llrintl _PARAMS((_LONG_DOUBLE)); +#endif /* __i386__ */ +#endif /* !_LDBL_EQ_DBL */ + -- cgit v1.2.3 From 848f1a13b6e6a9089ae6634c5af41aee59b5cc8a Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Thu, 22 Jan 2015 08:49:51 +0100 Subject: Fix merge fail in nuttx configs, adjust LP and HP work stack sizes, reduce interrupt stack from excessive 4K to 2K --- nuttx-configs/aerocore/nsh/defconfig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nuttx-configs/aerocore/nsh/defconfig b/nuttx-configs/aerocore/nsh/defconfig index fab7dbbd2..c4f91a86d 100644 --- a/nuttx-configs/aerocore/nsh/defconfig +++ b/nuttx-configs/aerocore/nsh/defconfig @@ -332,7 +332,7 @@ CONFIG_BOARD_LOOPSPERMSEC=16717 CONFIG_DRAM_START=0x20000000 CONFIG_DRAM_SIZE=262144 CONFIG_ARCH_HAVE_INTERRUPTSTACK=y -CONFIG_ARCH_INTERRUPTSTACK=4096 +CONFIG_ARCH_INTERRUPTSTACK=2048 # # Boot options @@ -415,8 +415,8 @@ CONFIG_PREALLOC_TIMERS=50 # # Stack and heap information # -CONFIG_IDLETHREAD_STACKSIZE=6000 -CONFIG_USERMAIN_STACKSIZE=4096 +CONFIG_IDLETHREAD_STACKSIZE=3500 +CONFIG_USERMAIN_STACKSIZE=2600 CONFIG_PTHREAD_STACK_MIN=512 CONFIG_PTHREAD_STACK_DEFAULT=2048 -- cgit v1.2.3 From e21e143413fed3b100ead3e6be2e9d37a750b86e Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Thu, 22 Jan 2015 09:20:19 +0100 Subject: Enable CU term in FMUv2 config --- makefiles/config_px4fmu-v1_default.mk | 3 ++- makefiles/config_px4fmu-v2_default.mk | 3 ++- makefiles/config_px4fmu-v2_test.mk | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/makefiles/config_px4fmu-v1_default.mk b/makefiles/config_px4fmu-v1_default.mk index f30733694..89fd531f0 100644 --- a/makefiles/config_px4fmu-v1_default.mk +++ b/makefiles/config_px4fmu-v1_default.mk @@ -154,4 +154,5 @@ endef # command priority stack entrypoint BUILTIN_COMMANDS := \ $(call _B, sercon, , 2048, sercon_main ) \ - $(call _B, serdis, , 2048, serdis_main ) + $(call _B, serdis, , 2048, serdis_main ) \ + $(call _B, cu, , 2048, cu_main ) diff --git a/makefiles/config_px4fmu-v2_default.mk b/makefiles/config_px4fmu-v2_default.mk index 86925f9ff..37d7cd9c7 100644 --- a/makefiles/config_px4fmu-v2_default.mk +++ b/makefiles/config_px4fmu-v2_default.mk @@ -175,4 +175,5 @@ endef # command priority stack entrypoint BUILTIN_COMMANDS := \ $(call _B, sercon, , 2048, sercon_main ) \ - $(call _B, serdis, , 2048, serdis_main ) + $(call _B, serdis, , 2048, serdis_main ) \ + $(call _B, cu, , 2048, cu_main ) diff --git a/makefiles/config_px4fmu-v2_test.mk b/makefiles/config_px4fmu-v2_test.mk index 1e677f0da..db2bd2305 100644 --- a/makefiles/config_px4fmu-v2_test.mk +++ b/makefiles/config_px4fmu-v2_test.mk @@ -110,4 +110,5 @@ endef # command priority stack entrypoint BUILTIN_COMMANDS := \ $(call _B, sercon, , 2048, sercon_main ) \ - $(call _B, serdis, , 2048, serdis_main ) + $(call _B, serdis, , 2048, serdis_main ) \ + $(call _B, cu, , 2048, cu_main ) -- cgit v1.2.3 From a3190663e39c97e73c5cd7bd79da7856a9393a6b Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Thu, 22 Jan 2015 16:23:23 +0100 Subject: PX4IO driver: Try to talk to IO instead of just waiting for it --- ROMFS/px4fmu_common/init.d/rcS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ROMFS/px4fmu_common/init.d/rcS b/ROMFS/px4fmu_common/init.d/rcS index ea3f721f3..38892c475 100644 --- a/ROMFS/px4fmu_common/init.d/rcS +++ b/ROMFS/px4fmu_common/init.d/rcS @@ -207,7 +207,7 @@ then if px4io forceupdate 14662 ${IO_FILE} then - usleep 500000 + usleep 10000 if px4io checkcrc $IO_FILE then echo "PX4IO CRC OK after updating" >> $LOG_FILE -- cgit v1.2.3 From c2c4676b9d68b4ce08acab2baa6ca8a438e3c5ee Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Thu, 22 Jan 2015 10:41:33 -1000 Subject: Added Support for C++ static initializers --- src/drivers/boards/px4fmu-v2/module.mk | 7 +++++++ src/drivers/boards/px4fmu-v2/px4fmu2_init.c | 8 ++++++++ src/modules/systemlib/up_cxxinitialize.c | 14 +++++++++----- 3 files changed, 24 insertions(+), 5 deletions(-) diff --git a/src/drivers/boards/px4fmu-v2/module.mk b/src/drivers/boards/px4fmu-v2/module.mk index 103232b0c..e62e48e99 100644 --- a/src/drivers/boards/px4fmu-v2/module.mk +++ b/src/drivers/boards/px4fmu-v2/module.mk @@ -9,4 +9,11 @@ SRCS = px4fmu_can.c \ px4fmu_usb.c \ px4fmu2_led.c + +ENABLE_CXXINITIALIZE=$(call check_nuttx_config ,"CONFIG_HAVE_CXX 1", $(NUTTX_CONFIG_H)) +ENABLE_CXXINITIALIZE+=$(call check_nuttx_config ,"CONFIG_HAVE_CXXINITIALIZE 1", $(NUTTX_CONFIG_H)) +ifeq ("$(ENABLE_CXXINITIALIZE)",$(nuttx_config_2true)) +SRCS += ../../../modules/systemlib/up_cxxinitialize.c +endif + MAXOPTIMIZATION = -Os diff --git a/src/drivers/boards/px4fmu-v2/px4fmu2_init.c b/src/drivers/boards/px4fmu-v2/px4fmu2_init.c index 36ef53e2a..7fc1cd1df 100644 --- a/src/drivers/boards/px4fmu-v2/px4fmu2_init.c +++ b/src/drivers/boards/px4fmu-v2/px4fmu2_init.c @@ -239,6 +239,14 @@ __EXPORT int nsh_archinitialize(void) stm32_configgpio(GPIO_VDD_5V_HIPOWER_OC); stm32_configgpio(GPIO_VDD_5V_PERIPH_OC); +#if defined(CONFIG_HAVE_CXX) && defined(CONFIG_HAVE_CXXINITIALIZE) + + /* run C++ ctors before we go any further */ + + up_cxxinitialize(); + +#endif + /* configure the high-resolution time/callout interface */ hrt_init(); diff --git a/src/modules/systemlib/up_cxxinitialize.c b/src/modules/systemlib/up_cxxinitialize.c index c78f29570..4028945e5 100644 --- a/src/modules/systemlib/up_cxxinitialize.c +++ b/src/modules/systemlib/up_cxxinitialize.c @@ -1,8 +1,8 @@ /************************************************************************************ - * configs/stm32f4discovery/src/up_cxxinitialize.c + * src/modules/systemlib/up_cxxinitialize.c * arch/arm/src/board/up_cxxinitialize.c * - * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -44,9 +44,10 @@ #include -//#include -//#include "chip.h" +#include +#include "chip.h" +#if defined(CONFIG_HAVE_CXX) && defined(CONFIG_HAVE_CXXINITIALIZE) /************************************************************************************ * Definitions ************************************************************************************/ @@ -122,7 +123,7 @@ extern uint32_t _etext; * ***************************************************************************/ -__EXPORT void up_cxxinitialize(void) +void up_cxxinitialize(void) { initializer_t *initp; @@ -148,3 +149,6 @@ __EXPORT void up_cxxinitialize(void) } } } + +#endif /* CONFIG_HAVE_CXX && CONFIG_HAVE_CXXINITIALIZE */ + -- cgit v1.2.3 From c273adf79e087e36ee1eb4a95b30b6d1f4d3c40c Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Thu, 22 Jan 2015 12:28:18 -1000 Subject: Added Support for C++ static initializers for all boards. Including compile time checking for proper C++ configuration and not calling up_cxxinitialize redundantly --- src/drivers/boards/aerocore/aerocore_init.c | 15 +++++++++++++++ src/drivers/boards/aerocore/module.mk | 6 ++++++ src/drivers/boards/px4fmu-v1/module.mk | 6 ++++++ src/drivers/boards/px4fmu-v1/px4fmu_init.c | 14 ++++++++++++++ src/drivers/boards/px4fmu-v2/px4fmu2_init.c | 6 ++++++ src/drivers/boards/px4io-v1/module.mk | 6 ++++++ src/drivers/boards/px4io-v2/module.mk | 6 ++++++ src/modules/px4iofirmware/px4io.c | 11 +++++++++++ 8 files changed, 70 insertions(+) diff --git a/src/drivers/boards/aerocore/aerocore_init.c b/src/drivers/boards/aerocore/aerocore_init.c index e370fa983..91dbe4b81 100644 --- a/src/drivers/boards/aerocore/aerocore_init.c +++ b/src/drivers/boards/aerocore/aerocore_init.c @@ -228,6 +228,21 @@ __EXPORT int nsh_archinitialize(void) stm32_configgpio(GPIO_ADC1_IN12); /* J1 breakout */ stm32_configgpio(GPIO_ADC1_IN13); /* J1 breakout */ +#if defined(CONFIG_HAVE_CXX) && defined(CONFIG_HAVE_CXXINITIALIZE) + + /* run C++ ctors before we go any further */ + + up_cxxinitialize(); + +# if defined(CONFIG_EXAMPLES_NSH_CXXINITIALIZE) +# error CONFIG_EXAMPLES_NSH_CXXINITIALIZE Must not be defined! Use CONFIG_HAVE_CXX and CONFIG_HAVE_CXXINITIALIZE. +# endif + +#else +# error platform is dependent on c++ both CONFIG_HAVE_CXX and CONFIG_HAVE_CXXINITIALIZE must be defined. +#endif + + /* configure the high-resolution time/callout interface */ hrt_init(); diff --git a/src/drivers/boards/aerocore/module.mk b/src/drivers/boards/aerocore/module.mk index 0a2d91009..05e3d878d 100644 --- a/src/drivers/boards/aerocore/module.mk +++ b/src/drivers/boards/aerocore/module.mk @@ -7,4 +7,10 @@ SRCS = aerocore_init.c \ aerocore_spi.c \ aerocore_led.c +ENABLE_CXXINITIALIZE=$(call check_nuttx_config ,"CONFIG_HAVE_CXX 1", $(NUTTX_CONFIG_H)) +ENABLE_CXXINITIALIZE+=$(call check_nuttx_config ,"CONFIG_HAVE_CXXINITIALIZE 1", $(NUTTX_CONFIG_H)) +ifeq ("$(ENABLE_CXXINITIALIZE)",$(nuttx_config_2true)) +SRCS += ../../../modules/systemlib/up_cxxinitialize.c +endif + MAXOPTIMIZATION = -Os diff --git a/src/drivers/boards/px4fmu-v1/module.mk b/src/drivers/boards/px4fmu-v1/module.mk index 5e1a27d5a..ff717fe92 100644 --- a/src/drivers/boards/px4fmu-v1/module.mk +++ b/src/drivers/boards/px4fmu-v1/module.mk @@ -9,4 +9,10 @@ SRCS = px4fmu_can.c \ px4fmu_usb.c \ px4fmu_led.c +ENABLE_CXXINITIALIZE=$(call check_nuttx_config ,"CONFIG_HAVE_CXX 1", $(NUTTX_CONFIG_H)) +ENABLE_CXXINITIALIZE+=$(call check_nuttx_config ,"CONFIG_HAVE_CXXINITIALIZE 1", $(NUTTX_CONFIG_H)) +ifeq ("$(ENABLE_CXXINITIALIZE)",$(nuttx_config_2true)) +SRCS += ../../../modules/systemlib/up_cxxinitialize.c +endif + MAXOPTIMIZATION = -Os diff --git a/src/drivers/boards/px4fmu-v1/px4fmu_init.c b/src/drivers/boards/px4fmu-v1/px4fmu_init.c index 0e22aaee0..c9d4cce1e 100644 --- a/src/drivers/boards/px4fmu-v1/px4fmu_init.c +++ b/src/drivers/boards/px4fmu-v1/px4fmu_init.c @@ -145,6 +145,20 @@ __EXPORT int nsh_archinitialize(void) stm32_configgpio(GPIO_ADC1_IN11); /* IN12 and IN13 further below */ +#if defined(CONFIG_HAVE_CXX) && defined(CONFIG_HAVE_CXXINITIALIZE) + + /* run C++ ctors before we go any further */ + + up_cxxinitialize(); + +# if defined(CONFIG_EXAMPLES_NSH_CXXINITIALIZE) +# error CONFIG_EXAMPLES_NSH_CXXINITIALIZE Must not be defined! Use CONFIG_HAVE_CXX and CONFIG_HAVE_CXXINITIALIZE. +# endif + +#else +# error platform is dependent on c++ both CONFIG_HAVE_CXX and CONFIG_HAVE_CXXINITIALIZE must be defined. +#endif + /* configure the high-resolution time/callout interface */ hrt_init(); diff --git a/src/drivers/boards/px4fmu-v2/px4fmu2_init.c b/src/drivers/boards/px4fmu-v2/px4fmu2_init.c index 7fc1cd1df..e32c18759 100644 --- a/src/drivers/boards/px4fmu-v2/px4fmu2_init.c +++ b/src/drivers/boards/px4fmu-v2/px4fmu2_init.c @@ -245,6 +245,12 @@ __EXPORT int nsh_archinitialize(void) up_cxxinitialize(); +# if defined(CONFIG_EXAMPLES_NSH_CXXINITIALIZE) +# error CONFIG_EXAMPLES_NSH_CXXINITIALIZE Must not be defined! Use CONFIG_HAVE_CXX and CONFIG_HAVE_CXXINITIALIZE. +# endif + +#else +# error platform is dependent on c++ both CONFIG_HAVE_CXX and CONFIG_HAVE_CXXINITIALIZE must be defined. #endif /* configure the high-resolution time/callout interface */ diff --git a/src/drivers/boards/px4io-v1/module.mk b/src/drivers/boards/px4io-v1/module.mk index a7a14dd07..52f17f3f2 100644 --- a/src/drivers/boards/px4io-v1/module.mk +++ b/src/drivers/boards/px4io-v1/module.mk @@ -5,4 +5,10 @@ SRCS = px4io_init.c \ px4io_pwm_servo.c +ENABLE_CXXINITIALIZE=$(call check_nuttx_config ,"CONFIG_HAVE_CXX 1", $(NUTTX_CONFIG_H)) +ENABLE_CXXINITIALIZE+=$(call check_nuttx_config ,"CONFIG_HAVE_CXXINITIALIZE 1", $(NUTTX_CONFIG_H)) +ifeq ("$(ENABLE_CXXINITIALIZE)",$(nuttx_config_2true)) +SRCS += ../../../modules/systemlib/up_cxxinitialize.c +endif + MAXOPTIMIZATION = -Os diff --git a/src/drivers/boards/px4io-v2/module.mk b/src/drivers/boards/px4io-v2/module.mk index 3f0e9a0b3..5613ad405 100644 --- a/src/drivers/boards/px4io-v2/module.mk +++ b/src/drivers/boards/px4io-v2/module.mk @@ -5,4 +5,10 @@ SRCS = px4iov2_init.c \ px4iov2_pwm_servo.c +ENABLE_CXXINITIALIZE=$(call check_nuttx_config ,"CONFIG_HAVE_CXX 1", $(NUTTX_CONFIG_H)) +ENABLE_CXXINITIALIZE+=$(call check_nuttx_config ,"CONFIG_HAVE_CXXINITIALIZE 1", $(NUTTX_CONFIG_H)) +ifeq ("$(ENABLE_CXXINITIALIZE)",$(nuttx_config_2true)) +SRCS += ../../../modules/systemlib/up_cxxinitialize.c +endif + MAXOPTIMIZATION = -Os diff --git a/src/modules/px4iofirmware/px4io.c b/src/modules/px4iofirmware/px4io.c index c31342262..a2f8965bd 100644 --- a/src/modules/px4iofirmware/px4io.c +++ b/src/modules/px4iofirmware/px4io.c @@ -226,9 +226,20 @@ calculate_fw_crc(void) int user_start(int argc, char *argv[]) { +#if defined(CONFIG_HAVE_CXX) && defined(CONFIG_HAVE_CXXINITIALIZE) + /* run C++ ctors before we go any further */ + up_cxxinitialize(); +# if defined(CONFIG_EXAMPLES_NSH_CXXINITIALIZE) +# error CONFIG_EXAMPLES_NSH_CXXINITIALIZE Must not be defined! Use CONFIG_HAVE_CXX and CONFIG_HAVE_CXXINITIALIZE. +# endif + +#else +# error platform is dependent on c++ both CONFIG_HAVE_CXX and CONFIG_HAVE_CXXINITIALIZE must be defined. +#endif + /* reset all to zero */ memset(&system_state, 0, sizeof(system_state)); -- cgit v1.2.3 From 35f6b811ff0a8b6e8c742b1f31e96fe2cdd615ed Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Fri, 23 Jan 2015 13:52:43 -1000 Subject: Using Nuttx stack assessment itnerfaces --- nuttx-configs/aerocore/nsh/defconfig | 1 + nuttx-configs/px4fmu-v1/nsh/defconfig | 1 + nuttx-configs/px4fmu-v2/nsh/defconfig | 1 + nuttx-configs/px4io-v1/nsh/defconfig | 1 + src/systemcmds/top/top.c | 21 ++++++++++++--------- 5 files changed, 16 insertions(+), 9 deletions(-) diff --git a/nuttx-configs/aerocore/nsh/defconfig b/nuttx-configs/aerocore/nsh/defconfig index c4f91a86d..408201815 100644 --- a/nuttx-configs/aerocore/nsh/defconfig +++ b/nuttx-configs/aerocore/nsh/defconfig @@ -319,6 +319,7 @@ CONFIG_ARCH_DMA=y # CONFIG_ADDRENV is not set CONFIG_ARCH_HAVE_VFORK=y CONFIG_ARCH_STACKDUMP=y +CONFIG_STACK_COLORATION=y # CONFIG_ENDIAN_BIG is not set # CONFIG_ARCH_HAVE_RAMFUNCS is not set CONFIG_ARCH_HAVE_RAMVECTORS=y diff --git a/nuttx-configs/px4fmu-v1/nsh/defconfig b/nuttx-configs/px4fmu-v1/nsh/defconfig index 842993532..b976d364b 100644 --- a/nuttx-configs/px4fmu-v1/nsh/defconfig +++ b/nuttx-configs/px4fmu-v1/nsh/defconfig @@ -314,6 +314,7 @@ CONFIG_ARCH_DMA=y # CONFIG_ADDRENV is not set CONFIG_ARCH_HAVE_VFORK=y CONFIG_ARCH_STACKDUMP=y +CONFIG_STACK_COLORATION=y # CONFIG_ENDIAN_BIG is not set # CONFIG_ARCH_HAVE_RAMFUNCS is not set CONFIG_ARCH_HAVE_RAMVECTORS=y diff --git a/nuttx-configs/px4fmu-v2/nsh/defconfig b/nuttx-configs/px4fmu-v2/nsh/defconfig index 6a1aec22b..126accaf5 100644 --- a/nuttx-configs/px4fmu-v2/nsh/defconfig +++ b/nuttx-configs/px4fmu-v2/nsh/defconfig @@ -354,6 +354,7 @@ CONFIG_ARCH_DMA=y # CONFIG_ADDRENV is not set CONFIG_ARCH_HAVE_VFORK=y CONFIG_ARCH_STACKDUMP=y +CONFIG_STACK_COLORATION=y # CONFIG_ENDIAN_BIG is not set # CONFIG_ARCH_HAVE_RAMFUNCS is not set CONFIG_ARCH_HAVE_RAMVECTORS=y diff --git a/nuttx-configs/px4io-v1/nsh/defconfig b/nuttx-configs/px4io-v1/nsh/defconfig index 54161dc77..10a278801 100755 --- a/nuttx-configs/px4io-v1/nsh/defconfig +++ b/nuttx-configs/px4io-v1/nsh/defconfig @@ -372,6 +372,7 @@ CONFIG_ARCH_HAVE_MPU=y # CONFIG_ARCH_USE_MPU is not set # CONFIG_ARCH_IRQPRIO is not set CONFIG_ARCH_STACKDUMP=y +CONFIG_STACK_COLORATION=y # CONFIG_ENDIAN_BIG is not set # CONFIG_ARCH_IDLE_CUSTOM is not set # CONFIG_ARCH_HAVE_RAMFUNCS is not set diff --git a/src/systemcmds/top/top.c b/src/systemcmds/top/top.c index 37e913040..03a049386 100644 --- a/src/systemcmds/top/top.c +++ b/src/systemcmds/top/top.c @@ -41,6 +41,7 @@ */ #include +#include #include #include #include @@ -217,18 +218,20 @@ top_main(void) ); } - unsigned stack_size = (uintptr_t)system_load.tasks[i].tcb->adj_stack_ptr - - (uintptr_t)system_load.tasks[i].tcb->stack_alloc_ptr; - unsigned stack_free = 0; - uint8_t *stack_sweeper = (uint8_t *)system_load.tasks[i].tcb->stack_alloc_ptr; - while (stack_free < stack_size) { - if (*stack_sweeper++ != 0xff) - break; + size_t stack_size = system_load.tasks[i].tcb->adj_stack_size; + ssize_t stack_free = 0; - stack_free++; +#if CONFIG_ARCH_INTERRUPTSTACK > 3 + if (system_load.tasks[i].tcb->pid == 0) { + stack_size = (CONFIG_ARCH_INTERRUPTSTACK & ~3); + stack_free = up_check_intstack_remain(); + } else { +#endif + stack_free = up_check_tcbstack_remain(system_load.tasks[i].tcb); +#if CONFIG_ARCH_INTERRUPTSTACK > 3 } - +#endif printf(CL "%4d %*-s %8lld %2d.%03d %5u/%5u %3u (%3u) ", system_load.tasks[i].tcb->pid, CONFIG_TASK_NAME_SIZE, system_load.tasks[i].tcb->name, -- cgit v1.2.3 From 16c8b406505ba87cfd1afdf9e016b209f175b207 Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Sat, 24 Jan 2015 04:04:21 -1000 Subject: Updated config --- nuttx-configs/px4fmu-v2/nsh/defconfig | 1 - 1 file changed, 1 deletion(-) diff --git a/nuttx-configs/px4fmu-v2/nsh/defconfig b/nuttx-configs/px4fmu-v2/nsh/defconfig index 126accaf5..6a1aec22b 100644 --- a/nuttx-configs/px4fmu-v2/nsh/defconfig +++ b/nuttx-configs/px4fmu-v2/nsh/defconfig @@ -354,7 +354,6 @@ CONFIG_ARCH_DMA=y # CONFIG_ADDRENV is not set CONFIG_ARCH_HAVE_VFORK=y CONFIG_ARCH_STACKDUMP=y -CONFIG_STACK_COLORATION=y # CONFIG_ENDIAN_BIG is not set # CONFIG_ARCH_HAVE_RAMFUNCS is not set CONFIG_ARCH_HAVE_RAMVECTORS=y -- cgit v1.2.3 From 94af659f4fd2b7d81e0b2807c0d0c35b1a9eed8e Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Mon, 26 Jan 2015 11:24:20 -1000 Subject: Bug fix:The CRC detection on px4io was failing with -1 result, do the the fact that the PX4IO_Uploader had closed the port and Nuttx (now) disabled the clock and PX4IO_serial did not managed the clock --- src/drivers/px4io/px4io_serial.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/drivers/px4io/px4io_serial.cpp b/src/drivers/px4io/px4io_serial.cpp index 16d917ef5..752f22d01 100644 --- a/src/drivers/px4io/px4io_serial.cpp +++ b/src/drivers/px4io/px4io_serial.cpp @@ -217,6 +217,9 @@ PX4IO_serial::~PX4IO_serial() stm32_unconfiggpio(PX4IO_SERIAL_TX_GPIO); stm32_unconfiggpio(PX4IO_SERIAL_RX_GPIO); + /* Disable APB clock for the USART peripheral */ + modifyreg32(STM32_RCC_APB2ENR, RCC_APB2ENR_USART6EN, 0); + /* and kill our semaphores */ sem_destroy(&_completion_semaphore); sem_destroy(&_bus_semaphore); @@ -247,6 +250,10 @@ PX4IO_serial::init() return -1; } + + /* Enable the APB clock for the USART peripheral */ + modifyreg32(STM32_RCC_APB2ENR, 0, RCC_APB2ENR_USART6EN); + /* configure pins for serial use */ stm32_configgpio(PX4IO_SERIAL_TX_GPIO); stm32_configgpio(PX4IO_SERIAL_RX_GPIO); -- cgit v1.2.3 From ef8d56ec15639c1ecb6fbdd111cf8842538768ed Mon Sep 17 00:00:00 2001 From: Thomas Gubler Date: Tue, 27 Jan 2015 09:57:07 +0100 Subject: rc.interface: expand mixer variables --- ROMFS/px4fmu_common/init.d/rc.interface | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/ROMFS/px4fmu_common/init.d/rc.interface b/ROMFS/px4fmu_common/init.d/rc.interface index eceff0f99..78417ca8e 100644 --- a/ROMFS/px4fmu_common/init.d/rc.interface +++ b/ROMFS/px4fmu_common/init.d/rc.interface @@ -13,21 +13,21 @@ then if [ $MIXER_AUX == none -a $USE_IO == yes ] then - set MIXER_AUX $MIXER.aux + set MIXER_AUX ${MIXER}.aux fi # Use the mixer file from the SD-card if it exists - if [ -f $SDCARD_MIXERS_PATH/$MIXER.main.mix ] + if [ -f ${SDCARD_MIXERS_PATH}/${MIXER}.main.mix ] then - set MIXER_FILE $SDCARD_MIXERS_PATH/$MIXER.main.mix + set MIXER_FILE ${SDCARD_MIXERS_PATH}/${MIXER}.main.mix # Try out the old convention, for backward compatibility else - if [ -f $SDCARD_MIXERS_PATH/$MIXER.mix ] + if [ -f ${SDCARD_MIXERS_PATH}/${MIXER}.mix ] then - set MIXER_FILE $SDCARD_MIXERS_PATH/$MIXER.mix + set MIXER_FILE ${SDCARD_MIXERS_PATH}/${MIXER}.mix else - set MIXER_FILE /etc/mixers/$MIXER.main.mix + set MIXER_FILE /etc/mixers/${MIXER}.main.mix fi fi @@ -104,14 +104,14 @@ then set MIXER_AUX_FILE none - if [ -f $SDCARD_MIXERS_PATH/$MIXER_AUX.mix ] + if [ -f ${SDCARD_MIXERS_PATH}/${MIXER_AUX}.mix ] then - set MIXER_AUX_FILE $SDCARD_MIXERS_PATH/$MIXER_AUX.mix + set MIXER_AUX_FILE ${SDCARD_MIXERS_PATH}/${MIXER_AUX}.mix else - if [ -f /etc/mixers/$MIXER_AUX.mix ] + if [ -f /etc/mixers/${MIXER_AUX}.mix ] then - set MIXER_AUX_FILE /etc/mixers/$MIXER_AUX.mix + set MIXER_AUX_FILE /etc/mixers/${MIXER_AUX}.mix fi fi -- cgit v1.2.3 From 15a175aa11fc32b28795ea2aa84762f986e3828a Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Tue, 27 Jan 2015 14:55:20 -1000 Subject: removed message in favor of syslog --- src/drivers/boards/px4fmu-v2/px4fmu2_init.c | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/src/drivers/boards/px4fmu-v2/px4fmu2_init.c b/src/drivers/boards/px4fmu-v2/px4fmu2_init.c index e32c18759..566e94c64 100644 --- a/src/drivers/boards/px4fmu-v2/px4fmu2_init.c +++ b/src/drivers/boards/px4fmu-v2/px4fmu2_init.c @@ -83,22 +83,6 @@ __END_DECLS /* Configuration ************************************************************/ -/* Debug ********************************************************************/ - -#ifdef CONFIG_CPP_HAVE_VARARGS -# ifdef CONFIG_DEBUG -# define message(...) lowsyslog(__VA_ARGS__) -# else -# define message(...) printf(__VA_ARGS__) -# endif -#else -# ifdef CONFIG_DEBUG -# define message lowsyslog -# else -# define message printf -# endif -#endif - /**************************************************************************** * Protected Functions ****************************************************************************/ @@ -337,7 +321,7 @@ __EXPORT int nsh_archinitialize(void) SPI_SELECT(spi4, PX4_SPIDEV_EXT0, false); SPI_SELECT(spi4, PX4_SPIDEV_EXT1, false); - message("[boot] Initialized SPI port 4\n"); + syslog(LOG_INFO,"[boot] Initialized SPI port 4\n"); #ifdef CONFIG_MMCSD /* First, get an instance of the SDIO interface */ -- cgit v1.2.3 From 02a7d818751254eda10b18afb39f2325560f2a73 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Fri, 30 Jan 2015 09:35:46 +0100 Subject: Add export to up_cxxinitialize to make it globally visible --- src/modules/systemlib/up_cxxinitialize.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/systemlib/up_cxxinitialize.c b/src/modules/systemlib/up_cxxinitialize.c index 4028945e5..d665ecc3a 100644 --- a/src/modules/systemlib/up_cxxinitialize.c +++ b/src/modules/systemlib/up_cxxinitialize.c @@ -123,7 +123,7 @@ extern uint32_t _etext; * ***************************************************************************/ -void up_cxxinitialize(void) +__EXPORT void up_cxxinitialize(void) { initializer_t *initp; -- cgit v1.2.3 From a4dcf7ab0fe9eb5616711f54488c25abe9ca6c4d Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Fri, 30 Jan 2015 09:59:19 +0100 Subject: Aerocore: board init --- src/drivers/boards/aerocore/aerocore_init.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/drivers/boards/aerocore/aerocore_init.c b/src/drivers/boards/aerocore/aerocore_init.c index 91dbe4b81..6882ca80d 100644 --- a/src/drivers/boards/aerocore/aerocore_init.c +++ b/src/drivers/boards/aerocore/aerocore_init.c @@ -1,6 +1,6 @@ /**************************************************************************** * - * Copyright (C) 2012 PX4 Development Team. All rights reserved. + * Copyright (c) 2012-2015 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 @@ -110,6 +110,10 @@ __END_DECLS * Protected Functions ****************************************************************************/ +#if defined(CONFIG_HAVE_CXX) && defined(CONFIG_HAVE_CXXINITIALIZE) +__EXPORT extern void up_cxxinitialize(); +#endif + #if defined(CONFIG_FAT_DMAMEMORY) # if !defined(CONFIG_GRAN) || !defined(CONFIG_FAT_DMAMEMORY) # error microSD DMA support requires CONFIG_GRAN @@ -117,12 +121,12 @@ __END_DECLS static GRAN_HANDLE dma_allocator; -/* - * The DMA heap size constrains the total number of things that can be +/* + * The DMA heap size constrains the total number of things that can be * ready to do DMA at a time. * * For example, FAT DMA depends on one sector-sized buffer per filesystem plus - * one sector-sized buffer per file. + * one sector-sized buffer per file. * * We use a fundamental alignment / granule size of 64B; this is sufficient * to guarantee alignment for the largest STM32 DMA burst (16 beats x 32bits). @@ -137,8 +141,10 @@ dma_alloc_init(void) sizeof(g_dma_heap), 7, /* 128B granule - must be > alignment (XXX bug?) */ 6); /* 64B alignment */ + if (dma_allocator == NULL) { message("[boot] DMA allocator setup FAILED"); + } else { g_dma_perf = perf_alloc(PC_COUNT, "DMA allocations"); } @@ -277,11 +283,13 @@ __EXPORT int nsh_archinitialize(void) /* Configure Sensors on SPI bus #3 */ spi3 = up_spiinitialize(3); + if (!spi3) { message("[boot] FAILED to initialize SPI port 3\n"); board_led_on(LED_AMBER); return -ENODEV; } + /* Default: 1MHz, 8 bits, Mode 3 */ SPI_SETFREQUENCY(spi3, 10000000); SPI_SETBITS(spi3, 8); @@ -294,11 +302,13 @@ __EXPORT int nsh_archinitialize(void) /* Configure FRAM on SPI bus #4 */ spi4 = up_spiinitialize(4); + if (!spi4) { message("[boot] FAILED to initialize SPI port 4\n"); board_led_on(LED_AMBER); return -ENODEV; } + /* Default: ~10MHz, 8 bits, Mode 3 */ SPI_SETFREQUENCY(spi4, 10 * 1000 * 1000); SPI_SETBITS(spi4, 8); -- cgit v1.2.3 From 7c0e3a296cacd3ad7ce44c49fe44cd7eb9a35a16 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Fri, 30 Jan 2015 09:59:50 +0100 Subject: FMUv1: board init --- src/drivers/boards/px4fmu-v1/px4fmu_init.c | 40 ++++++++++++++++-------------- 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/src/drivers/boards/px4fmu-v1/px4fmu_init.c b/src/drivers/boards/px4fmu-v1/px4fmu_init.c index c9d4cce1e..cc8e6757e 100644 --- a/src/drivers/boards/px4fmu-v1/px4fmu_init.c +++ b/src/drivers/boards/px4fmu-v1/px4fmu_init.c @@ -1,6 +1,6 @@ /**************************************************************************** * - * Copyright (c) 2012, 2013 PX4 Development Team. All rights reserved. + * Copyright (c) 2012-2015 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 @@ -91,6 +91,10 @@ __END_DECLS * Public Functions ****************************************************************************/ +#if defined(CONFIG_HAVE_CXX) && defined(CONFIG_HAVE_CXXINITIALIZE) +__EXPORT extern void up_cxxinitialize(); +#endif + /************************************************************************************ * Name: stm32_boardinitialize * @@ -216,23 +220,23 @@ __EXPORT int nsh_archinitialize(void) * Keep the SPI2 init optional and conditionally initialize the ADC pins */ - #ifdef CONFIG_STM32_SPI2 - spi2 = up_spiinitialize(2); - /* Default SPI2 to 1MHz and de-assert the known chip selects. */ - SPI_SETFREQUENCY(spi2, 10000000); - SPI_SETBITS(spi2, 8); - SPI_SETMODE(spi2, SPIDEV_MODE3); - SPI_SELECT(spi2, PX4_SPIDEV_GYRO, false); - SPI_SELECT(spi2, PX4_SPIDEV_ACCEL_MAG, false); - - syslog(LOG_INFO, "[boot] Initialized SPI port2 (ADC IN12/13 blocked)\n"); - #else - spi2 = NULL; - syslog(LOG_INFO, "[boot] Enabling IN12/13 instead of SPI2\n"); - /* no SPI2, use pins for ADC */ - stm32_configgpio(GPIO_ADC1_IN12); - stm32_configgpio(GPIO_ADC1_IN13); // jumperable to MPU6000 DRDY on some boards - #endif +#ifdef CONFIG_STM32_SPI2 + spi2 = up_spiinitialize(2); + /* Default SPI2 to 1MHz and de-assert the known chip selects. */ + SPI_SETFREQUENCY(spi2, 10000000); + SPI_SETBITS(spi2, 8); + SPI_SETMODE(spi2, SPIDEV_MODE3); + SPI_SELECT(spi2, PX4_SPIDEV_GYRO, false); + SPI_SELECT(spi2, PX4_SPIDEV_ACCEL_MAG, false); + + syslog(LOG_INFO, "[boot] Initialized SPI port2 (ADC IN12/13 blocked)\n"); +#else + spi2 = NULL; + syslog(LOG_INFO, "[boot] Enabling IN12/13 instead of SPI2\n"); + /* no SPI2, use pins for ADC */ + stm32_configgpio(GPIO_ADC1_IN12); + stm32_configgpio(GPIO_ADC1_IN13); // jumperable to MPU6000 DRDY on some boards +#endif /* Get the SPI port for the microSD slot */ -- cgit v1.2.3 From 90b8bdaf6400bff75b3621ea025b17a71246c9b1 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Fri, 30 Jan 2015 09:59:57 +0100 Subject: FMUv2: board init --- src/drivers/boards/px4fmu-v2/px4fmu2_init.c | 33 +++++++++++++++++------------ 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/src/drivers/boards/px4fmu-v2/px4fmu2_init.c b/src/drivers/boards/px4fmu-v2/px4fmu2_init.c index 566e94c64..d5298d98b 100644 --- a/src/drivers/boards/px4fmu-v2/px4fmu2_init.c +++ b/src/drivers/boards/px4fmu-v2/px4fmu2_init.c @@ -1,6 +1,6 @@ /**************************************************************************** * - * Copyright (C) 2012 PX4 Development Team. All rights reserved. + * Copyright (c) 2012-2015 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 @@ -32,13 +32,13 @@ ****************************************************************************/ /** - * @file px4fmu_init.c + * @file px4fmu2_init.c * - * PX4FMU-specific early startup code. This file implements the + * PX4FMUv2-specific early startup code. This file implements the * nsh_archinitialize() function that is called early by nsh during startup. * * Code here is run before the rcS script is invoked; it should start required - * subsystems and perform board-specific initialisation. + * subsystems and perform board-specific initialization. */ /**************************************************************************** @@ -87,6 +87,10 @@ __END_DECLS * Protected Functions ****************************************************************************/ +#if defined(CONFIG_HAVE_CXX) && defined(CONFIG_HAVE_CXXINITIALIZE) +__EXPORT extern void up_cxxinitialize(); +#endif + #if defined(CONFIG_FAT_DMAMEMORY) # if !defined(CONFIG_GRAN) || !defined(CONFIG_FAT_DMAMEMORY) # error microSD DMA support requires CONFIG_GRAN @@ -96,12 +100,12 @@ __END_DECLS static GRAN_HANDLE dma_allocator; -/* - * The DMA heap size constrains the total number of things that can be +/* + * The DMA heap size constrains the total number of things that can be * ready to do DMA at a time. * * For example, FAT DMA depends on one sector-sized buffer per filesystem plus - * one sector-sized buffer per file. + * one sector-sized buffer per file. * * We use a fundamental alignment / granule size of 64B; this is sufficient * to guarantee alignment for the largest STM32 DMA burst (16 beats x 32bits). @@ -117,8 +121,10 @@ dma_alloc_init(void) sizeof(g_dma_heap), 7, /* 128B granule - must be > alignment (XXX bug?) */ 6); /* 64B alignment */ + if (dma_allocator == NULL) { syslog(LOG_ERR, "[boot] DMA allocator setup FAILED"); + } else { g_dma_perf = perf_alloc(PC_COUNT, "DMA allocations"); } @@ -208,9 +214,6 @@ __EXPORT int nsh_archinitialize(void) stm32_configgpio(GPIO_ADC1_IN2); /* BATT_VOLTAGE_SENS */ stm32_configgpio(GPIO_ADC1_IN3); /* BATT_CURRENT_SENS */ stm32_configgpio(GPIO_ADC1_IN4); /* VDD_5V_SENS */ - // stm32_configgpio(GPIO_ADC1_IN10); /* used by VBUS valid */ - // stm32_configgpio(GPIO_ADC1_IN11); /* unused */ - // stm32_configgpio(GPIO_ADC1_IN12); /* used by MPU6000 CS */ stm32_configgpio(GPIO_ADC1_IN13); /* FMU_AUX_ADC_1 */ stm32_configgpio(GPIO_ADC1_IN14); /* FMU_AUX_ADC_2 */ stm32_configgpio(GPIO_ADC1_IN15); /* PRESSURE_SENS */ @@ -321,20 +324,22 @@ __EXPORT int nsh_archinitialize(void) SPI_SELECT(spi4, PX4_SPIDEV_EXT0, false); SPI_SELECT(spi4, PX4_SPIDEV_EXT1, false); - syslog(LOG_INFO,"[boot] Initialized SPI port 4\n"); + syslog(LOG_INFO, "[boot] Initialized SPI port 4\n"); - #ifdef CONFIG_MMCSD +#ifdef CONFIG_MMCSD /* First, get an instance of the SDIO interface */ sdio = sdio_initialize(CONFIG_NSH_MMCSDSLOTNO); + if (!sdio) { syslog(LOG_ERR, "[boot] Failed to initialize SDIO slot %d\n", - CONFIG_NSH_MMCSDSLOTNO); + CONFIG_NSH_MMCSDSLOTNO); return -ENODEV; } /* Now bind the SDIO interface to the MMC/SD driver */ int ret = mmcsd_slotinitialize(CONFIG_NSH_MMCSDMINOR, sdio); + if (ret != OK) { syslog(LOG_ERR, "[boot] Failed to bind SDIO to the MMC/SD driver: %d\n", ret); return ret; @@ -344,7 +349,7 @@ __EXPORT int nsh_archinitialize(void) sdio_mediachange(sdio, true); syslog(LOG_INFO, "[boot] Initialized SDIO\n"); - #endif +#endif return OK; } -- cgit v1.2.3 From f624e7ea4cdab64cf51e2124ba88c66963a09d9a Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Fri, 30 Jan 2015 10:00:11 +0100 Subject: IOv1/v2: board init --- src/modules/px4iofirmware/px4io.c | 49 +++++++++++++++++++++++---------------- 1 file changed, 29 insertions(+), 20 deletions(-) diff --git a/src/modules/px4iofirmware/px4io.c b/src/modules/px4iofirmware/px4io.c index a2f8965bd..aa7d87f34 100644 --- a/src/modules/px4iofirmware/px4io.c +++ b/src/modules/px4iofirmware/px4io.c @@ -1,6 +1,6 @@ /**************************************************************************** * - * Copyright (c) 2012-2014 PX4 Development Team. All rights reserved. + * Copyright (c) 2012-2015 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 @@ -61,7 +61,7 @@ __EXPORT int user_start(int argc, char *argv[]); -extern void up_cxxinitialize(void); +__EXPORT extern void up_cxxinitialize(void); struct sys_state_s system_state; @@ -97,11 +97,12 @@ isr_debug(uint8_t level, const char *fmt, ...) if (level > r_page_setup[PX4IO_P_SETUP_SET_DEBUG]) { return; } + va_list ap; va_start(ap, fmt); vsnprintf(msg[msg_next_in], sizeof(msg[0]), fmt, ap); va_end(ap); - msg_next_in = (msg_next_in+1) % NUM_MSG; + msg_next_in = (msg_next_in + 1) % NUM_MSG; msg_counter++; } @@ -113,11 +114,14 @@ show_debug_messages(void) { if (msg_counter != last_msg_counter) { uint32_t n = msg_counter - last_msg_counter; - if (n > NUM_MSG) n = NUM_MSG; + + if (n > NUM_MSG) { n = NUM_MSG; } + last_msg_counter = msg_counter; + while (n--) { debug("%s", msg[msg_next_out]); - msg_next_out = (msg_next_out+1) % NUM_MSG; + msg_next_out = (msg_next_out + 1) % NUM_MSG; } } } @@ -135,7 +139,7 @@ ring_blink(void) #ifdef GPIO_LED4 if (/* IO armed */ (r_status_flags & PX4IO_P_STATUS_FLAGS_SAFETY_OFF) - /* and FMU is armed */ && (r_setup_arming & PX4IO_P_SETUP_ARMING_FMU_ARMED)) { + /* and FMU is armed */ && (r_setup_arming & PX4IO_P_SETUP_ARMING_FMU_ARMED)) { LED_RING(1); return; } @@ -151,7 +155,7 @@ ring_blink(void) if (brightness_counter < max_brightness) { - bool on = ((on_counter * 100) / brightness_counter+1) <= ((brightness * 100) / max_brightness+1); + bool on = ((on_counter * 100) / brightness_counter + 1) <= ((brightness * 100) / max_brightness + 1); // XXX once led is PWM driven, // remove the ! in the line below @@ -195,7 +199,7 @@ static uint64_t reboot_time; */ void schedule_reboot(uint32_t time_delta_usec) { - reboot_time = hrt_absolute_time() + time_delta_usec; + reboot_time = hrt_absolute_time() + time_delta_usec; } /** @@ -203,9 +207,9 @@ void schedule_reboot(uint32_t time_delta_usec) */ static void check_reboot(void) { - if (reboot_time != 0 && hrt_absolute_time() > reboot_time) { - up_systemreset(); - } + if (reboot_time != 0 && hrt_absolute_time() > reboot_time) { + up_systemreset(); + } } static void @@ -215,12 +219,14 @@ calculate_fw_crc(void) #define APP_LOAD_ADDRESS 0x08001000 // compute CRC of the current firmware uint32_t sum = 0; + for (unsigned p = 0; p < APP_SIZE_MAX; p += 4) { uint32_t bytes = *(uint32_t *)(p + APP_LOAD_ADDRESS); sum = crc32part((uint8_t *)&bytes, sizeof(bytes), sum); } + r_page_setup[PX4IO_P_SETUP_CRC] = sum & 0xFFFF; - r_page_setup[PX4IO_P_SETUP_CRC+1] = sum >> 16; + r_page_setup[PX4IO_P_SETUP_CRC + 1] = sum >> 16; } int @@ -319,7 +325,7 @@ user_start(int argc, char *argv[]) * allocations. We don't want him to be able to * get past that point. This needs to be clearly * documented in the dev guide. - * + * */ if (minfo.mxordblk < 600) { @@ -331,10 +337,12 @@ user_start(int argc, char *argv[]) if (phase) { LED_AMBER(true); LED_BLUE(false); + } else { LED_AMBER(false); LED_BLUE(true); } + up_udelay(250000); phase = !phase; @@ -349,7 +357,8 @@ user_start(int argc, char *argv[]) */ uint64_t last_debug_time = 0; - uint64_t last_heartbeat_time = 0; + uint64_t last_heartbeat_time = 0; + for (;;) { /* track the rate at which the loop is running */ @@ -365,14 +374,14 @@ user_start(int argc, char *argv[]) controls_tick(); perf_end(controls_perf); - if ((hrt_absolute_time() - last_heartbeat_time) > 250*1000) { - last_heartbeat_time = hrt_absolute_time(); - heartbeat_blink(); - } + if ((hrt_absolute_time() - last_heartbeat_time) > 250 * 1000) { + last_heartbeat_time = hrt_absolute_time(); + heartbeat_blink(); + } ring_blink(); - check_reboot(); + check_reboot(); /* check for debug activity (default: none) */ show_debug_messages(); @@ -382,7 +391,7 @@ user_start(int argc, char *argv[]) */ if (hrt_absolute_time() - last_debug_time > (1000 * 1000)) { - isr_debug(1, "d:%u s=0x%x a=0x%x f=0x%x m=%u", + isr_debug(1, "d:%u s=0x%x a=0x%x f=0x%x m=%u", (unsigned)r_page_setup[PX4IO_P_SETUP_SET_DEBUG], (unsigned)r_status_flags, (unsigned)r_setup_arming, -- cgit v1.2.3 From 57998de0d21a7c4c4dc5c309f55d053a0bb9e3af Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Fri, 30 Jan 2015 10:16:51 +0100 Subject: Fix compiler warning on prototypes --- src/drivers/boards/aerocore/aerocore_init.c | 2 +- src/drivers/boards/px4fmu-v1/px4fmu_init.c | 2 +- src/drivers/boards/px4fmu-v2/px4fmu2_init.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/drivers/boards/aerocore/aerocore_init.c b/src/drivers/boards/aerocore/aerocore_init.c index 6882ca80d..79e3e9e77 100644 --- a/src/drivers/boards/aerocore/aerocore_init.c +++ b/src/drivers/boards/aerocore/aerocore_init.c @@ -111,7 +111,7 @@ __END_DECLS ****************************************************************************/ #if defined(CONFIG_HAVE_CXX) && defined(CONFIG_HAVE_CXXINITIALIZE) -__EXPORT extern void up_cxxinitialize(); +__EXPORT extern void up_cxxinitialize(void); #endif #if defined(CONFIG_FAT_DMAMEMORY) diff --git a/src/drivers/boards/px4fmu-v1/px4fmu_init.c b/src/drivers/boards/px4fmu-v1/px4fmu_init.c index cc8e6757e..fb32d258c 100644 --- a/src/drivers/boards/px4fmu-v1/px4fmu_init.c +++ b/src/drivers/boards/px4fmu-v1/px4fmu_init.c @@ -92,7 +92,7 @@ __END_DECLS ****************************************************************************/ #if defined(CONFIG_HAVE_CXX) && defined(CONFIG_HAVE_CXXINITIALIZE) -__EXPORT extern void up_cxxinitialize(); +__EXPORT extern void up_cxxinitialize(void); #endif /************************************************************************************ diff --git a/src/drivers/boards/px4fmu-v2/px4fmu2_init.c b/src/drivers/boards/px4fmu-v2/px4fmu2_init.c index d5298d98b..d1ef33cff 100644 --- a/src/drivers/boards/px4fmu-v2/px4fmu2_init.c +++ b/src/drivers/boards/px4fmu-v2/px4fmu2_init.c @@ -88,7 +88,7 @@ __END_DECLS ****************************************************************************/ #if defined(CONFIG_HAVE_CXX) && defined(CONFIG_HAVE_CXXINITIALIZE) -__EXPORT extern void up_cxxinitialize(); +__EXPORT extern void up_cxxinitialize(void); #endif #if defined(CONFIG_FAT_DMAMEMORY) -- cgit v1.2.3 From 4515ae8c0e896eebca73a576bf9e39d56e04d07f Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Fri, 30 Jan 2015 10:17:11 +0100 Subject: Reduce make output to ensure the console printing is not slowing the build process down --- makefiles/module.mk | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/makefiles/module.mk b/makefiles/module.mk index 9c1a828cc..6311a68f1 100644 --- a/makefiles/module.mk +++ b/makefiles/module.mk @@ -113,7 +113,9 @@ ifeq ($(MODULE_MK),) $(error No module makefile specified) endif -$(info %% MODULE_MK = $(MODULE_MK)) +# newline +$(info ) +$(info %% MODULE $(MODULE_NAME) ($(MODULE_MK))) # # Get the board/toolchain config @@ -125,10 +127,11 @@ include $(BOARD_FILE) # include $(MODULE_MK) MODULE_SRC := $(dir $(MODULE_MK)) -$(info % MODULE_NAME = $(MODULE_NAME)) -$(info % MODULE_SRC = $(MODULE_SRC)) -$(info % MODULE_OBJ = $(MODULE_OBJ)) -$(info % MODULE_WORK_DIR = $(MODULE_WORK_DIR)) +# this information is helpful during build system debugging, but not quite otherwise +# $(info % MODULE_NAME = $(MODULE_NAME)) +# $(info % MODULE_SRC = $(MODULE_SRC)) +# $(info % MODULE_OBJ = $(MODULE_OBJ)) +# $(info % MODULE_WORK_DIR = $(MODULE_WORK_DIR)) # # Things that, if they change, might affect everything -- cgit v1.2.3 From 4db2b8d49dd3ccb903e577a1f2c4712741539b9f Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Fri, 30 Jan 2015 10:39:20 +0100 Subject: Aerocore: CXX init --- src/drivers/boards/aerocore/aerocore_init.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/drivers/boards/aerocore/aerocore_init.c b/src/drivers/boards/aerocore/aerocore_init.c index 79e3e9e77..4d257d24b 100644 --- a/src/drivers/boards/aerocore/aerocore_init.c +++ b/src/drivers/boards/aerocore/aerocore_init.c @@ -71,6 +71,10 @@ #include #include +#if defined(CONFIG_HAVE_CXX) && defined(CONFIG_HAVE_CXXINITIALIZE) +#include +#endif + /**************************************************************************** * Pre-Processor Definitions ****************************************************************************/ @@ -110,10 +114,6 @@ __END_DECLS * Protected Functions ****************************************************************************/ -#if defined(CONFIG_HAVE_CXX) && defined(CONFIG_HAVE_CXXINITIALIZE) -__EXPORT extern void up_cxxinitialize(void); -#endif - #if defined(CONFIG_FAT_DMAMEMORY) # if !defined(CONFIG_GRAN) || !defined(CONFIG_FAT_DMAMEMORY) # error microSD DMA support requires CONFIG_GRAN -- cgit v1.2.3 From 9ef46e3a6283b3c1e3867b2685527496a804661a Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Fri, 30 Jan 2015 10:39:34 +0100 Subject: FMUv1: CXX init --- src/drivers/boards/px4fmu-v1/px4fmu_init.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/drivers/boards/px4fmu-v1/px4fmu_init.c b/src/drivers/boards/px4fmu-v1/px4fmu_init.c index fb32d258c..8118e4809 100644 --- a/src/drivers/boards/px4fmu-v1/px4fmu_init.c +++ b/src/drivers/boards/px4fmu-v1/px4fmu_init.c @@ -69,6 +69,10 @@ #include +#if defined(CONFIG_HAVE_CXX) && defined(CONFIG_HAVE_CXXINITIALIZE) +#include +#endif + /* todo: This is constant but not proper */ __BEGIN_DECLS extern void led_off(int led); @@ -91,10 +95,6 @@ __END_DECLS * Public Functions ****************************************************************************/ -#if defined(CONFIG_HAVE_CXX) && defined(CONFIG_HAVE_CXXINITIALIZE) -__EXPORT extern void up_cxxinitialize(void); -#endif - /************************************************************************************ * Name: stm32_boardinitialize * -- cgit v1.2.3 From 37afc82bd6a4f3a60825c01782b042036ae3ae35 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Fri, 30 Jan 2015 10:39:47 +0100 Subject: FMUv2: CXX init --- src/drivers/boards/px4fmu-v2/px4fmu2_init.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/drivers/boards/px4fmu-v2/px4fmu2_init.c b/src/drivers/boards/px4fmu-v2/px4fmu2_init.c index d1ef33cff..2c5ab2025 100644 --- a/src/drivers/boards/px4fmu-v2/px4fmu2_init.c +++ b/src/drivers/boards/px4fmu-v2/px4fmu2_init.c @@ -72,6 +72,10 @@ #include #include +#if defined(CONFIG_HAVE_CXX) && defined(CONFIG_HAVE_CXXINITIALIZE) +#include +#endif + /* todo: This is constant but not proper */ __BEGIN_DECLS extern void led_off(int led); @@ -87,10 +91,6 @@ __END_DECLS * Protected Functions ****************************************************************************/ -#if defined(CONFIG_HAVE_CXX) && defined(CONFIG_HAVE_CXXINITIALIZE) -__EXPORT extern void up_cxxinitialize(void); -#endif - #if defined(CONFIG_FAT_DMAMEMORY) # if !defined(CONFIG_GRAN) || !defined(CONFIG_FAT_DMAMEMORY) # error microSD DMA support requires CONFIG_GRAN -- cgit v1.2.3 From b379c9d0db189b41c3c4ae8bdf20add3df3756c4 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Fri, 30 Jan 2015 10:40:03 +0100 Subject: IOv1/v2: CXX init --- src/modules/px4iofirmware/px4io.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/modules/px4iofirmware/px4io.c b/src/modules/px4iofirmware/px4io.c index aa7d87f34..a737117e2 100644 --- a/src/modules/px4iofirmware/px4io.c +++ b/src/modules/px4iofirmware/px4io.c @@ -53,6 +53,7 @@ #include #include +#include #include @@ -61,8 +62,6 @@ __EXPORT int user_start(int argc, char *argv[]); -__EXPORT extern void up_cxxinitialize(void); - struct sys_state_s system_state; static struct hrt_call serial_dma_call; -- cgit v1.2.3 From 835d4308828f33d2fb5ad4ed2bd89e7e1beba351 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Fri, 30 Jan 2015 10:40:25 +0100 Subject: Systemlib: proper use of headers for CXX init --- src/modules/systemlib/systemlib.h | 3 +++ src/modules/systemlib/up_cxxinitialize.c | 2 ++ 2 files changed, 5 insertions(+) diff --git a/src/modules/systemlib/systemlib.h b/src/modules/systemlib/systemlib.h index 2f24215a9..25f74351c 100644 --- a/src/modules/systemlib/systemlib.h +++ b/src/modules/systemlib/systemlib.h @@ -48,6 +48,9 @@ __BEGIN_DECLS /** Reboots the board */ __EXPORT void systemreset(bool to_bootloader) noreturn_function; +/** Executes the CXX static initializers */ +__EXPORT void up_cxxinitialize(void); + /** Sends SIGUSR1 to all processes */ __EXPORT void killall(void); diff --git a/src/modules/systemlib/up_cxxinitialize.c b/src/modules/systemlib/up_cxxinitialize.c index d665ecc3a..b04661b66 100644 --- a/src/modules/systemlib/up_cxxinitialize.c +++ b/src/modules/systemlib/up_cxxinitialize.c @@ -47,6 +47,8 @@ #include #include "chip.h" +#include + #if defined(CONFIG_HAVE_CXX) && defined(CONFIG_HAVE_CXXINITIALIZE) /************************************************************************************ * Definitions -- cgit v1.2.3 From 7b019b7b5d330907ccb0b74e9bd3b1e90216de57 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Fri, 30 Jan 2015 10:56:07 +0100 Subject: CXX init: Drop export in C file --- src/modules/systemlib/up_cxxinitialize.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/systemlib/up_cxxinitialize.c b/src/modules/systemlib/up_cxxinitialize.c index b04661b66..7b9ca5cb1 100644 --- a/src/modules/systemlib/up_cxxinitialize.c +++ b/src/modules/systemlib/up_cxxinitialize.c @@ -125,7 +125,7 @@ extern uint32_t _etext; * ***************************************************************************/ -__EXPORT void up_cxxinitialize(void) +void up_cxxinitialize(void) { initializer_t *initp; -- cgit v1.2.3 From 0784ad995bd51f9a450139bc8ca3b348920fc4a7 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Fri, 30 Jan 2015 11:05:03 +0100 Subject: Dropping GCC 4.7 support --- .travis.yml | 6 +++--- makefiles/toolchain_gnu-arm-eabi.mk | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index a994d3471..f7744344c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,9 +16,9 @@ before_script: - sudo apt-get install flex bison libncurses5-dev autoconf texinfo build-essential libtool zlib1g-dev genromfs git wget cmake - pushd . - cd ~ - - wget https://launchpadlibrarian.net/174121628/gcc-arm-none-eabi-4_7-2014q2-20140408-linux.tar.bz2 - - tar -jxf gcc-arm-none-eabi-4_7-2014q2-20140408-linux.tar.bz2 - - exportline="export PATH=$HOME/gcc-arm-none-eabi-4_7-2014q2/bin:\$PATH" + - wget https://launchpadlibrarian.net/186124160/gcc-arm-none-eabi-4_8-2014q3-20140805-linux.tar.bz2 + - tar -jxf gcc-arm-none-eabi-4_8-2014q3-20140805-linux.tar.bz2 + - exportline="export PATH=$HOME/gcc-arm-none-eabi-4_8-2014q3/bin:\$PATH" - if grep -Fxq "$exportline" ~/.profile; then echo nothing to do ; else echo $exportline >> ~/.profile; fi - . ~/.profile - popd diff --git a/makefiles/toolchain_gnu-arm-eabi.mk b/makefiles/toolchain_gnu-arm-eabi.mk index 853885a3b..4c49edaab 100644 --- a/makefiles/toolchain_gnu-arm-eabi.mk +++ b/makefiles/toolchain_gnu-arm-eabi.mk @@ -50,7 +50,7 @@ OBJDUMP = $(CROSSDEV)objdump # Check if the right version of the toolchain is available # -CROSSDEV_VER_SUPPORTED = 4.7.4 4.7.5 4.7.6 4.8.4 4.9.3 +CROSSDEV_VER_SUPPORTED = 4.8.4 4.9.3 CROSSDEV_VER_FOUND = $(shell $(CC) -dumpversion) ifeq (,$(findstring $(CROSSDEV_VER_FOUND), $(CROSSDEV_VER_SUPPORTED))) -- cgit v1.2.3 From 2a7bcf8ff3e535e6664f70223608beeac80320dd Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Fri, 30 Jan 2015 14:56:42 +0100 Subject: setup.mk: Formatting --- makefiles/setup.mk | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/makefiles/setup.mk b/makefiles/setup.mk index 07890d927..b41ec0180 100644 --- a/makefiles/setup.mk +++ b/makefiles/setup.mk @@ -1,5 +1,5 @@ # -# Copyright (C) 2012 PX4 Development Team. All rights reserved. +# Copyright (c) 2012-2015 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 @@ -48,7 +48,6 @@ export PX4_PLATFORMS_DIR = $(abspath $(PX4_BASE)/src/platforms)/ export PX4_MK_DIR = $(abspath $(PX4_BASE)/makefiles)/ export NUTTX_SRC = $(abspath $(PX4_BASE)/NuttX/nuttx)/ export MAVLINK_SRC = $(abspath $(PX4_BASE)/mavlink/include/mavlink/v1.0)/ -export NUTTX_APP_SRC = $(abspath $(PX4_BASE)/NuttX/apps)/ export MAVLINK_SRC = $(abspath $(PX4_BASE)/mavlink)/ export UAVCAN_DIR = $(abspath $(PX4_BASE)/uavcan)/ export ROMFS_SRC = $(abspath $(PX4_BASE)/ROMFS)/ @@ -69,17 +68,17 @@ export INCLUDE_DIRS := $(PX4_MODULE_SRC) \ # # Tools # -export MKFW = $(PX4_BASE)/Tools/px_mkfw.py +export MKFW = $(PX4_BASE)/Tools/px_mkfw.py export UPLOADER = $(PX4_BASE)/Tools/px_uploader.py -export COPY = cp +export COPY = cp export COPYDIR = cp -Rf export REMOVE = rm -f export RMDIR = rm -rf export GENROMFS = genromfs export TOUCH = touch export MKDIR = mkdir -export FIND = find -export ECHO = echo +export FIND = find +export ECHO = echo export UNZIP_CMD = unzip export PYTHON = python export OPENOCD = openocd -- cgit v1.2.3 From 4277c1ea7ead8ccbacf617cc09fb3bb2cd7ed951 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Fri, 30 Jan 2015 14:57:37 +0100 Subject: System lib: exclude up_cxxinit from compile as the board makefiles include it --- src/modules/systemlib/module.mk | 1 - src/modules/systemlib/systemlib.h | 3 --- 2 files changed, 4 deletions(-) diff --git a/src/modules/systemlib/module.mk b/src/modules/systemlib/module.mk index f2499bbb1..00b4e4b98 100644 --- a/src/modules/systemlib/module.mk +++ b/src/modules/systemlib/module.mk @@ -43,7 +43,6 @@ SRCS = err.c \ conversions.c \ cpuload.c \ getopt_long.c \ - up_cxxinitialize.c \ pid/pid.c \ systemlib.c \ airspeed.c \ diff --git a/src/modules/systemlib/systemlib.h b/src/modules/systemlib/systemlib.h index 25f74351c..2f24215a9 100644 --- a/src/modules/systemlib/systemlib.h +++ b/src/modules/systemlib/systemlib.h @@ -48,9 +48,6 @@ __BEGIN_DECLS /** Reboots the board */ __EXPORT void systemreset(bool to_bootloader) noreturn_function; -/** Executes the CXX static initializers */ -__EXPORT void up_cxxinitialize(void); - /** Sends SIGUSR1 to all processes */ __EXPORT void killall(void); -- cgit v1.2.3 From 123ed82b5da723947466e4ee6daf0cc979426267 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Fri, 30 Jan 2015 15:00:11 +0100 Subject: Simplify aerocore config --- src/drivers/boards/aerocore/module.mk | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/drivers/boards/aerocore/module.mk b/src/drivers/boards/aerocore/module.mk index 05e3d878d..c1b51cd26 100644 --- a/src/drivers/boards/aerocore/module.mk +++ b/src/drivers/boards/aerocore/module.mk @@ -5,12 +5,7 @@ SRCS = aerocore_init.c \ aerocore_pwm_servo.c \ aerocore_spi.c \ - aerocore_led.c - -ENABLE_CXXINITIALIZE=$(call check_nuttx_config ,"CONFIG_HAVE_CXX 1", $(NUTTX_CONFIG_H)) -ENABLE_CXXINITIALIZE+=$(call check_nuttx_config ,"CONFIG_HAVE_CXXINITIALIZE 1", $(NUTTX_CONFIG_H)) -ifeq ("$(ENABLE_CXXINITIALIZE)",$(nuttx_config_2true)) -SRCS += ../../../modules/systemlib/up_cxxinitialize.c -endif + aerocore_led.c \ + ../../../modules/systemlib/up_cxxinitialize.c MAXOPTIMIZATION = -Os -- cgit v1.2.3 From 4d0eacef33cc54487dec6830d045cd4fe3ab333d Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Fri, 30 Jan 2015 15:00:24 +0100 Subject: FMUv1: Simplify config --- src/drivers/boards/px4fmu-v1/module.mk | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/drivers/boards/px4fmu-v1/module.mk b/src/drivers/boards/px4fmu-v1/module.mk index ff717fe92..5a3f5f801 100644 --- a/src/drivers/boards/px4fmu-v1/module.mk +++ b/src/drivers/boards/px4fmu-v1/module.mk @@ -7,12 +7,7 @@ SRCS = px4fmu_can.c \ px4fmu_pwm_servo.c \ px4fmu_spi.c \ px4fmu_usb.c \ - px4fmu_led.c - -ENABLE_CXXINITIALIZE=$(call check_nuttx_config ,"CONFIG_HAVE_CXX 1", $(NUTTX_CONFIG_H)) -ENABLE_CXXINITIALIZE+=$(call check_nuttx_config ,"CONFIG_HAVE_CXXINITIALIZE 1", $(NUTTX_CONFIG_H)) -ifeq ("$(ENABLE_CXXINITIALIZE)",$(nuttx_config_2true)) -SRCS += ../../../modules/systemlib/up_cxxinitialize.c -endif + px4fmu_led.c \ + ../../../modules/systemlib/up_cxxinitialize.c MAXOPTIMIZATION = -Os -- cgit v1.2.3 From 4f9740e71a0b65f847ff62bb82812ae296fd1725 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Fri, 30 Jan 2015 15:02:19 +0100 Subject: Simplify v2 config --- src/drivers/boards/px4fmu-v2/module.mk | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/drivers/boards/px4fmu-v2/module.mk b/src/drivers/boards/px4fmu-v2/module.mk index e62e48e99..cfe7e675b 100644 --- a/src/drivers/boards/px4fmu-v2/module.mk +++ b/src/drivers/boards/px4fmu-v2/module.mk @@ -7,13 +7,7 @@ SRCS = px4fmu_can.c \ px4fmu_pwm_servo.c \ px4fmu_spi.c \ px4fmu_usb.c \ - px4fmu2_led.c - - -ENABLE_CXXINITIALIZE=$(call check_nuttx_config ,"CONFIG_HAVE_CXX 1", $(NUTTX_CONFIG_H)) -ENABLE_CXXINITIALIZE+=$(call check_nuttx_config ,"CONFIG_HAVE_CXXINITIALIZE 1", $(NUTTX_CONFIG_H)) -ifeq ("$(ENABLE_CXXINITIALIZE)",$(nuttx_config_2true)) -SRCS += ../../../modules/systemlib/up_cxxinitialize.c -endif + px4fmu2_led.c \ + ../../../modules/systemlib/up_cxxinitialize.c MAXOPTIMIZATION = -Os -- cgit v1.2.3 From 51e112c697ff57c32d457d592c5eba54038b6ac8 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Fri, 30 Jan 2015 15:04:04 +0100 Subject: IOv1: simplify config --- src/drivers/boards/px4io-v1/module.mk | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/drivers/boards/px4io-v1/module.mk b/src/drivers/boards/px4io-v1/module.mk index 52f17f3f2..40c79da4e 100644 --- a/src/drivers/boards/px4io-v1/module.mk +++ b/src/drivers/boards/px4io-v1/module.mk @@ -3,12 +3,7 @@ # SRCS = px4io_init.c \ - px4io_pwm_servo.c - -ENABLE_CXXINITIALIZE=$(call check_nuttx_config ,"CONFIG_HAVE_CXX 1", $(NUTTX_CONFIG_H)) -ENABLE_CXXINITIALIZE+=$(call check_nuttx_config ,"CONFIG_HAVE_CXXINITIALIZE 1", $(NUTTX_CONFIG_H)) -ifeq ("$(ENABLE_CXXINITIALIZE)",$(nuttx_config_2true)) -SRCS += ../../../modules/systemlib/up_cxxinitialize.c -endif + px4io_pwm_servo.c \ + ../../../modules/systemlib/up_cxxinitialize.c MAXOPTIMIZATION = -Os -- cgit v1.2.3 From a2243a5ffca0e64ce3d5ac74a99745b9ad20ca5b Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Fri, 30 Jan 2015 15:04:47 +0100 Subject: IOv2: simplify config --- src/drivers/boards/px4io-v2/module.mk | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/drivers/boards/px4io-v2/module.mk b/src/drivers/boards/px4io-v2/module.mk index 5613ad405..15e003599 100644 --- a/src/drivers/boards/px4io-v2/module.mk +++ b/src/drivers/boards/px4io-v2/module.mk @@ -3,12 +3,7 @@ # SRCS = px4iov2_init.c \ - px4iov2_pwm_servo.c - -ENABLE_CXXINITIALIZE=$(call check_nuttx_config ,"CONFIG_HAVE_CXX 1", $(NUTTX_CONFIG_H)) -ENABLE_CXXINITIALIZE+=$(call check_nuttx_config ,"CONFIG_HAVE_CXXINITIALIZE 1", $(NUTTX_CONFIG_H)) -ifeq ("$(ENABLE_CXXINITIALIZE)",$(nuttx_config_2true)) -SRCS += ../../../modules/systemlib/up_cxxinitialize.c -endif + px4iov2_pwm_servo.c \ + ../../../modules/systemlib/up_cxxinitialize.c MAXOPTIMIZATION = -Os -- cgit v1.2.3 From cefa002b7b536005cd10506996f02f45f721bf91 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Sat, 31 Jan 2015 01:13:05 +0100 Subject: Allow GCC 4.7.4 in check --- makefiles/toolchain_gnu-arm-eabi.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/makefiles/toolchain_gnu-arm-eabi.mk b/makefiles/toolchain_gnu-arm-eabi.mk index 4c49edaab..853885a3b 100644 --- a/makefiles/toolchain_gnu-arm-eabi.mk +++ b/makefiles/toolchain_gnu-arm-eabi.mk @@ -50,7 +50,7 @@ OBJDUMP = $(CROSSDEV)objdump # Check if the right version of the toolchain is available # -CROSSDEV_VER_SUPPORTED = 4.8.4 4.9.3 +CROSSDEV_VER_SUPPORTED = 4.7.4 4.7.5 4.7.6 4.8.4 4.9.3 CROSSDEV_VER_FOUND = $(shell $(CC) -dumpversion) ifeq (,$(findstring $(CROSSDEV_VER_FOUND), $(CROSSDEV_VER_SUPPORTED))) -- cgit v1.2.3 From c9a201c82f3c3a024d9d23cf88557f92521bbeb5 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Sun, 8 Feb 2015 11:09:48 +0100 Subject: Fix echo output of Makefile --- Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index d5ece137b..7c8fa7a4f 100644 --- a/Makefile +++ b/Makefile @@ -303,9 +303,9 @@ clean: .PHONY: distclean distclean: cleannuttxpatches clean @echo > /dev/null - $(Q) $(REMOVE) $(ARCHIVE_DIR)*.export > /dev/null - $(Q) $(MAKE) -C $(NUTTX_SRC) -r $(MQUIET) distclean > /dev/null - $(Q) (cd $(NUTTX_SRC)/configs && $(FIND) . -maxdepth 1 -type l -delete) > /dev/null + $(Q) $(REMOVE) $(ARCHIVE_DIR)*.export + $(Q) $(MAKE) -C $(NUTTX_SRC) -r $(MQUIET) distclean + $(Q) (cd $(NUTTX_SRC)/configs && $(FIND) . -maxdepth 1 -type l -delete) # # Print some help text -- cgit v1.2.3 From bdc7bb447e9671a159bd9754ff84219db91cb439 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Sun, 8 Feb 2015 13:11:28 +0100 Subject: Fix code style in IO driver --- src/drivers/px4io/px4io_serial.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/drivers/px4io/px4io_serial.cpp b/src/drivers/px4io/px4io_serial.cpp index 752f22d01..c6c0126f4 100644 --- a/src/drivers/px4io/px4io_serial.cpp +++ b/src/drivers/px4io/px4io_serial.cpp @@ -218,7 +218,7 @@ PX4IO_serial::~PX4IO_serial() stm32_unconfiggpio(PX4IO_SERIAL_RX_GPIO); /* Disable APB clock for the USART peripheral */ - modifyreg32(STM32_RCC_APB2ENR, RCC_APB2ENR_USART6EN, 0); + modifyreg32(STM32_RCC_APB2ENR, RCC_APB2ENR_USART6EN, 0); /* and kill our semaphores */ sem_destroy(&_completion_semaphore); @@ -252,7 +252,7 @@ PX4IO_serial::init() /* Enable the APB clock for the USART peripheral */ - modifyreg32(STM32_RCC_APB2ENR, 0, RCC_APB2ENR_USART6EN); + modifyreg32(STM32_RCC_APB2ENR, 0, RCC_APB2ENR_USART6EN); /* configure pins for serial use */ stm32_configgpio(PX4IO_SERIAL_TX_GPIO); -- cgit v1.2.3 From c2279bb8cd3d26f2d7606d3f374e14229af279dc Mon Sep 17 00:00:00 2001 From: Kevin Bretney Date: Wed, 5 Nov 2014 17:02:55 -0800 Subject: Added mavstation config --- Images/mavstation.prototype | 12 + ROMFS/mavstation_common/init.d/rcS | 10 + makefiles/board_mavstation.mk | 11 + makefiles/config_mavstation_default.mk | 26 + makefiles/upload.mk | 3 + nuttx-configs/mavstation/include/README.txt | 1 + nuttx-configs/mavstation/include/board.h | 198 ++++++ nuttx-configs/mavstation/include/nsh_romfsimg.h | 42 ++ nuttx-configs/mavstation/nsh/Make.defs | 173 +++++ nuttx-configs/mavstation/nsh/defconfig | 739 +++++++++++++++++++++ nuttx-configs/mavstation/nsh/oldapconfig | 52 ++ nuttx-configs/mavstation/nsh/setenv.sh | 47 ++ nuttx-configs/mavstation/scripts/ld.script | 129 ++++ nuttx-configs/mavstation/src/Makefile | 84 +++ nuttx-configs/mavstation/src/README.txt | 1 + nuttx-configs/mavstation/src/empty.c | 4 + src/drivers/boards/mavstation/board_config.h | 86 +++ src/drivers/boards/mavstation/mavstation_init.c | 147 ++++ src/drivers/boards/mavstation/mavstation_led.c | 142 ++++ .../boards/mavstation/mavstation_pwm_servo.c | 93 +++ src/drivers/boards/mavstation/mavstation_usb.c | 116 ++++ src/drivers/boards/mavstation/module.mk | 16 + src/examples/px4_simple_app/px4_simple_app.c | 3 +- src/modules/mavstation_firmware/appdebug.c | 67 ++ src/modules/mavstation_firmware/appdebug.h | 14 + src/modules/mavstation_firmware/gpio.c | 68 ++ src/modules/mavstation_firmware/gpio.h | 15 + src/modules/mavstation_firmware/hardware.h | 20 + src/modules/mavstation_firmware/mavstation.c | 151 +++++ src/modules/mavstation_firmware/module.mk | 11 + src/modules/mavstation_firmware/sysstate.h | 21 + 31 files changed, 2501 insertions(+), 1 deletion(-) create mode 100644 Images/mavstation.prototype create mode 100644 ROMFS/mavstation_common/init.d/rcS create mode 100644 makefiles/board_mavstation.mk create mode 100644 makefiles/config_mavstation_default.mk create mode 100755 nuttx-configs/mavstation/include/README.txt create mode 100755 nuttx-configs/mavstation/include/board.h create mode 100644 nuttx-configs/mavstation/include/nsh_romfsimg.h create mode 100644 nuttx-configs/mavstation/nsh/Make.defs create mode 100644 nuttx-configs/mavstation/nsh/defconfig create mode 100644 nuttx-configs/mavstation/nsh/oldapconfig create mode 100755 nuttx-configs/mavstation/nsh/setenv.sh create mode 100755 nuttx-configs/mavstation/scripts/ld.script create mode 100644 nuttx-configs/mavstation/src/Makefile create mode 100644 nuttx-configs/mavstation/src/README.txt create mode 100644 nuttx-configs/mavstation/src/empty.c create mode 100644 src/drivers/boards/mavstation/board_config.h create mode 100644 src/drivers/boards/mavstation/mavstation_init.c create mode 100644 src/drivers/boards/mavstation/mavstation_led.c create mode 100644 src/drivers/boards/mavstation/mavstation_pwm_servo.c create mode 100644 src/drivers/boards/mavstation/mavstation_usb.c create mode 100644 src/drivers/boards/mavstation/module.mk create mode 100644 src/modules/mavstation_firmware/appdebug.c create mode 100644 src/modules/mavstation_firmware/appdebug.h create mode 100644 src/modules/mavstation_firmware/gpio.c create mode 100644 src/modules/mavstation_firmware/gpio.h create mode 100644 src/modules/mavstation_firmware/hardware.h create mode 100644 src/modules/mavstation_firmware/mavstation.c create mode 100644 src/modules/mavstation_firmware/module.mk create mode 100644 src/modules/mavstation_firmware/sysstate.h diff --git a/Images/mavstation.prototype b/Images/mavstation.prototype new file mode 100644 index 000000000..1834d5950 --- /dev/null +++ b/Images/mavstation.prototype @@ -0,0 +1,12 @@ +{ + "board_id": 20, + "magic": "MAVSTATION", + "description": "Firmware for the Mavstation board", + "image": "", + "build_time": 0, + "summary": "MAVSTATION", + "version": "0.1", + "image_size": 0, + "git_identity": "", + "board_revision": 0 +} diff --git a/ROMFS/mavstation_common/init.d/rcS b/ROMFS/mavstation_common/init.d/rcS new file mode 100644 index 000000000..34cc1cb76 --- /dev/null +++ b/ROMFS/mavstation_common/init.d/rcS @@ -0,0 +1,10 @@ +#!nsh +# +# Mavstation startup script. +# +# NOTE: COMMENT LINES ARE REMOVED BEFORE STORED IN ROMFS. +# + +echo "[i] Starting Mavstation Code..." + +mavstation diff --git a/makefiles/board_mavstation.mk b/makefiles/board_mavstation.mk new file mode 100644 index 000000000..115e8d6b6 --- /dev/null +++ b/makefiles/board_mavstation.mk @@ -0,0 +1,11 @@ +# +# Board-specific definitions for the mavstation +# + +# +# Configure the toolchain +# +CONFIG_ARCH = CORTEXM3 +CONFIG_BOARD = MAVSTATION + +include $(PX4_MK_DIR)/toolchain_gnu-arm-eabi.mk diff --git a/makefiles/config_mavstation_default.mk b/makefiles/config_mavstation_default.mk new file mode 100644 index 000000000..c762ea71a --- /dev/null +++ b/makefiles/config_mavstation_default.mk @@ -0,0 +1,26 @@ +# +# Makefile for the mavstation_default configuration +# + +# +# Use the configuration's ROMFS +# +ROMFS_ROOT = $(PX4_BASE)/ROMFS/mavstation_common + +# +# Board support modules +# +MODULES += drivers/device +MODULES += drivers/stm32 +MODULES += drivers/boards/mavstation +MODULES += modules/mavstation_firmware + + + +define _B + $(strip $1).$(or $(strip $2),SCHED_PRIORITY_DEFAULT).$(or $(strip $3),CONFIG_PTHREAD_STACK_DEFAULT).$(strip $4) +endef + +BUILTIN_COMMANDS := \ + $(call _B, sercon, , 1024, sercon_main) \ + $(call _B, serdis, , 1024, serdis_main) diff --git a/makefiles/upload.mk b/makefiles/upload.mk index 29b415688..3b1bda060 100644 --- a/makefiles/upload.mk +++ b/makefiles/upload.mk @@ -35,6 +35,9 @@ upload-serial-aerocore: +upload-serial-mavstation: $(BUNDLE) $(UPLOADER) + $(Q) $(PYTHON) -u $(UPLOADER) --port $(SERIAL_PORTS) $(BUNDLE) + # # JTAG firmware uploading with OpenOCD # diff --git a/nuttx-configs/mavstation/include/README.txt b/nuttx-configs/mavstation/include/README.txt new file mode 100755 index 000000000..7a56b3f43 --- /dev/null +++ b/nuttx-configs/mavstation/include/README.txt @@ -0,0 +1 @@ +This directory contains header files unique to the mavstation board. diff --git a/nuttx-configs/mavstation/include/board.h b/nuttx-configs/mavstation/include/board.h new file mode 100755 index 000000000..4c79422d4 --- /dev/null +++ b/nuttx-configs/mavstation/include/board.h @@ -0,0 +1,198 @@ +/************************************************************************************ + * configs/mavstation/include/board.h + * include/arch/board/board.h + * + * Copyright (C) 2009 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * Copyright (C) 2012 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 NuttX 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. + * + ************************************************************************************/ + +#ifndef __ARCH_BOARD_BOARD_H +#define __ARCH_BOARD_BOARD_H + +/************************************************************************************ + * Included Files + ************************************************************************************/ + +#include +#ifndef __ASSEMBLY__ +# include +# include +#endif +#include +#include +#include + +/************************************************************************************ + * Definitions + ************************************************************************************/ + +/* Clocking *************************************************************************/ + +/* On-board crystal frequency is 24MHz (HSE) */ + +#define STM32_BOARD_XTAL 24000000ul + + +/* PLL source is HSE/1, PLL multipler is 2: PLL frequency is 24MHz (XTAL) x 2 = 48MHz */ + +#define STM32_CFGR_PLLSRC RCC_CFGR_PLLSRC +#define STM32_CFGR_PLLXTPRE 0 +#define STM32_CFGR_PLLMUL RCC_CFGR_PLLMUL_CLKx2 +#define STM32_PLL_FREQUENCY (2*STM32_BOARD_XTAL) + +/* Use the PLL and set the SYSCLK source to be the PLL */ + +#define STM32_SYSCLK_SW RCC_CFGR_SW_PLL +#define STM32_SYSCLK_SWS RCC_CFGR_SWS_PLL +#define STM32_SYSCLK_FREQUENCY STM32_PLL_FREQUENCY + +/* AHB clock (HCLK) is SYSCLK (48MHz) */ + +#define STM32_RCC_CFGR_HPRE RCC_CFGR_HPRE_SYSCLK +#define STM32_HCLK_FREQUENCY STM32_SYSCLK_FREQUENCY +#define STM32_BOARD_HCLK STM32_HCLK_FREQUENCY /* same as above, to satisfy compiler */ + +/* APB2 clock (PCLK2) is HCLK (48MHz) */ + +#define STM32_RCC_CFGR_PPRE2 RCC_CFGR_PPRE2_HCLK +#define STM32_PCLK2_FREQUENCY STM32_HCLK_FREQUENCY +#define STM32_APB2_CLKIN (STM32_PCLK2_FREQUENCY) /* Timers 2-4 */ + +/* APB2 timer 1 will receive PCLK2. */ + +#define STM32_APB2_TIM1_CLKIN (STM32_PCLK2_FREQUENCY) +#define STM32_APB2_TIM8_CLKIN (STM32_PCLK2_FREQUENCY) + +/* APB1 clock (PCLK1) is HCLK (24MHz) */ + +#define STM32_RCC_CFGR_PPRE1 RCC_CFGR_PPRE1_HCLKd2 +#define STM32_PCLK1_FREQUENCY (STM32_HCLK_FREQUENCY/2) + +/* All timers run off PCLK */ + +#define STM32_APB1_TIM1_CLKIN (STM32_PCLK2_FREQUENCY) +#define STM32_APB1_TIM2_CLKIN (STM32_PCLK1_FREQUENCY) +#define STM32_APB1_TIM3_CLKIN (STM32_PCLK1_FREQUENCY) +#define STM32_APB1_TIM4_CLKIN (STM32_PCLK1_FREQUENCY) + +#define STM32_CFGR_USBPRE RCC_CFGR_USBPRE + +/* + * Some of the USART pins are not available; override the GPIO + * definitions with an invalid pin configuration. + */ +/* +#undef GPIO_USART2_CTS +#define GPIO_USART2_CTS 0xffffffff +#undef GPIO_USART2_RTS +#define GPIO_USART2_RTS 0xffffffff +#undef GPIO_USART2_CK +#define GPIO_USART2_CK 0xffffffff +#undef GPIO_USART3_TX +#define GPIO_USART3_TX 0xffffffff +#undef GPIO_USART3_CK +#define GPIO_USART3_CK 0xffffffff +#undef GPIO_USART3_CTS +#define GPIO_USART3_CTS 0xffffffff +#undef GPIO_USART3_RTS +#define GPIO_USART3_RTS 0xffffffff +*/ +#define GPIO_USB_PULLUP (GPIO_OUTPUT|GPIO_CNF_OUTPP|GPIO_MODE_50MHz|\ + GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN8) + +/* + * High-resolution timer + */ +#ifdef CONFIG_HRT_TIMER +# define HRT_TIMER 3 /* use timer3 for the HRT */ +# define HRT_TIMER_CHANNEL 2 /* use capture/compare channel 2 */ +#endif + +/* + * PPM + * + * PPM input is handled by the HRT timer. + * + * Pin is PA8, timer 1, channel 1 + */ +#if defined(CONFIG_HRT_TIMER) && defined (CONFIG_HRT_PPM) +# define HRT_PPM_CHANNEL 1 /* use capture/compare channel 1 */ +# define GPIO_PPM_IN GPIO_TIM1_CH1IN +#endif + +/* LED definitions ******************************************************************/ +/* PX4 has two LEDs that we will encode as: */ + +#define LED_STARTED 0 /* LED? */ +#define LED_HEAPALLOCATE 1 /* LED? */ +#define LED_IRQSENABLED 2 /* LED? + LED? */ +#define LED_STACKCREATED 3 /* LED? */ +#define LED_INIRQ 4 /* LED? + LED? */ +#define LED_SIGNAL 5 /* LED? + LED? */ +#define LED_ASSERTION 6 /* LED? + LED? + LED? */ +#define LED_PANIC 7 /* N/C + N/C + N/C + LED? */ + +/************************************************************************************ + * Public Data + ************************************************************************************/ + +#ifndef __ASSEMBLY__ + +#undef EXTERN +#if defined(__cplusplus) +#define EXTERN extern "C" +extern "C" { +#else +#define EXTERN extern +#endif + +/************************************************************************************ + * Public Function Prototypesæ + ************************************************************************************/ +/************************************************************************************ + * Name: stm32_boardinitialize + * + * Description: + * All STM32 architectures must provide the following entry point. This entry point + * is called early in the intitialization -- after all memory has been configured + * and mapped but before any devices have been initialized. + * + ************************************************************************************/ + +EXTERN void stm32_boardinitialize(void); + +#if defined(__cplusplus) +} +#endif + +#endif /* __ASSEMBLY__ */ +#endif /* __ARCH_BOARD_BOARD_H */ diff --git a/nuttx-configs/mavstation/include/nsh_romfsimg.h b/nuttx-configs/mavstation/include/nsh_romfsimg.h new file mode 100644 index 000000000..15e4e7a8d --- /dev/null +++ b/nuttx-configs/mavstation/include/nsh_romfsimg.h @@ -0,0 +1,42 @@ +/**************************************************************************** + * + * Copyright (C) 2013 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. + * + ****************************************************************************/ + +/** + * nsh_romfsetc.h + * + * This file is a stub for 'make export' purposes; the actual ROMFS + * must be supplied by the library client. + */ + +extern unsigned char romfs_img[]; +extern unsigned int romfs_img_len; diff --git a/nuttx-configs/mavstation/nsh/Make.defs b/nuttx-configs/mavstation/nsh/Make.defs new file mode 100644 index 000000000..a51ffb442 --- /dev/null +++ b/nuttx-configs/mavstation/nsh/Make.defs @@ -0,0 +1,173 @@ +############################################################################ +# configs/mavstation/nsh/Make.defs +# +# Copyright (C) 2011 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt +# +# 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 NuttX 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 ${TOPDIR}/.config +include ${TOPDIR}/tools/Config.mk +include ${TOPDIR}/arch/arm/src/armv7-m/Toolchain.defs + +# +# We only support building with the ARM bare-metal toolchain from +# https://launchpad.net/gcc-arm-embedded on Windows, Linux or Mac OS. +# +CONFIG_ARMV7M_TOOLCHAIN := GNU_EABI + +include ${TOPDIR}/arch/arm/src/armv7-m/Toolchain.defs + +CC = $(CROSSDEV)gcc +CXX = $(CROSSDEV)g++ +CPP = $(CROSSDEV)gcc -E +LD = $(CROSSDEV)ld +AR = $(CROSSDEV)ar rcs +NM = $(CROSSDEV)nm +OBJCOPY = $(CROSSDEV)objcopy +OBJDUMP = $(CROSSDEV)objdump + +MAXOPTIMIZATION = -Os +ARCHCPUFLAGS = -mcpu=cortex-m3 \ + -mthumb \ + -march=armv7-m + +# enable precise stack overflow tracking +ifeq ($(CONFIG_ARMV7M_STACKCHECK),y) +INSTRUMENTATIONDEFINES = -finstrument-functions -ffixed-r10 +endif + + +# use our linker script +LDSCRIPT = ld.script + +ifeq ($(WINTOOL),y) + # Windows-native toolchains + DIRLINK = $(TOPDIR)/tools/copydir.sh + DIRUNLINK = $(TOPDIR)/tools/unlink.sh + MKDEP = $(TOPDIR)/tools/mknulldeps.sh + ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" + ARCHXXINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" -isystem "${shell cygpath -w $(TOPDIR)/include/cxx}" + ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/$(LDSCRIPT)}" +else + ifeq ($(PX4_WINTOOL),y) + # Windows-native toolchains (MSYS) + DIRLINK = $(TOPDIR)/tools/copydir.sh + DIRUNLINK = $(TOPDIR)/tools/unlink.sh + MKDEP = $(TOPDIR)/tools/mknulldeps.sh + ARCHINCLUDES = -I. -isystem $(TOPDIR)/include + ARCHXXINCLUDES = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx + ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/$(LDSCRIPT) + else + # Linux/Cygwin-native toolchain + MKDEP = $(TOPDIR)/tools/mkdeps.sh + ARCHINCLUDES = -I. -isystem $(TOPDIR)/include + ARCHXXINCLUDES = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx + ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/$(LDSCRIPT) + endif +endif + +# tool versions +ARCHCCVERSION = ${shell $(CC) -v 2>&1 | sed -n '/^gcc version/p' | sed -e 's/^gcc version \([0-9\.]\)/\1/g' -e 's/[-\ ].*//g' -e '1q'} +ARCHCCMAJOR = ${shell echo $(ARCHCCVERSION) | cut -d'.' -f1} + +# optimisation flags +ARCHOPTIMIZATION = $(MAXOPTIMIZATION) \ + -fno-strict-aliasing \ + -fno-strength-reduce \ + -fomit-frame-pointer \ + -funsafe-math-optimizations \ + -fno-builtin-printf \ + -ffunction-sections \ + -fdata-sections + +ifeq ("${CONFIG_DEBUG_SYMBOLS}","y") +ARCHOPTIMIZATION += -g +endif + +ARCHCFLAGS = -std=gnu99 +ARCHCXXFLAGS = -fno-exceptions -fno-rtti -std=gnu++0x +ARCHWARNINGS = -Wall \ + -Wextra \ + -Wdouble-promotion \ + -Wshadow \ + -Wfloat-equal \ + -Wframe-larger-than=1024 \ + -Wpointer-arith \ + -Wlogical-op \ + -Wmissing-declarations \ + -Wpacked \ + -Wno-unused-parameter +# -Wcast-qual - generates spurious noreturn attribute warnings, try again later +# -Wconversion - would be nice, but too many "risky-but-safe" conversions in the code +# -Wcast-align - would help catch bad casts in some cases, but generates too many false positives + +ARCHCWARNINGS = $(ARCHWARNINGS) \ + -Wbad-function-cast \ + -Wstrict-prototypes \ + -Wold-style-declaration \ + -Wmissing-parameter-type \ + -Wmissing-prototypes \ + -Wnested-externs \ + -Wunsuffixed-float-constants +ARCHWARNINGSXX = $(ARCHWARNINGS) +ARCHDEFINES = +ARCHPICFLAGS = -fpic -msingle-pic-base -mpic-register=r10 + +# this seems to be the only way to add linker flags +EXTRA_LIBS += --warn-common \ + --gc-sections + +CFLAGS = $(ARCHCFLAGS) $(ARCHCWARNINGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(INSTRUMENTATIONDEFINES) $(ARCHDEFINES) $(EXTRADEFINES) -pipe -fno-common +CPICFLAGS = $(ARCHPICFLAGS) $(CFLAGS) +CXXFLAGS = $(ARCHCXXFLAGS) $(ARCHWARNINGSXX) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHXXINCLUDES) $(INSTRUMENTATIONDEFINES) $(ARCHDEFINES) $(EXTRADEFINES) -pipe +CXXPICFLAGS = $(ARCHPICFLAGS) $(CXXFLAGS) +CPPFLAGS = $(ARCHINCLUDES) $(INSTRUMENTATIONDEFINES) $(ARCHDEFINES) $(EXTRADEFINES) +AFLAGS = $(CFLAGS) -D__ASSEMBLY__ + +NXFLATLDFLAGS1 = -r -d -warn-common +NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections +LDNXFLATFLAGS = -e main -s 2048 + +OBJEXT = .o +LIBEXT = .a +EXEEXT = + +# produce partially-linked $1 from files in $2 +define PRELINK + @echo "PRELINK: $1" + $(Q) $(LD) -Ur -o $1 $2 && $(OBJCOPY) --localize-hidden $1 +endef + +HOSTCC = gcc +HOSTINCLUDES = -I. +HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe +HOSTLDFLAGS = + diff --git a/nuttx-configs/mavstation/nsh/defconfig b/nuttx-configs/mavstation/nsh/defconfig new file mode 100644 index 000000000..6f752df2d --- /dev/null +++ b/nuttx-configs/mavstation/nsh/defconfig @@ -0,0 +1,739 @@ +############################################################################ +# configs/mavstation/nsh/defconfig +# +# Copyright (C) 2009-2012 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt +# +# 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 NuttX 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. +# +############################################################################ +# +# architecture selection +# +# CONFIG_ARCH - identifies the arch subdirectory and, hence, the +# processor architecture. +# CONFIG_ARCH_family - for use in C code. This identifies the +# particular chip family that the architecture is implemented +# in. +# CONFIG_ARCH_architecture - for use in C code. This identifies the +# specific architecture within the chip familyl. +# CONFIG_ARCH_CHIP - Identifies the arch/*/chip subdirectory +# CONFIG_ARCH_CHIP_name - For use in C code +# CONFIG_ARCH_BOARD - identifies the configs subdirectory and, hence, +# the board that supports the particular chip or SoC. +# CONFIG_ARCH_BOARD_name - for use in C code +# CONFIG_ENDIAN_BIG - define if big endian (default is little endian) +# CONFIG_BOARD_LOOPSPERMSEC - for delay loops +# CONFIG_DRAM_SIZE - Describes the installed DRAM. +# CONFIG_DRAM_START - The start address of DRAM (physical) +# CONFIG_DRAM_END - Last address+1 of installed RAM +# CONFIG_ARCH_IRQPRIO - The ST32F100CB supports interrupt prioritization +# CONFIG_ARCH_INTERRUPTSTACK - This architecture supports an interrupt +# stack. If defined, this symbol is the size of the interrupt +# stack in bytes. If not defined, the user task stacks will be +# used during interrupt handling. +# CONFIG_ARCH_STACKDUMP - Do stack dumps after assertions +# CONFIG_ARCH_BOOTLOADER - Set if you are using a bootloader. +# CONFIG_ARCH_LEDS - Use LEDs to show state. Unique to board architecture. +# CONFIG_ARCH_BUTTONS - Enable support for buttons. Unique to board architecture. +# CONFIG_ARCH_CALIBRATION - Enables some build in instrumentation that +# cause a 100 second delay during boot-up. This 100 second delay +# serves no purpose other than it allows you to calibrate +# CONFIG_BOARD_LOOPSPERMSEC. You simply use a stop watch to measure +# the 100 second delay then adjust CONFIG_BOARD_LOOPSPERMSEC until +# the delay actually is 100 seconds. +# CONFIG_ARCH_DMA - Support DMA initialization +# +CONFIG_ARCH="arm" +CONFIG_ARCH_ARM=y +CONFIG_ARCH_CORTEXM3=y +CONFIG_ARCH_CHIP_STM32=y +CONFIG_ARCH_CORTEXM3=y +CONFIG_ARCH_FAMILY="armv7-m" +CONFIG_ARCH_CHIP="stm32" +CONFIG_ARMV7M_USEBASEPRI=y +CONFIG_ARCH_HAVE_CMNVECTOR=y +CONFIG_ARMV7M_CMNVECTOR=y + +CONFIG_ARCH_CHIP_STM32F102CB=y +CONFIG_ARCH_BOARD=mavstation +CONFIG_ARCH_BOARD_MAVSTATION=y +CONFIG_BOARD_LOOPSPERMSEC=24000 +CONFIG_RAM_SIZE=16000 +CONFIG_RAM_START=0x20000000 +CONFIG_RAM_END=(CONFIG_RAM_START+CONFIG_RAM_SIZE) +CONFIG_ARCH_HAVE_INTERRUPTSTACK=y +CONFIG_ARCH_INTERRUPTSTACK=340 +CONFIG_ARCH_IRQPRIO=y +CONFIG_ARCH_INTERRUPTSTACK=n +CONFIG_ARCH_STACKDUMP=y +CONFIG_ARCH_BOOTLOADER=y +CONFIG_ARCH_LEDS=n +CONFIG_ARCH_BUTTONS=y +CONFIG_ARCH_CALIBRATION=n +CONFIG_ARCH_DMA=n +#CONFIG_SERIAL_TERMIOS=y + +CONFIG_ARMV7M_TOOLCHAIN_GNU_EABIL=y + +# +# JTAG Enable settings (by default JTAG-DP and SW-DP are disabled): +# +# CONFIG_STM32_DFU - Use the DFU bootloader, not JTAG +# +# JTAG Enable options: +# +# CONFIG_STM32_JTAG_FULL_ENABLE - Enables full SWJ (JTAG-DP + SW-DP) +# CONFIG_STM32_JTAG_NOJNTRST_ENABLE - Enables full SWJ (JTAG-DP + SW-DP) +# but without JNTRST. +# CONFIG_STM32_JTAG_SW_ENABLE - Set JTAG-DP disabled and SW-DP enabled +# +CONFIG_STM32_DFU=n +CONFIG_STM32_JTAG_FULL_ENABLE=y +CONFIG_STM32_JTAG_NOJNTRST_ENABLE=n +CONFIG_STM32_JTAG_SW_ENABLE=n + +# +# Individual subsystems can be enabled: +# AHB: +CONFIG_STM32_DMA1=n +CONFIG_STM32_DMA2=n +CONFIG_STM32_CRC=n +# APB1: +# Timers 2 and 4 are owned by the PWM driver +CONFIG_STM32_TIM2=n +CONFIG_STM32_TIM4=n +CONFIG_STM32_WWDG=n +CONFIG_STM32_SPI2=n +CONFIG_STM32_USART2=y +CONFIG_STM32_USART3=n +CONFIG_STM32_I2C1=y +CONFIG_STM32_I2C2=y +CONFIG_STM32_BKP=n +CONFIG_STM32_PWR=n +CONFIG_STM32_DAC=n +# APB2: +CONFIG_STM32_ADC1=y +CONFIG_STM32_ADC2=n +# TIM3 is owned by the HRT +CONFIG_STM32_TIM3=n +CONFIG_STM32_SPI1=n +CONFIG_STM32_TIM8=n +CONFIG_STM32_USART1=y +CONFIG_STM32_ADC3=n +CONFIG_STM32_USB=y + +# +# Timer and I2C devices may need to the following to force power to be applied: +# +#CONFIG_STM32_FORCEPOWER=y + +# +# STM32F100 specific serial device driver settings +# +# CONFIG_USARTn_SERIAL_CONSOLE - selects the USARTn for the +# console and ttys0 (default is the USART1). +# CONFIG_USARTn_RXBUFSIZE - Characters are buffered as received. +# This specific the size of the receive buffer +# CONFIG_USARTn_TXBUFSIZE - Characters are buffered before +# being sent. This specific the size of the transmit buffer +# CONFIG_USARTn_BAUD - The configure BAUD of the UART. Must be +# CONFIG_USARTn_BITS - The number of bits. Must be either 7 or 8. +# CONFIG_USARTn_PARTIY - 0=no parity, 1=odd parity, 2=even parity +# CONFIG_USARTn_2STOP - Two stop bits +# +CONFIG_USART1_SERIAL_CONSOLE=y +CONFIG_USART2_SERIAL_CONSOLE=n +CONFIG_USART3_SERIAL_CONSOLE=n + +CONFIG_USART1_TXBUFSIZE=64 +CONFIG_USART2_TXBUFSIZE=64 +CONFIG_USART3_TXBUFSIZE=64 + +CONFIG_USART1_RXBUFSIZE=64 +CONFIG_USART2_RXBUFSIZE=64 +CONFIG_USART3_RXBUFSIZE=64 + +CONFIG_USART1_BAUD=57600 +CONFIG_USART2_BAUD=115200 +CONFIG_USART3_BAUD=115200 + +CONFIG_USART1_BITS=8 +CONFIG_USART2_BITS=8 +CONFIG_USART3_BITS=8 + +CONFIG_USART1_PARITY=0 +CONFIG_USART2_PARITY=0 +CONFIG_USART3_PARITY=0 + +CONFIG_USART1_2STOP=0 +CONFIG_USART2_2STOP=0 +CONFIG_USART3_2STOP=0 + +CONFIG_USBDEV=y +#CONFIG_USART1_RXDMA=y +#SERIAL_HAVE_CONSOLE_DMA=y + +# +# USB Device Controller Driver Options +# +# CONFIG_USBDEV_ISOCHRONOUS is not set +# CONFIG_USBDEV_DUALSPEED is not set +CONFIG_USBDEV_SELFPOWERED=y +# CONFIG_USBDEV_BUSPOWERED is not set +CONFIG_USBDEV_MAXPOWER=100 +# CONFIG_USBDEV_DMA is not set +CONFIG_USBDEV_TRACE=y +CONFIG_USBDEV_TRACE_NRECORDS=32 +# CONFIG_USBDEV_TRACE_STRINGS is not set + +# +# USB CDC/ACM Device Commands +# +CONFIG_SYSTEM_CDCACM=y +CONFIG_SYSTEM_CDCACM_DEVMINOR=0 + +# +# USB Device Class Driver Options +# +# CONFIG_USBDEV_COMPOSITE is not set +# CONFIG_PL2303 is not set +CONFIG_CDCACM=y +CONFIG_CDCACM_CONSOLE=n +CONFIG_CDCACM_EP0MAXPACKET=64 +CONFIG_CDCACM_EPINTIN=1 +CONFIG_CDCACM_EPINTIN_FSSIZE=64 +CONFIG_CDCACM_EPINTIN_HSSIZE=64 +CONFIG_CDCACM_EPBULKOUT=3 +CONFIG_CDCACM_EPBULKOUT_FSSIZE=64 +CONFIG_CDCACM_EPBULKOUT_HSSIZE=512 +CONFIG_CDCACM_EPBULKIN=2 +CONFIG_CDCACM_EPBULKIN_FSSIZE=64 +CONFIG_CDCACM_EPBULKIN_HSSIZE=512 +CONFIG_CDCACM_NWRREQS=4 +CONFIG_CDCACM_NRDREQS=4 +CONFIG_CDCACM_BULKIN_REQLEN=96 +CONFIG_CDCACM_RXBUFSIZE=256 +CONFIG_CDCACM_TXBUFSIZE=296 +CONFIG_CDCACM_VENDORID=0x0525 +CONFIG_CDCACM_PRODUCTID=0xa4a7 +CONFIG_CDCACM_VENDORSTR="NuttX" +CONFIG_CDCACM_PRODUCTSTR="CDC/ACM Serial" + +# PX4IO specific driver settings +# +# CONFIG_HRT_TIMER +# Enables the high-resolution timer. The board definition must +# set HRT_TIMER and HRT_TIMER_CHANNEL to the timer and capture/ +# compare channels to be used. +# CONFIG_HRT_PPM +# Enables R/C PPM input using the HRT. The board definition must +# set HRT_PPM_CHANNEL to the timer capture/compare channel to be +# used, and define GPIO_PPM_IN to configure the appropriate timer +# GPIO. +# CONFIG_PWM_SERVO +# Enables the PWM servo driver. The driver configuration must be +# supplied by the board support at initialisation time. +# Note that USART2 must be disabled on the PX4 board for this to +# be available. +# +# +CONFIG_HRT_TIMER=y +CONFIG_HRT_PPM=n +CONFIG_PWM_SERVO=y + +# +# General build options +# +# CONFIG_RRLOAD_BINARY - make the rrload binary format used with +# BSPs from www.ridgerun.com using the tools/mkimage.sh script +# CONFIG_INTELHEX_BINARY - make the Intel HEX binary format +# used with many different loaders using the GNU objcopy program +# Should not be selected if you are not using the GNU toolchain. +# CONFIG_MOTOROLA_SREC - make the Motorola S-Record binary format +# used with many different loaders using the GNU objcopy program +# Should not be selected if you are not using the GNU toolchain. +# CONFIG_RAW_BINARY - make a raw binary format file used with many +# different loaders using the GNU objcopy program. This option +# should not be selected if you are not using the GNU toolchain. +# CONFIG_HAVE_LIBM - toolchain supports libm.a +# +CONFIG_RRLOAD_BINARY=n +CONFIG_INTELHEX_BINARY=n +CONFIG_MOTOROLA_SREC=n +CONFIG_RAW_BINARY=y +CONFIG_HAVE_LIBM=n +CONFIG_BINFMT_DISABLE=n +CONFIG_FS_BINFS=y + +# +# Examples +# +# CONFIG_EXAMPLES_BUTTONS is not set +# CONFIG_EXAMPLES_CAN is not set +# CONFIG_EXAMPLES_CONFIGDATA is not set +# CONFIG_EXAMPLES_CPUHOG is not set +# CONFIG_EXAMPLES_CXXTEST is not set +# CONFIG_EXAMPLES_DHCPD is not set +# CONFIG_EXAMPLES_ELF is not set +# CONFIG_EXAMPLES_FTPC is not set +# CONFIG_EXAMPLES_FTPD is not set +CONFIG_EXAMPLES_HELLO=y +# CONFIG_EXAMPLES_HELLOXX is not set +# CONFIG_EXAMPLES_JSON is not set +# CONFIG_EXAMPLES_HIDKBD is not set +# CONFIG_EXAMPLES_KEYPADTEST is not set +# CONFIG_EXAMPLES_IGMP is not set +# CONFIG_EXAMPLES_MM is not set +# CONFIG_EXAMPLES_MODBUS is not set +CONFIG_EXAMPLES_MOUNT=y +# CONFIG_EXAMPLES_MOUNT_BLOCKDEVICE is not set +CONFIG_EXAMPLES_MOUNT_NSECTORS=1024 +CONFIG_EXAMPLES_MOUNT_SECTORSIZE=256 +CONFIG_EXAMPLES_MOUNT_RAMDEVNO=0 +# CONFIG_EXAMPLES_MTDPART is not set +# CONFIG_EXAMPLES_NRF24L01TERM is not set +CONFIG_EXAMPLES_NSH=y +# CONFIG_EXAMPLES_NSH_CXXINITIALIZE is not set +# CONFIG_EXAMPLES_NULL is not set +# CONFIG_EXAMPLES_NX is not set +# CONFIG_EXAMPLES_NXTERM is not set +# CONFIG_EXAMPLES_NXFFS is not set +# CONFIG_EXAMPLES_NXFLAT is not set +# CONFIG_EXAMPLES_NXHELLO is not set +# CONFIG_EXAMPLES_NXIMAGE is not set +# CONFIG_EXAMPLES_NXLINES is not set +# CONFIG_EXAMPLES_NXTEXT is not set +# CONFIG_EXAMPLES_OSTEST is not set +# CONFIG_EXAMPLES_PIPE is not set +# CONFIG_EXAMPLES_POSIXSPAWN is not set +# CONFIG_EXAMPLES_QENCODER is not set +# CONFIG_EXAMPLES_RGMP is not set +# CONFIG_EXAMPLES_ROMFS is not set +# CONFIG_EXAMPLES_SENDMAIL is not set +# CONFIG_EXAMPLES_SERIALBLASTER is not set +# CONFIG_EXAMPLES_SERIALRX is not set +# CONFIG_EXAMPLES_SERLOOP is not set +# CONFIG_EXAMPLES_SLCD is not set +# CONFIG_EXAMPLES_SMART_TEST is not set +# CONFIG_EXAMPLES_SMART is not set +# CONFIG_EXAMPLES_TCPECHO is not set +# CONFIG_EXAMPLES_TELNETD is not set +# CONFIG_EXAMPLES_THTTPD is not set +# CONFIG_EXAMPLES_TIFF is not set +# CONFIG_EXAMPLES_TOUCHSCREEN is not set +# CONFIG_EXAMPLES_WEBSERVER is not set +# CONFIG_EXAMPLES_USBSERIAL is not set +# CONFIG_EXAMPLES_USBTERM is not set +# CONFIG_EXAMPLES_WATCHDOG is not set + +# +# General OS setup +# +# CONFIG_APPS_DIR - Identifies the relative path to the directory +# that builds the application to link with NuttX. Default: ../apps +# CONFIG_DEBUG - enables built-in debug options +# CONFIG_DEBUG_VERBOSE - enables verbose debug output +# CONFIG_DEBUG_SYMBOLS - build without optimization and with +# debug symbols (needed for use with a debugger). +# CONFIG_HAVE_CXX - Enable support for C++ +# CONFIG_HAVE_CXXINITIALIZE - The platform-specific logic includes support +# for initialization of static C++ instances for this architecture +# and for the selected toolchain (via up_cxxinitialize()). +# CONFIG_MM_REGIONS - If the architecture includes multiple +# regions of memory to allocate from, this specifies the +# number of memory regions that the memory manager must +# handle and enables the API mm_addregion(start, end); +# CONFIG_ARCH_LOWPUTC - architecture supports low-level, boot +# time console output +# CONFIG_MSEC_PER_TICK - The default system timer is 100Hz +# or MSEC_PER_TICK=10. This setting may be defined to +# inform NuttX that the processor hardware is providing +# system timer interrupts at some interrupt interval other +# than 10 msec. +# CONFIG_RR_INTERVAL - The round robin timeslice will be set +# this number of milliseconds; Round robin scheduling can +# be disabled by setting this value to zero. +# CONFIG_SCHED_INSTRUMENTATION - enables instrumentation in +# scheduler to monitor system performance +# CONFIG_TASK_NAME_SIZE - Spcifies that maximum size of a +# task name to save in the TCB. Useful if scheduler +# instrumentation is selected. Set to zero to disable. +# CONFIG_START_YEAR, CONFIG_START_MONTH, CONFIG_START_DAY - +# Used to initialize the internal time logic. +# CONFIG_GREGORIAN_TIME - Enables Gregorian time conversions. +# You would only need this if you are concerned about accurate +# time conversions in the past or in the distant future. +# CONFIG_JULIAN_TIME - Enables Julian time conversions. You +# would only need this if you are concerned about accurate +# time conversion in the distand past. You must also define +# CONFIG_GREGORIAN_TIME in order to use Julian time. +# CONFIG_DEV_CONSOLE - Set if architecture-specific logic +# provides /dev/console. Enables stdout, stderr, stdin. +# CONFIG_DEV_LOWCONSOLE - Use the simple, low-level serial console +# driver (minimul support) +# CONFIG_MUTEX_TYPES: Set to enable support for recursive and +# errorcheck mutexes. Enables pthread_mutexattr_settype(). +# CONFIG_PRIORITY_INHERITANCE : Set to enable support for priority +# inheritance on mutexes and semaphores. +# CONFIG_SEM_PREALLOCHOLDERS: This setting is only used if priority +# inheritance is enabled. It defines the maximum number of +# different threads (minus one) that can take counts on a +# semaphore with priority inheritance support. This may be +# set to zero if priority inheritance is disabled OR if you +# are only using semaphores as mutexes (only one holder) OR +# if no more than two threads participate using a counting +# semaphore. +# CONFIG_SEM_NNESTPRIO. If priority inheritance is enabled, +# then this setting is the maximum number of higher priority +# threads (minus 1) than can be waiting for another thread +# to release a count on a semaphore. This value may be set +# to zero if no more than one thread is expected to wait for +# a semaphore. +# CONFIG_FDCLONE_DISABLE. Disable cloning of all file descriptors +# by task_create() when a new task is started. If set, all +# files/drivers will appear to be closed in the new task. +# CONFIG_FDCLONE_STDIO. Disable cloning of all but the first +# three file descriptors (stdin, stdout, stderr) by task_create() +# when a new task is started. If set, all files/drivers will +# appear to be closed in the new task except for stdin, stdout, +# and stderr. +# CONFIG_SDCLONE_DISABLE. Disable cloning of all socket +# desciptors by task_create() when a new task is started. If +# set, all sockets will appear to be closed in the new task. +# CONFIG_NXFLAT. Enable support for the NXFLAT binary format. +# This format will support execution of NuttX binaries located +# in a ROMFS filesystem (see examples/nxflat). +# CONFIG_SCHED_WORKQUEUE. Create a dedicated "worker" thread to +# handle delayed processing from interrupt handlers. This feature +# is required for some drivers but, if there are not complaints, +# can be safely disabled. The worker thread also performs +# garbage collection -- completing any delayed memory deallocations +# from interrupt handlers. If the worker thread is disabled, +# then that clean will be performed by the IDLE thread instead +# (which runs at the lowest of priority and may not be appropriate +# if memory reclamation is of high priority). If CONFIG_SCHED_WORKQUEUE +# is enabled, then the following options can also be used: +# CONFIG_SCHED_WORKPRIORITY - The execution priority of the worker +# thread. Default: 50 +# CONFIG_SCHED_WORKPERIOD - How often the worker thread checks for +# work in units of microseconds. Default: 50*1000 (50 MS). +# CONFIG_SCHED_WORKSTACKSIZE - The stack size allocated for the worker +# thread. Default: CONFIG_IDLETHREAD_STACKSIZE. +# CONFIG_SIG_SIGWORK - The signal number that will be used to wake-up +# the worker thread. Default: 4 +# +CONFIG_APPS_DIR="../apps" +CONFIG_ARCH_HAVE_STACKCHECK=y +CONFIG_STACK_COLORATION=y +CONFIG_ARCH_HAVE_HEAPCHECK=y +CONFIG_MSEC_PWER_TICK=1 +CONFIG_DEBUG=n +CONFIG_DEBUG_VERBOSE=n +CONFIG_DEBUG_SYMBOLS=y +CONFIG_HAVE_CXX=y +CONFIG_HAVE_CXXINITIALIZE=y +CONFIG_ARCH_MATH_H=y +CONFIG_MM_REGIONS=1 +CONFIG_MM_SMALL=y +CONFIG_ARCH_LOWPUTC=y +CONFIG_RR_INTERVAL=200 +CONFIG_SCHED_INSTRUMENTATION=n +CONFIG_TASK_NAME_SIZE=8 +CONFIG_START_YEAR=2009 +CONFIG_START_MONTH=9 +CONFIG_START_DAY=21 +CONFIG_GREGORIAN_TIME=n +CONFIG_JULIAN_TIME=n +CONFIG_DEV_CONSOLE=y +CONFIG_DEV_LOWCONSOLE=n +CONFIG_MUTEX_TYPES=n +CONFIG_PRIORITY_INHERITANCE=n +CONFIG_SEM_PREALLOCHOLDERS=0 +CONFIG_SEM_NNESTPRIO=0 +CONFIG_FDCLONE_DISABLE=n +CONFIG_FDCLONE_STDIO=y +CONFIG_SDCLONE_DISABLE=y +CONFIG_NXFLAT=n +CONFIG_SCHED_WORKQUEUE=n +CONFIG_SCHED_WORKPRIORITY=50 +CONFIG_SCHED_WORKPERIOD=(50*1000) +CONFIG_SCHED_WORKSTACKSIZE=512 +CONFIG_SIG_SIGWORK=4 + +CONFIG_USER_ENTRYPOINT="nsh_main" +# +# The following can be used to disable categories of +# APIs supported by the OS. If the compiler supports +# weak functions, then it should not be necessary to +# disable functions unless you want to restrict usage +# of those APIs. +# +# There are certain dependency relationships in these +# features. +# +# o mq_notify logic depends on signals to awaken tasks +# waiting for queues to become full or empty. +# o pthread_condtimedwait() depends on signals to wake +# up waiting tasks. +# +CONFIG_DISABLE_CLOCK=n +CONFIG_DISABLE_POSIX_TIMERS=y +CONFIG_DISABLE_PTHREAD=n +CONFIG_DISABLE_SIGNALS=n +CONFIG_DISABLE_MQUEUE=y +CONFIG_DISABLE_MOUNTPOINT=n +CONFIG_DISABLE_ENVIRON=n +CONFIG_DISABLE_POLL=n + +# +# Misc libc settings +# +# CONFIG_NOPRINTF_FIELDWIDTH - sprintf-related logic is a +# little smaller if we do not support fieldwidthes +# +CONFIG_NOPRINTF_FIELDWIDTH=n +CONFIG_C99_BOOL8=y + +# +# Allow for architecture optimized implementations +# +# The architecture can provide optimized versions of the +# following to improve system performance +# +CONFIG_ARCH_MEMCPY=n +CONFIG_ARCH_MEMCMP=n +CONFIG_ARCH_MEMMOVE=n +CONFIG_ARCH_MEMSET=n +CONFIG_ARCH_STRCMP=n +CONFIG_ARCH_STRCPY=n +CONFIG_ARCH_STRNCPY=n +CONFIG_ARCH_STRLEN=n +CONFIG_ARCH_STRNLEN=n +CONFIG_ARCH_BZERO=n + +# +# Sizes of configurable things (0 disables) +# +# CONFIG_MAX_TASKS - The maximum number of simultaneously +# active tasks. This value must be a power of two. +# CONFIG_MAX_TASK_ARGS - This controls the maximum number of +# of parameters that a task may receive (i.e., maxmum value +# of 'argc') +# CONFIG_NPTHREAD_KEYS - The number of items of thread- +# specific data that can be retained +# CONFIG_NFILE_DESCRIPTORS - The maximum number of file +# descriptors (one for each open) +# CONFIG_NFILE_STREAMS - The maximum number of streams that +# can be fopen'ed +# CONFIG_NAME_MAX - The maximum size of a file name. +# CONFIG_STDIO_BUFFER_SIZE - Size of the buffer to allocate +# on fopen. (Only if CONFIG_NFILE_STREAMS > 0) +# CONFIG_NUNGET_CHARS - Number of characters that can be +# buffered by ungetc() (Only if CONFIG_NFILE_STREAMS > 0) +# CONFIG_PREALLOC_MQ_MSGS - The number of pre-allocated message +# structures. The system manages a pool of preallocated +# message structures to minimize dynamic allocations +# CONFIG_MQ_MAXMSGSIZE - Message structures are allocated with +# a fixed payload size given by this settin (does not include +# other message structure overhead. +# CONFIG_MAX_WDOGPARMS - Maximum number of parameters that +# can be passed to a watchdog handler +# CONFIG_PREALLOC_WDOGS - The number of pre-allocated watchdog +# structures. The system manages a pool of preallocated +# watchdog structures to minimize dynamic allocations +# CONFIG_PREALLOC_TIMERS - The number of pre-allocated POSIX +# timer structures. The system manages a pool of preallocated +# timer structures to minimize dynamic allocations. Set to +# zero for all dynamic allocations. +# +CONFIG_MAX_TASKS=4 +CONFIG_MAX_TASK_ARGS=4 +CONFIG_NPTHREAD_KEYS=2 +CONFIG_NFILE_DESCRIPTORS=6 +CONFIG_NFILE_STREAMS=4 +CONFIG_NAME_MAX=32 +CONFIG_STDIO_BUFFER_SIZE=64 +#CONFIG_STDIO_LINEBUFFER=y +CONFIG_NUNGET_CHARS=2 +CONFIG_PREALLOC_MQ_MSGS=1 +CONFIG_MQ_MAXMSGSIZE=32 +CONFIG_MAX_WDOGPARMS=2 +CONFIG_PREALLOC_WDOGS=3 +CONFIG_PREALLOC_TIMERS=1 + + +# +# File Systems +# + +# +# File system configuration +# +CONFIG_FS_ROMFS=y + +# +# NSH Library +# +CONFIG_NSH_LIBRARY=y + +# +# Settings for apps/nshlib +# +# CONFIG_NSH_BUILTIN_APPS - Support external registered, +# "named" applications that can be executed from the NSH +# command line (see apps/README.txt for more information). +# CONFIG_NSH_FILEIOSIZE - Size of a static I/O buffer +# CONFIG_NSH_STRERROR - Use strerror(errno) +# CONFIG_NSH_LINELEN - Maximum length of one command line +# CONFIG_NSH_NESTDEPTH - Max number of nested if-then[-else]-fi +# CONFIG_NSH_DISABLESCRIPT - Disable scripting support +# CONFIG_NSH_DISABLEBG - Disable background commands +# CONFIG_NSH_ROMFSETC - Use startup script in /etc +# CONFIG_NSH_CONSOLE - Use serial console front end +# CONFIG_NSH_TELNET - Use telnetd console front end +# CONFIG_NSH_ARCHINIT - Platform provides architecture +# specific initialization (nsh_archinitialize()). +# +# If CONFIG_NSH_TELNET is selected: +# CONFIG_NSH_IOBUFFER_SIZE -- Telnetd I/O buffer size +# CONFIG_NSH_DHCPC - Obtain address using DHCP +# CONFIG_NSH_IPADDR - Provides static IP address +# CONFIG_NSH_DRIPADDR - Provides static router IP address +# CONFIG_NSH_NETMASK - Provides static network mask +# CONFIG_NSH_NOMAC - Use a bogus MAC address +# +# If CONFIG_NSH_ROMFSETC is selected: +# CONFIG_NSH_ROMFSMOUNTPT - ROMFS mountpoint +# CONFIG_NSH_INITSCRIPT - Relative path to init script +# CONFIG_NSH_ROMFSDEVNO - ROMFS RAM device minor +# CONFIG_NSH_ROMFSSECTSIZE - ROMF sector size +# CONFIG_NSH_FATDEVNO - FAT FS RAM device minor +# CONFIG_NSH_FATSECTSIZE - FAT FS sector size +# CONFIG_NSH_FATNSECTORS - FAT FS number of sectors +# CONFIG_NSH_FATMOUNTPT - FAT FS mountpoint +# +CONFIG_BUILTIN=y +CONFIG_NSH_BUILTIN_APPS=y +CONFIG_NSH_FILEIOSIZE=64 +CONFIG_NSH_STRERROR=n +CONFIG_NSH_READLINE=y +CONFIG_NSH_LINELEN=64 +CONFIG_NSH_CMDPARMS=y +CONFIG_NSH_MAXARGUMENTS=12 +CONFIG_NSH_ARGCAT=y +CONFIG_NSH_NESTDEPTH=1 +CONFIG_NSH_DISABLESCRIPT=n +CONFIG_NSH_DISABLEBG=n +CONFIG_NSH_ROMFSETC=n +CONFIG_NSH_CONSOLE=y +CONFIG_NSH_TELNET=n +CONFIG_NSH_ARCHINIT=n +CONFIG_NSH_IOBUFFER_SIZE=256 +CONFIG_NSH_STACKSIZE=1024 +CONFIG_NSH_DHCPC=n +CONFIG_NSH_NOMAC=n +CONFIG_NSH_IPADDR=(10<<24|0<<16|0<<8|2) +CONFIG_NSH_DRIPADDR=(10<<24|0<<16|0<<8|1) +CONFIG_NSH_NETMASK=(255<<24|255<<16|255<<8|0) +CONFIG_NSH_ROMFSETC=y +CONFIG_NSH_ROMFSMOUNTPT="/etc" +CONFIG_NSH_INITSCRIPT="init.d/rcS" +CONFIG_NSH_ROMFSDEVNO=0 +CONFIG_NSH_ROMFSSECTSIZE=128 +CONFIG_NSH_ARCHROMFS=y +CONFIG_FS_FAT=y +CONFIG_NSH_FATDEVNO=1 +CONFIG_NSH_FATSECTSIZE=512 +CONFIG_NSH_FATNSECTORS=1024 +CONFIG_NSH_FATMOUNTPT=/tmp +CONFIG_NSH_DISABLE_MOUNT=n + + +CONFIG_I2C=y +# CONFIG_I2C_SLAVE is not set +CONFIG_I2C_TRANSFER=y +# CONFIG_I2C_WRITEREAD is not set +# CONFIG_I2C_POLLED is not set +# CONFIG_I2C_TRACE is not set +CONFIG_ARCH_HAVE_I2CRESET=y +CONFIG_I2C_RESET=y +CONFIG_SPI=y +CONFIG_SPI_EXCHANGE=y +CONFIG_WATCHDOG=y + +# +# Architecture-specific NSH options +# +CONFIG_NSH_MMCSDSPIPORTNO=0 +CONFIG_NSH_MMCSDSLOTNO=0 +CONFIG_NSH_MMCSDMINOR=0 + +# +# readline() +# +CONFIG_SYSTEM_READLINE=y +CONFIG_READLINE_ECHO=y + +# +# Stack and heap information +# +# CONFIG_BOOT_RUNFROMFLASH - Some configurations support XIP +# operation from FLASH but must copy initialized .data sections to RAM. +# (should also be =n for the STM3210E-EVAL which always runs from flash) +# CONFIG_BOOT_COPYTORAM - Some configurations boot in FLASH +# but copy themselves entirely into RAM for better performance. +# CONFIG_CUSTOM_STACK - The up_ implementation will handle +# all stack operations outside of the nuttx model. +# CONFIG_STACK_POINTER - The initial stack pointer (arm7tdmi only) +# CONFIG_IDLETHREAD_STACKSIZE - The size of the initial stack. +# This is the thread that (1) performs the inital boot of the system up +# to the point where user_start() is spawned, and (2) there after is the +# IDLE thread that executes only when there is no other thread ready to +# run. +# CONFIG_USERMAIN_STACKSIZE - The size of the stack to allocate +# for the main user thread that begins at the user_start() entry point. +# CONFIG_PTHREAD_STACK_MIN - Minimum pthread stack size +# CONFIG_PTHREAD_STACK_DEFAULT - Default pthread stack size +# CONFIG_HEAP_BASE - The beginning of the heap +# CONFIG_HEAP_SIZE - The size of the heap +# +CONFIG_BOOT_RUNFROMFLASH=y +CONFIG_BOOT_COPYTORAM=n +CONFIG_CUSTOM_STACK=n +CONFIG_STACK_POINTER= +CONFIG_IDLETHREAD_STACKSIZE=280 +CONFIG_USERMAIN_STACKSIZE=1024 +CONFIG_PTHREAD_STACK_MIN=256 +CONFIG_PTHREAD_STACK_DEFAULT=340 +CONFIG_HEAP_BASE= +CONFIG_HEAP_SIZE= +CONFIG_POSIX_SPAWN_PROXY_STACKSIZE=768 +CONFIG_TASK_SPAWN_DEFAULT_STACKSIZE=768 +CONFIG_BUILTIN_PROXY_STACKSIZE=768 + diff --git a/nuttx-configs/mavstation/nsh/oldapconfig b/nuttx-configs/mavstation/nsh/oldapconfig new file mode 100644 index 000000000..c022f1c9d --- /dev/null +++ b/nuttx-configs/mavstation/nsh/oldapconfig @@ -0,0 +1,52 @@ +############################################################################ +# configs/stm3210e-eval/nsh/appconfig +# +# Copyright (C) 2011-2012 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt +# +# 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 NuttX 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. +# +############################################################################ + +# Path to example in apps/examples containing the user_start entry point + +#CONFIGURED_APPS += examples/mavstation +CONFIGURED_APPS += examples/hello + +CONFIGURED_APPS += system/readline +CONFIGURED_APPS += nshlib +CONFIGURED_APPS += reboot + +CONFIGURED_APPS += drivers/boards/mavstation + +#ifeq ($(CONFIG_USBDEV),y) +#ifeq ($(CONFIG_CDCACM),y) + CONFIGURED_APPS += examples/cdcacm +#endif +#endif + diff --git a/nuttx-configs/mavstation/nsh/setenv.sh b/nuttx-configs/mavstation/nsh/setenv.sh new file mode 100755 index 000000000..ff9a4bf8a --- /dev/null +++ b/nuttx-configs/mavstation/nsh/setenv.sh @@ -0,0 +1,47 @@ +#!/bin/bash +# configs/stm3210e-eval/dfu/setenv.sh +# +# Copyright (C) 2009 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt +# +# 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 NuttX 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. +# + +if [ "$(basename $0)" = "setenv.sh" ] ; then + echo "You must source this script, not run it!" 1>&2 + exit 1 +fi + +if [ -z "${PATH_ORIG}" ]; then export PATH_ORIG="${PATH}"; fi + +WD=`pwd` +export RIDE_BIN="/cygdrive/c/Program Files/Raisonance/Ride/arm-gcc/bin" +export BUILDROOT_BIN="${WD}/../misc/buildroot/build_arm_nofpu/staging_dir/bin" +export PATH="${BUILDROOT_BIN}:${RIDE_BIN}:/sbin:/usr/sbin:${PATH_ORIG}" + +echo "PATH : ${PATH}" diff --git a/nuttx-configs/mavstation/scripts/ld.script b/nuttx-configs/mavstation/scripts/ld.script new file mode 100755 index 000000000..5986eebf0 --- /dev/null +++ b/nuttx-configs/mavstation/scripts/ld.script @@ -0,0 +1,129 @@ +/**************************************************************************** + * configs/stm3210e-eval/nsh/ld.script + * + * Copyright (C) 2009, 2011 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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 NuttX 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. + * + ****************************************************************************/ + +/* The STM32F102CB has 128Kb of FLASH beginning at address 0x0800:0000 and + * 16Kb of SRAM beginning at address 0x2000:0000. When booting from FLASH, + * FLASH memory is aliased to address 0x0000:0000 where the code expects to + * begin execution by jumping to the entry point in the 0x0800:0000 address + * range. + */ + +MEMORY +{ + flash (rx) : ORIGIN = 0x08002000, LENGTH = 120K + sram (rwx) : ORIGIN = 0x20000000, LENGTH = 16K +} + +OUTPUT_ARCH(arm) +ENTRY(__start) /* treat __start as the anchor for dead code stripping */ +EXTERN(_vectors) /* force the vectors to be included in the output */ + +/* + * Ensure that abort() is present in the final object. The exception handling + * code pulled in by libgcc.a requires it (and that code cannot be easily avoided). + */ +EXTERN(abort) + +SECTIONS +{ + .text : { + _stext = ABSOLUTE(.); + *(.vectors) + *(.text .text.*) + *(.fixup) + *(.gnu.warning) + *(.rodata .rodata.*) + *(.gnu.linkonce.t.*) + *(.glue_7) + *(.glue_7t) + *(.got) + *(.gcc_except_table) + *(.gnu.linkonce.r.*) + _etext = ABSOLUTE(.); + } > flash + + /* + * Init functions (static constructors and the like) + */ + .init_section : { + _sinit = ABSOLUTE(.); + KEEP(*(.init_array .init_array.*)) + _einit = ABSOLUTE(.); + } > flash + + .ARM.extab : { + *(.ARM.extab*) + } > flash + + __exidx_start = ABSOLUTE(.); + .ARM.exidx : { + *(.ARM.exidx*) + } > flash + __exidx_end = ABSOLUTE(.); + + _eronly = ABSOLUTE(.); + + /* The STM32F102CB has 16Kb of SRAM beginning at the following address */ + + .data : { + _sdata = ABSOLUTE(.); + *(.data .data.*) + *(.gnu.linkonce.d.*) + CONSTRUCTORS + _edata = ABSOLUTE(.); + } > sram AT > flash + + .bss : { + _sbss = ABSOLUTE(.); + *(.bss .bss.*) + *(.gnu.linkonce.b.*) + *(COMMON) + _ebss = ABSOLUTE(.); + } > sram + + /* Stabs debugging sections. */ + .stab 0 : { *(.stab) } + .stabstr 0 : { *(.stabstr) } + .stab.excl 0 : { *(.stab.excl) } + .stab.exclstr 0 : { *(.stab.exclstr) } + .stab.index 0 : { *(.stab.index) } + .stab.indexstr 0 : { *(.stab.indexstr) } + .comment 0 : { *(.comment) } + .debug_abbrev 0 : { *(.debug_abbrev) } + .debug_info 0 : { *(.debug_info) } + .debug_line 0 : { *(.debug_line) } + .debug_pubnames 0 : { *(.debug_pubnames) } + .debug_aranges 0 : { *(.debug_aranges) } +} diff --git a/nuttx-configs/mavstation/src/Makefile b/nuttx-configs/mavstation/src/Makefile new file mode 100644 index 000000000..0e10b8efe --- /dev/null +++ b/nuttx-configs/mavstation/src/Makefile @@ -0,0 +1,84 @@ +############################################################################ +# configs/mavstation/src/Makefile +# +# Copyright (C) 2009-2010 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt +# +# 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 NuttX 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 $(TOPDIR)/Make.defs + +CFLAGS += -I$(TOPDIR)/sched + +ASRCS = +AOBJS = $(ASRCS:.S=$(OBJEXT)) + +CSRCS = empty.c + +COBJS = $(CSRCS:.c=$(OBJEXT)) + +SRCS = $(ASRCS) $(CSRCS) +OBJS = $(AOBJS) $(COBJS) + +ARCH_SRCDIR = $(TOPDIR)/arch/$(CONFIG_ARCH)/src +ifeq ($(WINTOOL),y) + CFLAGS += -I "${shell cygpath -w $(ARCH_SRCDIR)/chip}" \ + -I "${shell cygpath -w $(ARCH_SRCDIR)/common}" \ + -I "${shell cygpath -w $(ARCH_SRCDIR)/armv7-m}" +else + CFLAGS += -I$(ARCH_SRCDIR)/chip -I$(ARCH_SRCDIR)/common -I$(ARCH_SRCDIR)/armv7-m +endif + +all: libboard$(LIBEXT) + +$(AOBJS): %$(OBJEXT): %.S + $(call ASSEMBLE, $<, $@) + +$(COBJS) $(LINKOBJS): %$(OBJEXT): %.c + $(call COMPILE, $<, $@) + +libboard$(LIBEXT): $(OBJS) + $(call ARCHIVE, $@, $(OBJS)) + +.depend: Makefile $(SRCS) + @$(MKDEP) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep + @touch $@ + +depend: .depend + +clean: + $(call DELFILE, libboard$(LIBEXT)) + $(call CLEAN) + +distclean: clean + $(call DELFILE, Make.dep) + $(call DELFILE, .depend) + +-include Make.dep diff --git a/nuttx-configs/mavstation/src/README.txt b/nuttx-configs/mavstation/src/README.txt new file mode 100644 index 000000000..c6c9eb496 --- /dev/null +++ b/nuttx-configs/mavstation/src/README.txt @@ -0,0 +1 @@ +This directory contains drivers unique to the Mavstation board. diff --git a/nuttx-configs/mavstation/src/empty.c b/nuttx-configs/mavstation/src/empty.c new file mode 100644 index 000000000..5de10699f --- /dev/null +++ b/nuttx-configs/mavstation/src/empty.c @@ -0,0 +1,4 @@ +/* + * There are no source files here, but libboard.a can't be empty, so + * we have this empty source file to keep it company. + */ diff --git a/src/drivers/boards/mavstation/board_config.h b/src/drivers/boards/mavstation/board_config.h new file mode 100644 index 000000000..8aeeac83c --- /dev/null +++ b/src/drivers/boards/mavstation/board_config.h @@ -0,0 +1,86 @@ +/**************************************************************************** + * + * Copyright (c) 2012-2015 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 board_config.h + * + * PX4IO hardware definitions. + */ + +#pragma once + +/************************************************************************************ + * Included Files + ************************************************************************************/ + +#include +#include +#include + +/* these headers are not C++ safe */ +#include +#include + +/************************************************************************************ + * Definitions + ************************************************************************************/ +#define UDID_START 0x1FFFF7E8 +/* PX4IO GPIOs **********************************************************************/ +/* LEDs */ + +#define GPIO_LED1 (GPIO_OUTPUT|GPIO_CNF_OUTPP|GPIO_MODE_50MHz|\ + GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN14) +#define GPIO_LED2 (GPIO_OUTPUT|GPIO_CNF_OUTPP|GPIO_MODE_50MHz|\ + GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN15) +#define GPIO_LED3 (GPIO_OUTPUT|GPIO_CNF_OUTPP|GPIO_MODE_50MHz|\ + GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN10) + +/* USB Pullup *************************************************************/ + +#define GPIO_USB_PULLUP (GPIO_OUTPUT|GPIO_CNF_OUTPP|GPIO_MODE_50MHz|\ + GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN8) +/* PWM Outputs ********************************************************************/ + + +#define GPIO_PWM1 (GPIO_OUTPUT|GPIO_CNF_OUTPP|GPIO_MODE_50MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN0) +#define GPIO_PWM2 (GPIO_OUTPUT|GPIO_CNF_OUTPP|GPIO_MODE_50MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN1) +#define GPIO_PWM3 (GPIO_OUTPUT|GPIO_CNF_OUTPP|GPIO_MODE_50MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN8) +#define GPIO_PWM4 (GPIO_OUTPUT|GPIO_CNF_OUTPP|GPIO_MODE_50MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN9) + +/* Not used or conflicting with HRT Timer 3 *****************************************/ +//#define GPIO_PWM5 (GPIO_OUTPUT|GPIO_CNF_OUTPP|GPIO_MODE_50MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN6) +//#define GPIO_PWM6 (GPIO_OUTPUT|GPIO_CNF_OUTPP|GPIO_MODE_50MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN7) +//#define GPIO_PWM7 (GPIO_OUTPUT|GPIO_CNF_OUTPP|GPIO_MODE_50MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN0) +//#define GPIO_PWM8 (GPIO_OUTPUT|GPIO_CNF_OUTPP|GPIO_MODE_50MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN1) + +extern void stm32_usbinitialize(void); diff --git a/src/drivers/boards/mavstation/mavstation_init.c b/src/drivers/boards/mavstation/mavstation_init.c new file mode 100644 index 000000000..94bb1d04a --- /dev/null +++ b/src/drivers/boards/mavstation/mavstation_init.c @@ -0,0 +1,147 @@ +/**************************************************************************** + * + * Copyright (c) 2012-2015 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 mavstation_init.c + * + * mavstation-specific early startup code. This file implements the + * nsh_archinitialize() function that is called early by nsh during startup. + * + * Code here is run before the rcS script is invoked; it should start required + * subsystems and perform board-specific initialisation. + */ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include +#include + +#include + +#include +#include "board_config.h" + +#include + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/* Configuration ************************************************************/ + +/* Debug ********************************************************************/ + +#ifdef CONFIG_CPP_HAVE_VARARGS +# ifdef CONFIG_DEBUG +# define message(...) lowsyslog(__VA_ARGS__) +# else +# define message(...) printf(__VA_ARGS__) +# endif +#else +# ifdef CONFIG_DEBUG +# define message lowsyslog +# else +# define message printf +# endif +#endif + +/**************************************************************************** + * Protected Functions + ****************************************************************************/ + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/************************************************************************************ + * Name: stm32_boardinitialize + * + * Description: + * All STM32 architectures must provide the following entry point. This entry point + * is called early in the intitialization -- after all memory has been configured + * and mapped but before any devices have been initialized. + * + ************************************************************************************/ + +__EXPORT void stm32_boardinitialize(void) +{ + + /* configure GPIOs */ + + /* turn off - all leds are active low */ + stm32_gpiowrite(GPIO_LED1, true); + stm32_gpiowrite(GPIO_LED2, true); + stm32_gpiowrite(GPIO_LED3, true); + stm32_configgpio(GPIO_LED1); + stm32_configgpio(GPIO_LED2); + stm32_configgpio(GPIO_LED3); + + + stm32_configgpio(GPIO_USB_PULLUP); + stm32_gpiowrite(GPIO_USB_PULLUP, false); + + + stm32_gpiowrite(GPIO_PWM1, false); + stm32_configgpio(GPIO_PWM1); + + stm32_gpiowrite(GPIO_PWM2, false); + stm32_configgpio(GPIO_PWM2); + + stm32_gpiowrite(GPIO_PWM3, false); + stm32_configgpio(GPIO_PWM3); + + stm32_gpiowrite(GPIO_PWM4, false); + stm32_configgpio(GPIO_PWM4); + +#if defined(CONFIG_HAVE_CXX) && defined(CONFIG_HAVE_CXXINITIALIZE) + + /* run C++ ctors before we go any further */ + + up_cxxinitialize(); + +# if defined(CONFIG_EXAMPLES_NSH_CXXINITIALIZE) +# error CONFIG_EXAMPLES_NSH_CXXINITIALIZE Must not be defined! Use CONFIG_HAVE_CXX and CONFIG_HAVE_CXXINITIALIZE. +# endif + +#else +# error platform is dependent on c++ both CONFIG_HAVE_CXX and CONFIG_HAVE_CXXINITIALIZE must be defined. +#endif + stm32_usbinitialize(); + +} diff --git a/src/drivers/boards/mavstation/mavstation_led.c b/src/drivers/boards/mavstation/mavstation_led.c new file mode 100644 index 000000000..16650b824 --- /dev/null +++ b/src/drivers/boards/mavstation/mavstation_led.c @@ -0,0 +1,142 @@ +/**************************************************************************** + * + * Copyright (c) 2013-2015 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 mavstation_led.c + * + * MAVSTATION LED backend. + */ + +#include + +#include + +#include "stm32.h" +#include "board_config.h" + +#include + +/* + * Ideally we'd be able to get these from up_internal.h, + * but since we want to be able to disable the NuttX use + * of leds for system indication at will and there is no + * separate switch, we need to build independent of the + * CONFIG_ARCH_LEDS configuration switch. + */ +__BEGIN_DECLS +extern void led_init(void); +extern void led_on(int led); +extern void led_off(int led); +extern void led_toggle(int led); +__END_DECLS + +__EXPORT void led_init() +{ + /* Configure LED1 GPIO for output */ + + stm32_configgpio(GPIO_LED1); + stm32_configgpio(GPIO_LED2); + stm32_configgpio(GPIO_LED3); +} + +__EXPORT void led_on(int led) +{ + switch (led) { + case 1: + stm32_gpiowrite(GPIO_LED1, true); + break; + + case 2: + stm32_gpiowrite(GPIO_LED2, true); + break; + + case 0: + stm32_gpiowrite(GPIO_LED3, true); + break; + } + +} + +__EXPORT void led_off(int led) +{ + switch (led) { + case 1: + stm32_gpiowrite(GPIO_LED1, false); + break; + + case 2: + stm32_gpiowrite(GPIO_LED2, false); + break; + + case 0: + stm32_gpiowrite(GPIO_LED3, false); + break; + } + +} + +__EXPORT void led_toggle(int led) +{ + switch (led) { + case 1: + if (stm32_gpioread(GPIO_LED1)) { + stm32_gpiowrite(GPIO_LED1, false); + + } else { + stm32_gpiowrite(GPIO_LED1, true); + } + + break; + + case 2: + if (stm32_gpioread(GPIO_LED2)) { + stm32_gpiowrite(GPIO_LED2, false); + + } else { + stm32_gpiowrite(GPIO_LED2, true); + } + + break; + + case 0: + if (stm32_gpioread(GPIO_LED3)) { + stm32_gpiowrite(GPIO_LED3, false); + + } else { + stm32_gpiowrite(GPIO_LED3, true); + } + + break; + } + +} diff --git a/src/drivers/boards/mavstation/mavstation_pwm_servo.c b/src/drivers/boards/mavstation/mavstation_pwm_servo.c new file mode 100644 index 000000000..ffb1eca9d --- /dev/null +++ b/src/drivers/boards/mavstation/mavstation_pwm_servo.c @@ -0,0 +1,93 @@ +/**************************************************************************** + * + * Copyright (c) 2012-2015 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 mavstation_pwm_servo.c + * + * Configuration data for the stm32 pwm_servo driver. + * + * Note that these arrays must always be fully-sized. + */ + +#include + +#include + +#include +#include + +#include +#include +#include + +__EXPORT const struct pwm_servo_timer pwm_timers[PWM_SERVO_MAX_TIMERS] = { + { + .base = STM32_TIM2_BASE, + .clock_register = STM32_RCC_APB1ENR, + .clock_bit = RCC_APB1ENR_TIM2EN, + .clock_freq = STM32_APB1_TIM2_CLKIN + }, + { + .base = STM32_TIM4_BASE, + .clock_register = STM32_RCC_APB1ENR, + .clock_bit = RCC_APB1ENR_TIM4EN, + .clock_freq = STM32_APB1_TIM4_CLKIN + } +}; + +__EXPORT const struct pwm_servo_channel pwm_channels[PWM_SERVO_MAX_CHANNELS] = { + { + .gpio = GPIO_TIM2_CH1OUT, + .timer_index = 0, + .timer_channel = 1, + .default_value = 1000, + }, + { + .gpio = GPIO_TIM2_CH2OUT, + .timer_index = 0, + .timer_channel = 2, + .default_value = 1000, + }, + { + .gpio = GPIO_TIM4_CH3OUT, + .timer_index = 2, + .timer_channel = 3, + .default_value = 1000, + }, + { + .gpio = GPIO_TIM4_CH4OUT, + .timer_index = 2, + .timer_channel = 4, + .default_value = 1000, + }, +}; diff --git a/src/drivers/boards/mavstation/mavstation_usb.c b/src/drivers/boards/mavstation/mavstation_usb.c new file mode 100644 index 000000000..dda47cc5a --- /dev/null +++ b/src/drivers/boards/mavstation/mavstation_usb.c @@ -0,0 +1,116 @@ +/************************************************************************************ + * configs/stm32_tiny/src/up_usbdev.c + * + * Copyright (C) 2009-2011, 2013 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * Laurent Latil + * + * 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 NuttX 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. + * + ************************************************************************************/ + +/************************************************************************************ + * Included Files + ************************************************************************************/ + +#include + +#include +#include +#include +#include + +#include +#include + +#include +#include +#include "board_config.h" + +/************************************************************************************ + * Definitions + ************************************************************************************/ + +/************************************************************************************ + * Private Functions + ************************************************************************************/ + +/************************************************************************************ + * Public Functions + ************************************************************************************/ + +/************************************************************************************ + * Name: stm32_usbinitialize + * + * Description: + * Called to setup USB-related GPIO pins for the Hy-Mini STM32v board. + * + ************************************************************************************/ + +__EXPORT void stm32_usbinitialize(void) +{ + ulldbg("called\n"); + + /* USB Soft Connect Pullup */ + stm32_configgpio(GPIO_USB_PULLUP); +} + +/************************************************************************************ + * Name: stm32_usbpullup + * + * Description: + * If USB is supported and the board supports a pullup via GPIO (for USB software + * connect and disconnect), then the board software must provide stm32_pullup. + * See include/nuttx/usb/usbdev.h for additional description of this method. + * Alternatively, if no pull-up GPIO the following EXTERN can be redefined to be + * NULL. + * + ************************************************************************************/ + +__EXPORT int stm32_usbpullup(FAR struct usbdev_s *dev, bool enable) +{ + usbtrace(TRACE_DEVPULLUP, (uint16_t)enable); + stm32_gpiowrite(GPIO_USB_PULLUP, true); + return OK; +} + +/************************************************************************************ + * Name: stm32_usbsuspend + * + * Description: + * Board logic must provide the stm32_usbsuspend logic if the USBDEV driver is + * used. This function is called whenever the USB enters or leaves suspend mode. + * This is an opportunity for the board logic to shutdown clocks, power, etc. + * while the USB is suspended. + * + ************************************************************************************/ + +__EXPORT void stm32_usbsuspend(FAR struct usbdev_s *dev, bool resume) +{ + ulldbg("resume: %d\n", resume); +} diff --git a/src/drivers/boards/mavstation/module.mk b/src/drivers/boards/mavstation/module.mk new file mode 100644 index 000000000..9333746c0 --- /dev/null +++ b/src/drivers/boards/mavstation/module.mk @@ -0,0 +1,16 @@ +# +# Board-specific startup code for the mavstation +# + +SRCS = mavstation_init.c \ + mavstation_pwm_servo.c \ + mavstation_usb.c \ + mavstation_led.c + +ENABLE_CXXINITIALIZE=$(call check_nuttx_config ,"CONFIG_HAVE_CXX 1", $(NUTTX_CONFIG_H)) +ENABLE_CXXINITIALIZE+=$(call check_nuttx_config ,"CONFIG_HAVE_CXXINITIALIZE 1", $(NUTTX_CONFIG_H)) +ifeq ("$(ENABLE_CXXINITIALIZE)",$(nuttx_config_2true)) +SRCS += ../../../modules/systemlib/up_cxxinitialize.c +endif + +MAXOPTIMIZATION = -Os diff --git a/src/examples/px4_simple_app/px4_simple_app.c b/src/examples/px4_simple_app/px4_simple_app.c index 4e9f099ed..0dd359a17 100644 --- a/src/examples/px4_simple_app/px4_simple_app.c +++ b/src/examples/px4_simple_app/px4_simple_app.c @@ -42,6 +42,7 @@ #include #include #include +#include #include #include @@ -75,7 +76,7 @@ int px4_simple_app_main(int argc, char *argv[]) for (int i = 0; i < 5; i++) { /* wait for sensor update of 1 file descriptor for 1000 ms (1 second) */ int poll_ret = poll(fds, 1, 1000); - + /* handle the poll result */ if (poll_ret == 0) { /* this means none of our providers is giving us data */ diff --git a/src/modules/mavstation_firmware/appdebug.c b/src/modules/mavstation_firmware/appdebug.c new file mode 100644 index 000000000..340ae1470 --- /dev/null +++ b/src/modules/mavstation_firmware/appdebug.c @@ -0,0 +1,67 @@ + +#include +#include +#include +#include + +#include +#include + +#include "appdebug.h" + + +static volatile uint32_t msg_counter; +static volatile uint32_t last_msg_counter; +static volatile uint8_t msg_next_out, msg_next_in; + +/* + * a set of debug buffers to allow us to send debug information from ISRs + */ +#define NUM_MSG 2 +static char msg[NUM_MSG][40]; + +/* + * WARNING: too large buffers here consume the memory required + * for mixer handling. Do not allocate more than 80 bytes for + * output. + */ + +void isr_debug(uint8_t level, const char *fmt, ...) +{ + va_list ap; + va_start(ap, fmt); + vsnprintf(msg[msg_next_in], sizeof(msg[0]), fmt, ap); + va_end(ap); + msg_next_in = (msg_next_in + 1) % NUM_MSG; + msg_counter++; +} + +/* + * show all pending debug messages + */ +void show_debug_messages(void) +{ + if (msg_counter != last_msg_counter) { + uint32_t n = msg_counter - last_msg_counter; + + if (n > NUM_MSG) { n = NUM_MSG; } + + last_msg_counter = msg_counter; + + while (n--) { + debug("%s", msg[msg_next_out]); + msg_next_out = (msg_next_out + 1) % NUM_MSG; + } + } +} + +static uint64_t last_debug_time = 0; + +void isr_debug_tick(void) +{ + /* post debug state at ~1Hz */ + if (hrt_absolute_time() - last_debug_time > (1000 * 1000)) { + /* Put debug info here */ + last_debug_time = hrt_absolute_time(); + } +} diff --git a/src/modules/mavstation_firmware/appdebug.h b/src/modules/mavstation_firmware/appdebug.h new file mode 100644 index 000000000..907ca2814 --- /dev/null +++ b/src/modules/mavstation_firmware/appdebug.h @@ -0,0 +1,14 @@ + +#ifndef __MAVSTATION_FIRMWARE_APPDEBUG_H__ +#define __MAVSTATION_FIRMWARE_APPDEBUG_H__ + +# define debug(fmt, args...) lowsyslog(LOG_DEBUG,fmt "\n", ##args) +/* + * add a debug message to be printed on the console + */ +void isr_debug(uint8_t level, const char *fmt, ...); +void isr_debug_tick(void); +void show_debug_messages(void); + +#endif // __MAVSTATION_FIRMWARE_APPDEBUG_H__ + diff --git a/src/modules/mavstation_firmware/gpio.c b/src/modules/mavstation_firmware/gpio.c new file mode 100644 index 000000000..66b93f111 --- /dev/null +++ b/src/modules/mavstation_firmware/gpio.c @@ -0,0 +1,68 @@ + +#include + +#include +#include +#include + +#include "gpio.h" +#include "hardware.h" + +struct btn { + uint32_t gpio; + bool state; +}; + +static const uint32_t leds[] = { GPIO_LED1, GPIO_LED2, GPIO_LED3 }; +static const int num_leds = sizeof(leds) / sizeof(leds[0]); + +static struct btn buttons[] = { { .gpio = GPIO_BTN0, .state = false } + , { .gpio = GPIO_BTN1, .state = false } + , { .gpio = GPIO_BTN2, .state = false } + , { .gpio = GPIO_BTN3, .state = false } + , { .gpio = GPIO_BTN4, .state = false } +}; +static int num_buttons = sizeof(buttons) / sizeof(buttons[0]); + +void gpio_interface_init(void) +{ + for (int i = 0; i < num_leds; i++) { + stm32_gpiowrite(leds[i], true); + stm32_configgpio(leds[i]); + } + + for (int i = 0; i < num_buttons; i++) { + stm32_configgpio(buttons[i].gpio); + } + + stm32_gpiowrite(GPIO_USART2MUX, false); + stm32_configgpio(GPIO_USART2MUX); +} + +void gpio_interface_tick(void) +{ + for (int i = 0; i < num_buttons; i++) { + buttons[i].state = stm32_gpioread(buttons[i].gpio); + } +} + +void gpio_interface_setusart2mux(bool conn_to_rpi) +{ + stm32_gpiowrite(GPIO_USART2MUX, conn_to_rpi); +} + +void gpio_interface_setled(int led, bool on) +{ + if (led >= 0 && led < num_leds) { + stm32_gpiowrite(leds[led], !on); + } +} + +bool gpio_interface_getbtn(int btn) +{ + if (btn >= 0 && btn < num_buttons) { + return buttons[btn].state; + + } else { return false; } +} + diff --git a/src/modules/mavstation_firmware/gpio.h b/src/modules/mavstation_firmware/gpio.h new file mode 100644 index 000000000..4d7505c94 --- /dev/null +++ b/src/modules/mavstation_firmware/gpio.h @@ -0,0 +1,15 @@ + +#ifndef __MAVSTATION_FIRMWARE_GPIO_H__ +#define __MAVSTATION_FIRMWARE_GPIO_H__ + +#include + +void gpio_interface_init(void); +void gpio_interface_tick(void); +void gpio_interface_setled(int, bool); +bool gpio_interface_getbtn(int); + +void gpio_interface_setusart2mux(bool conn_to_rpi); + +#endif // __MAVSTATION_FIRMWARE_GPIO_H__ + diff --git a/src/modules/mavstation_firmware/hardware.h b/src/modules/mavstation_firmware/hardware.h new file mode 100644 index 000000000..dae97fb8a --- /dev/null +++ b/src/modules/mavstation_firmware/hardware.h @@ -0,0 +1,20 @@ + +#ifndef __MAVSTATION_FIRMWARE_HARDWARE_H__ +#define __MAVSTATION_FIRMWARE_HARDWARE_H__ + + +#define GPIO_USART2MUX (GPIO_OUTPUT|GPIO_CNF_OUTPP|GPIO_MODE_50MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN12) +#define GPIO_USB_PULL (GPIO_OUTPUT|GPIO_CNF_OUTPP|GPIO_MODE_50MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN8) +#define GPIO_LED1 (GPIO_OUTPUT|GPIO_CNF_OUTPP|GPIO_MODE_50MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN13) +#define GPIO_LED2 (GPIO_OUTPUT|GPIO_CNF_OUTPP|GPIO_MODE_50MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN14) +#define GPIO_LED3 (GPIO_OUTPUT|GPIO_CNF_OUTPP|GPIO_MODE_50MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN15) + +#define GPIO_BTN0 (GPIO_INPUT|GPIO_CNF_INPULLUP|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN4) +#define GPIO_BTN1 (GPIO_INPUT|GPIO_CNF_INPULLUP|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN5) +#define GPIO_BTN2 (GPIO_INPUT|GPIO_CNF_INPULLUP|GPIO_MODE_INPUT|GPIO_PORTB|GPIO_PIN2) +#define GPIO_BTN3 (GPIO_INPUT|GPIO_CNF_INPULLUP|GPIO_MODE_INPUT|GPIO_PORTC|GPIO_PIN13) +#define GPIO_BTN4 (GPIO_INPUT|GPIO_CNF_INPULLUP|GPIO_MODE_INPUT|GPIO_PORTC|GPIO_PIN14) + + +#endif // __MAVSTATION_FIRMWARE_HARDWARE_H__ + diff --git a/src/modules/mavstation_firmware/mavstation.c b/src/modules/mavstation_firmware/mavstation.c new file mode 100644 index 000000000..977763b34 --- /dev/null +++ b/src/modules/mavstation_firmware/mavstation.c @@ -0,0 +1,151 @@ +/**************************************************************************** + * + * Copyright (c) 2012-2015 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 mavstation.c + * Top-level logic for the mavstation module. + */ + +#include + +#include // required for task_create +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include + +#include + +#include "sysstate.h" +#include "gpio.h" +#include "appdebug.h" + +__EXPORT int user_start(int argc, char *argv[]); + +struct sys_state_s system_state; + +#ifdef CONFIG_ARCH_DMA +static struct hrt_call serial_dma_call; +#endif +int MuxFlag, MuxState; + +__EXPORT int mavstation_main(int argc, char *argv[]); +int +mavstation_main(int argc, char *argv[]) +{ + /* reset all to zero */ + memset(&system_state, 0, sizeof(system_state)); + + /* configure the high-resolution time/callout interface */ + hrt_init(); + + /* + * Poll at 1ms intervals for received bytes that have not triggered + * a DMA event. + */ +#ifdef CONFIG_ARCH_DMA + hrt_call_every(&serial_dma_call, 1000, 1000, (hrt_callout)stm32_serial_dma_poll, NULL); +#endif + + /* print some startup info */ + debug("\nmavstation: starting\n"); + + /* start gpio interface */ + gpio_interface_init(); + /* pass usart2 to raspberry pi by default */ + gpio_interface_setusart2mux(false); + MuxState = 0; + MuxFlag = 0; + + /* add a performance counter for the interface */ + perf_counter_t interface_perf = perf_alloc(PC_ELAPSED, "interface"); + + /* and one for measuring the loop rate */ + perf_counter_t loop_perf = perf_alloc(PC_INTERVAL, "loop"); + + /* + * Run everything in a tight loop. + */ + + for (;;) { + + /* track the rate at which the loop is running */ + perf_count(loop_perf); + + /* kick the interface */ + perf_begin(interface_perf); + gpio_interface_tick(); + + if (gpio_interface_getbtn(0) & !MuxFlag) { + if (MuxState) { + gpio_interface_setusart2mux(false); + gpio_interface_setled(2, 1); + MuxState = 0; + + } else { + gpio_interface_setusart2mux(true); + gpio_interface_setled(2, 0); + MuxState = 1; + } + + MuxFlag = 1; + + } else if (!gpio_interface_getbtn(0)) { + MuxFlag = 0; + } + +#ifdef DEBUG_GPIOS + + for (int i = 1; i < 5; i++) { + gpio_interface_setled(((i % 2)), gpio_interface_getbtn(i)); + } + +#endif + + perf_end(interface_perf); + + /* check for debug activity */ + show_debug_messages(); + isr_debug_tick(); + + } +} + diff --git a/src/modules/mavstation_firmware/module.mk b/src/modules/mavstation_firmware/module.mk new file mode 100644 index 000000000..e2a94b5db --- /dev/null +++ b/src/modules/mavstation_firmware/module.mk @@ -0,0 +1,11 @@ + +MODULE_COMMAND = mavstation + +SRCS = gpio.c \ + mavstation.c \ + appdebug.c \ + ../systemlib/perf_counter.c + +MODULE_STACKSIZE = 512 + +MAXOPTIMIZATION = -Os diff --git a/src/modules/mavstation_firmware/sysstate.h b/src/modules/mavstation_firmware/sysstate.h new file mode 100644 index 000000000..ddb594549 --- /dev/null +++ b/src/modules/mavstation_firmware/sysstate.h @@ -0,0 +1,21 @@ + +#ifndef __MAVSTATION_FIRMWARE_SYS_STATE_H__ +#define __MAVSTATION_FIRMWARE_SYS_STATE_H__ + +/* + * System state structure. + */ +struct sys_state_s { + + volatile uint64_t rc_channels_timestamp; + + /** + * Last FMU receive time, in microseconds since system boot + */ + volatile uint64_t fmu_data_received_time; + +}; + +extern struct sys_state_s system_state; + +#endif // __MAVSTATION_FIRMWARE_SYS_STATE_H__ -- cgit v1.2.3 From 4115735f160b082c1d39a631540611775f24c9a4 Mon Sep 17 00:00:00 2001 From: Kevin Bretney Date: Thu, 12 Feb 2015 13:38:33 -0800 Subject: changed app load address to match updated bootloader (12k bootloader, 116k app) --- nuttx-configs/mavstation/scripts/ld.script | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nuttx-configs/mavstation/scripts/ld.script b/nuttx-configs/mavstation/scripts/ld.script index 5986eebf0..fe993ee7b 100755 --- a/nuttx-configs/mavstation/scripts/ld.script +++ b/nuttx-configs/mavstation/scripts/ld.script @@ -42,7 +42,7 @@ MEMORY { - flash (rx) : ORIGIN = 0x08002000, LENGTH = 120K + flash (rx) : ORIGIN = 0x08003000, LENGTH = 116K sram (rwx) : ORIGIN = 0x20000000, LENGTH = 16K } -- cgit v1.2.3 From 363c7a33762cbb0a1393c996535f6fa9e5170092 Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Wed, 18 Feb 2015 14:29:34 -1000 Subject: Added patch to build with c++11 --- nuttx-patches/wchar.h.patch | 57 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 nuttx-patches/wchar.h.patch diff --git a/nuttx-patches/wchar.h.patch b/nuttx-patches/wchar.h.patch new file mode 100644 index 000000000..716db992e --- /dev/null +++ b/nuttx-patches/wchar.h.patch @@ -0,0 +1,57 @@ +diff --git NuttX/nuttx/include/wchar.h NuttX/nuttx/include/wchar.h +index 54fa796..889b272 100644 +--- NuttX/nuttx/include/wchar.h ++++ NuttX/nuttx/include/wchar.h +@@ -118,7 +118,19 @@ typedef int wint_t; + * Reference: Opengroup.org + */ + +-struct tm; /* Forward reference (see ) */ ++ struct tm; /* Forward reference (see ) */ ++ ++/* An object type other than an array type that can hold the conversion state ++ * information necessary to convert between sequences of (possibly multi-byte) ++ * characters and wide characters. If a codeset is being ++ * used such that an mbstate_t needs to preserve more than two levels of ++ * reserved state, the results are unspecified. ++ */ ++ ++typedef struct ++{ ++ int __fill[6]; ++} mbstate_t; + + /**************************************************************************** + * Public Data +@@ -142,7 +154,18 @@ extern "C" + * Reference: Opengroup.org + */ + +-#if 0 /* Not yet implemented */ ++ ++#ifndef _WCTYPE_T ++#define _WCTYPE_T ++# ifdef _AEABI_PORTABLE ++typedef void *wctype_t; ++# else ++typedef int wctype_t; ++# endif ++#endif /* !_WCTYPE_T */ ++ ++ /* Not yet implemented */ ++ + wint_t btowc(int); + int fwprintf(FILE *, const wchar_t *, ...); + int fwscanf(FILE *, const wchar_t *, ...); +@@ -218,7 +241,10 @@ wchar_t *wmemmove(wchar_t *, const wchar_t *, size_t); + wchar_t *wmemset(wchar_t *, wchar_t, size_t); + int wprintf(const wchar_t *, ...); + int wscanf(const wchar_t *, ...); +-#endif ++int vfwscanf(FILE *, const wchar_t *, va_list); ++int vswscanf(const wchar_t *, const wchar_t *, va_list); ++int vwscanf(const wchar_t *, va_list); ++float wcstof(const wchar_t *, wchar_t **); + + #undef EXTERN + #ifdef __cplusplus -- cgit v1.2.3 From 6ecdf359325758eebdcddb6d9243797f6fbb2a03 Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Wed, 18 Feb 2015 16:47:35 -1000 Subject: Interim fix for timeval being incorrectly defined in cxx/ctime --- nuttx-patches/ctime.patch | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 nuttx-patches/ctime.patch diff --git a/nuttx-patches/ctime.patch b/nuttx-patches/ctime.patch new file mode 100644 index 000000000..4d8b1fd0f --- /dev/null +++ b/nuttx-patches/ctime.patch @@ -0,0 +1,12 @@ +diff --git NuttX/nuttx/include/cxx/ctime NuttX/nuttx/include/cxx/ctime +index 3d3dfae..18fdded 100644 +--- NuttX/nuttx/include/cxx/ctime ++++ NuttX/nuttx/include/cxx/ctime +@@ -53,7 +53,6 @@ namespace std + using ::clockid_t; + using ::timer_t; + using ::timespec; +- using ::timeval; + using ::tm; + using ::itimerspec; + using ::sigevent; -- cgit v1.2.3 From ac024a8026016de0f8eb749bc7988f1a45573332 Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Thu, 19 Feb 2015 06:47:13 -1000 Subject: Latest Intrim C++11 workaround waitng on feedback --- nuttx-patches/c++11.patch | 142 ++++++++++++++++++++++++++++++++++++++++++++ nuttx-patches/ctime.patch | 12 ---- nuttx-patches/wchar.h.patch | 57 ------------------ 3 files changed, 142 insertions(+), 69 deletions(-) create mode 100644 nuttx-patches/c++11.patch delete mode 100644 nuttx-patches/ctime.patch delete mode 100644 nuttx-patches/wchar.h.patch diff --git a/nuttx-patches/c++11.patch b/nuttx-patches/c++11.patch new file mode 100644 index 000000000..17b3fd52f --- /dev/null +++ b/nuttx-patches/c++11.patch @@ -0,0 +1,142 @@ +diff --git NuttX/nuttx/include/cxx/cwchar NuttX/nuttx/include/cxx/cwchar +index 60c261d..68a1c04 100755 +--- NuttX/nuttx/include/cxx/cwchar ++++ NuttX/nuttx/include/cxx/cwchar +@@ -46,4 +46,97 @@ + // Namespace + //*************************************************************************** + ++namespace std ++{ ++ using ::mbstate_t; ++} // namespace std ++ ++/* These functions are not implemented, but listed here to allow compilation ++* Any resulting linker error will require the implementation of the offending ++* function(s) Code contributions are welcome. ++*/ ++ ++#if __cplusplus >= 201103L ++ ++wint_t btowc(int); ++int fwprintf(FILE *, const wchar_t *, ...); ++int fwscanf(FILE *, const wchar_t *, ...); ++int iswalnum(wint_t); ++int iswalpha(wint_t); ++int iswcntrl(wint_t); ++int iswdigit(wint_t); ++int iswgraph(wint_t); ++int iswlower(wint_t); ++int iswprint(wint_t); ++int iswpunct(wint_t); ++int iswspace(wint_t); ++int iswupper(wint_t); ++int iswxdigit(wint_t); ++int iswctype(wint_t, wctype_t); ++wint_t fgetwc(FILE *); ++wchar_t *fgetws(wchar_t *, int, FILE *); ++wint_t fputwc(wchar_t, FILE *); ++int fputws(const wchar_t *, FILE *); ++int fwide(FILE *, int); ++wint_t getwc(FILE *); ++wint_t getwchar(void); ++int mbsinit(const mbstate_t *); ++size_t mbrlen(const char *, size_t, mbstate_t *); ++size_t mbrtowc(wchar_t *, const char *, size_t, ++ mbstate_t *); ++size_t mbsrtowcs(wchar_t *, const char **, size_t, ++ mbstate_t *); ++wint_t putwc(wchar_t, FILE *); ++wint_t putwchar(wchar_t); ++int swprintf(wchar_t *, size_t, const wchar_t *, ...); ++int swscanf(const wchar_t *, const wchar_t *, ...); ++wint_t towlower(wint_t); ++wint_t towupper(wint_t); ++wint_t ungetwc(wint_t, FILE *); ++int vfwprintf(FILE *, const wchar_t *, va_list); ++int vwprintf(const wchar_t *, va_list); ++int vswprintf(wchar_t *, size_t, const wchar_t *, ++ va_list); ++size_t wcrtomb(char *, wchar_t, mbstate_t *); ++wchar_t *wcscat(wchar_t *, const wchar_t *); ++wchar_t *wcschr(const wchar_t *, wchar_t); ++int wcscmp(const wchar_t *, const wchar_t *); ++int wcscoll(const wchar_t *, const wchar_t *); ++wchar_t *wcscpy(wchar_t *, const wchar_t *); ++size_t wcscspn(const wchar_t *, const wchar_t *); ++size_t wcsftime(wchar_t *, size_t, const wchar_t *, ++ const struct tm *); ++size_t wcslen(const wchar_t *); ++wchar_t *wcsncat(wchar_t *, const wchar_t *, size_t); ++int wcsncmp(const wchar_t *, const wchar_t *, size_t); ++wchar_t *wcsncpy(wchar_t *, const wchar_t *, size_t); ++wchar_t *wcspbrk(const wchar_t *, const wchar_t *); ++wchar_t *wcsrchr(const wchar_t *, wchar_t); ++size_t wcsrtombs(char *, const wchar_t **, size_t, ++ mbstate_t *); ++size_t wcsspn(const wchar_t *, const wchar_t *); ++wchar_t *wcsstr(const wchar_t *, const wchar_t *); ++double wcstod(const wchar_t *, wchar_t **); ++wchar_t *wcstok(wchar_t *, const wchar_t *, wchar_t **); ++long int wcstol(const wchar_t *, wchar_t **, int); ++unsigned long int wcstoul(const wchar_t *, wchar_t **, int); ++wchar_t *wcswcs(const wchar_t *, const wchar_t *); ++int wcswidth(const wchar_t *, size_t); ++size_t wcsxfrm(wchar_t *, const wchar_t *, size_t); ++int wctob(wint_t); ++wctype_t wctype(const char *); ++int wcwidth(wchar_t); ++wchar_t *wmemchr(const wchar_t *, wchar_t, size_t); ++int wmemcmp(const wchar_t *, const wchar_t *, size_t); ++wchar_t *wmemcpy(wchar_t *, const wchar_t *, size_t); ++wchar_t *wmemmove(wchar_t *, const wchar_t *, size_t); ++wchar_t *wmemset(wchar_t *, wchar_t, size_t); ++int wprintf(const wchar_t *, ...); ++int wscanf(const wchar_t *, ...); ++int vfwscanf(FILE *, const wchar_t *, va_list); ++int vswscanf(const wchar_t *, const wchar_t *, va_list); ++int vwscanf(const wchar_t *, va_list); ++float wcstof(const wchar_t *, wchar_t **); ++ ++#endif + #endif // __INCLUDE_CXX_CWCHAR +diff --git NuttX/nuttx/include/wchar.h NuttX/nuttx/include/wchar.h +index 54fa796..263212a 100644 +--- NuttX/nuttx/include/wchar.h ++++ NuttX/nuttx/include/wchar.h +@@ -93,15 +93,31 @@ + * wctype_t + * A scalar type of a data object that can hold values which represent + * locale-specific character classification. +- * +- * mbstate_t ++ */ ++ ++#ifndef _WCTYPE_T ++#define _WCTYPE_T ++# ifdef _AEABI_PORTABLE ++typedef void *wctype_t; ++# else ++typedef int wctype_t; ++# endif ++#endif /* !_WCTYPE_T */ ++ ++ /* mbstate_t + * An object type other than an array type that can hold the conversion + * state information necessary to convert between sequences of (possibly + * multibyte) characters and wide-characters. If a codeset is being used + * such that an mbstate_t needs to preserve more than 2 levels of reserved + * state, the results are unspecified. +- * +- * FILE ++ */ ++ ++typedef struct ++{ ++ int __fill[6]; ++} mbstate_t; ++ ++/* FILE + * As described in . + * + * size_t diff --git a/nuttx-patches/ctime.patch b/nuttx-patches/ctime.patch deleted file mode 100644 index 4d8b1fd0f..000000000 --- a/nuttx-patches/ctime.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git NuttX/nuttx/include/cxx/ctime NuttX/nuttx/include/cxx/ctime -index 3d3dfae..18fdded 100644 ---- NuttX/nuttx/include/cxx/ctime -+++ NuttX/nuttx/include/cxx/ctime -@@ -53,7 +53,6 @@ namespace std - using ::clockid_t; - using ::timer_t; - using ::timespec; -- using ::timeval; - using ::tm; - using ::itimerspec; - using ::sigevent; diff --git a/nuttx-patches/wchar.h.patch b/nuttx-patches/wchar.h.patch deleted file mode 100644 index 716db992e..000000000 --- a/nuttx-patches/wchar.h.patch +++ /dev/null @@ -1,57 +0,0 @@ -diff --git NuttX/nuttx/include/wchar.h NuttX/nuttx/include/wchar.h -index 54fa796..889b272 100644 ---- NuttX/nuttx/include/wchar.h -+++ NuttX/nuttx/include/wchar.h -@@ -118,7 +118,19 @@ typedef int wint_t; - * Reference: Opengroup.org - */ - --struct tm; /* Forward reference (see ) */ -+ struct tm; /* Forward reference (see ) */ -+ -+/* An object type other than an array type that can hold the conversion state -+ * information necessary to convert between sequences of (possibly multi-byte) -+ * characters and wide characters. If a codeset is being -+ * used such that an mbstate_t needs to preserve more than two levels of -+ * reserved state, the results are unspecified. -+ */ -+ -+typedef struct -+{ -+ int __fill[6]; -+} mbstate_t; - - /**************************************************************************** - * Public Data -@@ -142,7 +154,18 @@ extern "C" - * Reference: Opengroup.org - */ - --#if 0 /* Not yet implemented */ -+ -+#ifndef _WCTYPE_T -+#define _WCTYPE_T -+# ifdef _AEABI_PORTABLE -+typedef void *wctype_t; -+# else -+typedef int wctype_t; -+# endif -+#endif /* !_WCTYPE_T */ -+ -+ /* Not yet implemented */ -+ - wint_t btowc(int); - int fwprintf(FILE *, const wchar_t *, ...); - int fwscanf(FILE *, const wchar_t *, ...); -@@ -218,7 +241,10 @@ wchar_t *wmemmove(wchar_t *, const wchar_t *, size_t); - wchar_t *wmemset(wchar_t *, wchar_t, size_t); - int wprintf(const wchar_t *, ...); - int wscanf(const wchar_t *, ...); --#endif -+int vfwscanf(FILE *, const wchar_t *, va_list); -+int vswscanf(const wchar_t *, const wchar_t *, va_list); -+int vwscanf(const wchar_t *, va_list); -+float wcstof(const wchar_t *, wchar_t **); - - #undef EXTERN - #ifdef __cplusplus -- cgit v1.2.3 From 9000cb1967f1928a5b74500521e31551ff12676f Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Wed, 25 Feb 2015 08:00:18 -1000 Subject: Intrim DANGEROUS fix to allow the PX4 development to continue until there is a SAFE solution to foreign (non-nuttx) header file inclusion. There is a potential of a binary incompatibility and runtime errors, memory overwrites or corruption. --- nuttx-patches/c++11.patch | 91 ++++++++++++++++++++++++++++++++--------------- 1 file changed, 62 insertions(+), 29 deletions(-) diff --git a/nuttx-patches/c++11.patch b/nuttx-patches/c++11.patch index 17b3fd52f..70276aa92 100644 --- a/nuttx-patches/c++11.patch +++ b/nuttx-patches/c++11.patch @@ -1,20 +1,39 @@ diff --git NuttX/nuttx/include/cxx/cwchar NuttX/nuttx/include/cxx/cwchar -index 60c261d..68a1c04 100755 +index 67716ab..bd21740 100755 --- NuttX/nuttx/include/cxx/cwchar +++ NuttX/nuttx/include/cxx/cwchar -@@ -46,4 +46,97 @@ +@@ -46,13 +46,115 @@ // Namespace //*************************************************************************** -+namespace std -+{ -+ using ::mbstate_t; -+} // namespace std ++/* N.B. The following definitions are enabled at this time to allow the PX4 ++ * development to continue until there is a SAFE solution to foreign ++ * (non-nuttx) header file inclusion. There is a potential of a binary ++ * incompatibility and runtime errors, memory overwrites or corruption ++ * VVVVVVVVVVVVVVVVVVVVVVVVVV Begin Warning VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV ++ */ + namespace std + { +-#if 0 /* Not defined */ ++#if __cplusplus >= 201103L + using ::mbstate_t; + #endif ++/*^^^^^^^^^^^^^^^^^^^^^^^^^ End Warning ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/ + -+/* These functions are not implemented, but listed here to allow compilation -+* Any resulting linker error will require the implementation of the offending -+* function(s) Code contributions are welcome. -+*/ + using ::wint_t; + using ::size_t; + }; + ++/* N.B. The following definitions are enabled at this time to allow the PX4 ++ * development to continue until there is a SAFE solution to foreign ++ * (non-nuttx) header file inclusion. There is a potential of a binary ++ * incompatibility and runtime errors, memory overwrites or corruption ++ * ++ * These functions are not implemented, but listed here to allow compilation ++ * Any resulting linker error will require the implementation of the offending ++ * function(s) Code contributions are welcome. ++ * VVVVVVVVVVVVVVVVVVVVVVVVVV Begin Warning VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV ++ */ + +#if __cplusplus >= 201103L + @@ -97,21 +116,26 @@ index 60c261d..68a1c04 100755 +int vswscanf(const wchar_t *, const wchar_t *, va_list); +int vwscanf(const wchar_t *, va_list); +float wcstof(const wchar_t *, wchar_t **); -+ +#endif ++/*^^^^^^^^^^^^^^^^^^^^^^^^^ End Warning ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/ #endif // __INCLUDE_CXX_CWCHAR diff --git NuttX/nuttx/include/wchar.h NuttX/nuttx/include/wchar.h -index 54fa796..263212a 100644 +index 90e3d4f..f7dee97 100644 --- NuttX/nuttx/include/wchar.h +++ NuttX/nuttx/include/wchar.h -@@ -93,15 +93,31 @@ - * wctype_t +@@ -96,7 +96,25 @@ typedef int wint_t; + /* wctype_t * A scalar type of a data object that can hold values which represent * locale-specific character classification. - * -- * mbstate_t + */ + ++/* N.B. The following definitions are enabled at this time to allow the PX4 ++ * development to continue until there is a SAFE solution to foreign ++ * (non-nuttx) header file inclusion. There is a potential of a binary ++ * incompatibility and runtime errors, memory overwrites or corruption ++ * VVVVVVVVVVVVVVVVVVVVVVVVVV Begin Warning VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV ++ */ +#ifndef _WCTYPE_T +#define _WCTYPE_T +# ifdef _AEABI_PORTABLE @@ -120,23 +144,32 @@ index 54fa796..263212a 100644 +typedef int wctype_t; +# endif +#endif /* !_WCTYPE_T */ ++/*^^^^^^^^^^^^^^^^^^^^^^^^^ End Warning ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/ + -+ /* mbstate_t ++/* + * mbstate_t * An object type other than an array type that can hold the conversion * state information necessary to convert between sequences of (possibly - * multibyte) characters and wide-characters. If a codeset is being used - * such that an mbstate_t needs to preserve more than 2 levels of reserved +@@ -105,7 +123,13 @@ typedef int wint_t; * state, the results are unspecified. -- * -- * FILE + */ + +-#if 0 /* Not used */ ++/* N.B. The following definitions are enabled at this time to allow the PX4 ++ * development to continue until there is a SAFE solution to foreign ++ * (non-nuttx) header file inclusion. There is a potential of a binary ++ * incompatibility and runtime errors, memory overwrites or corruption ++ * VVVVVVVVVVVVVVVVVVVVVVVVVV Begin Warning VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV + */ -+ -+typedef struct -+{ -+ int __fill[6]; -+} mbstate_t; -+ -+/* FILE ++#if __cplusplus >= 201103L + /* Commented out because this is dangerous. This defines a type that would + * be internal to some wchar implementation. NuttX does not implement the + * wchar functions. Having this definition is a time bomb: If this header +@@ -128,6 +152,7 @@ struct mbstate_s + + typedef struct mbstate_s mbstate_t; + #endif ++/*^^^^^^^^^^^^^^^^^^^^^^^^^ End Warning ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/ + + /* FILE * As described in . - * - * size_t -- cgit v1.2.3 From ad5418ace153240b822ae4ae9d7fc83da1744d95 Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Wed, 25 Feb 2015 11:52:21 -1000 Subject: Updated to new tm32_pwr_enablebkp Interface Interface to tm32_pwr_enablebkp now supports enable/disable --- src/modules/systemlib/systemlib.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/modules/systemlib/systemlib.c b/src/modules/systemlib/systemlib.c index 82183b0d7..a3f7cc852 100644 --- a/src/modules/systemlib/systemlib.c +++ b/src/modules/systemlib/systemlib.c @@ -61,10 +61,11 @@ void systemreset(bool to_bootloader) { if (to_bootloader) { - stm32_pwr_enablebkp(); + stm32_pwr_enablebkp(true); /* XXX wow, this is evil - write a magic number into backup register zero */ *(uint32_t *)0x40002850 = 0xb007b007; + stm32_pwr_enablebkp(false); } up_systemreset(); -- cgit v1.2.3 From 2fd8bc4d49a810eb56cfe59688a1c2dab9decc56 Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Tue, 3 Mar 2015 13:30:24 -1000 Subject: NuttX now uses nuttx/board.h not arch.h for board_ related intrerfaces like leds etc --- src/drivers/boards/aerocore/aerocore_init.c | 1 + src/drivers/boards/mavstation/mavstation_init.c | 1 + src/drivers/boards/px4fmu-v1/px4fmu_init.c | 1 + src/drivers/boards/px4fmu-v2/px4fmu2_init.c | 1 + src/drivers/boards/px4io-v1/px4io_init.c | 1 + src/drivers/boards/px4io-v2/px4iov2_init.c | 1 + 6 files changed, 6 insertions(+) diff --git a/src/drivers/boards/aerocore/aerocore_init.c b/src/drivers/boards/aerocore/aerocore_init.c index 4d257d24b..1a6eead3f 100644 --- a/src/drivers/boards/aerocore/aerocore_init.c +++ b/src/drivers/boards/aerocore/aerocore_init.c @@ -53,6 +53,7 @@ #include #include +#include #include #include #include diff --git a/src/drivers/boards/mavstation/mavstation_init.c b/src/drivers/boards/mavstation/mavstation_init.c index 94bb1d04a..a4ded45a8 100644 --- a/src/drivers/boards/mavstation/mavstation_init.c +++ b/src/drivers/boards/mavstation/mavstation_init.c @@ -53,6 +53,7 @@ #include #include +#include #include #include "board_config.h" diff --git a/src/drivers/boards/px4fmu-v1/px4fmu_init.c b/src/drivers/boards/px4fmu-v1/px4fmu_init.c index 8118e4809..c6207312f 100644 --- a/src/drivers/boards/px4fmu-v1/px4fmu_init.c +++ b/src/drivers/boards/px4fmu-v1/px4fmu_init.c @@ -53,6 +53,7 @@ #include #include +#include #include #include #include diff --git a/src/drivers/boards/px4fmu-v2/px4fmu2_init.c b/src/drivers/boards/px4fmu-v2/px4fmu2_init.c index 2c5ab2025..7c4a450ec 100644 --- a/src/drivers/boards/px4fmu-v2/px4fmu2_init.c +++ b/src/drivers/boards/px4fmu-v2/px4fmu2_init.c @@ -53,6 +53,7 @@ #include #include +#include #include #include #include diff --git a/src/drivers/boards/px4io-v1/px4io_init.c b/src/drivers/boards/px4io-v1/px4io_init.c index 8292da9e1..6daacfec8 100644 --- a/src/drivers/boards/px4io-v1/px4io_init.c +++ b/src/drivers/boards/px4io-v1/px4io_init.c @@ -53,6 +53,7 @@ #include #include +#include #include "stm32.h" #include "board_config.h" diff --git a/src/drivers/boards/px4io-v2/px4iov2_init.c b/src/drivers/boards/px4io-v2/px4iov2_init.c index 5c3343ccc..117791017 100644 --- a/src/drivers/boards/px4io-v2/px4iov2_init.c +++ b/src/drivers/boards/px4io-v2/px4iov2_init.c @@ -53,6 +53,7 @@ #include #include +#include #include #include "board_config.h" -- cgit v1.2.3 From 5549ee2097d1dc2f9377a0569a38a1f0fecef20b Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Tue, 3 Mar 2015 14:59:36 -1000 Subject: Rebased on master but using nuttx_next configs --- nuttx-configs/aerocore/nsh/defconfig | 11 +- nuttx-configs/px4fmu-v1/nsh/defconfig | 566 ++++++++++++++++++++++++++-------- nuttx-configs/px4fmu-v2/nsh/defconfig | 547 ++++++++++++++++++++++++-------- 3 files changed, 874 insertions(+), 250 deletions(-) diff --git a/nuttx-configs/aerocore/nsh/defconfig b/nuttx-configs/aerocore/nsh/defconfig index 408201815..dcb132e01 100644 --- a/nuttx-configs/aerocore/nsh/defconfig +++ b/nuttx-configs/aerocore/nsh/defconfig @@ -2,7 +2,6 @@ # Automatically generated file; DO NOT EDIT. # Nuttx/ Configuration # -CONFIG_NUTTX_NEWCONFIG=y # # Build Setup @@ -93,7 +92,7 @@ CONFIG_ARCH_HAVE_MPU=y # CONFIG_ARMV7M_TOOLCHAIN_BUILDROOT is not set # CONFIG_ARMV7M_TOOLCHAIN_CODEREDL is not set # CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYL is not set -CONFIG_ARMV7M_TOOLCHAIN_GNU_EABI=y +CONFIG_ARMV7M_TOOLCHAIN_GNU_EABIL=y CONFIG_ARMV7M_STACKCHECK=n CONFIG_SERIAL_TERMIOS=y @@ -293,7 +292,7 @@ CONFIG_STM32_USART_SINGLEWIRE=y # CONFIG_STM32_I2C_DYNTIMEO is not set CONFIG_STM32_I2CTIMEOSEC=0 CONFIG_STM32_I2CTIMEOMS=10 -CONFIG_STM32_I2CTIMEOTICKS=500 +CONFIG_STM32_I2CTIMEOTICKS=10 # CONFIG_STM32_I2C_DUTY16_9 is not set # @@ -348,8 +347,8 @@ CONFIG_BOOT_RUNFROMFLASH=y # Board Selection # CONFIG_ARCH_BOARD_AEROCORE=y -CONFIG_ARCH_BOARD_CUSTOM=y -CONFIG_ARCH_BOARD="" +# CONFIG_ARCH_BOARD_CUSTOM is not set +CONFIG_ARCH_BOARD="aerocore" # # Common Board Options @@ -468,6 +467,8 @@ CONFIG_MTD_BYTE_WRITE=y # CONFIG_MTD_M25P is not set # CONFIG_MTD_SMART is not set CONFIG_MTD_RAMTRON=y +CONFIG_RAMTRON_WRITEWAIT=y +CONFIG_RAMTRON_SETSPEED=y CONFIG_RAMTRON_FUJITSU=y # CONFIG_MTD_SST25 is not set # CONFIG_MTD_SST39FV is not set diff --git a/nuttx-configs/px4fmu-v1/nsh/defconfig b/nuttx-configs/px4fmu-v1/nsh/defconfig index b976d364b..5bb7bed15 100644 --- a/nuttx-configs/px4fmu-v1/nsh/defconfig +++ b/nuttx-configs/px4fmu-v1/nsh/defconfig @@ -2,13 +2,14 @@ # Automatically generated file; DO NOT EDIT. # Nuttx/ Configuration # -CONFIG_NUTTX_NEWCONFIG=y + # # Build Setup # # CONFIG_EXPERIMENTAL is not set -# CONFIG_HOST_LINUX is not set -CONFIG_HOST_OSX=y +# CONFIG_DEFAULT_SMALL is not set +CONFIG_HOST_LINUX=y +# CONFIG_HOST_OSX is not set # CONFIG_HOST_WINDOWS is not set # CONFIG_HOST_OTHER is not set @@ -16,6 +17,7 @@ CONFIG_HOST_OSX=y # Build Configuration # CONFIG_APPS_DIR="../apps" +CONFIG_BUILD_FLAT=y # CONFIG_BUILD_2PASS is not set # @@ -25,10 +27,12 @@ CONFIG_APPS_DIR="../apps" # CONFIG_INTELHEX_BINARY is not set # CONFIG_MOTOROLA_SREC is not set CONFIG_RAW_BINARY=y +# CONFIG_UBOOT_UIMAGE is not set # # Customize Header Files # +# CONFIG_ARCH_STDINT_H is not set # CONFIG_ARCH_STDBOOL_H is not set CONFIG_ARCH_MATH_H=y # CONFIG_ARCH_FLOAT_H is not set @@ -38,12 +42,17 @@ CONFIG_ARCH_MATH_H=y # Debug Options # # CONFIG_DEBUG is not set +CONFIG_ARCH_HAVE_STACKCHECK=y +CONFIG_ARCH_HAVE_HEAPCHECK=y CONFIG_DEBUG_SYMBOLS=y +CONFIG_ARCH_HAVE_CUSTOMOPT=y +CONFIG_DEBUG_NOOPT=y +# CONFIG_DEBUG_CUSTOMOPT is not set +# CONFIG_DEBUG_FULLOPT is not set # # System Type # -# CONFIG_ARCH_8051 is not set CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set @@ -59,23 +68,35 @@ CONFIG_ARCH="arm" # # ARM Options # +# CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set # CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set +# CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX is not set # CONFIG_ARCH_CHIP_KINETIS is not set # CONFIG_ARCH_CHIP_KL is not set # CONFIG_ARCH_CHIP_LM is not set +# CONFIG_ARCH_CHIP_TIVA is not set # CONFIG_ARCH_CHIP_LPC17XX is not set # CONFIG_ARCH_CHIP_LPC214X is not set # CONFIG_ARCH_CHIP_LPC2378 is not set # CONFIG_ARCH_CHIP_LPC31XX is not set # CONFIG_ARCH_CHIP_LPC43XX is not set # CONFIG_ARCH_CHIP_NUC1XX is not set +# CONFIG_ARCH_CHIP_SAMA5 is not set +# CONFIG_ARCH_CHIP_SAMD is not set # CONFIG_ARCH_CHIP_SAM34 is not set CONFIG_ARCH_CHIP_STM32=y # CONFIG_ARCH_CHIP_STR71X is not set +# CONFIG_ARCH_ARM7TDMI is not set +# CONFIG_ARCH_ARM926EJS is not set +# CONFIG_ARCH_ARM920T is not set +# CONFIG_ARCH_CORTEXM0 is not set +# CONFIG_ARCH_CORTEXM3 is not set CONFIG_ARCH_CORTEXM4=y +# CONFIG_ARCH_CORTEXA5 is not set +# CONFIG_ARCH_CORTEXA8 is not set CONFIG_ARCH_FAMILY="armv7-m" CONFIG_ARCH_CHIP="stm32" CONFIG_ARMV7M_USEBASEPRI=y @@ -83,16 +104,17 @@ CONFIG_ARCH_HAVE_CMNVECTOR=y CONFIG_ARMV7M_CMNVECTOR=y CONFIG_ARCH_HAVE_FPU=y CONFIG_ARCH_FPU=y -CONFIG_ARCH_HAVE_MPU=y # CONFIG_ARMV7M_MPU is not set # # ARMV7M Configuration Options # # CONFIG_ARMV7M_TOOLCHAIN_BUILDROOT is not set -CONFIG_ARMV7M_TOOLCHAIN_GNU_EABI=y +# CONFIG_ARMV7M_TOOLCHAIN_CODEREDL is not set +# CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYL is not set +CONFIG_ARMV7M_TOOLCHAIN_GNU_EABIL=y CONFIG_ARMV7M_STACKCHECK=n -CONFIG_SERIAL_TERMIOS=y +# CONFIG_ARMV7M_ITMSYSLOG is not set # # STM32 Configuration Options @@ -115,6 +137,7 @@ CONFIG_SERIAL_TERMIOS=y # CONFIG_ARCH_CHIP_STM32L152V6 is not set # CONFIG_ARCH_CHIP_STM32L152V8 is not set # CONFIG_ARCH_CHIP_STM32L152VB is not set +# CONFIG_ARCH_CHIP_STM32L162ZD is not set # CONFIG_ARCH_CHIP_STM32F100C8 is not set # CONFIG_ARCH_CHIP_STM32F100CB is not set # CONFIG_ARCH_CHIP_STM32F100R8 is not set @@ -127,15 +150,27 @@ CONFIG_SERIAL_TERMIOS=y # CONFIG_ARCH_CHIP_STM32F100VC is not set # CONFIG_ARCH_CHIP_STM32F100VD is not set # CONFIG_ARCH_CHIP_STM32F100VE is not set +# CONFIG_ARCH_CHIP_STM32F102CB is not set +# CONFIG_ARCH_CHIP_STM32F103T8 is not set +# CONFIG_ARCH_CHIP_STM32F103TB is not set # CONFIG_ARCH_CHIP_STM32F103C4 is not set # CONFIG_ARCH_CHIP_STM32F103C8 is not set -# CONFIG_ARCH_CHIP_STM32F103RET6 is not set -# CONFIG_ARCH_CHIP_STM32F103VCT6 is not set -# CONFIG_ARCH_CHIP_STM32F103VET6 is not set -# CONFIG_ARCH_CHIP_STM32F103ZET6 is not set -# CONFIG_ARCH_CHIP_STM32F105VBT7 is not set +# CONFIG_ARCH_CHIP_STM32F103CB is not set +# CONFIG_ARCH_CHIP_STM32F103R8 is not set +# CONFIG_ARCH_CHIP_STM32F103RB is not set +# CONFIG_ARCH_CHIP_STM32F103RC is not set +# CONFIG_ARCH_CHIP_STM32F103RD is not set +# CONFIG_ARCH_CHIP_STM32F103RE is not set +# CONFIG_ARCH_CHIP_STM32F103RG is not set +# CONFIG_ARCH_CHIP_STM32F103V8 is not set +# CONFIG_ARCH_CHIP_STM32F103VB is not set +# CONFIG_ARCH_CHIP_STM32F103VC is not set +# CONFIG_ARCH_CHIP_STM32F103VE is not set +# CONFIG_ARCH_CHIP_STM32F103ZE is not set +# CONFIG_ARCH_CHIP_STM32F105VB is not set # CONFIG_ARCH_CHIP_STM32F107VC is not set # CONFIG_ARCH_CHIP_STM32F207IG is not set +# CONFIG_ARCH_CHIP_STM32F207ZE is not set # CONFIG_ARCH_CHIP_STM32F302CB is not set # CONFIG_ARCH_CHIP_STM32F302CC is not set # CONFIG_ARCH_CHIP_STM32F302RB is not set @@ -148,6 +183,8 @@ CONFIG_SERIAL_TERMIOS=y # CONFIG_ARCH_CHIP_STM32F303RC is not set # CONFIG_ARCH_CHIP_STM32F303VB is not set # CONFIG_ARCH_CHIP_STM32F303VC is not set +# CONFIG_ARCH_CHIP_STM32F401RE is not set +# CONFIG_ARCH_CHIP_STM32F411RE is not set CONFIG_ARCH_CHIP_STM32F405RG=y # CONFIG_ARCH_CHIP_STM32F405VG is not set # CONFIG_ARCH_CHIP_STM32F405ZG is not set @@ -160,23 +197,71 @@ CONFIG_ARCH_CHIP_STM32F405RG=y # CONFIG_ARCH_CHIP_STM32F427V is not set # CONFIG_ARCH_CHIP_STM32F427Z is not set # CONFIG_ARCH_CHIP_STM32F427I is not set +# CONFIG_ARCH_CHIP_STM32F429V is not set +# CONFIG_ARCH_CHIP_STM32F429Z is not set +# CONFIG_ARCH_CHIP_STM32F429I is not set +# CONFIG_ARCH_CHIP_STM32F429B is not set +# CONFIG_ARCH_CHIP_STM32F429N is not set # CONFIG_STM32_STM32L15XX is not set # CONFIG_STM32_ENERGYLITE is not set # CONFIG_STM32_STM32F10XX is not set # CONFIG_STM32_VALUELINE is not set # CONFIG_STM32_CONNECTIVITYLINE is not set # CONFIG_STM32_PERFORMANCELINE is not set +# CONFIG_STM32_USBACCESSLINE is not set # CONFIG_STM32_HIGHDENSITY is not set # CONFIG_STM32_MEDIUMDENSITY is not set # CONFIG_STM32_LOWDENSITY is not set # CONFIG_STM32_STM32F20XX is not set +# CONFIG_STM32_STM32F207 is not set # CONFIG_STM32_STM32F30XX is not set CONFIG_STM32_STM32F40XX=y +# CONFIG_STM32_STM32F401 is not set +# CONFIG_STM32_STM32F411 is not set +CONFIG_STM32_STM32F405=y +# CONFIG_STM32_STM32F407 is not set +# CONFIG_STM32_STM32F427 is not set +# CONFIG_STM32_STM32F429 is not set # CONFIG_STM32_DFU is not set # # STM32 Peripheral Support # +CONFIG_STM32_HAVE_CCM=y +# CONFIG_STM32_HAVE_USBDEV is not set +CONFIG_STM32_HAVE_OTGFS=y +CONFIG_STM32_HAVE_FSMC=y +CONFIG_STM32_HAVE_USART3=y +CONFIG_STM32_HAVE_UART4=y +CONFIG_STM32_HAVE_UART5=y +CONFIG_STM32_HAVE_USART6=y +# CONFIG_STM32_HAVE_UART7 is not set +# CONFIG_STM32_HAVE_UART8 is not set +CONFIG_STM32_HAVE_TIM1=y +CONFIG_STM32_HAVE_TIM5=y +CONFIG_STM32_HAVE_TIM6=y +CONFIG_STM32_HAVE_TIM7=y +CONFIG_STM32_HAVE_TIM8=y +CONFIG_STM32_HAVE_TIM9=y +CONFIG_STM32_HAVE_TIM10=y +CONFIG_STM32_HAVE_TIM11=y +CONFIG_STM32_HAVE_TIM12=y +CONFIG_STM32_HAVE_TIM13=y +CONFIG_STM32_HAVE_TIM14=y +# CONFIG_STM32_HAVE_TIM15 is not set +# CONFIG_STM32_HAVE_TIM16 is not set +# CONFIG_STM32_HAVE_TIM17 is not set +CONFIG_STM32_HAVE_ADC2=y +CONFIG_STM32_HAVE_ADC3=y +# CONFIG_STM32_HAVE_ADC4 is not set +CONFIG_STM32_HAVE_CAN1=y +CONFIG_STM32_HAVE_CAN2=y +CONFIG_STM32_HAVE_RNG=y +# CONFIG_STM32_HAVE_ETHMAC is not set +CONFIG_STM32_HAVE_SPI2=y +CONFIG_STM32_HAVE_SPI3=y +# CONFIG_STM32_HAVE_SPI4 is not set +# CONFIG_STM32_HAVE_SPI5 is not set CONFIG_STM32_ADC1=y # CONFIG_STM32_ADC2 is not set # CONFIG_STM32_ADC3 is not set @@ -191,7 +276,6 @@ CONFIG_STM32_DMA2=y # CONFIG_STM32_DAC1 is not set # CONFIG_STM32_DAC2 is not set # CONFIG_STM32_DCMI is not set -# CONFIG_STM32_ETHMAC is not set # CONFIG_STM32_FSMC is not set # CONFIG_STM32_HASH is not set CONFIG_STM32_I2C1=y @@ -264,14 +348,10 @@ CONFIG_STM32_USART=y # CONFIG_USART1_RXDMA is not set # CONFIG_USART2_RS485 is not set CONFIG_USART2_RXDMA=y -# CONFIG_USART3_RXDMA is not set -# CONFIG_UART4_RXDMA is not set # CONFIG_UART5_RS485 is not set CONFIG_UART5_RXDMA=y # CONFIG_USART6_RS485 is not set CONFIG_USART6_RXDMA=y -# CONFIG_USART7_RXDMA is not set -# CONFIG_USART8_RXDMA is not set CONFIG_SERIAL_DISABLE_REORDERING=y CONFIG_STM32_FLOWCONTROL_BROKEN=y CONFIG_STM32_USART_SINGLEWIRE=y @@ -285,6 +365,7 @@ CONFIG_STM32_USART_SINGLEWIRE=y # # I2C Configuration # +# CONFIG_STM32_I2C_ALT is not set # CONFIG_STM32_I2C_DYNTIMEO is not set CONFIG_STM32_I2CTIMEOSEC=0 CONFIG_STM32_I2CTIMEOMS=10 @@ -292,15 +373,19 @@ CONFIG_STM32_I2CTIMEOTICKS=10 # CONFIG_STM32_I2C_DUTY16_9 is not set # -# USB Host Configuration +# USB FS Host Configuration # # -# USB Device Configuration +# USB HS Host Configuration # # -# External Memory Configuration +# USB Host Debug Configuration +# + +# +# USB Device Configuration # # @@ -309,13 +394,22 @@ CONFIG_STM32_I2CTIMEOTICKS=10 # CONFIG_ARCH_NOINTC is not set # CONFIG_ARCH_VECNOTIRQ is not set CONFIG_ARCH_DMA=y -# CONFIG_ARCH_IRQPRIO is not set -# CONFIG_CUSTOM_STACK is not set -# CONFIG_ADDRENV is not set +CONFIG_ARCH_HAVE_IRQPRIO=y +# CONFIG_ARCH_L2CACHE is not set +# CONFIG_ARCH_HAVE_COHERENT_DCACHE is not set +# CONFIG_ARCH_HAVE_ADDRENV is not set +# CONFIG_ARCH_NEED_ADDRENV_MAPPING is not set CONFIG_ARCH_HAVE_VFORK=y +# CONFIG_ARCH_HAVE_MMU is not set +CONFIG_ARCH_HAVE_MPU=y +# CONFIG_ARCH_NAND_HWECC is not set +# CONFIG_ARCH_HAVE_EXTCLK is not set +# CONFIG_ARCH_USE_MPU is not set +# CONFIG_ARCH_IRQPRIO is not set CONFIG_ARCH_STACKDUMP=y CONFIG_STACK_COLORATION=y # CONFIG_ENDIAN_BIG is not set +# CONFIG_ARCH_IDLE_CUSTOM is not set # CONFIG_ARCH_HAVE_RAMFUNCS is not set CONFIG_ARCH_HAVE_RAMVECTORS=y # CONFIG_ARCH_RAMVECTORS is not set @@ -325,10 +419,14 @@ CONFIG_ARCH_HAVE_RAMVECTORS=y # CONFIG_BOARD_LOOPSPERMSEC=16717 # CONFIG_ARCH_CALIBRATION is not set -CONFIG_DRAM_START=0x20000000 -CONFIG_DRAM_SIZE=196608 + +# +# Interrupt options +# CONFIG_ARCH_HAVE_INTERRUPTSTACK=y -CONFIG_ARCH_INTERRUPTSTACK=4096 +CONFIG_ARCH_INTERRUPTSTACK=2048 +CONFIG_ARCH_HAVE_HIPRI_INTERRUPT=y +# CONFIG_ARCH_HIPRI_INTERRUPT is not set # # Boot options @@ -339,12 +437,26 @@ CONFIG_BOOT_RUNFROMFLASH=y # CONFIG_BOOT_RUNFROMSDRAM is not set # CONFIG_BOOT_COPYTORAM is not set +# +# Boot Memory Configuration +# +CONFIG_RAM_START=0x20000000 +CONFIG_RAM_SIZE=196608 +# CONFIG_ARCH_HAVE_SDRAM is not set + # # Board Selection # CONFIG_ARCH_BOARD_PX4FMU_V1=y -CONFIG_ARCH_BOARD_CUSTOM=y -CONFIG_ARCH_BOARD="" +# CONFIG_ARCH_BOARD_CUSTOM is not set +CONFIG_ARCH_BOARD="px4fmu-v1" + +# +# Custom Board Configuration +# +CONFIG_ARCH_BOARD_CUSTOM_DIR="" +# CONFIG_BOARD_CUSTOM_LEDS is not set +# CONFIG_BOARD_CUSTOM_BUTTONS is not set # # Common Board Options @@ -360,37 +472,75 @@ CONFIG_NSH_MMCSDSPIPORTNO=3 # # RTOS Features # -# CONFIG_BOARD_INITIALIZE is not set -CONFIG_MSEC_PER_TICK=1 -CONFIG_RR_INTERVAL=0 -CONFIG_SCHED_INSTRUMENTATION=y -CONFIG_TASK_NAME_SIZE=24 -# CONFIG_SCHED_HAVE_PARENT is not set +CONFIG_DISABLE_OS_API=y +# CONFIG_DISABLE_POSIX_TIMERS is not set +# CONFIG_DISABLE_PTHREAD is not set +# CONFIG_DISABLE_SIGNALS is not set +# CONFIG_DISABLE_MQUEUE is not set +# CONFIG_DISABLE_ENVIRON is not set + +# +# Clocks and Timers +# +CONFIG_USEC_PER_TICK=1000 +# CONFIG_SYSTEM_TIME64 is not set +# CONFIG_CLOCK_MONOTONIC is not set # CONFIG_JULIAN_TIME is not set CONFIG_START_YEAR=1970 CONFIG_START_MONTH=1 CONFIG_START_DAY=1 -CONFIG_DEV_CONSOLE=y +CONFIG_MAX_WDOGPARMS=2 +CONFIG_PREALLOC_WDOGS=50 +CONFIG_WDOG_INTRESERVE=4 +CONFIG_PREALLOC_TIMERS=50 + +# +# Tasks and Scheduling +# +# CONFIG_INIT_NONE is not set +CONFIG_INIT_ENTRYPOINT=y +# CONFIG_INIT_FILEPATH is not set +CONFIG_USER_ENTRYPOINT="nsh_main" +CONFIG_RR_INTERVAL=0 +CONFIG_TASK_NAME_SIZE=24 +CONFIG_MAX_TASKS=32 +# CONFIG_SCHED_HAVE_PARENT is not set +CONFIG_SCHED_WAITPID=y + +# +# Pthread Options +# # CONFIG_MUTEX_TYPES is not set -CONFIG_PRIORITY_INHERITANCE=y -CONFIG_SEM_PREALLOCHOLDERS=0 -CONFIG_SEM_NNESTPRIO=8 +CONFIG_NPTHREAD_KEYS=4 + +# +# Performance Monitoring +# +# CONFIG_SCHED_CPULOAD is not set +CONFIG_SCHED_INSTRUMENTATION=y + +# +# Files and I/O +# +CONFIG_DEV_CONSOLE=y # CONFIG_FDCLONE_DISABLE is not set CONFIG_FDCLONE_STDIO=y CONFIG_SDCLONE_DISABLE=y -CONFIG_SCHED_WAITPID=y +CONFIG_NFILE_DESCRIPTORS=42 +CONFIG_NFILE_STREAMS=8 +CONFIG_NAME_MAX=32 +CONFIG_PRIORITY_INHERITANCE=y +CONFIG_SEM_PREALLOCHOLDERS=0 +CONFIG_SEM_NNESTPRIO=8 + +# +# RTOS hooks +# +# CONFIG_BOARD_INITIALIZE is not set # CONFIG_SCHED_STARTHOOK is not set CONFIG_SCHED_ATEXIT=y CONFIG_SCHED_ATEXIT_MAX=1 # CONFIG_SCHED_ONEXIT is not set -CONFIG_USER_ENTRYPOINT="nsh_main" -CONFIG_DISABLE_OS_API=y -# CONFIG_DISABLE_CLOCK is not set -# CONFIG_DISABLE_POSIX_TIMERS is not set -# CONFIG_DISABLE_PTHREAD is not set -# CONFIG_DISABLE_SIGNALS is not set -# CONFIG_DISABLE_MQUEUE is not set -# CONFIG_DISABLE_ENVIRON is not set # # Signal Numbers @@ -402,19 +552,25 @@ CONFIG_SIG_SIGCONDTIMEDOUT=16 CONFIG_SIG_SIGWORK=4 # -# Sizes of configurable things (0 disables) +# POSIX Message Queue Options # -CONFIG_MAX_TASKS=32 -CONFIG_MAX_TASK_ARGS=10 -CONFIG_NPTHREAD_KEYS=4 -CONFIG_NFILE_DESCRIPTORS=42 -CONFIG_NFILE_STREAMS=8 -CONFIG_NAME_MAX=32 CONFIG_PREALLOC_MQ_MSGS=4 CONFIG_MQ_MAXMSGSIZE=32 -CONFIG_MAX_WDOGPARMS=2 -CONFIG_PREALLOC_WDOGS=50 -CONFIG_PREALLOC_TIMERS=50 + +# +# Work Queue Support +# +CONFIG_SCHED_WORKQUEUE=y +CONFIG_SCHED_HPWORK=y +CONFIG_SCHED_HPWORKPRIORITY=192 +CONFIG_SCHED_HPWORKPERIOD=5000 +CONFIG_SCHED_HPWORKSTACKSIZE=1800 +CONFIG_SCHED_LPWORK=y +CONFIG_SCHED_LPNTHREADS=1 +CONFIG_SCHED_LPWORKPRIORITY=50 +CONFIG_SCHED_LPWORKPRIOMAX=176 +CONFIG_SCHED_LPWORKPERIOD=50000 +CONFIG_SCHED_LPWORKSTACKSIZE=1800 # # Stack and heap information @@ -423,6 +579,7 @@ CONFIG_IDLETHREAD_STACKSIZE=3500 CONFIG_USERMAIN_STACKSIZE=2600 CONFIG_PTHREAD_STACK_MIN=512 CONFIG_PTHREAD_STACK_DEFAULT=2048 +# CONFIG_LIB_SYSCALL is not set # # Device Drivers @@ -431,25 +588,37 @@ CONFIG_PTHREAD_STACK_DEFAULT=2048 CONFIG_DEV_NULL=y # CONFIG_DEV_ZERO is not set # CONFIG_LOOP is not set + +# +# Buffering +# +# CONFIG_DRVR_WRITEBUFFER is not set +# CONFIG_DRVR_READAHEAD is not set # CONFIG_RAMDISK is not set # CONFIG_CAN is not set +# CONFIG_ARCH_HAVE_PWM_PULSECOUNT is not set # CONFIG_PWM is not set +CONFIG_ARCH_HAVE_I2CRESET=y CONFIG_I2C=y # CONFIG_I2C_SLAVE is not set CONFIG_I2C_TRANSFER=y # CONFIG_I2C_WRITEREAD is not set # CONFIG_I2C_POLLED is not set # CONFIG_I2C_TRACE is not set -CONFIG_ARCH_HAVE_I2CRESET=y CONFIG_I2C_RESET=y CONFIG_SPI=y # CONFIG_SPI_OWNBUS is not set CONFIG_SPI_EXCHANGE=y # CONFIG_SPI_CMDDATA is not set +# CONFIG_SPI_BITBANG is not set +# CONFIG_I2S is not set # CONFIG_RTC is not set CONFIG_WATCHDOG=y +CONFIG_WATCHDOG_DEVPATH="/dev/watchdog0" +# CONFIG_TIMER is not set # CONFIG_ANALOG is not set # CONFIG_AUDIO_DEVICES is not set +# CONFIG_VIDEO_DEVICES is not set # CONFIG_BCH is not set # CONFIG_INPUT is not set # CONFIG_LCD is not set @@ -461,50 +630,90 @@ CONFIG_MMCSD_NSLOTS=1 # CONFIG_MMCSD_HAVECARDDETECT is not set CONFIG_MMCSD_SPI=y CONFIG_MMCSD_SPICLOCK=24000000 -# CONFIG_MMCSD_SDIO is not set +CONFIG_MMCSD_SPIMODE=0 +# CONFIG_ARCH_HAVE_SDIO is not set CONFIG_MTD=y + +# +# MTD Configuration +# +CONFIG_MTD_PARTITION=y +# CONFIG_MTD_SECT512 is not set +CONFIG_MTD_BYTE_WRITE=y +# CONFIG_MTD_CONFIG is not set + +# +# MTD Device Drivers +# +# CONFIG_MTD_NAND is not set +# CONFIG_RAMMTD is not set +# CONFIG_MTD_AT24XX is not set +# CONFIG_MTD_AT25 is not set +# CONFIG_MTD_AT45DB is not set +# CONFIG_MTD_M25P is not set +# CONFIG_MTD_SMART is not set +# CONFIG_MTD_RAMTRON is not set +# CONFIG_MTD_SST25 is not set +# CONFIG_MTD_SST25XX is not set +# CONFIG_MTD_SST39FV is not set +# CONFIG_MTD_W25 is not set +CONFIG_EEPROM=y +# CONFIG_SPI_EE_25XX is not set CONFIG_PIPES=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set +# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set CONFIG_SERIAL_REMOVABLE=y # CONFIG_16550_UART is not set +# CONFIG_ARCH_HAVE_UART is not set +# CONFIG_ARCH_HAVE_UART0 is not set +# CONFIG_ARCH_HAVE_UART1 is not set +# CONFIG_ARCH_HAVE_UART2 is not set +# CONFIG_ARCH_HAVE_UART3 is not set +# CONFIG_ARCH_HAVE_UART4 is not set CONFIG_ARCH_HAVE_UART5=y +# CONFIG_ARCH_HAVE_UART6 is not set +# CONFIG_ARCH_HAVE_UART7 is not set +# CONFIG_ARCH_HAVE_UART8 is not set +# CONFIG_ARCH_HAVE_SCI0 is not set +# CONFIG_ARCH_HAVE_SCI1 is not set +# CONFIG_ARCH_HAVE_USART0 is not set CONFIG_ARCH_HAVE_USART1=y CONFIG_ARCH_HAVE_USART2=y +# CONFIG_ARCH_HAVE_USART3 is not set +# CONFIG_ARCH_HAVE_USART4 is not set +# CONFIG_ARCH_HAVE_USART5 is not set CONFIG_ARCH_HAVE_USART6=y +# CONFIG_ARCH_HAVE_USART7 is not set +# CONFIG_ARCH_HAVE_USART8 is not set +# CONFIG_ARCH_HAVE_OTHER_UART is not set + +# +# USART Configuration +# +CONFIG_USART1_ISUART=y +CONFIG_USART2_ISUART=y +CONFIG_USART6_ISUART=y CONFIG_MCU_SERIAL=y CONFIG_STANDARD_SERIAL=y CONFIG_SERIAL_NPOLLWAITERS=2 +CONFIG_SERIAL_IFLOWCONTROL=y +CONFIG_SERIAL_OFLOWCONTROL=y +CONFIG_SERIAL_IFLOWCONTROL_WATERMARKS=y +CONFIG_SERIAL_IFLOWCONTROL_LOWER_WATERMARK=10 +CONFIG_SERIAL_IFLOWCONTROL_UPPER_WATERMARK=90 +CONFIG_ARCH_HAVE_SERIAL_TERMIOS=y +CONFIG_SERIAL_TERMIOS=y CONFIG_USART1_SERIAL_CONSOLE=y # CONFIG_USART2_SERIAL_CONSOLE is not set # CONFIG_UART5_SERIAL_CONSOLE is not set # CONFIG_USART6_SERIAL_CONSOLE is not set +# CONFIG_OTHER_SERIAL_CONSOLE is not set # CONFIG_NO_SERIAL_CONSOLE is not set -# -# MTD Configuration -# -CONFIG_MTD_PARTITION=y -CONFIG_MTD_BYTE_WRITE=y - -# -# MTD Device Drivers -# -# CONFIG_RAMMTD is not set -# CONFIG_MTD_AT24XX is not set -# CONFIG_MTD_AT45DB is not set -# CONFIG_MTD_M25P is not set -# CONFIG_MTD_SMART is not set -# CONFIG_MTD_RAMTRON is not set -CONFIG_RAMTRON_WRITEWAIT=y -CONFIG_RAMTRON_SETSPEED=y -# CONFIG_MTD_SST25 is not set -# CONFIG_MTD_SST39FV is not set -# CONFIG_MTD_W25 is not set - # # USART1 Configuration # @@ -552,11 +761,6 @@ CONFIG_USART6_PARITY=0 CONFIG_USART6_2STOP=0 # CONFIG_USART6_IFLOWCONTROL is not set # CONFIG_USART6_OFLOWCONTROL is not set -CONFIG_SERIAL_IFLOWCONTROL=y -CONFIG_SERIAL_OFLOWCONTROL=y -CONFIG_SERIAL_IFLOWCONTROL_WATERMARKS=y -CONFIG_SERIAL_IFLOWCONTROL_LOWER_WATERMARK=10 -CONFIG_SERIAL_IFLOWCONTROL_UPPER_WATERMARK=90 CONFIG_USBDEV=y # @@ -567,8 +771,8 @@ CONFIG_USBDEV=y # CONFIG_USBDEV_SELFPOWERED is not set CONFIG_USBDEV_BUSPOWERED=y CONFIG_USBDEV_MAXPOWER=500 -# CONFIG_USBDEV_REMOTEWAKEUP is not set # CONFIG_USBDEV_DMA is not set +# CONFIG_ARCH_USBDEV_STALLQUEUE is not set # CONFIG_USBDEV_TRACE is not set # @@ -577,7 +781,7 @@ CONFIG_USBDEV_MAXPOWER=500 # CONFIG_USBDEV_COMPOSITE is not set # CONFIG_PL2303 is not set CONFIG_CDCACM=y -CONFIG_CDCACM_CONSOLE=n +# CONFIG_CDCACM_CONSOLE is not set CONFIG_CDCACM_EP0MAXPACKET=64 CONFIG_CDCACM_EPINTIN=1 CONFIG_CDCACM_EPINTIN_FSSIZE=64 @@ -613,8 +817,15 @@ CONFIG_CDCACM_PRODUCTSTR="PX4 FMU v1.x" # # Networking Support # +# CONFIG_ARCH_HAVE_NET is not set +# CONFIG_ARCH_HAVE_PHY is not set # CONFIG_NET is not set +# +# Crypto API +# +# CONFIG_CRYPTO is not set + # # File Systems # @@ -623,6 +834,13 @@ CONFIG_CDCACM_PRODUCTSTR="PX4 FMU v1.x" # File system configuration # # CONFIG_DISABLE_MOUNTPOINT is not set +# CONFIG_FS_AUTOMOUNTER is not set +# CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set +CONFIG_FS_READABLE=y +CONFIG_FS_WRITABLE=y +# CONFIG_FS_AIO is not set +# CONFIG_FS_NAMED_SEMAPHORES is not set +CONFIG_FS_MQUEUE_MPATH="/var/mqueue" # CONFIG_FS_RAMMAP is not set CONFIG_FS_FAT=y CONFIG_FAT_LCNAMES=y @@ -631,6 +849,7 @@ CONFIG_FAT_MAXFNAME=32 CONFIG_FS_FATTIME=y # CONFIG_FAT_DMAMEMORY is not set CONFIG_FS_NXFFS=y +# CONFIG_NXFFS_SCAN_VOLUME is not set CONFIG_NXFFS_PREALLOCATED=y CONFIG_NXFFS_ERASEDSTATE=0xff CONFIG_NXFFS_PACKTHRESHOLD=32 @@ -639,12 +858,13 @@ CONFIG_NXFFS_TAILTHRESHOLD=2048 CONFIG_FS_ROMFS=y # CONFIG_FS_SMARTFS is not set CONFIG_FS_BINFS=y +# CONFIG_FS_PROCFS is not set # # System Logging # -# CONFIG_SYSLOG_ENABLE is not set CONFIG_SYSLOG=y +# CONFIG_SYSLOG_TIMESTAMP is not set CONFIG_SYSLOG_CHAR=y CONFIG_SYSLOG_DEVPATH="/dev/ttyS0" @@ -656,9 +876,9 @@ CONFIG_SYSLOG_DEVPATH="/dev/ttyS0" # # Memory Management # -# CONFIG_MM_MULTIHEAP is not set # CONFIG_MM_SMALL is not set CONFIG_MM_REGIONS=2 +# CONFIG_ARCH_HAVE_HEAP2 is not set CONFIG_GRAN=y CONFIG_GRAN_SINGLE=y CONFIG_GRAN_INTR=y @@ -669,7 +889,7 @@ CONFIG_GRAN_INTR=y # CONFIG_AUDIO is not set # -# Binary Formats +# Binary Loader # # CONFIG_BINFMT_DISABLE is not set # CONFIG_BINFMT_EXEPATH is not set @@ -692,6 +912,7 @@ CONFIG_NUNGET_CHARS=2 CONFIG_LIB_HOMEDIR="/" # CONFIG_NOPRINTF_FIELDWIDTH is not set CONFIG_LIBC_FLOATINGPOINT=y +# CONFIG_LIBC_IOCTL_VARIADIC is not set CONFIG_LIB_RAND_ORDER=1 # CONFIG_EOL_IS_CR is not set # CONFIG_EOL_IS_LF is not set @@ -703,7 +924,10 @@ CONFIG_TASK_SPAWN_DEFAULT_STACKSIZE=2048 CONFIG_LIBC_STRERROR=y # CONFIG_LIBC_STRERROR_SHORT is not set # CONFIG_LIBC_PERROR_STDOUT is not set +CONFIG_LIBC_TMPDIR="/tmp" +CONFIG_LIBC_MAX_TMPFILE=32 CONFIG_ARCH_LOWPUTC=y +# CONFIG_LIBC_LOCALTIME is not set CONFIG_LIB_SENDFILE_BUFSIZE=512 # CONFIG_ARCH_ROMGETC is not set CONFIG_ARCH_OPTIMIZED_FUNCTIONS=y @@ -723,15 +947,6 @@ CONFIG_ARCH_MEMCPY=y # # Non-standard Library Support # -CONFIG_SCHED_WORKQUEUE=y -CONFIG_SCHED_HPWORK=y -CONFIG_SCHED_WORKPRIORITY=192 -CONFIG_SCHED_WORKPERIOD=5000 -CONFIG_SCHED_WORKSTACKSIZE=1800 -CONFIG_SCHED_LPWORK=y -CONFIG_SCHED_LPWORKPRIORITY=50 -CONFIG_SCHED_LPWORKPERIOD=50000 -CONFIG_SCHED_LPWORKSTACKSIZE=1800 # CONFIG_LIB_KBDCODEC is not set # CONFIG_LIB_SLCDCODEC is not set @@ -762,8 +977,8 @@ CONFIG_BUILTIN_PROXY_STACKSIZE=1024 # # CONFIG_EXAMPLES_BUTTONS is not set # CONFIG_EXAMPLES_CAN is not set -CONFIG_EXAMPLES_CDCACM=y -# CONFIG_EXAMPLES_COMPOSITE is not set +# CONFIG_EXAMPLES_CONFIGDATA is not set +# CONFIG_EXAMPLES_CPUHOG is not set # CONFIG_EXAMPLES_CXXTEST is not set # CONFIG_EXAMPLES_DHCPD is not set # CONFIG_EXAMPLES_ELF is not set @@ -775,15 +990,20 @@ CONFIG_EXAMPLES_CDCACM=y # CONFIG_EXAMPLES_HIDKBD is not set # CONFIG_EXAMPLES_KEYPADTEST is not set # CONFIG_EXAMPLES_IGMP is not set -# CONFIG_EXAMPLES_LCDRW is not set # CONFIG_EXAMPLES_MM is not set # CONFIG_EXAMPLES_MODBUS is not set CONFIG_EXAMPLES_MOUNT=y +# CONFIG_EXAMPLES_MOUNT_BLOCKDEVICE is not set +CONFIG_EXAMPLES_MOUNT_NSECTORS=2048 +CONFIG_EXAMPLES_MOUNT_SECTORSIZE=512 +CONFIG_EXAMPLES_MOUNT_RAMDEVNO=0 +# CONFIG_EXAMPLES_MTDPART is not set # CONFIG_EXAMPLES_NRF24L01TERM is not set CONFIG_EXAMPLES_NSH=y +# CONFIG_EXAMPLES_NSH_CXXINITIALIZE is not set # CONFIG_EXAMPLES_NULL is not set # CONFIG_EXAMPLES_NX is not set -# CONFIG_EXAMPLES_NXCONSOLE is not set +# CONFIG_EXAMPLES_NXTERM is not set # CONFIG_EXAMPLES_NXFFS is not set # CONFIG_EXAMPLES_NXFLAT is not set # CONFIG_EXAMPLES_NXHELLO is not set @@ -791,13 +1011,14 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_NXLINES is not set # CONFIG_EXAMPLES_NXTEXT is not set # CONFIG_EXAMPLES_OSTEST is not set -# CONFIG_EXAMPLES_PASHELLO is not set # CONFIG_EXAMPLES_PIPE is not set # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_QENCODER is not set # CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_ROMFS is not set # CONFIG_EXAMPLES_SENDMAIL is not set +# CONFIG_EXAMPLES_SERIALBLASTER is not set +# CONFIG_EXAMPLES_SERIALRX is not set # CONFIG_EXAMPLES_SERLOOP is not set # CONFIG_EXAMPLES_SLCD is not set # CONFIG_EXAMPLES_SMART_TEST is not set @@ -808,9 +1029,8 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_TIFF is not set # CONFIG_EXAMPLES_TOUCHSCREEN is not set # CONFIG_EXAMPLES_UDP is not set -# CONFIG_EXAMPLES_UIP is not set +# CONFIG_EXAMPLES_WEBSERVER is not set # CONFIG_EXAMPLES_USBSERIAL is not set -# CONFIG_EXAMPLES_USBMSC is not set # CONFIG_EXAMPLES_USBTERM is not set # CONFIG_EXAMPLES_WATCHDOG is not set @@ -818,11 +1038,13 @@ CONFIG_EXAMPLES_NSH=y # Graphics Support # # CONFIG_TIFF is not set +# CONFIG_GRAPHICS_TRAVELER is not set # # Interpreters # # CONFIG_INTERPRETERS_FICL is not set +# CONFIG_INTERPRETERS_BAS is not set # CONFIG_INTERPRETERS_PCODE is not set # @@ -833,17 +1055,14 @@ CONFIG_EXAMPLES_NSH=y # Networking Utilities # # CONFIG_NETUTILS_CODECS is not set -# CONFIG_NETUTILS_DHCPC is not set # CONFIG_NETUTILS_DHCPD is not set # CONFIG_NETUTILS_FTPC is not set # CONFIG_NETUTILS_FTPD is not set # CONFIG_NETUTILS_JSON is not set -# CONFIG_NETUTILS_RESOLV is not set # CONFIG_NETUTILS_SMTP is not set -# CONFIG_NETUTILS_TELNETD is not set # CONFIG_NETUTILS_TFTPC is not set # CONFIG_NETUTILS_THTTPD is not set -# CONFIG_NETUTILS_UIPLIB is not set +# CONFIG_NETUTILS_NETLIB is not set # CONFIG_NETUTILS_WEBCLIENT is not set # @@ -855,15 +1074,32 @@ CONFIG_EXAMPLES_NSH=y # NSH Library # CONFIG_NSH_LIBRARY=y + +# +# Command Line Configuration +# +CONFIG_NSH_READLINE=y +# CONFIG_NSH_CLE is not set +CONFIG_NSH_LINELEN=128 +# CONFIG_NSH_DISABLE_SEMICOLON is not set +CONFIG_NSH_CMDPARMS=y +CONFIG_NSH_MAXARGUMENTS=12 +CONFIG_NSH_ARGCAT=y +CONFIG_NSH_NESTDEPTH=8 +# CONFIG_NSH_DISABLEBG is not set CONFIG_NSH_BUILTIN_APPS=y # # Disable Individual commands # +# CONFIG_NSH_DISABLE_ADDROUTE is not set # CONFIG_NSH_DISABLE_CAT is not set # CONFIG_NSH_DISABLE_CD is not set # CONFIG_NSH_DISABLE_CP is not set +# CONFIG_NSH_DISABLE_CMP is not set # CONFIG_NSH_DISABLE_DD is not set +# CONFIG_NSH_DISABLE_DF is not set +# CONFIG_NSH_DISABLE_DELROUTE is not set # CONFIG_NSH_DISABLE_ECHO is not set # CONFIG_NSH_DISABLE_EXEC is not set # CONFIG_NSH_DISABLE_EXIT is not set @@ -883,9 +1119,7 @@ CONFIG_NSH_BUILTIN_APPS=y # CONFIG_NSH_DISABLE_MH is not set # CONFIG_NSH_DISABLE_MOUNT is not set # CONFIG_NSH_DISABLE_MW is not set -# CONFIG_NSH_DISABLE_NSFMOUNT is not set # CONFIG_NSH_DISABLE_PS is not set -# CONFIG_NSH_DISABLE_PING is not set # CONFIG_NSH_DISABLE_PUT is not set # CONFIG_NSH_DISABLE_PWD is not set # CONFIG_NSH_DISABLE_RM is not set @@ -905,31 +1139,36 @@ CONFIG_NSH_BUILTIN_APPS=y # # CONFIG_NSH_CMDOPT_DF_H is not set CONFIG_NSH_CODECS_BUFSIZE=128 +CONFIG_NSH_CMDOPT_HEXDUMP=y CONFIG_NSH_FILEIOSIZE=512 CONFIG_NSH_STRERROR=y -CONFIG_NSH_LINELEN=128 -CONFIG_NSH_MAXARGUMENTS=12 -CONFIG_NSH_NESTDEPTH=8 + +# +# Scripting Support +# # CONFIG_NSH_DISABLESCRIPT is not set -# CONFIG_NSH_DISABLEBG is not set +# CONFIG_NSH_DISABLE_ITEF is not set +# CONFIG_NSH_DISABLE_LOOPS is not set CONFIG_NSH_ROMFSETC=y # CONFIG_NSH_ROMFSRC is not set CONFIG_NSH_ROMFSMOUNTPT="/etc" CONFIG_NSH_INITSCRIPT="init.d/rcS" CONFIG_NSH_ROMFSDEVNO=0 CONFIG_NSH_ROMFSSECTSIZE=128 +# CONFIG_NSH_DEFAULTROMFS is not set CONFIG_NSH_ARCHROMFS=y +# CONFIG_NSH_CUSTOMROMFS is not set CONFIG_NSH_FATDEVNO=1 CONFIG_NSH_FATSECTSIZE=512 CONFIG_NSH_FATNSECTORS=1024 CONFIG_NSH_FATMOUNTPT="/tmp" -CONFIG_NSH_CONSOLE=y -# CONFIG_NSH_USBCONSOLE is not set # -# USB Trace Support +# Console Configuration # -# CONFIG_NSH_CONDEV is not set +CONFIG_NSH_CONSOLE=y +# CONFIG_NSH_USBCONSOLE is not set +# CONFIG_NSH_ALTCONDEV is not set CONFIG_NSH_ARCHINIT=y # @@ -937,7 +1176,12 @@ CONFIG_NSH_ARCHINIT=y # # -# System NSH Add-Ons +# Platform-specific Support +# +# CONFIG_PLATFORM_CONFIGDATA is not set + +# +# System Libraries and NSH Add-Ons # # @@ -946,9 +1190,18 @@ CONFIG_NSH_ARCHINIT=y # CONFIG_SYSTEM_FREE is not set # -# I2C tool +# EMACS-like Command Line Editor # -# CONFIG_SYSTEM_I2CTOOL is not set +# CONFIG_SYSTEM_CLE is not set + +# +# CU Minimal Terminal +# +CONFIG_SYSTEM_CUTERM=y +CONFIG_SYSTEM_CUTERM_DEFAULT_DEVICE="/dev/ttyS0" +CONFIG_SYSTEM_CUTERM_DEFAULT_BAUD=57600 +CONFIG_SYSTEM_CUTERM_STACKSIZE=2048 +CONFIG_SYSTEM_CUTERM_PRIORITY=100 # # FLASH Program Installation @@ -958,6 +1211,31 @@ CONFIG_NSH_ARCHINIT=y # # FLASH Erase-all Command # +# CONFIG_SYSTEM_FLASH_ERASEALL is not set + +# +# Intel HEX to binary conversion +# +# CONFIG_SYSTEM_HEX2BIN is not set + +# +# I2C tool +# +# CONFIG_SYSTEM_I2CTOOL is not set + +# +# INI File Parser +# +# CONFIG_SYSTEM_INIFILE is not set + +# +# NxPlayer media player library / command Line +# + +# +# RAM test +# +# CONFIG_SYSTEM_RAMTEST is not set # # readline() @@ -965,6 +1243,14 @@ CONFIG_NSH_ARCHINIT=y CONFIG_SYSTEM_READLINE=y CONFIG_READLINE_ECHO=y +# +# P-Code Support +# + +# +# PHY Tool +# + # # Power Off # @@ -980,11 +1266,45 @@ CONFIG_READLINE_ECHO=y # # CONFIG_SYSTEM_SDCARD is not set +# +# Sudoku +# +# CONFIG_SYSTEM_SUDOKU is not set + # # Sysinfo # CONFIG_SYSTEM_SYSINFO=y +CONFIG_SYSTEM_SYSINFO_STACKSIZE=1024 + +# +# VI Work-Alike Editor +# +# CONFIG_SYSTEM_VI is not set + +# +# Stack Monitor +# + +# +# USB CDC/ACM Device Commands +# +CONFIG_SYSTEM_CDCACM=y +CONFIG_SYSTEM_CDCACM_DEVMINOR=0 + +# +# USB Composite Device Commands +# + +# +# USB Mass Storage Device Commands +# # # USB Monitor # + +# +# Zmodem Commands +# +# CONFIG_SYSTEM_ZMODEM is not set diff --git a/nuttx-configs/px4fmu-v2/nsh/defconfig b/nuttx-configs/px4fmu-v2/nsh/defconfig index 6a1aec22b..ba39a3125 100644 --- a/nuttx-configs/px4fmu-v2/nsh/defconfig +++ b/nuttx-configs/px4fmu-v2/nsh/defconfig @@ -2,14 +2,14 @@ # Automatically generated file; DO NOT EDIT. # Nuttx/ Configuration # -CONFIG_NUTTX_NEWCONFIG=y # # Build Setup # # CONFIG_EXPERIMENTAL is not set -# CONFIG_HOST_LINUX is not set -CONFIG_HOST_OSX=y +# CONFIG_DEFAULT_SMALL is not set +CONFIG_HOST_LINUX=y +# CONFIG_HOST_OSX is not set # CONFIG_HOST_WINDOWS is not set # CONFIG_HOST_OTHER is not set @@ -17,6 +17,7 @@ CONFIG_HOST_OSX=y # Build Configuration # CONFIG_APPS_DIR="../apps" +CONFIG_BUILD_FLAT=y # CONFIG_BUILD_2PASS is not set # @@ -26,10 +27,12 @@ CONFIG_APPS_DIR="../apps" # CONFIG_INTELHEX_BINARY is not set # CONFIG_MOTOROLA_SREC is not set CONFIG_RAW_BINARY=y +# CONFIG_UBOOT_UIMAGE is not set # # Customize Header Files # +# CONFIG_ARCH_STDINT_H is not set # CONFIG_ARCH_STDBOOL_H is not set CONFIG_ARCH_MATH_H=y # CONFIG_ARCH_FLOAT_H is not set @@ -38,37 +41,19 @@ CONFIG_ARCH_MATH_H=y # # Debug Options # -CONFIG_DEBUG=n -CONFIG_DEBUG_VERBOSE=n - -# -# Subsystem Debug Options -# -# CONFIG_DEBUG_MM is not set -# CONFIG_DEBUG_SCHED is not set -# CONFIG_DEBUG_USB is not set -CONFIG_DEBUG_FS=y -# CONFIG_DEBUG_LIB is not set -# CONFIG_DEBUG_BINFMT is not set -# CONFIG_DEBUG_GRAPHICS is not set - -# -# Driver Debug Options -# -# CONFIG_DEBUG_ANALOG is not set -# CONFIG_DEBUG_I2C is not set -# CONFIG_DEBUG_SPI is not set -# CONFIG_DEBUG_SDIO is not set -# CONFIG_DEBUG_GPIO is not set -CONFIG_DEBUG_DMA=y -# CONFIG_DEBUG_WATCHDOG is not set -# CONFIG_DEBUG_AUDIO is not set +# CONFIG_DEBUG is not set +CONFIG_ARCH_HAVE_STACKCHECK=y +CONFIG_ARCH_HAVE_HEAPCHECK=y +CONFIG_STACK_COLORATION=y CONFIG_DEBUG_SYMBOLS=y +CONFIG_ARCH_HAVE_CUSTOMOPT=y +CONFIG_DEBUG_NOOPT=y +# CONFIG_DEBUG_CUSTOMOPT is not set +# CONFIG_DEBUG_FULLOPT is not set # # System Type # -# CONFIG_ARCH_8051 is not set CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set @@ -84,23 +69,35 @@ CONFIG_ARCH="arm" # # ARM Options # +# CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set # CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set +# CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX is not set # CONFIG_ARCH_CHIP_KINETIS is not set # CONFIG_ARCH_CHIP_KL is not set # CONFIG_ARCH_CHIP_LM is not set +# CONFIG_ARCH_CHIP_TIVA is not set # CONFIG_ARCH_CHIP_LPC17XX is not set # CONFIG_ARCH_CHIP_LPC214X is not set # CONFIG_ARCH_CHIP_LPC2378 is not set # CONFIG_ARCH_CHIP_LPC31XX is not set # CONFIG_ARCH_CHIP_LPC43XX is not set # CONFIG_ARCH_CHIP_NUC1XX is not set +# CONFIG_ARCH_CHIP_SAMA5 is not set +# CONFIG_ARCH_CHIP_SAMD is not set # CONFIG_ARCH_CHIP_SAM34 is not set CONFIG_ARCH_CHIP_STM32=y # CONFIG_ARCH_CHIP_STR71X is not set +# CONFIG_ARCH_ARM7TDMI is not set +# CONFIG_ARCH_ARM926EJS is not set +# CONFIG_ARCH_ARM920T is not set +# CONFIG_ARCH_CORTEXM0 is not set +# CONFIG_ARCH_CORTEXM3 is not set CONFIG_ARCH_CORTEXM4=y +# CONFIG_ARCH_CORTEXA5 is not set +# CONFIG_ARCH_CORTEXA8 is not set CONFIG_ARCH_FAMILY="armv7-m" CONFIG_ARCH_CHIP="stm32" CONFIG_ARMV7M_USEBASEPRI=y @@ -108,17 +105,17 @@ CONFIG_ARCH_HAVE_CMNVECTOR=y CONFIG_ARMV7M_CMNVECTOR=y CONFIG_ARCH_HAVE_FPU=y CONFIG_ARCH_FPU=y -CONFIG_ARCH_HAVE_MPU=y # CONFIG_ARMV7M_MPU is not set -# CONFIG_DEBUG_HARDFAULT is not set # # ARMV7M Configuration Options # # CONFIG_ARMV7M_TOOLCHAIN_BUILDROOT is not set -CONFIG_ARMV7M_TOOLCHAIN_GNU_EABI=y -CONFIG_ARMV7M_STACKCHECK=n -CONFIG_SERIAL_TERMIOS=y +# CONFIG_ARMV7M_TOOLCHAIN_CODEREDL is not set +# CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYL is not set +CONFIG_ARMV7M_TOOLCHAIN_GNU_EABIL=y +# CONFIG_ARMV7M_STACKCHECK is not set +# CONFIG_ARMV7M_ITMSYSLOG is not set CONFIG_SDIO_DMA=y CONFIG_SDIO_DMAPRIO=0x00010000 # CONFIG_SDIO_WIDTH_D1_ONLY is not set @@ -144,6 +141,7 @@ CONFIG_SDIO_DMAPRIO=0x00010000 # CONFIG_ARCH_CHIP_STM32L152V6 is not set # CONFIG_ARCH_CHIP_STM32L152V8 is not set # CONFIG_ARCH_CHIP_STM32L152VB is not set +# CONFIG_ARCH_CHIP_STM32L162ZD is not set # CONFIG_ARCH_CHIP_STM32F100C8 is not set # CONFIG_ARCH_CHIP_STM32F100CB is not set # CONFIG_ARCH_CHIP_STM32F100R8 is not set @@ -156,15 +154,27 @@ CONFIG_SDIO_DMAPRIO=0x00010000 # CONFIG_ARCH_CHIP_STM32F100VC is not set # CONFIG_ARCH_CHIP_STM32F100VD is not set # CONFIG_ARCH_CHIP_STM32F100VE is not set +# CONFIG_ARCH_CHIP_STM32F102CB is not set +# CONFIG_ARCH_CHIP_STM32F103T8 is not set +# CONFIG_ARCH_CHIP_STM32F103TB is not set # CONFIG_ARCH_CHIP_STM32F103C4 is not set # CONFIG_ARCH_CHIP_STM32F103C8 is not set -# CONFIG_ARCH_CHIP_STM32F103RET6 is not set -# CONFIG_ARCH_CHIP_STM32F103VCT6 is not set -# CONFIG_ARCH_CHIP_STM32F103VET6 is not set -# CONFIG_ARCH_CHIP_STM32F103ZET6 is not set -# CONFIG_ARCH_CHIP_STM32F105VBT7 is not set +# CONFIG_ARCH_CHIP_STM32F103CB is not set +# CONFIG_ARCH_CHIP_STM32F103R8 is not set +# CONFIG_ARCH_CHIP_STM32F103RB is not set +# CONFIG_ARCH_CHIP_STM32F103RC is not set +# CONFIG_ARCH_CHIP_STM32F103RD is not set +# CONFIG_ARCH_CHIP_STM32F103RE is not set +# CONFIG_ARCH_CHIP_STM32F103RG is not set +# CONFIG_ARCH_CHIP_STM32F103V8 is not set +# CONFIG_ARCH_CHIP_STM32F103VB is not set +# CONFIG_ARCH_CHIP_STM32F103VC is not set +# CONFIG_ARCH_CHIP_STM32F103VE is not set +# CONFIG_ARCH_CHIP_STM32F103ZE is not set +# CONFIG_ARCH_CHIP_STM32F105VB is not set # CONFIG_ARCH_CHIP_STM32F107VC is not set # CONFIG_ARCH_CHIP_STM32F207IG is not set +# CONFIG_ARCH_CHIP_STM32F207ZE is not set # CONFIG_ARCH_CHIP_STM32F302CB is not set # CONFIG_ARCH_CHIP_STM32F302CC is not set # CONFIG_ARCH_CHIP_STM32F302RB is not set @@ -177,6 +187,8 @@ CONFIG_SDIO_DMAPRIO=0x00010000 # CONFIG_ARCH_CHIP_STM32F303RC is not set # CONFIG_ARCH_CHIP_STM32F303VB is not set # CONFIG_ARCH_CHIP_STM32F303VC is not set +# CONFIG_ARCH_CHIP_STM32F401RE is not set +# CONFIG_ARCH_CHIP_STM32F411RE is not set # CONFIG_ARCH_CHIP_STM32F405RG is not set # CONFIG_ARCH_CHIP_STM32F405VG is not set # CONFIG_ARCH_CHIP_STM32F405ZG is not set @@ -189,24 +201,71 @@ CONFIG_SDIO_DMAPRIO=0x00010000 CONFIG_ARCH_CHIP_STM32F427V=y # CONFIG_ARCH_CHIP_STM32F427Z is not set # CONFIG_ARCH_CHIP_STM32F427I is not set +# CONFIG_ARCH_CHIP_STM32F429V is not set +# CONFIG_ARCH_CHIP_STM32F429Z is not set +# CONFIG_ARCH_CHIP_STM32F429I is not set +# CONFIG_ARCH_CHIP_STM32F429B is not set +# CONFIG_ARCH_CHIP_STM32F429N is not set # CONFIG_STM32_STM32L15XX is not set # CONFIG_STM32_ENERGYLITE is not set # CONFIG_STM32_STM32F10XX is not set # CONFIG_STM32_VALUELINE is not set # CONFIG_STM32_CONNECTIVITYLINE is not set # CONFIG_STM32_PERFORMANCELINE is not set +# CONFIG_STM32_USBACCESSLINE is not set # CONFIG_STM32_HIGHDENSITY is not set # CONFIG_STM32_MEDIUMDENSITY is not set # CONFIG_STM32_LOWDENSITY is not set # CONFIG_STM32_STM32F20XX is not set +# CONFIG_STM32_STM32F207 is not set # CONFIG_STM32_STM32F30XX is not set CONFIG_STM32_STM32F40XX=y +# CONFIG_STM32_STM32F401 is not set +# CONFIG_STM32_STM32F411 is not set +# CONFIG_STM32_STM32F405 is not set +# CONFIG_STM32_STM32F407 is not set CONFIG_STM32_STM32F427=y +# CONFIG_STM32_STM32F429 is not set # CONFIG_STM32_DFU is not set # # STM32 Peripheral Support # +CONFIG_STM32_HAVE_CCM=y +# CONFIG_STM32_HAVE_USBDEV is not set +CONFIG_STM32_HAVE_OTGFS=y +CONFIG_STM32_HAVE_FSMC=y +CONFIG_STM32_HAVE_USART3=y +CONFIG_STM32_HAVE_UART4=y +CONFIG_STM32_HAVE_UART5=y +CONFIG_STM32_HAVE_USART6=y +CONFIG_STM32_HAVE_UART7=y +CONFIG_STM32_HAVE_UART8=y +CONFIG_STM32_HAVE_TIM1=y +CONFIG_STM32_HAVE_TIM5=y +CONFIG_STM32_HAVE_TIM6=y +CONFIG_STM32_HAVE_TIM7=y +CONFIG_STM32_HAVE_TIM8=y +CONFIG_STM32_HAVE_TIM9=y +CONFIG_STM32_HAVE_TIM10=y +CONFIG_STM32_HAVE_TIM11=y +CONFIG_STM32_HAVE_TIM12=y +CONFIG_STM32_HAVE_TIM13=y +CONFIG_STM32_HAVE_TIM14=y +# CONFIG_STM32_HAVE_TIM15 is not set +# CONFIG_STM32_HAVE_TIM16 is not set +# CONFIG_STM32_HAVE_TIM17 is not set +CONFIG_STM32_HAVE_ADC2=y +CONFIG_STM32_HAVE_ADC3=y +# CONFIG_STM32_HAVE_ADC4 is not set +CONFIG_STM32_HAVE_CAN1=y +CONFIG_STM32_HAVE_CAN2=y +CONFIG_STM32_HAVE_RNG=y +CONFIG_STM32_HAVE_ETHMAC=y +CONFIG_STM32_HAVE_SPI2=y +CONFIG_STM32_HAVE_SPI3=y +CONFIG_STM32_HAVE_SPI4=y +CONFIG_STM32_HAVE_SPI5=y CONFIG_STM32_ADC1=y # CONFIG_STM32_ADC2 is not set # CONFIG_STM32_ADC3 is not set @@ -302,7 +361,6 @@ CONFIG_USART2_RXDMA=y CONFIG_USART3_RXDMA=y # CONFIG_UART4_RS485 is not set CONFIG_UART4_RXDMA=y -CONFIG_UART5_RXDMA=y # CONFIG_USART6_RS485 is not set CONFIG_USART6_RXDMA=y # CONFIG_UART7_RS485 is not set @@ -310,6 +368,7 @@ CONFIG_UART7_RXDMA=y # CONFIG_UART8_RS485 is not set CONFIG_UART8_RXDMA=y CONFIG_SERIAL_DISABLE_REORDERING=y +CONFIG_STM32_FLOWCONTROL_BROKEN=y CONFIG_STM32_USART_SINGLEWIRE=y # @@ -321,26 +380,34 @@ CONFIG_STM32_USART_SINGLEWIRE=y # # I2C Configuration # +# CONFIG_STM32_I2C_ALT is not set # CONFIG_STM32_I2C_DYNTIMEO is not set CONFIG_STM32_I2CTIMEOSEC=0 CONFIG_STM32_I2CTIMEOMS=10 +CONFIG_STM32_I2CTIMEOTICKS=10 # CONFIG_STM32_I2C_DUTY16_9 is not set # # SDIO Configuration # -CONFIG_SDIO_PRI=128 +# CONFIG_RTC_LSECLOCK is not set +# CONFIG_RTC_LSICLOCK is not set +CONFIG_RTC_HSECLOCK=y # -# USB Host Configuration +# USB FS Host Configuration # # -# USB Device Configuration +# USB HS Host Configuration # # -# External Memory Configuration +# USB Host Debug Configuration +# + +# +# USB Device Configuration # # @@ -349,12 +416,21 @@ CONFIG_SDIO_PRI=128 # CONFIG_ARCH_NOINTC is not set # CONFIG_ARCH_VECNOTIRQ is not set CONFIG_ARCH_DMA=y -# CONFIG_ARCH_IRQPRIO is not set -# CONFIG_CUSTOM_STACK is not set -# CONFIG_ADDRENV is not set +CONFIG_ARCH_HAVE_IRQPRIO=y +# CONFIG_ARCH_L2CACHE is not set +# CONFIG_ARCH_HAVE_COHERENT_DCACHE is not set +# CONFIG_ARCH_HAVE_ADDRENV is not set +# CONFIG_ARCH_NEED_ADDRENV_MAPPING is not set CONFIG_ARCH_HAVE_VFORK=y +# CONFIG_ARCH_HAVE_MMU is not set +CONFIG_ARCH_HAVE_MPU=y +# CONFIG_ARCH_NAND_HWECC is not set +# CONFIG_ARCH_HAVE_EXTCLK is not set +# CONFIG_ARCH_USE_MPU is not set +# CONFIG_ARCH_IRQPRIO is not set CONFIG_ARCH_STACKDUMP=y # CONFIG_ENDIAN_BIG is not set +# CONFIG_ARCH_IDLE_CUSTOM is not set # CONFIG_ARCH_HAVE_RAMFUNCS is not set CONFIG_ARCH_HAVE_RAMVECTORS=y # CONFIG_ARCH_RAMVECTORS is not set @@ -364,10 +440,14 @@ CONFIG_ARCH_HAVE_RAMVECTORS=y # CONFIG_BOARD_LOOPSPERMSEC=16717 # CONFIG_ARCH_CALIBRATION is not set -CONFIG_DRAM_START=0x20000000 -CONFIG_DRAM_SIZE=262144 + +# +# Interrupt options +# CONFIG_ARCH_HAVE_INTERRUPTSTACK=y -CONFIG_ARCH_INTERRUPTSTACK=4096 +CONFIG_ARCH_INTERRUPTSTACK=2048 +CONFIG_ARCH_HAVE_HIPRI_INTERRUPT=y +# CONFIG_ARCH_HIPRI_INTERRUPT is not set # # Boot options @@ -378,51 +458,96 @@ CONFIG_BOOT_RUNFROMFLASH=y # CONFIG_BOOT_RUNFROMSDRAM is not set # CONFIG_BOOT_COPYTORAM is not set +# +# Boot Memory Configuration +# +CONFIG_RAM_START=0x20000000 +CONFIG_RAM_SIZE=262144 +# CONFIG_ARCH_HAVE_SDRAM is not set + # # Board Selection # CONFIG_ARCH_BOARD_PX4FMU_V2=y -CONFIG_ARCH_BOARD_CUSTOM=y -CONFIG_ARCH_BOARD="" +# CONFIG_ARCH_BOARD_CUSTOM is not set +CONFIG_ARCH_BOARD="px4fmu-v2" # # Common Board Options # CONFIG_NSH_MMCSDMINOR=0 CONFIG_NSH_MMCSDSLOTNO=0 -CONFIG_MMCSD_HAVE_SDIOWAIT_WRCOMPLETE=y + # # Board-Specific Options # +CONFIG_BOARD_HAS_PROBES=y +# CONFIG_BOARD_USE_PROBES is not set # # RTOS Features # -# CONFIG_BOARD_INITIALIZE is not set -CONFIG_MSEC_PER_TICK=1 +# CONFIG_DISABLE_OS_API is not set + +# +# Clocks and Timers +# +CONFIG_USEC_PER_TICK=1000 +# CONFIG_SYSTEM_TIME64 is not set +# CONFIG_CLOCK_MONOTONIC is not set +# CONFIG_JULIAN_TIME is not set +CONFIG_MAX_WDOGPARMS=2 +CONFIG_PREALLOC_WDOGS=50 +CONFIG_WDOG_INTRESERVE=4 +CONFIG_PREALLOC_TIMERS=50 + +# +# Tasks and Scheduling +# +# CONFIG_INIT_NONE is not set +CONFIG_INIT_ENTRYPOINT=y +# CONFIG_INIT_FILEPATH is not set +CONFIG_USER_ENTRYPOINT="nsh_main" CONFIG_RR_INTERVAL=0 -CONFIG_SCHED_INSTRUMENTATION=y CONFIG_TASK_NAME_SIZE=24 +CONFIG_MAX_TASKS=32 # CONFIG_SCHED_HAVE_PARENT is not set -# CONFIG_JULIAN_TIME is not set -CONFIG_START_YEAR=1970 -CONFIG_START_MONTH=1 -CONFIG_START_DAY=1 -CONFIG_DEV_CONSOLE=y +CONFIG_SCHED_WAITPID=y + +# +# Pthread Options +# # CONFIG_MUTEX_TYPES is not set -CONFIG_PRIORITY_INHERITANCE=y -CONFIG_SEM_PREALLOCHOLDERS=0 -CONFIG_SEM_NNESTPRIO=8 +CONFIG_NPTHREAD_KEYS=4 + +# +# Performance Monitoring +# +# CONFIG_SCHED_CPULOAD is not set +CONFIG_SCHED_INSTRUMENTATION=y + +# +# Files and I/O +# +CONFIG_DEV_CONSOLE=y # CONFIG_FDCLONE_DISABLE is not set CONFIG_FDCLONE_STDIO=y CONFIG_SDCLONE_DISABLE=y -CONFIG_SCHED_WAITPID=y +CONFIG_NFILE_DESCRIPTORS=42 +CONFIG_NFILE_STREAMS=8 +CONFIG_NAME_MAX=32 +CONFIG_PRIORITY_INHERITANCE=y +CONFIG_SEM_PREALLOCHOLDERS=0 +CONFIG_SEM_NNESTPRIO=8 + +# +# RTOS hooks +# +# CONFIG_BOARD_INITIALIZE is not set # CONFIG_SCHED_STARTHOOK is not set CONFIG_SCHED_ATEXIT=y CONFIG_SCHED_ATEXIT_MAX=1 # CONFIG_SCHED_ONEXIT is not set -CONFIG_USER_ENTRYPOINT="nsh_main" -# CONFIG_DISABLE_OS_API is not set # # Signal Numbers @@ -434,19 +559,25 @@ CONFIG_SIG_SIGCONDTIMEDOUT=16 CONFIG_SIG_SIGWORK=4 # -# Sizes of configurable things (0 disables) +# POSIX Message Queue Options # -CONFIG_MAX_TASKS=32 -CONFIG_MAX_TASK_ARGS=10 -CONFIG_NPTHREAD_KEYS=4 -CONFIG_NFILE_DESCRIPTORS=42 -CONFIG_NFILE_STREAMS=8 -CONFIG_NAME_MAX=32 CONFIG_PREALLOC_MQ_MSGS=4 CONFIG_MQ_MAXMSGSIZE=32 -CONFIG_MAX_WDOGPARMS=2 -CONFIG_PREALLOC_WDOGS=50 -CONFIG_PREALLOC_TIMERS=50 + +# +# Work Queue Support +# +CONFIG_SCHED_WORKQUEUE=y +CONFIG_SCHED_HPWORK=y +CONFIG_SCHED_HPWORKPRIORITY=192 +CONFIG_SCHED_HPWORKPERIOD=5000 +CONFIG_SCHED_HPWORKSTACKSIZE=1800 +CONFIG_SCHED_LPWORK=y +CONFIG_SCHED_LPNTHREADS=1 +CONFIG_SCHED_LPWORKPRIORITY=50 +CONFIG_SCHED_LPWORKPRIOMAX=176 +CONFIG_SCHED_LPWORKPERIOD=50000 +CONFIG_SCHED_LPWORKSTACKSIZE=1800 # # Stack and heap information @@ -455,6 +586,7 @@ CONFIG_IDLETHREAD_STACKSIZE=3500 CONFIG_USERMAIN_STACKSIZE=2600 CONFIG_PTHREAD_STACK_MIN=512 CONFIG_PTHREAD_STACK_DEFAULT=2048 +# CONFIG_LIB_SYSCALL is not set # # Device Drivers @@ -463,27 +595,39 @@ CONFIG_PTHREAD_STACK_DEFAULT=2048 CONFIG_DEV_NULL=y # CONFIG_DEV_ZERO is not set # CONFIG_LOOP is not set + +# +# Buffering +# +# CONFIG_DRVR_WRITEBUFFER is not set +# CONFIG_DRVR_READAHEAD is not set # CONFIG_RAMDISK is not set # CONFIG_CAN is not set +# CONFIG_ARCH_HAVE_PWM_PULSECOUNT is not set # CONFIG_PWM is not set +CONFIG_ARCH_HAVE_I2CRESET=y CONFIG_I2C=y # CONFIG_I2C_SLAVE is not set CONFIG_I2C_TRANSFER=y # CONFIG_I2C_WRITEREAD is not set # CONFIG_I2C_POLLED is not set # CONFIG_I2C_TRACE is not set -CONFIG_ARCH_HAVE_I2CRESET=y CONFIG_I2C_RESET=y CONFIG_SPI=y # CONFIG_SPI_OWNBUS is not set CONFIG_SPI_EXCHANGE=y # CONFIG_SPI_CMDDATA is not set +# CONFIG_SPI_BITBANG is not set +# CONFIG_I2S is not set CONFIG_RTC=y CONFIG_RTC_DATETIME=y -CONFIG_RTC_HSECLOCK=y +# CONFIG_RTC_ALARM is not set CONFIG_WATCHDOG=y +CONFIG_WATCHDOG_DEVPATH="/dev/watchdog0" +# CONFIG_TIMER is not set # CONFIG_ANALOG is not set # CONFIG_AUDIO_DEVICES is not set +# CONFIG_VIDEO_DEVICES is not set # CONFIG_BCH is not set # CONFIG_INPUT is not set # CONFIG_LCD is not set @@ -494,8 +638,12 @@ CONFIG_MMCSD_MULTIBLOCK_DISABLE=y # CONFIG_MMCSD_MMCSUPPORT is not set # CONFIG_MMCSD_HAVECARDDETECT is not set # CONFIG_MMCSD_SPI is not set +CONFIG_ARCH_HAVE_SDIO=y +CONFIG_ARCH_HAVE_SDIOWAIT_WRCOMPLETE=y CONFIG_MMCSD_SDIO=y +CONFIG_SDIO_PREFLIGHT=y # CONFIG_SDIO_MUXBUS is not set +CONFIG_MMCSD_SDIOWAIT_WRCOMPLETE=y # CONFIG_SDIO_BLOCKSETUP is not set CONFIG_MTD=y @@ -503,39 +651,77 @@ CONFIG_MTD=y # MTD Configuration # CONFIG_MTD_PARTITION=y +# CONFIG_MTD_SECT512 is not set CONFIG_MTD_BYTE_WRITE=y +# CONFIG_MTD_CONFIG is not set # # MTD Device Drivers # +# CONFIG_MTD_NAND is not set # CONFIG_RAMMTD is not set # CONFIG_MTD_AT24XX is not set +# CONFIG_MTD_AT25 is not set # CONFIG_MTD_AT45DB is not set # CONFIG_MTD_M25P is not set # CONFIG_MTD_SMART is not set CONFIG_MTD_RAMTRON=y +CONFIG_RAMTRON_WRITEWAIT=y +CONFIG_RAMTRON_SETSPEED=y # CONFIG_MTD_SST25 is not set +# CONFIG_MTD_SST25XX is not set # CONFIG_MTD_SST39FV is not set # CONFIG_MTD_W25 is not set +# CONFIG_EEPROM is not set CONFIG_PIPES=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set +# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set CONFIG_SERIAL_REMOVABLE=y # CONFIG_16550_UART is not set +# CONFIG_ARCH_HAVE_UART is not set +# CONFIG_ARCH_HAVE_UART0 is not set +# CONFIG_ARCH_HAVE_UART1 is not set +# CONFIG_ARCH_HAVE_UART2 is not set +# CONFIG_ARCH_HAVE_UART3 is not set CONFIG_ARCH_HAVE_UART4=y +# CONFIG_ARCH_HAVE_UART5 is not set +# CONFIG_ARCH_HAVE_UART6 is not set CONFIG_ARCH_HAVE_UART7=y CONFIG_ARCH_HAVE_UART8=y +# CONFIG_ARCH_HAVE_SCI0 is not set +# CONFIG_ARCH_HAVE_SCI1 is not set +# CONFIG_ARCH_HAVE_USART0 is not set CONFIG_ARCH_HAVE_USART1=y CONFIG_ARCH_HAVE_USART2=y CONFIG_ARCH_HAVE_USART3=y +# CONFIG_ARCH_HAVE_USART4 is not set +# CONFIG_ARCH_HAVE_USART5 is not set CONFIG_ARCH_HAVE_USART6=y +# CONFIG_ARCH_HAVE_USART7 is not set +# CONFIG_ARCH_HAVE_USART8 is not set +# CONFIG_ARCH_HAVE_OTHER_UART is not set + +# +# USART Configuration +# +CONFIG_USART1_ISUART=y +CONFIG_USART2_ISUART=y +CONFIG_USART3_ISUART=y +CONFIG_USART6_ISUART=y CONFIG_MCU_SERIAL=y CONFIG_STANDARD_SERIAL=y CONFIG_SERIAL_NPOLLWAITERS=2 -# CONFIG_SERIAL_TIOCSERGSTRUCT is not set +CONFIG_SERIAL_IFLOWCONTROL=y +CONFIG_SERIAL_OFLOWCONTROL=y +CONFIG_SERIAL_IFLOWCONTROL_WATERMARKS=y +CONFIG_SERIAL_IFLOWCONTROL_LOWER_WATERMARK=10 +CONFIG_SERIAL_IFLOWCONTROL_UPPER_WATERMARK=90 +CONFIG_ARCH_HAVE_SERIAL_TERMIOS=y +CONFIG_SERIAL_TERMIOS=y # CONFIG_USART1_SERIAL_CONSOLE is not set # CONFIG_USART2_SERIAL_CONSOLE is not set # CONFIG_USART3_SERIAL_CONSOLE is not set @@ -543,6 +729,7 @@ CONFIG_SERIAL_NPOLLWAITERS=2 # CONFIG_USART6_SERIAL_CONSOLE is not set CONFIG_UART7_SERIAL_CONSOLE=y # CONFIG_UART8_SERIAL_CONSOLE is not set +# CONFIG_OTHER_SERIAL_CONSOLE is not set # CONFIG_NO_SERIAL_CONSOLE is not set # @@ -628,8 +815,6 @@ CONFIG_UART8_PARITY=0 CONFIG_UART8_2STOP=0 # CONFIG_UART8_IFLOWCONTROL is not set # CONFIG_UART8_OFLOWCONTROL is not set -CONFIG_SERIAL_IFLOWCONTROL=y -CONFIG_SERIAL_OFLOWCONTROL=y CONFIG_USBDEV=y # @@ -641,6 +826,7 @@ CONFIG_USBDEV=y CONFIG_USBDEV_BUSPOWERED=y CONFIG_USBDEV_MAXPOWER=500 # CONFIG_USBDEV_DMA is not set +# CONFIG_ARCH_USBDEV_STALLQUEUE is not set # CONFIG_USBDEV_TRACE is not set # @@ -685,8 +871,15 @@ CONFIG_CDCACM_PRODUCTSTR="PX4 FMU v2.x" # # Networking Support # +# CONFIG_ARCH_HAVE_NET is not set +# CONFIG_ARCH_HAVE_PHY is not set # CONFIG_NET is not set +# +# Crypto API +# +# CONFIG_CRYPTO is not set + # # File Systems # @@ -695,6 +888,13 @@ CONFIG_CDCACM_PRODUCTSTR="PX4 FMU v2.x" # File system configuration # # CONFIG_DISABLE_MOUNTPOINT is not set +# CONFIG_FS_AUTOMOUNTER is not set +# CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set +CONFIG_FS_READABLE=y +CONFIG_FS_WRITABLE=y +# CONFIG_FS_AIO is not set +# CONFIG_FS_NAMED_SEMAPHORES is not set +CONFIG_FS_MQUEUE_MPATH="/var/mqueue" # CONFIG_FS_RAMMAP is not set CONFIG_FS_FAT=y CONFIG_FAT_LCNAMES=y @@ -703,6 +903,7 @@ CONFIG_FAT_MAXFNAME=32 CONFIG_FS_FATTIME=y CONFIG_FAT_DMAMEMORY=y CONFIG_FS_NXFFS=y +# CONFIG_NXFFS_SCAN_VOLUME is not set CONFIG_NXFFS_PREALLOCATED=y CONFIG_NXFFS_ERASEDSTATE=0xff CONFIG_NXFFS_PACKTHRESHOLD=32 @@ -711,12 +912,13 @@ CONFIG_NXFFS_TAILTHRESHOLD=2048 CONFIG_FS_ROMFS=y # CONFIG_FS_SMARTFS is not set CONFIG_FS_BINFS=y +# CONFIG_FS_PROCFS is not set # # System Logging # -# CONFIG_SYSLOG_ENABLE is not set # CONFIG_SYSLOG is not set +# CONFIG_SYSLOG_TIMESTAMP is not set # # Graphics Support @@ -726,13 +928,12 @@ CONFIG_FS_BINFS=y # # Memory Management # -# CONFIG_MM_MULTIHEAP is not set # CONFIG_MM_SMALL is not set CONFIG_MM_REGIONS=2 +# CONFIG_ARCH_HAVE_HEAP2 is not set CONFIG_GRAN=y # CONFIG_GRAN_SINGLE is not set -# CONFIG_GRAN_INTR is not set -# CONFIG_DEBUG_GRAN is not set +CONFIG_GRAN_INTR=y # # Audio Support @@ -740,7 +941,7 @@ CONFIG_GRAN=y # CONFIG_AUDIO is not set # -# Binary Formats +# Binary Loader # # CONFIG_BINFMT_DISABLE is not set # CONFIG_BINFMT_EXEPATH is not set @@ -763,6 +964,7 @@ CONFIG_NUNGET_CHARS=2 CONFIG_LIB_HOMEDIR="/" # CONFIG_NOPRINTF_FIELDWIDTH is not set CONFIG_LIBC_FLOATINGPOINT=y +# CONFIG_LIBC_IOCTL_VARIADIC is not set CONFIG_LIB_RAND_ORDER=1 # CONFIG_EOL_IS_CR is not set # CONFIG_EOL_IS_LF is not set @@ -774,7 +976,10 @@ CONFIG_TASK_SPAWN_DEFAULT_STACKSIZE=2048 CONFIG_LIBC_STRERROR=y # CONFIG_LIBC_STRERROR_SHORT is not set # CONFIG_LIBC_PERROR_STDOUT is not set +CONFIG_LIBC_TMPDIR="/tmp" +CONFIG_LIBC_MAX_TMPFILE=32 CONFIG_ARCH_LOWPUTC=y +# CONFIG_LIBC_LOCALTIME is not set CONFIG_LIB_SENDFILE_BUFSIZE=512 # CONFIG_ARCH_ROMGETC is not set CONFIG_ARCH_OPTIMIZED_FUNCTIONS=y @@ -794,15 +999,6 @@ CONFIG_ARCH_MEMCPY=y # # Non-standard Library Support # -CONFIG_SCHED_WORKQUEUE=y -CONFIG_SCHED_HPWORK=y -CONFIG_SCHED_WORKPRIORITY=192 -CONFIG_SCHED_WORKPERIOD=5000 -CONFIG_SCHED_WORKSTACKSIZE=1800 -CONFIG_SCHED_LPWORK=y -CONFIG_SCHED_LPWORKPRIORITY=50 -CONFIG_SCHED_LPWORKPERIOD=50000 -CONFIG_SCHED_LPWORKSTACKSIZE=1800 # CONFIG_LIB_KBDCODEC is not set # CONFIG_LIB_SLCDCODEC is not set @@ -833,8 +1029,8 @@ CONFIG_BUILTIN_PROXY_STACKSIZE=1024 # # CONFIG_EXAMPLES_BUTTONS is not set # CONFIG_EXAMPLES_CAN is not set -CONFIG_EXAMPLES_CDCACM=y -# CONFIG_EXAMPLES_COMPOSITE is not set +# CONFIG_EXAMPLES_CONFIGDATA is not set +# CONFIG_EXAMPLES_CPUHOG is not set # CONFIG_EXAMPLES_CXXTEST is not set # CONFIG_EXAMPLES_DHCPD is not set # CONFIG_EXAMPLES_ELF is not set @@ -846,15 +1042,20 @@ CONFIG_EXAMPLES_CDCACM=y # CONFIG_EXAMPLES_HIDKBD is not set # CONFIG_EXAMPLES_KEYPADTEST is not set # CONFIG_EXAMPLES_IGMP is not set -# CONFIG_EXAMPLES_LCDRW is not set # CONFIG_EXAMPLES_MM is not set # CONFIG_EXAMPLES_MODBUS is not set CONFIG_EXAMPLES_MOUNT=y +# CONFIG_EXAMPLES_MOUNT_BLOCKDEVICE is not set +CONFIG_EXAMPLES_MOUNT_NSECTORS=2048 +CONFIG_EXAMPLES_MOUNT_SECTORSIZE=512 +CONFIG_EXAMPLES_MOUNT_RAMDEVNO=0 +# CONFIG_EXAMPLES_MTDPART is not set # CONFIG_EXAMPLES_NRF24L01TERM is not set CONFIG_EXAMPLES_NSH=y +# CONFIG_EXAMPLES_NSH_CXXINITIALIZE is not set # CONFIG_EXAMPLES_NULL is not set # CONFIG_EXAMPLES_NX is not set -# CONFIG_EXAMPLES_NXCONSOLE is not set +# CONFIG_EXAMPLES_NXTERM is not set # CONFIG_EXAMPLES_NXFFS is not set # CONFIG_EXAMPLES_NXFLAT is not set # CONFIG_EXAMPLES_NXHELLO is not set @@ -862,13 +1063,14 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_NXLINES is not set # CONFIG_EXAMPLES_NXTEXT is not set # CONFIG_EXAMPLES_OSTEST is not set -# CONFIG_EXAMPLES_PASHELLO is not set # CONFIG_EXAMPLES_PIPE is not set # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_QENCODER is not set # CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_ROMFS is not set # CONFIG_EXAMPLES_SENDMAIL is not set +# CONFIG_EXAMPLES_SERIALBLASTER is not set +# CONFIG_EXAMPLES_SERIALRX is not set # CONFIG_EXAMPLES_SERLOOP is not set # CONFIG_EXAMPLES_SLCD is not set # CONFIG_EXAMPLES_SMART_TEST is not set @@ -878,10 +1080,8 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_THTTPD is not set # CONFIG_EXAMPLES_TIFF is not set # CONFIG_EXAMPLES_TOUCHSCREEN is not set -# CONFIG_EXAMPLES_UDP is not set -# CONFIG_EXAMPLES_UIP is not set +# CONFIG_EXAMPLES_WEBSERVER is not set # CONFIG_EXAMPLES_USBSERIAL is not set -# CONFIG_EXAMPLES_USBMSC is not set # CONFIG_EXAMPLES_USBTERM is not set # CONFIG_EXAMPLES_WATCHDOG is not set @@ -889,12 +1089,15 @@ CONFIG_EXAMPLES_NSH=y # Graphics Support # # CONFIG_TIFF is not set +# CONFIG_GRAPHICS_TRAVELER is not set # # Interpreters # +# CONFIG_INTERPRETERS_BAS is not set # CONFIG_INTERPRETERS_FICL is not set # CONFIG_INTERPRETERS_PCODE is not set +# CONFIG_INTERPRETERS_MICROPYTHON is not set # # Network Utilities @@ -904,17 +1107,14 @@ CONFIG_EXAMPLES_NSH=y # Networking Utilities # # CONFIG_NETUTILS_CODECS is not set -# CONFIG_NETUTILS_DHCPC is not set # CONFIG_NETUTILS_DHCPD is not set # CONFIG_NETUTILS_FTPC is not set # CONFIG_NETUTILS_FTPD is not set # CONFIG_NETUTILS_JSON is not set -# CONFIG_NETUTILS_RESOLV is not set # CONFIG_NETUTILS_SMTP is not set -# CONFIG_NETUTILS_TELNETD is not set # CONFIG_NETUTILS_TFTPC is not set # CONFIG_NETUTILS_THTTPD is not set -# CONFIG_NETUTILS_UIPLIB is not set +# CONFIG_NETUTILS_NETLIB is not set # CONFIG_NETUTILS_WEBCLIENT is not set # @@ -926,15 +1126,32 @@ CONFIG_EXAMPLES_NSH=y # NSH Library # CONFIG_NSH_LIBRARY=y + +# +# Command Line Configuration +# +CONFIG_NSH_READLINE=y +# CONFIG_NSH_CLE is not set +CONFIG_NSH_LINELEN=128 +# CONFIG_NSH_DISABLE_SEMICOLON is not set +CONFIG_NSH_CMDPARMS=y +CONFIG_NSH_MAXARGUMENTS=12 +CONFIG_NSH_ARGCAT=y +CONFIG_NSH_NESTDEPTH=8 +# CONFIG_NSH_DISABLEBG is not set CONFIG_NSH_BUILTIN_APPS=y # # Disable Individual commands # +# CONFIG_NSH_DISABLE_ADDROUTE is not set # CONFIG_NSH_DISABLE_CAT is not set # CONFIG_NSH_DISABLE_CD is not set # CONFIG_NSH_DISABLE_CP is not set +# CONFIG_NSH_DISABLE_CMP is not set # CONFIG_NSH_DISABLE_DD is not set +# CONFIG_NSH_DISABLE_DF is not set +# CONFIG_NSH_DISABLE_DELROUTE is not set # CONFIG_NSH_DISABLE_ECHO is not set # CONFIG_NSH_DISABLE_EXEC is not set # CONFIG_NSH_DISABLE_EXIT is not set @@ -954,9 +1171,7 @@ CONFIG_NSH_BUILTIN_APPS=y # CONFIG_NSH_DISABLE_MH is not set # CONFIG_NSH_DISABLE_MOUNT is not set # CONFIG_NSH_DISABLE_MW is not set -# CONFIG_NSH_DISABLE_NSFMOUNT is not set # CONFIG_NSH_DISABLE_PS is not set -# CONFIG_NSH_DISABLE_PING is not set # CONFIG_NSH_DISABLE_PUT is not set # CONFIG_NSH_DISABLE_PWD is not set # CONFIG_NSH_DISABLE_RM is not set @@ -976,32 +1191,36 @@ CONFIG_NSH_BUILTIN_APPS=y # # CONFIG_NSH_CMDOPT_DF_H is not set CONFIG_NSH_CODECS_BUFSIZE=128 +# CONFIG_NSH_CMDOPT_HEXDUMP is not set CONFIG_NSH_FILEIOSIZE=512 CONFIG_NSH_STRERROR=y -CONFIG_NSH_LINELEN=128 -CONFIG_NSH_MAXARGUMENTS=12 -CONFIG_NSH_NESTDEPTH=8 + +# +# Scripting Support +# # CONFIG_NSH_DISABLESCRIPT is not set -# CONFIG_NSH_DISABLEBG is not set +# CONFIG_NSH_DISABLE_ITEF is not set +# CONFIG_NSH_DISABLE_LOOPS is not set CONFIG_NSH_ROMFSETC=y # CONFIG_NSH_ROMFSRC is not set CONFIG_NSH_ROMFSMOUNTPT="/etc" CONFIG_NSH_INITSCRIPT="init.d/rcS" CONFIG_NSH_ROMFSDEVNO=0 CONFIG_NSH_ROMFSSECTSIZE=128 +# CONFIG_NSH_DEFAULTROMFS is not set CONFIG_NSH_ARCHROMFS=y +# CONFIG_NSH_CUSTOMROMFS is not set CONFIG_NSH_FATDEVNO=1 CONFIG_NSH_FATSECTSIZE=512 CONFIG_NSH_FATNSECTORS=1024 CONFIG_NSH_FATMOUNTPT="/tmp" -CONFIG_NSH_CONSOLE=y -# CONFIG_NSH_USBCONSOLE is not set # -# USB Trace Support +# Console Configuration # -# CONFIG_NSH_USBDEV_TRACE is not set -# CONFIG_NSH_CONDEV is not set +CONFIG_NSH_CONSOLE=y +# CONFIG_NSH_USBCONSOLE is not set +# CONFIG_NSH_ALTCONDEV is not set CONFIG_NSH_ARCHINIT=y # @@ -1009,7 +1228,12 @@ CONFIG_NSH_ARCHINIT=y # # -# System NSH Add-Ons +# Platform-specific Support +# +# CONFIG_PLATFORM_CONFIGDATA is not set + +# +# System Libraries and NSH Add-Ons # # @@ -1018,9 +1242,18 @@ CONFIG_NSH_ARCHINIT=y # CONFIG_SYSTEM_FREE is not set # -# I2C tool +# EMACS-like Command Line Editor # -# CONFIG_SYSTEM_I2CTOOL is not set +# CONFIG_SYSTEM_CLE is not set + +# +# CU Minimal Terminal +# +CONFIG_SYSTEM_CUTERM=y +CONFIG_SYSTEM_CUTERM_DEFAULT_DEVICE="/dev/ttyS0" +CONFIG_SYSTEM_CUTERM_DEFAULT_BAUD=57600 +CONFIG_SYSTEM_CUTERM_STACKSIZE=2048 +CONFIG_SYSTEM_CUTERM_PRIORITY=100 # # FLASH Program Installation @@ -1032,12 +1265,44 @@ CONFIG_NSH_ARCHINIT=y # # CONFIG_SYSTEM_FLASH_ERASEALL is not set +# +# Intel HEX to binary conversion +# +# CONFIG_SYSTEM_HEX2BIN is not set + +# +# I2C tool +# +# CONFIG_SYSTEM_I2CTOOL is not set + +# +# INI File Parser +# +# CONFIG_SYSTEM_INIFILE is not set + +# +# NxPlayer media player library / command Line +# + +# +# RAM test +# +# CONFIG_SYSTEM_RAMTEST is not set + # # readline() # CONFIG_SYSTEM_READLINE=y CONFIG_READLINE_ECHO=y +# +# P-Code Support +# + +# +# PHY Tool +# + # # Power Off # @@ -1053,11 +1318,49 @@ CONFIG_READLINE_ECHO=y # # CONFIG_SYSTEM_SDCARD is not set +# +# Sudoku +# +# CONFIG_SYSTEM_SUDOKU is not set + # # Sysinfo # CONFIG_SYSTEM_SYSINFO=y +CONFIG_SYSTEM_SYSINFO_STACKSIZE=1024 + +# +# Temperature +# + +# +# VI Work-Alike Editor +# +# CONFIG_SYSTEM_VI is not set + +# +# Stack Monitor +# + +# +# USB CDC/ACM Device Commands +# +CONFIG_SYSTEM_CDCACM=y +CONFIG_SYSTEM_CDCACM_DEVMINOR=0 + +# +# USB Composite Device Commands +# + +# +# USB Mass Storage Device Commands +# # # USB Monitor # + +# +# Zmodem Commands +# +# CONFIG_SYSTEM_ZMODEM is not set -- cgit v1.2.3 From a702c6cf025036c906313f496c2b2495d6a8845b Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Tue, 3 Mar 2015 16:30:51 -1000 Subject: Hard Fault Logging - one issue remians reduse memory foot print --- ROMFS/px4fmu_common/init.d/rcS | 14 +- makefiles/config_px4fmu-v2_default.mk | 1 + makefiles/config_px4fmu-v2_multiplatform.mk | 1 + makefiles/config_px4fmu-v2_test.mk | 1 + nuttx-configs/px4fmu-v2/nsh/defconfig | 8 +- src/drivers/boards/px4fmu-v2/px4fmu2_init.c | 261 ++++++++++ src/modules/systemlib/hardfault_log.h | 383 ++++++++++++++ src/systemcmds/hardfault_log/hardfault_log.c | 718 +++++++++++++++++++++++++++ src/systemcmds/hardfault_log/module.mk | 43 ++ 9 files changed, 1427 insertions(+), 3 deletions(-) create mode 100644 src/modules/systemlib/hardfault_log.h create mode 100644 src/systemcmds/hardfault_log/hardfault_log.c create mode 100644 src/systemcmds/hardfault_log/module.mk diff --git a/ROMFS/px4fmu_common/init.d/rcS b/ROMFS/px4fmu_common/init.d/rcS index 38892c475..ced270521 100644 --- a/ROMFS/px4fmu_common/init.d/rcS +++ b/ROMFS/px4fmu_common/init.d/rcS @@ -29,8 +29,18 @@ if mount -t vfat /dev/mmcsd0 /fs/microsd then set LOG_FILE /fs/microsd/bootlog.txt echo "[i] microSD mounted: /fs/microsd" - # Start playing the startup tune - tone_alarm start + if hardfault_log check + then + tone_alarm error + if hardfault_log commit + then + hardfault_log reset + tone_alarm stop + fi + else + # Start playing the startup tune + tone_alarm start + fi else set LOG_FILE /dev/null fi diff --git a/makefiles/config_px4fmu-v2_default.mk b/makefiles/config_px4fmu-v2_default.mk index 37d7cd9c7..c87d7a86d 100644 --- a/makefiles/config_px4fmu-v2_default.mk +++ b/makefiles/config_px4fmu-v2_default.mk @@ -56,6 +56,7 @@ MODULES += systemcmds/perf MODULES += systemcmds/preflight_check MODULES += systemcmds/pwm MODULES += systemcmds/esc_calib +MODULES += systemcmds/hardfault_log MODULES += systemcmds/reboot MODULES += systemcmds/top MODULES += systemcmds/config diff --git a/makefiles/config_px4fmu-v2_multiplatform.mk b/makefiles/config_px4fmu-v2_multiplatform.mk index 29eb68096..b4584bac1 100644 --- a/makefiles/config_px4fmu-v2_multiplatform.mk +++ b/makefiles/config_px4fmu-v2_multiplatform.mk @@ -55,6 +55,7 @@ MODULES += systemcmds/perf MODULES += systemcmds/preflight_check MODULES += systemcmds/pwm MODULES += systemcmds/esc_calib +MODULES += systemcmds/hardfault_log MODULES += systemcmds/reboot MODULES += systemcmds/top MODULES += systemcmds/config diff --git a/makefiles/config_px4fmu-v2_test.mk b/makefiles/config_px4fmu-v2_test.mk index db2bd2305..544aaf05e 100644 --- a/makefiles/config_px4fmu-v2_test.mk +++ b/makefiles/config_px4fmu-v2_test.mk @@ -42,6 +42,7 @@ MODULES += systemcmds/perf MODULES += systemcmds/preflight_check MODULES += systemcmds/pwm MODULES += systemcmds/esc_calib +MODULES += systemcmds/hardfault_log MODULES += systemcmds/reboot MODULES += systemcmds/top MODULES += systemcmds/config diff --git a/nuttx-configs/px4fmu-v2/nsh/defconfig b/nuttx-configs/px4fmu-v2/nsh/defconfig index ba39a3125..aaeb03a08 100644 --- a/nuttx-configs/px4fmu-v2/nsh/defconfig +++ b/nuttx-configs/px4fmu-v2/nsh/defconfig @@ -390,6 +390,12 @@ CONFIG_STM32_I2CTIMEOTICKS=10 # # SDIO Configuration # +CONFIG_STM32_BBSRAM=y +CONFIG_STM32_BBSRAM_FILES=4 +CONFIG_STM32_SAVE_CRASHDUMP=y +CONFIG_BOARD_CRASHDUMP=y +CONFIG_BOARD_RESET_ON_CRASH=y + # CONFIG_RTC_LSECLOCK is not set # CONFIG_RTC_LSICLOCK is not set CONFIG_RTC_HSECLOCK=y @@ -582,7 +588,7 @@ CONFIG_SCHED_LPWORKSTACKSIZE=1800 # # Stack and heap information # -CONFIG_IDLETHREAD_STACKSIZE=3500 +CONFIG_IDLETHREAD_STACKSIZE=380 CONFIG_USERMAIN_STACKSIZE=2600 CONFIG_PTHREAD_STACK_MIN=512 CONFIG_PTHREAD_STACK_DEFAULT=2048 diff --git a/src/drivers/boards/px4fmu-v2/px4fmu2_init.c b/src/drivers/boards/px4fmu-v2/px4fmu2_init.c index 7c4a450ec..98babbf05 100644 --- a/src/drivers/boards/px4fmu-v2/px4fmu2_init.c +++ b/src/drivers/boards/px4fmu-v2/px4fmu2_init.c @@ -49,6 +49,7 @@ #include #include +#include #include #include @@ -70,9 +71,12 @@ #include #include +#include #include #include +#include + #if defined(CONFIG_HAVE_CXX) && defined(CONFIG_HAVE_CXXINITIALIZE) #include #endif @@ -269,6 +273,131 @@ __EXPORT int nsh_archinitialize(void) (hrt_callout)stm32_serial_dma_poll, NULL); +#if defined(CONFIG_STM32_BBSRAM) + + /* NB. the use of the console requires the hrt running + * to poll the DMA + */ + + /* Using Battery Backed Up SRAM */ + + int filesizes[CONFIG_STM32_BBSRAM_FILES+1] = BSRAM_FILE_SIZES; + int nfc = stm32_bbsraminitialize(BBSRAM_PATH, filesizes); + + syslog(LOG_INFO, "[boot] %d Battery Backed Up File(s) \n",nfc); + +#if defined(CONFIG_STM32_SAVE_CRASHDUMP) + + /* Panic Logging in Battery Backed Up Files */ + + /* + * In an ideal world, if a fault happens in flight the + * system save it to BBSRAM will then reboot. Upon + * rebooting, the system will log the fault to disk, recover + * the flight state and continue to fly. But if there is + * a fault on the bench or in the air that prohibit the recovery + * or committing the log to disk, the things are too broken to + * fly. So the question is: + * + * Did we have a hard fault and not make it far enough + * through the boot sequence to commit the fault data to + * the SD card? + */ + + /* Do we have an uncommitted hard fault in BBSRAM? + * - this will be reset after a successful commit to SD + */ + int hadCrash = hardfault_check_status("boot"); + + if (hadCrash == OK) { + + syslog(LOG_INFO, "[boot] There was a hard fault hit the SPACE BAR to halt the system!\n"); + + /* Yes. So add one to the boot count - this will be reset after a successful + * commit to SD + */ + + int reboots = hardfault_increment_reboot("boot",false); + + /* Also end the misery for a user that holds for a key down on the console */ + + int bytesWaiting; + ioctl(fileno(stdin), FIONREAD, (unsigned long)((uintptr_t) &bytesWaiting)); + + if (reboots > 2 || bytesWaiting != 0 ) { + + /* Since we can not commit the fault dump to disk. display it + * to the console. + */ + + hardfault_write("boot", fileno(stdout), HARDFAULT_DISPLAY_FORMAT, false); + + syslog(LOG_INFO, "[boot] There were %d uncommitted Hard faults System halted%s\n", + reboots, + (bytesWaiting==0 ? "" : " Due to Key Press\n")); + + + /* For those of you with a debugger set a break point on up_assert and + * then set dbgContinue = 1 and go. + */ + + /* Clear any key press that got us here */ + + static volatile bool dbgContinue = false; + for (int c ='>'; !dbgContinue; c= getchar()) { + + switch(c) { + + case EOF: + + + case '\n': + case '\r': + case ' ': + continue; + + default: + + putchar(c); + putchar('\n'); + + switch(c) { + + case 'D': + case 'd': + hardfault_write("boot", fileno(stdout), HARDFAULT_DISPLAY_FORMAT, false); + break; + + case 'C': + case 'c': + hardfault_rearm("boot"); + hardfault_increment_reboot("boot",true); + break; + + case 'B': + case 'b': + dbgContinue = true; + break; + + default: + break; + } // Inner Switch + + syslog(LOG_INFO, "\nEnter B - Continue booting\n" \ + "Enter C - Clear the fault log\n" \ + "Enter D - Dump fault log\n\n?>"); + fflush(stdout); + break; + + } // outer switch + } // for + + } // inner if + } // outer if + +#endif // CONFIG_STM32_SAVE_CRASHDUMP +#endif // CONFIG_STM32_BBSRAM + /* initial LED state */ drv_led_start(); led_off(LED_AMBER); @@ -354,3 +483,135 @@ __EXPORT int nsh_archinitialize(void) return OK; } + +__EXPORT void board_crashdump(uint32_t currentsp, void *tcb, uint8_t *filename, int lineno) +{ + /* We need a chunk of ram to save the complete contest in. + * Since we are going to reboot we will use &_sdata + * + */ + fullcontext_s *pdump = (fullcontext_s*)&_sdata; + + (void)irqsave(); + + struct tcb_s *rtcb = (struct tcb_s *)tcb; + + /* Zero out everything */ + + memset(pdump,0,sizeof(fullcontext_s)); + + /* Save Info */ + + pdump->info.lineno = lineno; + + if (filename) { + + int offset = 0; + unsigned int len = strlen((char*)filename) + 1; + if (len > sizeof(pdump->info.filename)) { + offset = len - sizeof(pdump->info.filename) ; + } + strncpy(pdump->info.filename, (char*)&filename[offset], sizeof(pdump->info.filename)); + } + + /* Save the value of the pointer for current_regs as debugging info. + * It should be NULL in case of an ASSERT and will aid in cross + * checking the validity of system memory at the time of the + * fault. + */ + + pdump->info.current_regs = (uintptr_t) current_regs; + + /* Save Context */ + + /* If not NULL then we are in an interrupt context and the user context + * is in current_regs else we are running in the users context + */ + +#if CONFIG_TASK_NAME_SIZE > 0 + strncpy(pdump->context.proc.name, rtcb->name, CONFIG_TASK_NAME_SIZE); +#endif + + pdump->context.proc.pid = rtcb->pid; + + pdump->context.stack.current_sp = currentsp; + + if (current_regs) + { + pdump->info.stuff |= eRegs; + memcpy(&pdump->context.proc.xcp.regs, (void*)current_regs, sizeof(pdump->context.proc.xcp.regs)); + currentsp = pdump->context.proc.xcp.regs[REG_R13]; + } + + + pdump->context.stack.itopofstack = (uint32_t) &g_intstackbase;; + pdump->context.stack.istacksize = (CONFIG_ARCH_INTERRUPTSTACK & ~3); + + if (pdump->context.proc.pid == 0) { + + pdump->context.stack.utopofstack = g_idle_topstack - 4; + pdump->context.stack.ustacksize = CONFIG_IDLETHREAD_STACKSIZE; + + } else { + pdump->context.stack.utopofstack = (uint32_t) rtcb->adj_stack_ptr; + pdump->context.stack.ustacksize = (uint32_t) rtcb->adj_stack_size;; + } + +#if CONFIG_ARCH_INTERRUPTSTACK > 3 + + /* Get the limits on the interrupt stack memory */ + + pdump->context.stack.itopofstack = (uint32_t)&g_intstackbase; + pdump->context.stack.istacksize = (CONFIG_ARCH_INTERRUPTSTACK & ~3); + + /* If the current stack pointer is within the interrupt stack then + * save the interrupt stack data centered about the interrupt stack pointer + */ + + if (pdump->context.stack.current_sp <= pdump->context.stack.itopofstack && + pdump->context.stack.current_sp > pdump->context.stack.itopofstack - pdump->context.stack.istacksize) + { + pdump->info.stuff |= eIntStack; + memcpy(&pdump->istack, (void *)(pdump->context.stack.current_sp-sizeof(pdump->istack)/2), + sizeof(pdump->istack)); + } + +#endif + + /* If the saved context of the interrupted process's stack pointer lies within the + * allocated user stack memory then save the user stack centered about the user sp + */ + if (currentsp <= pdump->context.stack.utopofstack && + currentsp > pdump->context.stack.utopofstack - pdump->context.stack.ustacksize) + { + pdump->info.stuff |= eUserStack; + memcpy(&pdump->ustack, (void *)(currentsp-sizeof(pdump->ustack)/2), sizeof(pdump->ustack)); + } + + /* Oh boy we have a real hot mess on our hands so save above and below the + * current sp + */ + + if ((pdump->info.stuff & eStackValid) == 0) + { + pdump->info.stuff |= eStackUnknown; +#if CONFIG_ARCH_INTERRUPTSTACK > 3 + /* sp and above in istack */ + memcpy(&pdump->istack, (void *)pdump->context.stack.current_sp, sizeof(pdump->istack)); + /* below in ustack */ + memcpy(&pdump->ustack, (void *)(pdump->context.stack.current_sp-sizeof(pdump->ustack)), + sizeof(pdump->ustack)); +#else + /* save above and below in ustack */ + memcpy(&pdump->ustack, (void *)(pdump->context.stack.current_sp-sizeof(pdump->ustack)/2), + sizeof(pdump->ustack)/2); +#endif + } + + stm32_bbsram_savepanic(HARDFAULT_FILENO, (uint8_t*)pdump, sizeof(fullcontext_s)); + + +#if defined(CONFIG_BOARD_RESET_ON_CRASH) + systemreset(false); +#endif +} diff --git a/src/modules/systemlib/hardfault_log.h b/src/modules/systemlib/hardfault_log.h new file mode 100644 index 000000000..2161103a1 --- /dev/null +++ b/src/modules/systemlib/hardfault_log.h @@ -0,0 +1,383 @@ +/**************************************************************************** + * + * Copyright (C) 2015 PX4 Development Team. All rights reserved. + * Author: @author David Sidrane + * + * 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 +/**************************************************************************** + * Included Files + ****************************************************************************/ +#include +#include + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ +#define FREEZE_STR(s) #s +#define STRINGIFY(s) FREEZE_STR(s) +#define HARDFAULT_FILENO 3 +#define HARDFAULT_PATH BBSRAM_PATH""STRINGIFY(HARDFAULT_FILENO) +#define HARDFAULT_REBOOT_FILENO 0 +#define HARDFAULT_REBOOT_PATH BBSRAM_PATH""STRINGIFY(HARDFAULT_REBOOT_FILENO) + + +#define BBSRAM_SIZE_FN0 (sizeof(int)) +#define BBSRAM_SIZE_FN1 384 /* greater then 2.5 times the size of vehicle_status_s */ +#define BBSRAM_SIZE_FN2 384 /* greater then 2.5 times the size of vehicle_status_s */ +#define BBSRAM_SIZE_FN3 -1 + +/* The following guides in the amount of the user and interrupt stack + * data we can save. The amount of storage left will dictate the actual + * number of entries of the user stack data saved. If it is too big + * It will be truncated by the call to stm32_bbsram_savepanic + */ +#define BBSRAM_HEADER_SIZE 20 /* This is an assumption */ +#define BBSRAM_USED ((4*BBSRAM_HEADER_SIZE)+(BBSRAM_SIZE_FN0+BBSRAM_SIZE_FN1+BBSRAM_SIZE_FN2)) +#define BBSRAM_REAMINING (STM32_BBSRAM_SIZE-BBSRAM_USED) +#if CONFIG_ARCH_INTERRUPTSTACK <= 3 +# define BBSRAM_NUMBER_STACKS 1 +#else +# define BBSRAM_NUMBER_STACKS 2 +#endif +#define BBSRAM_FIXED_ELEMENTS_SIZE (sizeof(context_s)+sizeof(info_s)) +#define BBSRAM_LEFTOVER (BBSRAM_REAMINING-BBSRAM_FIXED_ELEMENTS_SIZE) + +#define CONFIG_ISTACK_SIZE (BBSRAM_LEFTOVER/BBSRAM_NUMBER_STACKS/sizeof(stack_word_t)) +#define CONFIG_USTACK_SIZE (BBSRAM_LEFTOVER/BBSRAM_NUMBER_STACKS/sizeof(stack_word_t)) + +/* The path to the Battery Backed up SRAM */ +#define BBSRAM_PATH "/fs/bbr" +/* The sizes of the files to create (-1) use rest of BBSRAM memory */ +#define BSRAM_FILE_SIZES { \ + BBSRAM_SIZE_FN0, /* For Time stamp only */ \ + BBSRAM_SIZE_FN1, /* For Current Flight Parameters Copy A */ \ + BBSRAM_SIZE_FN2, /* For Current Flight Parameters Copy B*/ \ + BBSRAM_SIZE_FN3, /* For the Panic Log use rest of space */ \ + 0 /* End of table marker */ \ +} + +/* For Assert keep this much of the file name*/ +#define MAX_FILE_PATH_LENGTH 40 + + +/* Fixed size strings + * To change a format add the number of chars not represented by the format + * Specifier to the xxxx_NUM definei.e %Y is YYYY so add 2 and %s is -2 + * Also xxxxTIME_FMT need to match in size. See CCASERT in hardfault_log.c + */ +#define LOG_PATH_BASE "/fs/microsd/" +#define LOG_PATH_BASE_LEN ((arraySize(LOG_PATH_BASE))-1) + +#define LOG_NAME_FMT "fault_%s.log" +#define LOG_NAME_NUM ( -2 ) +#define LOG_NAME_LEN ((arraySize(LOG_NAME_FMT)-1) + LOG_NAME_NUM) + +#define TIME_FMT "%Y_%m_%d_%H_%M_%S" +#define TIME_FMT_NUM (2+ 0+ 0+ 0+ 0+ 0) +#define TIME_FMT_LEN (((arraySize(TIME_FMT)-1) + TIME_FMT_NUM)) + +#define LOG_PATH_LEN ((LOG_PATH_BASE_LEN + LOG_NAME_LEN + TIME_FMT_LEN)) + +#define HEADER_TIME_FMT "%Y-%m-%d-%H:%M:%S" +#define HEADER_TIME_FMT_NUM (2+ 0+ 0+ 0+ 0+ 0) +#define HEADER_TIME_FMT_LEN (((arraySize(HEADER_TIME_FMT)-1) + HEADER_TIME_FMT_NUM)) + +/* Select which format to use. On a terminal the details are at the bottom + * and in a file they are at the top + */ +#define HARDFAULT_DISPLAY_FORMAT 1 +#define HARDFAULT_FILE_FORMAT 0 + +/**************************************************************************** + * Public Types + ****************************************************************************/ +#undef EXTERN +#if defined(__cplusplus) +#define EXTERN extern "C" +extern "C" +{ +#else +#define EXTERN extern +#endif + +/* Used for stack frame storage */ +typedef uint32_t stack_word_t; + +typedef struct { + int pid; /* Process ID */ + struct xcptcontext xcp; /* Interrupt register save area */ +#if CONFIG_TASK_NAME_SIZE > 0 + char name[CONFIG_TASK_NAME_SIZE+1]; /* Task name (with NULL terminator) */ +#endif +} process_t; + +/* Stack related data */ +typedef struct { + uint32_t current_sp; /* The stack the up_assert is running on + * it may be either the user stack for an assertion + * failure or the interrupt stack in the case of a + * hard fault + */ + uint32_t utopofstack; /* Top of the user stack at the time of the + * up_assert + */ + uint32_t ustacksize; /* Size of the user stack at the time of the + * up_assert + */ + +#if CONFIG_ARCH_INTERRUPTSTACK > 3 + + uint32_t itopofstack; /* Top of the interrupt stack at the time of the + * up_assert + */ + uint32_t istacksize; /* Size of the interrupt stack at the time of the + * up_assert + */ +#endif + +} stack_t; + +/* Not Used for reference only */ + +typedef struct +{ + uint32_t r0; + uint32_t r1; + uint32_t r2; + uint32_t r3; + uint32_t r4; + uint32_t r5; + uint32_t r6; + uint32_t r7; + uint32_t r8; + uint32_t r9; + uint32_t r10; + uint32_t r11; + uint32_t r12; + uint32_t sp; + uint32_t lr; + uint32_t pc; + uint32_t xpsr; + uint32_t d0; + uint32_t d1; + uint32_t d2; + uint32_t d3; + uint32_t d4; + uint32_t d5; + uint32_t d6; + uint32_t d7; + uint32_t d8; + uint32_t d9; + uint32_t d10; + uint32_t d11; + uint32_t d12; + uint32_t d13; + uint32_t d14; + uint32_t d15; + uint32_t fpscr; + uint32_t sp_main; + uint32_t sp_process; + uint32_t apsr; + uint32_t ipsr; + uint32_t epsr; + uint32_t primask; + uint32_t basepri; + uint32_t faultmask; + uint32_t control; + uint32_t s0; + uint32_t s1; + uint32_t s2; + uint32_t s3; + uint32_t s4; + uint32_t s5; + uint32_t s6; + uint32_t s7; + uint32_t s8; + uint32_t s9; + uint32_t s10; + uint32_t s11; + uint32_t s12; + uint32_t s13; + uint32_t s14; + uint32_t s15; + uint32_t s16; + uint32_t s17; + uint32_t s18; + uint32_t s19; + uint32_t s20; + uint32_t s21; + uint32_t s22; + uint32_t s23; + uint32_t s24; + uint32_t s25; + uint32_t s26; + uint32_t s27; + uint32_t s28; + uint32_t s29; + uint32_t s30; + uint32_t s31; +} proc_regs_s; + + +/* Flags to identify what is in the dump */ +typedef enum { + eRegs = 0x01, + eUserStack = 0x02, + eIntStack = 0x04, + eStackUnknown = 0x08, + eStackValid = eUserStack | eIntStack, +} stuff_t; + +typedef struct { + stuff_t stuff; /* What is in the dump */ + uintptr_t current_regs; /* Used to validate the dump */ + int lineno; /* __LINE__ to up_assert */ + char filename[MAX_FILE_PATH_LENGTH]; /* Last MAX_FILE_PATH_LENGTH of chars in + * __FILE__ to up_assert + */ +} info_s; + +typedef struct { /* The Context data */ + stack_t stack; + process_t proc; +} context_s; + +typedef struct { + info_s info; /* Then info */ + context_s context; /* The Context data */ +#if CONFIG_ARCH_INTERRUPTSTACK > 3 /* The amount of stack data is compile time + * sized backed on what is left after the + * other BBSRAM files are defined + * The order is such that only the + * ustack should be truncated + */ + stack_word_t istack[CONFIG_USTACK_SIZE]; +#endif + stack_word_t ustack[CONFIG_ISTACK_SIZE]; +} fullcontext_s; + +/**************************************************************************** + * Name: hardfault_check_status + * + * Description: + * Check the status of the BBSRAM hard fault file which can be in + * one of two states Armed, Valid or Broken. + * + * Armed - The file in the armed state is not accessible in the fs + * the act of unlinking it is what arms it. + * + * Valid - The file in the armed state is not accessible in the fs + * the act of unlinking it is what arms it. + * + * Inputs: + * - caller: A label to display in syslog output + * + * Returned Value: + * -ENOENT Armed - The file in the armed state + * OK Valid - The file contains data from a fault that has not + * been committed to disk (see write_hardfault). + * - Any < 0 Broken - Should not happen + * + ****************************************************************************/ +int hardfault_check_status(char *caller); + +/**************************************************************************** + * Name: hardfault_write + * + * Description: + * Will parse and write a human readable output of the data + * in the BBSRAM file. Once + * + * + * Inputs: + * - caller: A label to display in syslog output + * - fd: An FD to write the data to + * - format: Select which format to use. + * + * HARDFAULT_DISPLAY_FORMAT On the console the details are + * at the bottom + * HARDFAULT_FILE_FORMAT In a file details are at the top + * of the log file + * + * - rearm: If true will move the file to the Armed state, if + * false the file is not armed and can be read again + * + * Returned Value: + * + * OK or errno + * + * + ****************************************************************************/ +int hardfault_write(char *caller, int fd, int format, bool rearm); + +/**************************************************************************** + * Name: hardfault_rearm + * + * Description: + * Will move the file to the Armed state + * + * + * Inputs: + * - caller: A label to display in syslog output + * + * Returned Value: + * + * OK or errno + * + * + ****************************************************************************/ +int hardfault_rearm(char *caller); + +/**************************************************************************** + * Name: hardfault_increment_reboot + * + * Description: + * Will increment the reboot counter. The reboot counter will help + * detect reboot loops. + * + * + * Inputs: + * - caller: A label to display in syslog output + * - reset : when set will reset the reboot counter to 0. + * + * Returned Value: + * + * The current value of the reboot counter (post increment). + * + * + ****************************************************************************/ +int hardfault_increment_reboot(char *caller, bool reset); + +#if defined(__cplusplus) +extern "C" +} +#endif + diff --git a/src/systemcmds/hardfault_log/hardfault_log.c b/src/systemcmds/hardfault_log/hardfault_log.c new file mode 100644 index 000000000..e8f37335b --- /dev/null +++ b/src/systemcmds/hardfault_log/hardfault_log.c @@ -0,0 +1,718 @@ +/**************************************************************************** + * + * Copyright (C) 2015 PX4 Development Team. All rights reserved. + * Author: @author David Sidrane + * + * 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include + + +/**************************************************************************** + * Public Function Prototypes + ****************************************************************************/ +__EXPORT int hardfault_log_main(int argc, char *argv[]); + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Private Types + ****************************************************************************/ + +/**************************************************************************** + * Private Function Prototypes + ****************************************************************************/ +static int genfault(int fault); +/**************************************************************************** + * Private Data + ****************************************************************************/ +/**************************************************************************** + * Public Data + ****************************************************************************/ + +/**************************************************************************** + * Private Functions + ****************************************************************************/ +/**************************************************************************** + * genfault + ****************************************************************************/ + +static int genfault(int fault) +{ + + /* Pointer to System Control Block's System Control Register */ + + uint32_t *pCCR = (uint32_t *)0xE000ED14; + + static volatile int k = 0; + + switch(fault) + { + case 0: + + /* Enable divide by 0 fault generation */ + + *pCCR |= 0x10; + + k = 1 / fault; + + /* This is not going to happen + * Enable divide by 0 fault generation + */ + + *pCCR &= ~0x10; + break; + + case 1: + ASSERT( fault== 0); + /* This is not going to happen */ + break; + + case 2: + printf("null %s\n",NULL); + /* This is not going to happen */ + break; + + case 3: + { + char marker[20]; + strncpy(marker, "<-- ", sizeof(marker)); + printf("nill %s\n",""); + printf("nill fault==3 %s\n",(fault==3) ? "3" : ""); + printf("nill fault!=3 %s\n",(fault!=3) ? "3" : ""); + printf("0x%08x 0x%08x%s\n", fault, -fault, (fault==3) ? "" : marker); + printf("0x%08x 0x%08x%s\n", fault, -fault, (fault!=3) ? "" : marker); + printf("0x%08x 0x%08x%s\n", fault, -fault, fault==3 ? "" : marker); + printf("0x%08x 0x%08x%s\n", fault, -fault, fault!=3 ? "" : marker); + } + /* This is not going to happen */ + break; + + default: + break; + + } + UNUSED(k); + return OK; +} + + +/**************************************************************************** + * format_fault_time + ****************************************************************************/ +/* Ensure Size is the same foe formats or rewrite this */ +CCASSERT(TIME_FMT_LEN==HEADER_TIME_FMT_LEN); +static int format_fault_time(char *format, struct timespec *ts, char *buffer, unsigned int maxsz) +{ + int ret = -EINVAL; + if (buffer != NULL && format != NULL) { + ret = -ENOMEM; + if (maxsz >= TIME_FMT_LEN + 1 ) { + struct tm tt; + time_t time_sec = ts->tv_sec + (ts->tv_nsec / 1e9); + gmtime_r(&time_sec, &tt); + if (TIME_FMT_LEN == strftime(buffer, maxsz, format , &tt)) { + ret = OK; + } + } + } + return ret; +} + +/**************************************************************************** + * format_fault_file_name + ****************************************************************************/ + +static int format_fault_file_name(struct timespec *ts, char *buffer, unsigned int maxsz) +{ + char fmtbuff[ TIME_FMT_LEN + 1]; + int ret = -EINVAL; + + if (buffer) { + + ret = -ENOMEM; + unsigned int plen = LOG_PATH_BASE_LEN; + if (maxsz >= LOG_PATH_LEN) { + strncpy(buffer, LOG_PATH_BASE, plen); + maxsz -= plen; + int rv = format_fault_time(TIME_FMT,ts, fmtbuff, arraySize(fmtbuff)); + if (rv == OK) { + int n = snprintf(&buffer[plen], maxsz , LOG_NAME_FMT, fmtbuff); + if (n == (int) LOG_NAME_LEN + TIME_FMT_LEN) { + ret = OK; + } + } + } + } + return ret; +} + +/**************************************************************************** + * identify + ****************************************************************************/ +static void identify(char *caller) +{ + if (caller) { + syslog(LOG_INFO, "[%s] ", caller); + } +} + + +/**************************************************************************** + * hardfault_get_desc + ****************************************************************************/ +static int hardfault_get_desc(char *caller, struct bbsramd_s *desc, bool silent) +{ + int ret = -ENOENT; + int fd = open(HARDFAULT_PATH, O_RDONLY); + if (fd < 0 ) { + if (!silent) { + identify(caller); + syslog(LOG_INFO, "Failed to open Fault Log file [%s] (%d)\n", HARDFAULT_PATH, fd); + } + } else { + ret = -EIO; + int rv = ioctl(fd, STM32_BBSRAM_GETDESC_IOCTL, (unsigned long)((uintptr_t)desc)); + if (rv >= 0) { + ret = fd; + } else { + identify(caller); + syslog(LOG_INFO, "Failed to get Fault Log descriptor (%d)\n",rv); + } + } + return ret; +} + +/**************************************************************************** + * write_stack_detail + ****************************************************************************/ +static void write_stack_detail(int size, uint32_t topaddr, uint32_t spaddr, + uint32_t botaddr, char *sp_name, char *buffer, int max, int fd) +{ + + int n = 0; + n = snprintf(&buffer[n], max-n, " %s stack:\n",sp_name); + n += snprintf(&buffer[n], max-n, " top: 0x%08x\n", topaddr); + n += snprintf(&buffer[n], max-n, " sp: 0x%08x\n", spaddr); + write(fd, buffer,n); + n = 0; + n += snprintf(&buffer[n], max-n, " bottom: 0x%08x\n", botaddr); + n += snprintf(&buffer[n], max-n, " size: 0x%08x\n", size); + write(fd, buffer,n); +#ifndef CONFIG_STACK_COLORATION + FAR struct tcb_s tcb; + tcb.stack_alloc_ptr = (void*) botaddr; + tcb.adj_stack_size = size; + n = snprintf(buffer, max, " used: %08x\n", up_check_tcbstack(&tcb)); + write(fd, buffer,n); +#endif +} + +/**************************************************************************** + * write_stack + ****************************************************************************/ +static void write_stack(stack_word_t *swindow, int winsize, uint32_t wtopaddr, + uint32_t topaddr, uint32_t spaddr, uint32_t botaddr, + char *sp_name, char *buffer, int max, int fd) +{ + char marker[30]; + for (int i = winsize; i >= 0; i--) { + if (wtopaddr == topaddr) { + strncpy(marker, "<-- ", sizeof(marker)); + strncat(marker, sp_name, sizeof(marker)); + strncat(marker, " top", sizeof(marker)); + } else if (wtopaddr == spaddr) { + strncpy(marker, "<-- ", sizeof(marker)); + strncat(marker, sp_name, sizeof(marker)); + } else if (wtopaddr == botaddr) { + strncpy(marker, "<-- ", sizeof(marker)); + strncat(marker, sp_name, sizeof(marker)); + strncat(marker, " bottom", sizeof(marker)); + } else { + marker[0] = '\0'; + } + int n = snprintf(buffer, max,"0x%08x 0x%08x%s\n", wtopaddr, swindow[i], marker); + write(fd, buffer,n); + wtopaddr--; + } +} + +/**************************************************************************** + * write_registers + ****************************************************************************/ +static void write_registers(fullcontext_s* fc, char *buffer, int max, int fd) +{ + int n = snprintf(buffer, max, " r0:0x%08x r1:0x%08x r2:0x%08x r3:0x%08x r4:0x%08x r5:0x%08x r6:0x%08x r7:0x%08x\n", + fc->context.proc.xcp.regs[REG_R0], fc->context.proc.xcp.regs[REG_R1], + fc->context.proc.xcp.regs[REG_R2], fc->context.proc.xcp.regs[REG_R3], + fc->context.proc.xcp.regs[REG_R4], fc->context.proc.xcp.regs[REG_R5], + fc->context.proc.xcp.regs[REG_R6], fc->context.proc.xcp.regs[REG_R7]); + + write(fd, buffer,n); + n = snprintf(buffer, max, " r8:0x%08x r9:0x%08x r10:0x%08x r11:0x%08x r12:0x%08x sp:0x%08x lr:0x%08x pc:0x%08x\n", + fc->context.proc.xcp.regs[REG_R8], fc->context.proc.xcp.regs[REG_R9], + fc->context.proc.xcp.regs[REG_R10], fc->context.proc.xcp.regs[REG_R11], + fc->context.proc.xcp.regs[REG_R12], fc->context.proc.xcp.regs[REG_R13], + fc->context.proc.xcp.regs[REG_R14], fc->context.proc.xcp.regs[REG_R15]); + + write(fd, buffer,n); + +#ifdef CONFIG_ARMV7M_USEBASEPRI + n = snprintf(buffer, max, " xpsr:0x%08x basepri:0x%08x control:0x%08x\n", + fc->context.proc.xcp.regs[REG_XPSR], fc->context.proc.xcp.regs[REG_BASEPRI], + getcontrol()); +#else + n = snprintf(buffer, max, " xpsr:0x%08x primask:0x%08x control:0x%08x\n", + fc->context.proc.xcp.regs[REG_XPSR], fc->context.proc.xcp.regs[REG_PRIMASK], + getcontrol()); +#endif + write(fd, buffer,n); + +#ifdef REG_EXC_RETURN + n = snprintf(buffer, max, " exe return:0x%08x\n", fc->context.proc.xcp.regs[REG_EXC_RETURN]); + write(fd, buffer,n); +#endif +} + +/**************************************************************************** + * write_registers_info + ****************************************************************************/ +static int write_registers_info(int fdout, fullcontext_s *fc, char *buffer, + int sz) +{ + int ret = -ENOENT; + if (fc->info.stuff & eRegs) { + int n = snprintf(buffer, sz, " Processor registers: from 0x%08x\n", fc->info.current_regs); + write(fdout, buffer,n); + write_registers(fc, buffer, sz, fdout); + ret = OK; + } + return ret; +} + +/**************************************************************************** + * write_interrupt_stack_info + ****************************************************************************/ +static int write_interrupt_stack_info(int fdout, fullcontext_s *fc, char *buffer, + unsigned int sz) +{ + int ret = -ENOENT; + if (fc->info.stuff & eIntStack) { + write_stack_detail(fc->context.stack.istacksize, + fc->context.stack.itopofstack, + fc->context.stack.current_sp, + fc->context.stack.itopofstack - fc->context.stack.istacksize, + "IRQ", + buffer, sz, fdout); + ret = OK; + } + return ret; +} + +/**************************************************************************** + * write_user_stack_info + ****************************************************************************/ +static int write_user_stack_info(int fdout, fullcontext_s *fc, char *buffer, + unsigned int sz) +{ + int ret = -ENOENT; + if (fc->info.stuff & eUserStack) { + write_stack_detail(fc->context.stack.ustacksize, + fc->context.stack.utopofstack, + fc->context.proc.xcp.regs[REG_R13], + fc->context.stack.utopofstack - fc->context.stack.ustacksize, + "User", + buffer, sz, fdout); + ret = OK; + } + return ret; +} + +/**************************************************************************** + * write_dump_info + ****************************************************************************/ +static void write_dump_info(int fdout, fullcontext_s *fc, struct timespec *ts, + char *buffer, unsigned int sz) +{ + char fmtbuff[ TIME_FMT_LEN + 1]; + format_fault_time(HEADER_TIME_FMT, ts, fmtbuff, sizeof(fmtbuff)); + + bool isFault = (fc->info.current_regs != 0 || fc->context.proc.pid == 0); + int n; + n = snprintf(buffer, sz, "System fault Occurred on: %s\n", fmtbuff); + write(fdout, buffer, n); + if (isFault) { + n = snprintf(buffer, sz, " Type:Hard Fault"); + } else { + n = snprintf(buffer, sz, " Type:Assertion failed"); + } + write(fdout, buffer, n); + +#ifdef CONFIG_TASK_NAME_SIZE + n = snprintf(buffer, sz, " in file:%s at line: %d running task: %s\n", + fc->info.filename, fc->info.lineno, fc->context.proc.name); +#else + n = snprintf(buffer, sz, " in file:%s at line: %d \n", + fc->info.filename, fc->info.lineno); +#endif + write(fdout, buffer, n); + n = snprintf(buffer, sz, " FW git-hash: %s\n", FW_GIT); + write(fdout, buffer, n); + n = snprintf(buffer, sz, " Build datetime: %s %s\n", __DATE__, __TIME__); + write(fdout, buffer, n); + +} + +/**************************************************************************** + * write_dump_time + ****************************************************************************/ +static void write_dump_time(char *caller, char *tag, int fdout, + struct timespec *ts, char *buffer, unsigned int sz) +{ + char fmtbuff[ TIME_FMT_LEN + 1]; + format_fault_time(HEADER_TIME_FMT, ts, fmtbuff, sizeof(fmtbuff)); + int n = snprintf(buffer, sz, "[%s] -- %s %s Fault Log --\n",caller, fmtbuff, tag); + write(fdout, buffer, n); +} +/**************************************************************************** + * write_dump_footer + ****************************************************************************/ +static void write_dump_header(char * caller, int fdout, struct timespec *ts, + char *buffer, unsigned int sz) +{ + write_dump_time(caller, "Begin", fdout, ts, buffer, sz); +} +/**************************************************************************** + * write_dump_footer + ****************************************************************************/ +static void write_dump_footer(char * caller, int fdout, struct timespec *ts, + char *buffer, unsigned int sz) +{ + write_dump_time(caller, "END", fdout, ts, buffer, sz); +} +/**************************************************************************** + * write_intterupt_satck + ****************************************************************************/ +static int write_intterupt_stack(int fdout, fullcontext_s *fc, char *buffer, + unsigned int sz) +{ + int ret = -ENOENT; + if ((fc->info.stuff & eIntStack) != 0) { + int winsize = arraySize(fc->istack); + int wtopaddr = fc->context.stack.current_sp + winsize/2; + write_stack(fc->istack, winsize, wtopaddr, + fc->context.stack.itopofstack, + fc->context.stack.current_sp, + fc->context.stack.itopofstack - fc->context.stack.istacksize, + "Interrupt sp", buffer, sz, fdout); + ret = OK; + } + + return ret; +} + + +/**************************************************************************** + * write_user_stack + ****************************************************************************/ +static int write_user_stack(int fdout, fullcontext_s *fc, char *buffer, + unsigned int sz) +{ + int ret = -ENOENT; + if ((fc->info.stuff & eUserStack) != 0) { + int winsize = arraySize(fc->ustack); + int wtopaddr = fc->context.proc.xcp.regs[REG_R13] + winsize/2; + write_stack(fc->ustack, winsize, wtopaddr, + fc->context.stack.utopofstack, + fc->context.proc.xcp.regs[REG_R13], + fc->context.stack.utopofstack - fc->context.stack.ustacksize, + "User sp", buffer, sz, fdout); + ret = OK; + } + + return ret; +} + +/**************************************************************************** + * commit + ****************************************************************************/ +static int hardfault_commit(char *caller) +{ + int ret = -ENOENT; + int state = -1; + struct bbsramd_s desc; + char path[LOG_PATH_LEN+1]; + ret = hardfault_get_desc(caller, &desc, false); + if (ret >= 0) { + int fd = ret; + state = (desc.lastwrite.tv_sec || desc.lastwrite.tv_nsec) ? OK : 1; + int rv = close(fd); + if (rv < 0) { + identify(caller); + syslog(LOG_INFO, "Failed to Close Fault Log (%d)\n",rv); + } else { + if (state != OK) { + identify(caller); + syslog(LOG_INFO, "Nothing to save\n",path); + ret = -ENOENT; + } else { + ret = format_fault_file_name(&desc.lastwrite, path, arraySize(path)); + if (ret == OK) { + int fdout = open(path, O_RDWR | O_CREAT); + if (fdout > 0) { + identify(caller); + syslog(LOG_INFO, "Saving Fault Log file %s\n",path); + ret = hardfault_write(caller, fdout, HARDFAULT_FILE_FORMAT, true); + identify(caller); + syslog(LOG_INFO, "Done saving Fault Log file\n"); + close(fdout); + } + + } + } + } + } + return ret; +} + +/**************************************************************************** + * Public Functions + ****************************************************************************/ +/**************************************************************************** + * hardfault_rearm + ****************************************************************************/ +__EXPORT int hardfault_rearm(char *caller) +{ + int ret = OK; + int rv = unlink(HARDFAULT_PATH); + if (rv < 0) { + identify(caller); + syslog(LOG_INFO, "Failed to re arming Fault Log (%d)\n",rv); + ret = -EIO; + } else { + identify(caller); + syslog(LOG_INFO, "Fault Log is Armed\n"); + } + return ret; +} + +/**************************************************************************** + * hardfault_check_status + ****************************************************************************/ +__EXPORT int hardfault_check_status(char *caller) +{ + int state = -1; + struct bbsramd_s desc; + int ret = hardfault_get_desc(caller, &desc, true); + if (ret < 0) { + identify(caller); + if (ret == -ENOENT) { + syslog(LOG_INFO, "Fault Log is Armed\n"); + } else { + syslog(LOG_INFO, "Failed to open Fault Log file [%s] (%d)\n", HARDFAULT_PATH, ret); + } + } else { + int fd = ret; + state = (desc.lastwrite.tv_sec || desc.lastwrite.tv_nsec) ? OK : 1; + int rv = close(fd); + if (rv < 0) { + identify(caller); + syslog(LOG_INFO, "Failed to Close Fault Log (%d)\n",rv); + } else { + ret = state; + identify(caller); + syslog(LOG_INFO, "Fault Log info File No %d Length %d flags:0x%02x state:%d\n", + (unsigned int)desc.fileno, (unsigned int) desc.len, (unsigned int)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); + syslog(LOG_INFO, "Fault Logged on %s - Valid\n",buf); + } else { + rv = hardfault_rearm(caller); + if (rv < 0) { + ret = rv; + } + } + } + } + return ret; +} + +/**************************************************************************** + * hardfault_increment_reboot + ****************************************************************************/ +__EXPORT int hardfault_increment_reboot(char *caller, bool reset) +{ + int ret = -EIO; + int count = 0; + int fd = open(HARDFAULT_REBOOT_PATH, O_RDWR | O_CREAT); + if (fd < 0) { + identify(caller); + syslog(LOG_INFO, "Failed to open Fault reboot count file [%s] (%d)\n", HARDFAULT_REBOOT_PATH, ret); + } else { + if (!reset) { + read(fd, &count, sizeof(count)); + lseek(fd, 0, SEEK_SET); + count++; + } + ret = write(fd, &count, sizeof(count)); + close(fd); + ret = count; + } + return ret; +} +/**************************************************************************** + * hardfault_write + ****************************************************************************/ +fullcontext_s dump; + +__EXPORT int hardfault_write(char *caller, int fd, int format, bool rearm) +{ + char line[200]; + memset(&dump,0,sizeof(dump)); + struct bbsramd_s desc; + int ret = hardfault_get_desc(caller, &desc, false); + if (ret >= 0) { + int hffd = ret; + ret = read(hffd, (char *)&dump, sizeof(dump)); + if (ret < 0) { + identify(caller); + syslog(LOG_INFO, "Failed to read Fault Log file [%s] (%d)\n", HARDFAULT_PATH, ret); + } else { + ret = close(hffd); + if (ret < 0) { + identify(caller); + syslog(LOG_INFO, "Failed to Close Fault Log (%d)\n", ret); + + } else { + + switch(format) { + case HARDFAULT_DISPLAY_FORMAT: + write_dump_header(caller, fd, &desc.lastwrite,line, arraySize(line)); + write_intterupt_stack(fd, &dump, line, arraySize(line)); + write_user_stack(fd, &dump, line, arraySize(line)); + write_dump_info(fd, &dump, &desc.lastwrite, line, arraySize(line)); + write_registers_info(fd, &dump, line, arraySize(line)); + write_interrupt_stack_info(fd, &dump, line, arraySize(line)); + write_user_stack_info(fd, &dump, line, arraySize(line)); + break; + + case HARDFAULT_FILE_FORMAT: + write_dump_header(caller, fd, &desc.lastwrite,line, arraySize(line)); + write_dump_info(fd, &dump, &desc.lastwrite, line, arraySize(line)); + write_registers_info(fd, &dump, line, arraySize(line)); + write_interrupt_stack_info(fd, &dump, line, arraySize(line)); + write_user_stack_info(fd, &dump,line, arraySize(line)); + write_intterupt_stack(fd, &dump,line, arraySize(line)); + write_user_stack(fd, &dump, line, arraySize(line)); + break; + + default: + return -EINVAL; + break; + } + + write_dump_footer(caller, fd, &desc.lastwrite,line, arraySize(line)); + + if (rearm) { + ret = hardfault_rearm(caller); + + } + } + } + } + return ret; +} + +/**************************************************************************** + * Name: hardfault_log_main + ****************************************************************************/ +__EXPORT int hardfault_log_main(int argc, char *argv[]) +{ + char *self = "hardfault_log"; + + if (!strcmp(argv[1], "check")) { + + return hardfault_check_status(self); + + } else if (!strcmp(argv[1], "rearm")) { + + return hardfault_rearm(self); + + } else if (!strcmp(argv[1], "fault")) { + + int fault = 0; + if (argc > 2) { + fault = atol(argv[2]); + } + return genfault(fault); + + } else if (!strcmp(argv[1], "commit")) { + + return hardfault_commit(self); + + } else if (!strcmp(argv[1], "count")) { + + return hardfault_increment_reboot(self,false); + + } else if (!strcmp(argv[1], "reset")) { + + return hardfault_increment_reboot(self,true); + + } + + fprintf(stderr, "unrecognised command, try 'check' ,'rearm' , 'fault', 'count', 'reset' or 'commit'\n"); + return -EINVAL; +} diff --git a/src/systemcmds/hardfault_log/module.mk b/src/systemcmds/hardfault_log/module.mk new file mode 100644 index 000000000..8a6016c33 --- /dev/null +++ b/src/systemcmds/hardfault_log/module.mk @@ -0,0 +1,43 @@ +############################################################################ +# +# Copyright (c) 2012, 2015 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. +# +############################################################################ + +# +# reboot command. +# + +MODULE_COMMAND = hardfault_log +SRCS = hardfault_log.c + +MAXOPTIMIZATION = -Os + +MODULE_STACKSIZE = 1024 -- cgit v1.2.3 From 6d715e4a12549791c51fbca7df46847ca8a407eb Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Tue, 3 Mar 2015 16:31:57 -1000 Subject: Updated NuttX Submodule for Hard Fault Logging == upstream_to_greg_crashdump --- NuttX | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NuttX b/NuttX index b79aa7fa1..70f95fe45 160000 --- a/NuttX +++ b/NuttX @@ -1 +1 @@ -Subproject commit b79aa7fa11059d9006fe07194b2b45be1639aef7 +Subproject commit 70f95fe4500be3a09225c17edb77df87d4e006de -- cgit v1.2.3 From 4a931a99f055c5e62a99d1ddfb5c513991df2e87 Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Wed, 4 Mar 2015 03:52:02 -1000 Subject: Updated NuttX Submodule for Hard Fault Logging == upstream --- NuttX | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NuttX b/NuttX index 70f95fe45..d5645521c 160000 --- a/NuttX +++ b/NuttX @@ -1 +1 @@ -Subproject commit 70f95fe4500be3a09225c17edb77df87d4e006de +Subproject commit d5645521c83e57a1669f41dc0acae190596095f7 -- cgit v1.2.3 From baf9bd0346d7ee8dd236dc0ce0214a7c5543544a Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Wed, 4 Mar 2015 04:21:00 -1000 Subject: Adjust Stack Sizes like f7ef6 - but experimanting the CONFIG_IDLETHREAD_STACKSIZ on px4fmu-v2/nsh/defconfig --- nuttx-configs/aerocore/nsh/defconfig | 7 ++++--- nuttx-configs/px4fmu-v1/nsh/defconfig | 8 +++++--- nuttx-configs/px4fmu-v2/nsh/defconfig | 5 +++-- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/nuttx-configs/aerocore/nsh/defconfig b/nuttx-configs/aerocore/nsh/defconfig index dcb132e01..ca444ad95 100644 --- a/nuttx-configs/aerocore/nsh/defconfig +++ b/nuttx-configs/aerocore/nsh/defconfig @@ -332,7 +332,7 @@ CONFIG_BOARD_LOOPSPERMSEC=16717 CONFIG_DRAM_START=0x20000000 CONFIG_DRAM_SIZE=262144 CONFIG_ARCH_HAVE_INTERRUPTSTACK=y -CONFIG_ARCH_INTERRUPTSTACK=2048 +CONFIG_ARCH_INTERRUPTSTACK=1500 # # Boot options @@ -415,8 +415,9 @@ CONFIG_PREALLOC_TIMERS=50 # # Stack and heap information # -CONFIG_IDLETHREAD_STACKSIZE=3500 -CONFIG_USERMAIN_STACKSIZE=2600 +# This should be 380 with 28 bytes free +CONFIG_IDLETHREAD_STACKSIZE=1000 +CONFIG_USERMAIN_STACKSIZE=3000 CONFIG_PTHREAD_STACK_MIN=512 CONFIG_PTHREAD_STACK_DEFAULT=2048 diff --git a/nuttx-configs/px4fmu-v1/nsh/defconfig b/nuttx-configs/px4fmu-v1/nsh/defconfig index 5bb7bed15..f7a95c1a7 100644 --- a/nuttx-configs/px4fmu-v1/nsh/defconfig +++ b/nuttx-configs/px4fmu-v1/nsh/defconfig @@ -424,7 +424,8 @@ CONFIG_BOARD_LOOPSPERMSEC=16717 # Interrupt options # CONFIG_ARCH_HAVE_INTERRUPTSTACK=y -CONFIG_ARCH_INTERRUPTSTACK=2048 +# The actual usage is 420 bytes +CONFIG_ARCH_INTERRUPTSTACK=1500 CONFIG_ARCH_HAVE_HIPRI_INTERRUPT=y # CONFIG_ARCH_HIPRI_INTERRUPT is not set @@ -575,8 +576,9 @@ CONFIG_SCHED_LPWORKSTACKSIZE=1800 # # Stack and heap information # -CONFIG_IDLETHREAD_STACKSIZE=3500 -CONFIG_USERMAIN_STACKSIZE=2600 +# This should be 380 with 28 bytes free +CONFIG_IDLETHREAD_STACKSIZE=1000 +CONFIG_USERMAIN_STACKSIZE=3000 CONFIG_PTHREAD_STACK_MIN=512 CONFIG_PTHREAD_STACK_DEFAULT=2048 # CONFIG_LIB_SYSCALL is not set diff --git a/nuttx-configs/px4fmu-v2/nsh/defconfig b/nuttx-configs/px4fmu-v2/nsh/defconfig index aaeb03a08..9f94f0dd3 100644 --- a/nuttx-configs/px4fmu-v2/nsh/defconfig +++ b/nuttx-configs/px4fmu-v2/nsh/defconfig @@ -451,7 +451,7 @@ CONFIG_BOARD_LOOPSPERMSEC=16717 # Interrupt options # CONFIG_ARCH_HAVE_INTERRUPTSTACK=y -CONFIG_ARCH_INTERRUPTSTACK=2048 +CONFIG_ARCH_INTERRUPTSTACK=1500 CONFIG_ARCH_HAVE_HIPRI_INTERRUPT=y # CONFIG_ARCH_HIPRI_INTERRUPT is not set @@ -588,8 +588,9 @@ CONFIG_SCHED_LPWORKSTACKSIZE=1800 # # Stack and heap information # +# This set to 380 with 28 bytes free CONFIG_IDLETHREAD_STACKSIZE=380 -CONFIG_USERMAIN_STACKSIZE=2600 +CONFIG_USERMAIN_STACKSIZE=3000 CONFIG_PTHREAD_STACK_MIN=512 CONFIG_PTHREAD_STACK_DEFAULT=2048 # CONFIG_LIB_SYSCALL is not set -- cgit v1.2.3 From 1694c8faccfb83875a9ec5b98e131e970c16865e Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Wed, 4 Mar 2015 17:02:32 -1000 Subject: Reduced memory footprint with serialization and malloc --- src/drivers/boards/px4fmu-v2/px4fmu2_init.c | 102 +++--- src/modules/systemlib/hardfault_log.h | 82 ++--- src/systemcmds/hardfault_log/hardfault_log.c | 519 +++++++++++++++++---------- 3 files changed, 417 insertions(+), 286 deletions(-) diff --git a/src/drivers/boards/px4fmu-v2/px4fmu2_init.c b/src/drivers/boards/px4fmu-v2/px4fmu2_init.c index 98babbf05..52ee00a7d 100644 --- a/src/drivers/boards/px4fmu-v2/px4fmu2_init.c +++ b/src/drivers/boards/px4fmu-v2/px4fmu2_init.c @@ -311,7 +311,8 @@ __EXPORT int nsh_archinitialize(void) if (hadCrash == OK) { - syslog(LOG_INFO, "[boot] There was a hard fault hit the SPACE BAR to halt the system!\n"); + syslog(LOG_INFO, "[boot] There is a hard fault logged. Hold down the SPACE BAR," \ + " while booting to halt the system!\n"); /* Yes. So add one to the boot count - this will be reset after a successful * commit to SD @@ -326,13 +327,13 @@ __EXPORT int nsh_archinitialize(void) if (reboots > 2 || bytesWaiting != 0 ) { - /* Since we can not commit the fault dump to disk. display it + /* Since we can not commit the fault dump to disk. Display it * to the console. */ hardfault_write("boot", fileno(stdout), HARDFAULT_DISPLAY_FORMAT, false); - syslog(LOG_INFO, "[boot] There were %d uncommitted Hard faults System halted%s\n", + syslog(LOG_INFO, "[boot] There were %d reboots with Hard fault that were not committed to disk - System halted %s\n", reboots, (bytesWaiting==0 ? "" : " Due to Key Press\n")); @@ -344,7 +345,8 @@ __EXPORT int nsh_archinitialize(void) /* Clear any key press that got us here */ static volatile bool dbgContinue = false; - for (int c ='>'; !dbgContinue; c= getchar()) { + int c = '>'; + while (!dbgContinue) { switch(c) { @@ -387,6 +389,9 @@ __EXPORT int nsh_archinitialize(void) "Enter C - Clear the fault log\n" \ "Enter D - Dump fault log\n\n?>"); fflush(stdout); + if (!dbgContinue) { + c = getchar(); + } break; } // outer switch @@ -484,6 +489,13 @@ __EXPORT int nsh_archinitialize(void) return OK; } +inline static void copy_reverse(stack_word_t *dest, stack_word_t *src, int size) +{ + while (size--) { + *dest++ = *src--; + } +} + __EXPORT void board_crashdump(uint32_t currentsp, void *tcb, uint8_t *filename, int lineno) { /* We need a chunk of ram to save the complete contest in. @@ -498,7 +510,7 @@ __EXPORT void board_crashdump(uint32_t currentsp, void *tcb, uint8_t *filename, /* Zero out everything */ - memset(pdump,0,sizeof(fullcontext_s)); + memset(pdump, 0, sizeof(fullcontext_s)); /* Save Info */ @@ -524,56 +536,63 @@ __EXPORT void board_crashdump(uint32_t currentsp, void *tcb, uint8_t *filename, /* Save Context */ - /* If not NULL then we are in an interrupt context and the user context - * is in current_regs else we are running in the users context - */ #if CONFIG_TASK_NAME_SIZE > 0 - strncpy(pdump->context.proc.name, rtcb->name, CONFIG_TASK_NAME_SIZE); + strncpy(pdump->info.name, rtcb->name, CONFIG_TASK_NAME_SIZE); #endif - pdump->context.proc.pid = rtcb->pid; + pdump->info.pid = rtcb->pid; - pdump->context.stack.current_sp = currentsp; + + /* If current_regs is not NULL then we are in an interrupt context + * and the user context is in current_regs else we are running in + * the users context + */ if (current_regs) { - pdump->info.stuff |= eRegs; - memcpy(&pdump->context.proc.xcp.regs, (void*)current_regs, sizeof(pdump->context.proc.xcp.regs)); - currentsp = pdump->context.proc.xcp.regs[REG_R13]; - } + pdump->info.stacks.interrupt.sp = currentsp; + pdump->info.flags |= eRegs; + memcpy(pdump->info.regs, (void*)current_regs, sizeof(pdump->info.regs)); + pdump->info.stacks.user.sp = pdump->info.regs[REG_R13]; + currentsp = pdump->info.stacks.user.sp; + } else { - pdump->context.stack.itopofstack = (uint32_t) &g_intstackbase;; - pdump->context.stack.istacksize = (CONFIG_ARCH_INTERRUPTSTACK & ~3); + /* users context */ + + pdump->info.stacks.user.sp = currentsp; + } - if (pdump->context.proc.pid == 0) { + if (pdump->info.pid == 0) { - pdump->context.stack.utopofstack = g_idle_topstack - 4; - pdump->context.stack.ustacksize = CONFIG_IDLETHREAD_STACKSIZE; + pdump->info.stacks.user.top = g_idle_topstack - 4; + pdump->info.stacks.user.size = CONFIG_IDLETHREAD_STACKSIZE; } else { - pdump->context.stack.utopofstack = (uint32_t) rtcb->adj_stack_ptr; - pdump->context.stack.ustacksize = (uint32_t) rtcb->adj_stack_size;; + pdump->info.stacks.user.top = (uint32_t) rtcb->adj_stack_ptr; + pdump->info.stacks.user.size = (uint32_t) rtcb->adj_stack_size;; } #if CONFIG_ARCH_INTERRUPTSTACK > 3 /* Get the limits on the interrupt stack memory */ - pdump->context.stack.itopofstack = (uint32_t)&g_intstackbase; - pdump->context.stack.istacksize = (CONFIG_ARCH_INTERRUPTSTACK & ~3); + pdump->info.stacks.interrupt.top = (uint32_t)&g_intstackbase; + pdump->info.stacks.interrupt.size = (CONFIG_ARCH_INTERRUPTSTACK & ~3); /* If the current stack pointer is within the interrupt stack then * save the interrupt stack data centered about the interrupt stack pointer */ - if (pdump->context.stack.current_sp <= pdump->context.stack.itopofstack && - pdump->context.stack.current_sp > pdump->context.stack.itopofstack - pdump->context.stack.istacksize) + if (pdump->info.stacks.interrupt.sp <= pdump->info.stacks.interrupt.top && + pdump->info.stacks.interrupt.sp > pdump->info.stacks.interrupt.top - pdump->info.stacks.interrupt.size) { - pdump->info.stuff |= eIntStack; - memcpy(&pdump->istack, (void *)(pdump->context.stack.current_sp-sizeof(pdump->istack)/2), - sizeof(pdump->istack)); + pdump->info.flags |= eIntStack; + stack_word_t * ps = (stack_word_t *) pdump->info.stacks.interrupt.sp; + copy_reverse(pdump->istack, &ps[arraySize(pdump->istack)/2], arraySize(pdump->istack)); + } else { + pdump->info.flags |= eInvalidIntStack; } #endif @@ -581,30 +600,33 @@ __EXPORT void board_crashdump(uint32_t currentsp, void *tcb, uint8_t *filename, /* If the saved context of the interrupted process's stack pointer lies within the * allocated user stack memory then save the user stack centered about the user sp */ - if (currentsp <= pdump->context.stack.utopofstack && - currentsp > pdump->context.stack.utopofstack - pdump->context.stack.ustacksize) + if (currentsp <= pdump->info.stacks.user.top && + currentsp > pdump->info.stacks.user.top - pdump->info.stacks.user.size) { - pdump->info.stuff |= eUserStack; - memcpy(&pdump->ustack, (void *)(currentsp-sizeof(pdump->ustack)/2), sizeof(pdump->ustack)); + pdump->info.flags |= eUserStack; + stack_word_t * ps = (stack_word_t *) pdump->info.stacks.user.sp; + copy_reverse(pdump->ustack, &ps[arraySize(pdump->ustack)/2], arraySize(pdump->ustack)); + } else { + pdump->info.flags |= eInvalidUserStack; } /* Oh boy we have a real hot mess on our hands so save above and below the * current sp */ - if ((pdump->info.stuff & eStackValid) == 0) + if ((pdump->info.flags & eStackValid) == 0) { - pdump->info.stuff |= eStackUnknown; + pdump->info.flags |= (eStackUnknown | eStackValid); #if CONFIG_ARCH_INTERRUPTSTACK > 3 /* sp and above in istack */ - memcpy(&pdump->istack, (void *)pdump->context.stack.current_sp, sizeof(pdump->istack)); + stack_word_t * ps = (stack_word_t *) pdump->info.stacks.interrupt.sp; + copy_reverse(pdump->istack, &ps[arraySize(pdump->istack)], arraySize(pdump->istack)); /* below in ustack */ - memcpy(&pdump->ustack, (void *)(pdump->context.stack.current_sp-sizeof(pdump->ustack)), - sizeof(pdump->ustack)); + ps = (stack_word_t *) pdump->info.stacks.user.sp; + copy_reverse(pdump->ustack, &ps[arraySize(pdump->ustack)], arraySize(pdump->ustack)); #else /* save above and below in ustack */ - memcpy(&pdump->ustack, (void *)(pdump->context.stack.current_sp-sizeof(pdump->ustack)/2), - sizeof(pdump->ustack)/2); + copy_reverse(pdump->ustack, &ps[arraySize(pdump->ustack)/2], arraySize(pdump->ustack)); #endif } diff --git a/src/modules/systemlib/hardfault_log.h b/src/modules/systemlib/hardfault_log.h index 2161103a1..6983a5737 100644 --- a/src/modules/systemlib/hardfault_log.h +++ b/src/modules/systemlib/hardfault_log.h @@ -67,7 +67,7 @@ #else # define BBSRAM_NUMBER_STACKS 2 #endif -#define BBSRAM_FIXED_ELEMENTS_SIZE (sizeof(context_s)+sizeof(info_s)) +#define BBSRAM_FIXED_ELEMENTS_SIZE (sizeof(info_s)) #define BBSRAM_LEFTOVER (BBSRAM_REAMINING-BBSRAM_FIXED_ELEMENTS_SIZE) #define CONFIG_ISTACK_SIZE (BBSRAM_LEFTOVER/BBSRAM_NUMBER_STACKS/sizeof(stack_word_t)) @@ -123,7 +123,7 @@ #if defined(__cplusplus) #define EXTERN extern "C" extern "C" -{ +//{ #else #define EXTERN extern #endif @@ -131,36 +131,19 @@ extern "C" /* Used for stack frame storage */ typedef uint32_t stack_word_t; -typedef struct { - int pid; /* Process ID */ - struct xcptcontext xcp; /* Interrupt register save area */ -#if CONFIG_TASK_NAME_SIZE > 0 - char name[CONFIG_TASK_NAME_SIZE+1]; /* Task name (with NULL terminator) */ -#endif -} process_t; - /* Stack related data */ + typedef struct { - uint32_t current_sp; /* The stack the up_assert is running on - * it may be either the user stack for an assertion - * failure or the interrupt stack in the case of a - * hard fault - */ - uint32_t utopofstack; /* Top of the user stack at the time of the - * up_assert - */ - uint32_t ustacksize; /* Size of the user stack at the time of the - * up_assert - */ + uint32_t sp; + uint32_t top; + uint32_t size; -#if CONFIG_ARCH_INTERRUPTSTACK > 3 +} _stack_s; - uint32_t itopofstack; /* Top of the interrupt stack at the time of the - * up_assert - */ - uint32_t istacksize; /* Size of the interrupt stack at the time of the - * up_assert - */ +typedef struct { + _stack_s user; +#if CONFIG_ARCH_INTERRUPTSTACK > 3 + _stack_s interrupt; #endif } stack_t; @@ -249,30 +232,33 @@ typedef struct /* Flags to identify what is in the dump */ typedef enum { - eRegs = 0x01, - eUserStack = 0x02, - eIntStack = 0x04, - eStackUnknown = 0x08, - eStackValid = eUserStack | eIntStack, -} stuff_t; + eRegs = 0x01, + eUserStack = 0x02, + eIntStack = 0x04, + eStackValid = eUserStack | eIntStack, + eStackUnknown = 0x08, + eInvalidUserStack = 0x20, + eInvalidIntStack = 0x40, +} fault_flags_t; typedef struct { - stuff_t stuff; /* What is in the dump */ - uintptr_t current_regs; /* Used to validate the dump */ - int lineno; /* __LINE__ to up_assert */ - char filename[MAX_FILE_PATH_LENGTH]; /* Last MAX_FILE_PATH_LENGTH of chars in - * __FILE__ to up_assert - */ + fault_flags_t flags; /* What is in the dump */ + uintptr_t current_regs; /* Used to validate the dump */ + int lineno; /* __LINE__ to up_assert */ + int pid; /* Process ID */ + uint32_t regs[XCPTCONTEXT_REGS]; /* Interrupt register save + * area */ + stack_t stacks; /* Stack info */ +#if CONFIG_TASK_NAME_SIZE > 0 + char name[CONFIG_TASK_NAME_SIZE+1]; /* Task name (with NULL + * terminator) */ +#endif + char filename[MAX_FILE_PATH_LENGTH]; /* the Last of chars in + * __FILE__ to up_assert */ } info_s; -typedef struct { /* The Context data */ - stack_t stack; - process_t proc; -} context_s; - typedef struct { - info_s info; /* Then info */ - context_s context; /* The Context data */ + info_s info; /* The info */ #if CONFIG_ARCH_INTERRUPTSTACK > 3 /* The amount of stack data is compile time * sized backed on what is left after the * other BBSRAM files are defined @@ -378,6 +364,6 @@ int hardfault_increment_reboot(char *caller, bool reset); #if defined(__cplusplus) extern "C" -} +//} #endif diff --git a/src/systemcmds/hardfault_log/hardfault_log.c b/src/systemcmds/hardfault_log/hardfault_log.c index e8f37335b..959ea4a3a 100644 --- a/src/systemcmds/hardfault_log/hardfault_log.c +++ b/src/systemcmds/hardfault_log/hardfault_log.c @@ -38,11 +38,13 @@ #include #include +#include #include #include #include +#include #include #include #include @@ -65,7 +67,7 @@ __EXPORT int hardfault_log_main(int argc, char *argv[]); /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ - +#define OUT_BUFFER_LEN 200 /**************************************************************************** * Private Types ****************************************************************************/ @@ -119,26 +121,6 @@ static int genfault(int fault) /* This is not going to happen */ break; - case 2: - printf("null %s\n",NULL); - /* This is not going to happen */ - break; - - case 3: - { - char marker[20]; - strncpy(marker, "<-- ", sizeof(marker)); - printf("nill %s\n",""); - printf("nill fault==3 %s\n",(fault==3) ? "3" : ""); - printf("nill fault!=3 %s\n",(fault!=3) ? "3" : ""); - printf("0x%08x 0x%08x%s\n", fault, -fault, (fault==3) ? "" : marker); - printf("0x%08x 0x%08x%s\n", fault, -fault, (fault!=3) ? "" : marker); - printf("0x%08x 0x%08x%s\n", fault, -fault, fault==3 ? "" : marker); - printf("0x%08x 0x%08x%s\n", fault, -fault, fault!=3 ? "" : marker); - } - /* This is not going to happen */ - break; - default: break; @@ -237,106 +219,154 @@ static int hardfault_get_desc(char *caller, struct bbsramd_s *desc, bool silent) /**************************************************************************** * write_stack_detail ****************************************************************************/ -static void write_stack_detail(int size, uint32_t topaddr, uint32_t spaddr, - uint32_t botaddr, 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; - n = snprintf(&buffer[n], max-n, " %s stack:\n",sp_name); - n += snprintf(&buffer[n], max-n, " top: 0x%08x\n", topaddr); - n += snprintf(&buffer[n], max-n, " sp: 0x%08x\n", spaddr); - write(fd, buffer,n); + uint32_t sbot = si->top - si->size; + n = snprintf(&buffer[n], max-n, " %s stack: \n",sp_name); + n += snprintf(&buffer[n], max-n, " top: 0x%08x\n", si->top); + n += snprintf(&buffer[n], max-n, " sp: 0x%08x %s\n", si->sp, (inValid ? "Invalid" : "Valid")); + if (n != write(fd, buffer, n)) { + return -EIO; + } n = 0; - n += snprintf(&buffer[n], max-n, " bottom: 0x%08x\n", botaddr); - n += snprintf(&buffer[n], max-n, " size: 0x%08x\n", size); - write(fd, buffer,n); -#ifndef CONFIG_STACK_COLORATION + n += snprintf(&buffer[n], max-n, " bottom: 0x%08x\n", sbot); + n += snprintf(&buffer[n], max-n, " size: 0x%08x\n", si->size); + if (n != write(fd, buffer, n)) { + return -EIO; + } +#ifdef CONFIG_STACK_COLORATION FAR struct tcb_s tcb; - tcb.stack_alloc_ptr = (void*) botaddr; - tcb.adj_stack_size = size; + tcb.stack_alloc_ptr = (void*) sbot; + tcb.adj_stack_size = si->size; n = snprintf(buffer, max, " used: %08x\n", up_check_tcbstack(&tcb)); - write(fd, buffer,n); + if (n != write(fd, buffer, n)) { + return -EIO; + } #endif + return OK; } /**************************************************************************** * write_stack ****************************************************************************/ -static void write_stack(stack_word_t *swindow, int winsize, uint32_t wtopaddr, +static int read_stack(int fd, stack_word_t *words, int num) +{ + int bytes = read(fd, (char *) words, sizeof(stack_word_t) * num); + if (bytes > 0) { + bytes /= sizeof(stack_word_t); + } + return bytes; +} +static int write_stack(bool inValid, int winsize, uint32_t wtopaddr, uint32_t topaddr, uint32_t spaddr, uint32_t botaddr, - char *sp_name, char *buffer, int max, int fd) + char *sp_name, char *buffer, int max, int infd, int outfd) { - char marker[30]; - for (int i = winsize; i >= 0; i--) { - if (wtopaddr == topaddr) { - strncpy(marker, "<-- ", sizeof(marker)); - strncat(marker, sp_name, sizeof(marker)); - strncat(marker, " top", sizeof(marker)); - } else if (wtopaddr == spaddr) { - strncpy(marker, "<-- ", sizeof(marker)); - strncat(marker, sp_name, sizeof(marker)); - } else if (wtopaddr == botaddr) { - strncpy(marker, "<-- ", sizeof(marker)); - strncat(marker, sp_name, sizeof(marker)); - strncat(marker, " bottom", sizeof(marker)); - } else { - marker[0] = '\0'; - } - int n = snprintf(buffer, max,"0x%08x 0x%08x%s\n", wtopaddr, swindow[i], marker); - write(fd, buffer,n); - wtopaddr--; - } + char marker[30]; + stack_word_t stack[32]; + int ret = OK; + + int n = snprintf(buffer, max,"%s memory region, stack pointer lies %s stack\n", + sp_name, (inValid ? "outside of" : "within" )); + if (n != write(outfd, buffer, n)) { + + ret = -EIO; + + } else { + + while(winsize > 0 && ret == OK) { + int chunk = read_stack(infd, stack, arraySize(stack)); + if (chunk <= 0 ) { + ret = -EIO; + } else { + winsize -= chunk; + for (int i = 0; i < chunk; i++) { + if (wtopaddr == topaddr) { + strncpy(marker, "<-- ", sizeof(marker)); + strncat(marker, sp_name, sizeof(marker)); + strncat(marker, " top", sizeof(marker)); + } else if (wtopaddr == spaddr) { + strncpy(marker, "<-- ", sizeof(marker)); + strncat(marker, sp_name, sizeof(marker)); + } else if (wtopaddr == botaddr) { + strncpy(marker, "<-- ", sizeof(marker)); + strncat(marker, sp_name, sizeof(marker)); + strncat(marker, " bottom", sizeof(marker)); + } else { + marker[0] = '\0'; + } + n = snprintf(buffer, max,"0x%08x 0x%08x%s\n", wtopaddr, stack[i], marker); + if (n != write(outfd, buffer, n)) { + ret = -EIO; + } + wtopaddr--; + } + } + } + } + return ret; } /**************************************************************************** * write_registers ****************************************************************************/ -static void write_registers(fullcontext_s* fc, char *buffer, int max, int fd) +static int write_registers(uint32_t regs[], char *buffer, int max, int fd) { int n = snprintf(buffer, max, " r0:0x%08x r1:0x%08x r2:0x%08x r3:0x%08x r4:0x%08x r5:0x%08x r6:0x%08x r7:0x%08x\n", - fc->context.proc.xcp.regs[REG_R0], fc->context.proc.xcp.regs[REG_R1], - fc->context.proc.xcp.regs[REG_R2], fc->context.proc.xcp.regs[REG_R3], - fc->context.proc.xcp.regs[REG_R4], fc->context.proc.xcp.regs[REG_R5], - fc->context.proc.xcp.regs[REG_R6], fc->context.proc.xcp.regs[REG_R7]); + regs[REG_R0], regs[REG_R1], + regs[REG_R2], regs[REG_R3], + regs[REG_R4], regs[REG_R5], + regs[REG_R6], regs[REG_R7]); - write(fd, buffer,n); + if (n != write(fd, buffer, n)) { + return -EIO; + } n = snprintf(buffer, max, " r8:0x%08x r9:0x%08x r10:0x%08x r11:0x%08x r12:0x%08x sp:0x%08x lr:0x%08x pc:0x%08x\n", - fc->context.proc.xcp.regs[REG_R8], fc->context.proc.xcp.regs[REG_R9], - fc->context.proc.xcp.regs[REG_R10], fc->context.proc.xcp.regs[REG_R11], - fc->context.proc.xcp.regs[REG_R12], fc->context.proc.xcp.regs[REG_R13], - fc->context.proc.xcp.regs[REG_R14], fc->context.proc.xcp.regs[REG_R15]); + regs[REG_R8], regs[REG_R9], + regs[REG_R10], regs[REG_R11], + regs[REG_R12], regs[REG_R13], + regs[REG_R14], regs[REG_R15]); - write(fd, buffer,n); + if (n != write(fd, buffer, n)) { + return -EIO; + } #ifdef CONFIG_ARMV7M_USEBASEPRI n = snprintf(buffer, max, " xpsr:0x%08x basepri:0x%08x control:0x%08x\n", - fc->context.proc.xcp.regs[REG_XPSR], fc->context.proc.xcp.regs[REG_BASEPRI], + regs[REG_XPSR], regs[REG_BASEPRI], getcontrol()); #else n = snprintf(buffer, max, " xpsr:0x%08x primask:0x%08x control:0x%08x\n", - fc->context.proc.xcp.regs[REG_XPSR], fc->context.proc.xcp.regs[REG_PRIMASK], + regs[REG_XPSR], regs[REG_PRIMASK], getcontrol()); #endif - write(fd, buffer,n); + if (n != write(fd, buffer, n)) { + return -EIO; + } #ifdef REG_EXC_RETURN - n = snprintf(buffer, max, " exe return:0x%08x\n", fc->context.proc.xcp.regs[REG_EXC_RETURN]); - write(fd, buffer,n); + n = snprintf(buffer, max, " exe return:0x%08x\n", regs[REG_EXC_RETURN]); + if (n != write(fd, buffer, n)) { + return -EIO; + } #endif + return OK; } /**************************************************************************** * write_registers_info ****************************************************************************/ -static int write_registers_info(int fdout, fullcontext_s *fc, char *buffer, - int sz) +static int write_registers_info(int fdout, info_s *pi , char *buffer, int sz) { int ret = -ENOENT; - if (fc->info.stuff & eRegs) { - int n = snprintf(buffer, sz, " Processor registers: from 0x%08x\n", fc->info.current_regs); - write(fdout, buffer,n); - write_registers(fc, buffer, sz, fdout); - ret = OK; + if (pi->flags & eRegs) { + ret = -EIO; + int n = snprintf(buffer, sz, " Processor registers: from 0x%08x\n", pi->current_regs); + if (n == write(fdout, buffer, n)) { + ret = write_registers(pi->regs, buffer, sz, fdout); + } } return ret; } @@ -344,18 +374,14 @@ static int write_registers_info(int fdout, fullcontext_s *fc, char *buffer, /**************************************************************************** * write_interrupt_stack_info ****************************************************************************/ -static int write_interrupt_stack_info(int fdout, fullcontext_s *fc, char *buffer, - unsigned int sz) +static int write_interrupt_stack_info(int fdout, info_s *pi, char *buffer, + unsigned int sz) { int ret = -ENOENT; - if (fc->info.stuff & eIntStack) { - write_stack_detail(fc->context.stack.istacksize, - fc->context.stack.itopofstack, - fc->context.stack.current_sp, - fc->context.stack.itopofstack - fc->context.stack.istacksize, - "IRQ", - buffer, sz, fdout); - ret = OK; + if (pi->flags & eIntStack) { + ret = write_stack_detail((pi->flags & eInvalidIntStack) != 0, + &pi->stacks.interrupt, "IRQ", + buffer, sz, fdout); } return ret; } @@ -363,18 +389,13 @@ static int write_interrupt_stack_info(int fdout, fullcontext_s *fc, char *buffer /**************************************************************************** * write_user_stack_info ****************************************************************************/ -static int write_user_stack_info(int fdout, fullcontext_s *fc, char *buffer, - unsigned int sz) +static int write_user_stack_info(int fdout, info_s *pi, char *buffer, + unsigned int sz) { int ret = -ENOENT; - if (fc->info.stuff & eUserStack) { - write_stack_detail(fc->context.stack.ustacksize, - fc->context.stack.utopofstack, - fc->context.proc.xcp.regs[REG_R13], - fc->context.stack.utopofstack - fc->context.stack.ustacksize, - "User", - buffer, sz, fdout); - ret = OK; + if (pi->flags & eUserStack) { + ret = write_stack_detail((pi->flags & eInvalidUserStack) != 0, + &pi->stacks.user, "User", buffer, sz, fdout); } return ret; } @@ -382,81 +403,97 @@ static int write_user_stack_info(int fdout, fullcontext_s *fc, char *buffer, /**************************************************************************** * write_dump_info ****************************************************************************/ -static void write_dump_info(int fdout, fullcontext_s *fc, struct timespec *ts, +static int write_dump_info(int fdout, info_s *info, struct bbsramd_s * desc, char *buffer, unsigned int sz) { char fmtbuff[ TIME_FMT_LEN + 1]; - format_fault_time(HEADER_TIME_FMT, ts, fmtbuff, sizeof(fmtbuff)); + format_fault_time(HEADER_TIME_FMT, &desc->lastwrite, fmtbuff, sizeof(fmtbuff)); - bool isFault = (fc->info.current_regs != 0 || fc->context.proc.pid == 0); + bool isFault = (info->current_regs != 0 || info->pid == 0); int n; n = snprintf(buffer, sz, "System fault Occurred on: %s\n", fmtbuff); - write(fdout, buffer, n); + + if (n != write(fdout, buffer, n)) { + return -EIO; + } + if (isFault) { n = snprintf(buffer, sz, " Type:Hard Fault"); } else { n = snprintf(buffer, sz, " Type:Assertion failed"); } - write(fdout, buffer, n); + if (n != write(fdout, buffer, n)) { + return -EIO; + } #ifdef CONFIG_TASK_NAME_SIZE n = snprintf(buffer, sz, " in file:%s at line: %d running task: %s\n", - fc->info.filename, fc->info.lineno, fc->context.proc.name); + info->filename, info->lineno, info->name); #else n = snprintf(buffer, sz, " in file:%s at line: %d \n", - fc->info.filename, fc->info.lineno); + info->filename, info->lineno); #endif - write(fdout, buffer, n); + if (n != write(fdout, buffer, n)) { + return -EIO; + } n = snprintf(buffer, sz, " FW git-hash: %s\n", FW_GIT); - write(fdout, buffer, n); + if (n != write(fdout, buffer, n)) { + return -EIO; + } n = snprintf(buffer, sz, " Build datetime: %s %s\n", __DATE__, __TIME__); - write(fdout, buffer, n); - + if (n != write(fdout, buffer, n)) { + return -EIO; + } + return OK; } /**************************************************************************** * write_dump_time ****************************************************************************/ -static void write_dump_time(char *caller, char *tag, int fdout, +static int write_dump_time(char *caller, char *tag, int fdout, struct timespec *ts, char *buffer, unsigned int sz) { + int ret = OK; char fmtbuff[ TIME_FMT_LEN + 1]; format_fault_time(HEADER_TIME_FMT, ts, fmtbuff, sizeof(fmtbuff)); int n = snprintf(buffer, sz, "[%s] -- %s %s Fault Log --\n",caller, fmtbuff, tag); - write(fdout, buffer, n); + if (n != write(fdout, buffer, n)) { + ret = -EIO; + } + return ret; } /**************************************************************************** * write_dump_footer ****************************************************************************/ -static void write_dump_header(char * caller, int fdout, struct timespec *ts, +static int write_dump_header(char * caller, int fdout, struct timespec *ts, char *buffer, unsigned int sz) { - write_dump_time(caller, "Begin", fdout, ts, buffer, sz); + return write_dump_time(caller, "Begin", fdout, ts, buffer, sz); } /**************************************************************************** * write_dump_footer ****************************************************************************/ -static void write_dump_footer(char * caller, int fdout, struct timespec *ts, - char *buffer, unsigned int sz) +static int write_dump_footer(char * caller, int fdout, struct timespec *ts, + char *buffer, unsigned int sz) { - write_dump_time(caller, "END", fdout, ts, buffer, sz); + return write_dump_time(caller, "END", fdout, ts, buffer, sz); } /**************************************************************************** * write_intterupt_satck ****************************************************************************/ -static int write_intterupt_stack(int fdout, fullcontext_s *fc, char *buffer, +static int write_intterupt_stack(int fdin, int fdout, info_s *pi, char *buffer, unsigned int sz) { int ret = -ENOENT; - if ((fc->info.stuff & eIntStack) != 0) { - int winsize = arraySize(fc->istack); - int wtopaddr = fc->context.stack.current_sp + winsize/2; - write_stack(fc->istack, winsize, wtopaddr, - fc->context.stack.itopofstack, - fc->context.stack.current_sp, - fc->context.stack.itopofstack - fc->context.stack.istacksize, - "Interrupt sp", buffer, sz, fdout); - ret = OK; + if ((pi->flags & eIntStack) != 0) { + lseek(fdin, offsetof(fullcontext_s, istack), SEEK_SET); + ret = write_stack((pi->flags & eInvalidIntStack) != 0, + CONFIG_ISTACK_SIZE, + pi->stacks.interrupt.sp + CONFIG_ISTACK_SIZE/2, + pi->stacks.interrupt.top, + pi->stacks.interrupt.sp, + pi->stacks.interrupt.top - pi->stacks.interrupt.size, + "Interrupt sp", buffer, sz, fdin, fdout); } return ret; @@ -466,19 +503,19 @@ static int write_intterupt_stack(int fdout, fullcontext_s *fc, char *buffer, /**************************************************************************** * write_user_stack ****************************************************************************/ -static int write_user_stack(int fdout, fullcontext_s *fc, char *buffer, +static int write_user_stack(int fdin, int fdout, info_s *pi, char *buffer, unsigned int sz) { int ret = -ENOENT; - if ((fc->info.stuff & eUserStack) != 0) { - int winsize = arraySize(fc->ustack); - int wtopaddr = fc->context.proc.xcp.regs[REG_R13] + winsize/2; - write_stack(fc->ustack, winsize, wtopaddr, - fc->context.stack.utopofstack, - fc->context.proc.xcp.regs[REG_R13], - fc->context.stack.utopofstack - fc->context.stack.ustacksize, - "User sp", buffer, sz, fdout); - ret = OK; + if ((pi->flags & eUserStack) != 0) { + lseek(fdin,offsetof(fullcontext_s, ustack), SEEK_SET); + ret = write_stack((pi->flags & eInvalidUserStack) != 0, + CONFIG_USTACK_SIZE, + pi->stacks.user.sp + CONFIG_USTACK_SIZE/2, + pi->stacks.user.top, + pi->stacks.user.sp, + pi->stacks.user.top - pi->stacks.user.size, + "User sp", buffer, sz, fdin, fdout); } return ret; @@ -494,7 +531,9 @@ static int hardfault_commit(char *caller) struct bbsramd_s desc; char path[LOG_PATH_LEN+1]; ret = hardfault_get_desc(caller, &desc, false); + if (ret >= 0) { + int fd = ret; state = (desc.lastwrite.tv_sec || desc.lastwrite.tv_nsec) ? OK : 1; int rv = close(fd); @@ -502,30 +541,109 @@ static int hardfault_commit(char *caller) identify(caller); syslog(LOG_INFO, "Failed to Close Fault Log (%d)\n",rv); } else { + if (state != OK) { identify(caller); syslog(LOG_INFO, "Nothing to save\n",path); ret = -ENOENT; } else { - ret = format_fault_file_name(&desc.lastwrite, path, arraySize(path)); - if (ret == OK) { - int fdout = open(path, O_RDWR | O_CREAT); - if (fdout > 0) { - identify(caller); - syslog(LOG_INFO, "Saving Fault Log file %s\n",path); - ret = hardfault_write(caller, fdout, HARDFAULT_FILE_FORMAT, true); - identify(caller); - syslog(LOG_INFO, "Done saving Fault Log file\n"); - close(fdout); - } - - } + ret = format_fault_file_name(&desc.lastwrite, path, arraySize(path)); + if (ret == OK) { + int fdout = open(path, O_RDWR | O_CREAT); + if (fdout > 0) { + identify(caller); + syslog(LOG_INFO, "Saving Fault Log file %s\n",path); + ret = hardfault_write(caller, fdout, HARDFAULT_FILE_FORMAT, true); + identify(caller); + syslog(LOG_INFO, "Done saving Fault Log file\n"); + close(fdout); + } + } } } } return ret; } + +/**************************************************************************** + * hardfault_dowrite + ****************************************************************************/ +static int hardfault_dowrite(char * caller, int infd, int outfd, + struct bbsramd_s *desc, int format) +{ + int ret = -ENOMEM; + char *line = zalloc(OUT_BUFFER_LEN); + if (line) { + char *info = zalloc(sizeof(info_s)); + if (info) { + lseek(infd, offsetof(fullcontext_s, info), SEEK_SET); + ret = read(infd, info, sizeof(info_s)); + if (ret < 0) { + identify(caller); + syslog(LOG_INFO, "Failed to read Fault Log file [%s] (%d)\n", HARDFAULT_PATH, ret); + ret = -EIO; + } else { + info_s *pinfo = (info_s *) info; + ret = write_dump_header(caller, outfd, &desc->lastwrite, line, OUT_BUFFER_LEN); + if (ret == OK) { + + switch(format) { + case HARDFAULT_DISPLAY_FORMAT: + ret = write_intterupt_stack(infd, outfd, pinfo, line, OUT_BUFFER_LEN); + if (ret == OK || ret == -ENOENT) { + ret = write_user_stack(infd, outfd, pinfo, line, OUT_BUFFER_LEN); + if (ret == OK || ret == -ENOENT) { + ret = write_dump_info(outfd, pinfo, desc, line, OUT_BUFFER_LEN); + if (ret == OK || ret == -ENOENT) { + ret = write_registers_info(outfd, pinfo, line, OUT_BUFFER_LEN); + if (ret == OK || ret == -ENOENT) { + ret = write_interrupt_stack_info(outfd, pinfo, line, OUT_BUFFER_LEN); + if (ret == OK || ret == -ENOENT) { + ret = write_user_stack_info(outfd, pinfo, line, OUT_BUFFER_LEN); + } + } + } + } + } + break; + + case HARDFAULT_FILE_FORMAT: + ret = write_dump_info(outfd, pinfo, desc, line, OUT_BUFFER_LEN); + if (ret == OK) { + ret = write_registers_info(outfd, pinfo, line, OUT_BUFFER_LEN); + if (ret == OK || ret == -ENOENT) { + ret = write_interrupt_stack_info(outfd, pinfo, line, OUT_BUFFER_LEN); + if (ret == OK || ret == -ENOENT) { + ret = write_user_stack_info(outfd, pinfo, line, OUT_BUFFER_LEN); + if (ret == OK || ret == -ENOENT) { + ret = write_intterupt_stack(infd, outfd, pinfo, line, OUT_BUFFER_LEN); + if (ret == OK || ret == -ENOENT) { + ret = write_user_stack(infd, outfd, pinfo, line, OUT_BUFFER_LEN); + } + } + } + } + } + break; + + default: + ret = -EINVAL; + break; + } + } + if (ret == OK || ret == -ENOENT) { + ret = write_dump_footer(caller, outfd, &desc->lastwrite, line, OUT_BUFFER_LEN); + } + } + free(info); + } + free(line); + } + return ret; +} + + /**************************************************************************** * Public Functions ****************************************************************************/ @@ -602,75 +720,80 @@ __EXPORT int hardfault_increment_reboot(char *caller, bool reset) identify(caller); syslog(LOG_INFO, "Failed to open Fault reboot count file [%s] (%d)\n", HARDFAULT_REBOOT_PATH, ret); } else { + + ret = OK; if (!reset) { - read(fd, &count, sizeof(count)); - lseek(fd, 0, SEEK_SET); - count++; + if (read(fd, &count, sizeof(count)) != sizeof(count)) { + ret = -EIO; + close(fd); + } else { + lseek(fd, 0, SEEK_SET); + count++; + } + } + + if (ret == OK) { + ret = write(fd, &count, sizeof(count)); + if (ret != sizeof(count)) { + ret = -EIO; + } else { + ret = close(fd); + if (ret == OK) { + ret = count; + } + } } - ret = write(fd, &count, sizeof(count)); - close(fd); - ret = count; } return ret; } /**************************************************************************** * hardfault_write ****************************************************************************/ -fullcontext_s dump; __EXPORT int hardfault_write(char *caller, int fd, int format, bool rearm) { - char line[200]; - memset(&dump,0,sizeof(dump)); struct bbsramd_s desc; + + switch(format) { + + case HARDFAULT_FILE_FORMAT: + case HARDFAULT_DISPLAY_FORMAT: + break; + + default: + return -EINVAL; + } + int ret = hardfault_get_desc(caller, &desc, false); if (ret >= 0) { int hffd = ret; - ret = read(hffd, (char *)&dump, sizeof(dump)); + + + int rv = hardfault_dowrite(caller, hffd, fd, &desc, format); + + ret = close(hffd); if (ret < 0) { identify(caller); - syslog(LOG_INFO, "Failed to read Fault Log file [%s] (%d)\n", HARDFAULT_PATH, ret); - } else { - ret = close(hffd); - if (ret < 0) { - identify(caller); - syslog(LOG_INFO, "Failed to Close Fault Log (%d)\n", ret); + syslog(LOG_INFO, "Failed to Close Fault Log (%d)\n", ret); - } else { - - switch(format) { - case HARDFAULT_DISPLAY_FORMAT: - write_dump_header(caller, fd, &desc.lastwrite,line, arraySize(line)); - write_intterupt_stack(fd, &dump, line, arraySize(line)); - write_user_stack(fd, &dump, line, arraySize(line)); - write_dump_info(fd, &dump, &desc.lastwrite, line, arraySize(line)); - write_registers_info(fd, &dump, line, arraySize(line)); - write_interrupt_stack_info(fd, &dump, line, arraySize(line)); - write_user_stack_info(fd, &dump, line, arraySize(line)); - break; - - case HARDFAULT_FILE_FORMAT: - write_dump_header(caller, fd, &desc.lastwrite,line, arraySize(line)); - write_dump_info(fd, &dump, &desc.lastwrite, line, arraySize(line)); - write_registers_info(fd, &dump, line, arraySize(line)); - write_interrupt_stack_info(fd, &dump, line, arraySize(line)); - write_user_stack_info(fd, &dump,line, arraySize(line)); - write_intterupt_stack(fd, &dump,line, arraySize(line)); - write_user_stack(fd, &dump, line, arraySize(line)); - break; - - default: - return -EINVAL; - break; - } + } - write_dump_footer(caller, fd, &desc.lastwrite,line, arraySize(line)); + if (rv == OK && rearm) { + ret = hardfault_rearm(caller); + if (ret < 0) { + identify(caller); + syslog(LOG_INFO, "Failed to re-arm Fault Log (%d)\n", ret); + } + } - if (rearm) { - ret = hardfault_rearm(caller); + if (ret == OK) { + ret = rv; + } - } - } + if (ret != OK) + { + identify(caller); + syslog(LOG_INFO, "Failed to Write Fault Log (%d)\n", ret); } } return ret; -- cgit v1.2.3 From c5ba2fbfd1397bd610088be8acac473408a627da Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Thu, 5 Mar 2015 04:48:50 -1000 Subject: Update NuttX Submodule == upstream with better errors returned from BBSRAM --- NuttX | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NuttX b/NuttX index d5645521c..dbca8f554 160000 --- a/NuttX +++ b/NuttX @@ -1 +1 @@ -Subproject commit d5645521c83e57a1669f41dc0acae190596095f7 +Subproject commit dbca8f5549a676ec663f67d2bba9776f83b8fbf3 -- cgit v1.2.3 From 0e177d995788b7f4c265e13de360bb09a2c244a2 Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Thu, 5 Mar 2015 05:13:21 -1000 Subject: Added error message if uses of _sdata corrupts BBSRAM driver statics --- src/drivers/boards/px4fmu-v2/px4fmu2_init.c | 78 +++++++++++++++------------- src/modules/systemlib/hardfault_log.h | 12 ++--- src/systemcmds/hardfault_log/hardfault_log.c | 50 +++++++++--------- 3 files changed, 71 insertions(+), 69 deletions(-) diff --git a/src/drivers/boards/px4fmu-v2/px4fmu2_init.c b/src/drivers/boards/px4fmu-v2/px4fmu2_init.c index 52ee00a7d..74bbfa4c6 100644 --- a/src/drivers/boards/px4fmu-v2/px4fmu2_init.c +++ b/src/drivers/boards/px4fmu-v2/px4fmu2_init.c @@ -498,10 +498,13 @@ inline static void copy_reverse(stack_word_t *dest, stack_word_t *src, int size) __EXPORT void board_crashdump(uint32_t currentsp, void *tcb, uint8_t *filename, int lineno) { - /* We need a chunk of ram to save the complete contest in. + /* We need a chunk of ram to save the complete context in. * Since we are going to reboot we will use &_sdata - * + * which is the lowest memory and the amount we will save + * _should be_ below any resources we need herein. + * Unfortunately this is hard to test. See dead below */ + fullcontext_s *pdump = (fullcontext_s*)&_sdata; (void)irqsave(); @@ -553,13 +556,14 @@ __EXPORT void board_crashdump(uint32_t currentsp, void *tcb, uint8_t *filename, { pdump->info.stacks.interrupt.sp = currentsp; - pdump->info.flags |= eRegs; + pdump->info.flags |= (eRegsPresent | eUserStackPresent | eIntStackPresent); memcpy(pdump->info.regs, (void*)current_regs, sizeof(pdump->info.regs)); pdump->info.stacks.user.sp = pdump->info.regs[REG_R13]; - currentsp = pdump->info.stacks.user.sp; + } else { /* users context */ + pdump->info.flags |= eUserStackPresent; pdump->info.stacks.user.sp = currentsp; } @@ -581,56 +585,56 @@ __EXPORT void board_crashdump(uint32_t currentsp, void *tcb, uint8_t *filename, pdump->info.stacks.interrupt.top = (uint32_t)&g_intstackbase; pdump->info.stacks.interrupt.size = (CONFIG_ARCH_INTERRUPTSTACK & ~3); - /* If the current stack pointer is within the interrupt stack then - * save the interrupt stack data centered about the interrupt stack pointer + /* If In interrupt Context save the interrupt stack data centered + * about the interrupt stack pointer */ - if (pdump->info.stacks.interrupt.sp <= pdump->info.stacks.interrupt.top && - pdump->info.stacks.interrupt.sp > pdump->info.stacks.interrupt.top - pdump->info.stacks.interrupt.size) - { - pdump->info.flags |= eIntStack; + if ((pdump->info.flags & eIntStackPresent) != 0) { stack_word_t * ps = (stack_word_t *) pdump->info.stacks.interrupt.sp; copy_reverse(pdump->istack, &ps[arraySize(pdump->istack)/2], arraySize(pdump->istack)); - } else { - pdump->info.flags |= eInvalidIntStack; - } + } + + /* Is it Invalid? */ + + if (!(pdump->info.stacks.interrupt.sp <= pdump->info.stacks.interrupt.top && + pdump->info.stacks.interrupt.sp > pdump->info.stacks.interrupt.top - pdump->info.stacks.interrupt.size)) { + pdump->info.flags |= eInvalidIntStackPrt; + } #endif - /* If the saved context of the interrupted process's stack pointer lies within the - * allocated user stack memory then save the user stack centered about the user sp + /* If In interrupt context or User save the user stack data centered + * about the user stack pointer */ - if (currentsp <= pdump->info.stacks.user.top && - currentsp > pdump->info.stacks.user.top - pdump->info.stacks.user.size) + if ((pdump->info.flags & eUserStackPresent) != 0) { - pdump->info.flags |= eUserStack; stack_word_t * ps = (stack_word_t *) pdump->info.stacks.user.sp; copy_reverse(pdump->ustack, &ps[arraySize(pdump->ustack)/2], arraySize(pdump->ustack)); - } else { - pdump->info.flags |= eInvalidUserStack; } - /* Oh boy we have a real hot mess on our hands so save above and below the - * current sp - */ + /* Is it Invalid? */ - if ((pdump->info.flags & eStackValid) == 0) + if (!(pdump->info.stacks.user.sp <= pdump->info.stacks.user.top && + pdump->info.stacks.user.sp > pdump->info.stacks.user.top - pdump->info.stacks.user.size)) { - pdump->info.flags |= (eStackUnknown | eStackValid); -#if CONFIG_ARCH_INTERRUPTSTACK > 3 - /* sp and above in istack */ - stack_word_t * ps = (stack_word_t *) pdump->info.stacks.interrupt.sp; - copy_reverse(pdump->istack, &ps[arraySize(pdump->istack)], arraySize(pdump->istack)); - /* below in ustack */ - ps = (stack_word_t *) pdump->info.stacks.user.sp; - copy_reverse(pdump->ustack, &ps[arraySize(pdump->ustack)], arraySize(pdump->ustack)); -#else - /* save above and below in ustack */ - copy_reverse(pdump->ustack, &ps[arraySize(pdump->ustack)/2], arraySize(pdump->ustack)); -#endif + pdump->info.flags |= eInvalidUserStackPtr; } - stm32_bbsram_savepanic(HARDFAULT_FILENO, (uint8_t*)pdump, sizeof(fullcontext_s)); + int rv = stm32_bbsram_savepanic(HARDFAULT_FILENO, (uint8_t*)pdump, sizeof(fullcontext_s)); + + /* Test if memory got wiped because of using _sdata */ + + if (rv == -ENXIO) { + char * dead = "Memory wiped - dump not saved!"; + while(*dead) { + up_lowputc(*dead++); + } + } else if (rv == -ENOSPC) { + + /* hard fault again */ + + up_lowputc('!'); + } #if defined(CONFIG_BOARD_RESET_ON_CRASH) diff --git a/src/modules/systemlib/hardfault_log.h b/src/modules/systemlib/hardfault_log.h index 6983a5737..c64381b42 100644 --- a/src/modules/systemlib/hardfault_log.h +++ b/src/modules/systemlib/hardfault_log.h @@ -232,13 +232,11 @@ typedef struct /* Flags to identify what is in the dump */ typedef enum { - eRegs = 0x01, - eUserStack = 0x02, - eIntStack = 0x04, - eStackValid = eUserStack | eIntStack, - eStackUnknown = 0x08, - eInvalidUserStack = 0x20, - eInvalidIntStack = 0x40, + eRegsPresent = 0x01, + eUserStackPresent = 0x02, + eIntStackPresent = 0x04, + eInvalidUserStackPtr = 0x20, + eInvalidIntStackPrt = 0x40, } fault_flags_t; typedef struct { diff --git a/src/systemcmds/hardfault_log/hardfault_log.c b/src/systemcmds/hardfault_log/hardfault_log.c index 959ea4a3a..3ac98ae95 100644 --- a/src/systemcmds/hardfault_log/hardfault_log.c +++ b/src/systemcmds/hardfault_log/hardfault_log.c @@ -196,7 +196,7 @@ static void identify(char *caller) ****************************************************************************/ static int hardfault_get_desc(char *caller, struct bbsramd_s *desc, bool silent) { - int ret = -ENOENT; + int ret = ENOENT; int fd = open(HARDFAULT_PATH, O_RDONLY); if (fd < 0 ) { if (!silent) { @@ -360,8 +360,8 @@ static int write_registers(uint32_t regs[], char *buffer, int max, int fd) ****************************************************************************/ static int write_registers_info(int fdout, info_s *pi , char *buffer, int sz) { - int ret = -ENOENT; - if (pi->flags & eRegs) { + int ret = ENOENT; + if (pi->flags & eRegsPresent) { ret = -EIO; int n = snprintf(buffer, sz, " Processor registers: from 0x%08x\n", pi->current_regs); if (n == write(fdout, buffer, n)) { @@ -377,9 +377,9 @@ static int write_registers_info(int fdout, info_s *pi , char *buffer, int sz) static int write_interrupt_stack_info(int fdout, info_s *pi, char *buffer, unsigned int sz) { - int ret = -ENOENT; - if (pi->flags & eIntStack) { - ret = write_stack_detail((pi->flags & eInvalidIntStack) != 0, + int ret = ENOENT; + if (pi->flags & eIntStackPresent) { + ret = write_stack_detail((pi->flags & eInvalidIntStackPrt) != 0, &pi->stacks.interrupt, "IRQ", buffer, sz, fdout); } @@ -392,9 +392,9 @@ static int write_interrupt_stack_info(int fdout, info_s *pi, char *buffer, static int write_user_stack_info(int fdout, info_s *pi, char *buffer, unsigned int sz) { - int ret = -ENOENT; - if (pi->flags & eUserStack) { - ret = write_stack_detail((pi->flags & eInvalidUserStack) != 0, + int ret = ENOENT; + if (pi->flags & eUserStackPresent) { + ret = write_stack_detail((pi->flags & eInvalidUserStackPtr) != 0, &pi->stacks.user, "User", buffer, sz, fdout); } return ret; @@ -484,10 +484,10 @@ static int write_dump_footer(char * caller, int fdout, struct timespec *ts, static int write_intterupt_stack(int fdin, int fdout, info_s *pi, char *buffer, unsigned int sz) { - int ret = -ENOENT; - if ((pi->flags & eIntStack) != 0) { + int ret = ENOENT; + if ((pi->flags & eIntStackPresent) != 0) { lseek(fdin, offsetof(fullcontext_s, istack), SEEK_SET); - ret = write_stack((pi->flags & eInvalidIntStack) != 0, + ret = write_stack((pi->flags & eInvalidIntStackPrt) != 0, CONFIG_ISTACK_SIZE, pi->stacks.interrupt.sp + CONFIG_ISTACK_SIZE/2, pi->stacks.interrupt.top, @@ -506,10 +506,10 @@ static int write_intterupt_stack(int fdin, int fdout, info_s *pi, char *buffer, static int write_user_stack(int fdin, int fdout, info_s *pi, char *buffer, unsigned int sz) { - int ret = -ENOENT; - if ((pi->flags & eUserStack) != 0) { + int ret = ENOENT; + if ((pi->flags & eUserStackPresent) != 0) { lseek(fdin,offsetof(fullcontext_s, ustack), SEEK_SET); - ret = write_stack((pi->flags & eInvalidUserStack) != 0, + ret = write_stack((pi->flags & eInvalidUserStackPtr) != 0, CONFIG_USTACK_SIZE, pi->stacks.user.sp + CONFIG_USTACK_SIZE/2, pi->stacks.user.top, @@ -591,15 +591,15 @@ static int hardfault_dowrite(char * caller, int infd, int outfd, switch(format) { case HARDFAULT_DISPLAY_FORMAT: ret = write_intterupt_stack(infd, outfd, pinfo, line, OUT_BUFFER_LEN); - if (ret == OK || ret == -ENOENT) { + if (ret >= OK) { ret = write_user_stack(infd, outfd, pinfo, line, OUT_BUFFER_LEN); - if (ret == OK || ret == -ENOENT) { + if (ret >= OK) { ret = write_dump_info(outfd, pinfo, desc, line, OUT_BUFFER_LEN); - if (ret == OK || ret == -ENOENT) { + if (ret >= OK) { ret = write_registers_info(outfd, pinfo, line, OUT_BUFFER_LEN); - if (ret == OK || ret == -ENOENT) { + if (ret >= OK) { ret = write_interrupt_stack_info(outfd, pinfo, line, OUT_BUFFER_LEN); - if (ret == OK || ret == -ENOENT) { + if (ret >= OK) { ret = write_user_stack_info(outfd, pinfo, line, OUT_BUFFER_LEN); } } @@ -612,13 +612,13 @@ static int hardfault_dowrite(char * caller, int infd, int outfd, ret = write_dump_info(outfd, pinfo, desc, line, OUT_BUFFER_LEN); if (ret == OK) { ret = write_registers_info(outfd, pinfo, line, OUT_BUFFER_LEN); - if (ret == OK || ret == -ENOENT) { + if (ret >= OK) { ret = write_interrupt_stack_info(outfd, pinfo, line, OUT_BUFFER_LEN); - if (ret == OK || ret == -ENOENT) { + if (ret >= OK) { ret = write_user_stack_info(outfd, pinfo, line, OUT_BUFFER_LEN); - if (ret == OK || ret == -ENOENT) { + if (ret >= OK) { ret = write_intterupt_stack(infd, outfd, pinfo, line, OUT_BUFFER_LEN); - if (ret == OK || ret == -ENOENT) { + if (ret >= OK) { ret = write_user_stack(infd, outfd, pinfo, line, OUT_BUFFER_LEN); } } @@ -632,7 +632,7 @@ static int hardfault_dowrite(char * caller, int infd, int outfd, break; } } - if (ret == OK || ret == -ENOENT) { + if (ret >= OK) { ret = write_dump_footer(caller, outfd, &desc->lastwrite, line, OUT_BUFFER_LEN); } } -- cgit v1.2.3 From 4c6f44741180d0d82d585326d929136d8ef644ef Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Thu, 5 Mar 2015 05:14:48 -1000 Subject: Added BUILD_URI to locate elf file from fualt log --- makefiles/firmware.mk | 7 ++++++- src/lib/version/version.h | 2 ++ src/systemcmds/hardfault_log/hardfault_log.c | 4 ++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/makefiles/firmware.mk b/makefiles/firmware.mk index 21e8739aa..4b4823a98 100644 --- a/makefiles/firmware.mk +++ b/makefiles/firmware.mk @@ -110,7 +110,12 @@ ifneq ($(words $(PX4_BASE)),1) $(error Cannot build when the PX4_BASE path contains one or more space characters.) endif +# The Url for the elf file for crash logging + +BUILD_URI ?= "localhost" + $(info % GIT_DESC = $(GIT_DESC)) +$(info % BUILD_URI = $(BUILD_URI)) # # Set a default target so that included makefiles or errors here don't @@ -183,7 +188,7 @@ EXTRA_CLEANS = # # Extra defines for compilation # -export EXTRADEFINES := -DGIT_VERSION=$(GIT_DESC) +export EXTRADEFINES := -DGIT_VERSION=$(GIT_DESC) -DBUILD_URI=$(BUILD_URI) # # Append the per-board driver directory to the header search path. diff --git a/src/lib/version/version.h b/src/lib/version/version.h index d8ccb6774..366ba80a0 100644 --- a/src/lib/version/version.h +++ b/src/lib/version/version.h @@ -51,6 +51,8 @@ #define STRINGIFY(s) FREEZE_STR(s) #define FW_GIT STRINGIFY(GIT_VERSION) +#define FW_BUILD_URI STRINGIFY(BUILD_URI) + #ifdef CONFIG_ARCH_BOARD_PX4FMU_V1 #define HW_ARCH "PX4FMU_V1" #endif diff --git a/src/systemcmds/hardfault_log/hardfault_log.c b/src/systemcmds/hardfault_log/hardfault_log.c index 3ac98ae95..d0d67b4fc 100644 --- a/src/systemcmds/hardfault_log/hardfault_log.c +++ b/src/systemcmds/hardfault_log/hardfault_log.c @@ -444,6 +444,10 @@ static int write_dump_info(int fdout, info_s *info, struct bbsramd_s * desc, if (n != write(fdout, buffer, n)) { return -EIO; } + n = snprintf(buffer, sz, " Build url: %s \n", FW_BUILD_URI); + if (n != write(fdout, buffer, n)) { + return -EIO; + } return OK; } -- cgit v1.2.3 From f47b2995a4e39e7091fa420c7614fa0682f58b81 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Thu, 27 Nov 2014 17:18:45 +0100 Subject: Add param cmd to test config --- makefiles/config_px4fmu-v2_test.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/makefiles/config_px4fmu-v2_test.mk b/makefiles/config_px4fmu-v2_test.mk index 544aaf05e..39e65e9f2 100644 --- a/makefiles/config_px4fmu-v2_test.mk +++ b/makefiles/config_px4fmu-v2_test.mk @@ -30,7 +30,7 @@ MODULES += drivers/airspeed MODULES += drivers/ets_airspeed MODULES += drivers/meas_airspeed MODULES += modules/sensors - +MODULES += systemcmds/param # # System commands # -- cgit v1.2.3 From 8ae6b0f3d1ec76e8f2eee570f897d7284a4c2744 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Thu, 27 Nov 2014 18:36:42 +0100 Subject: Add top to test build --- makefiles/config_px4fmu-v2_test.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/makefiles/config_px4fmu-v2_test.mk b/makefiles/config_px4fmu-v2_test.mk index 39e65e9f2..544aaf05e 100644 --- a/makefiles/config_px4fmu-v2_test.mk +++ b/makefiles/config_px4fmu-v2_test.mk @@ -30,7 +30,7 @@ MODULES += drivers/airspeed MODULES += drivers/ets_airspeed MODULES += drivers/meas_airspeed MODULES += modules/sensors -MODULES += systemcmds/param + # # System commands # -- cgit v1.2.3 From 814719fd6a784fd9d9e724c721c2123815ee624a Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Thu, 25 Dec 2014 06:34:23 -1000 Subject: Added the ability to apply PX4 specific patches to Nuttx At the moment this entails adding NuttX/nuttx/arch/arm/include/math.h --- Makefile | 18 +- makefiles/setup.mk | 8 +- nuttx-patches/math.patch | 590 +++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 603 insertions(+), 13 deletions(-) create mode 100644 nuttx-patches/math.patch diff --git a/Makefile b/Makefile index 7c8fa7a4f..23fbf8f08 100644 --- a/Makefile +++ b/Makefile @@ -190,23 +190,23 @@ NUTTX_PATCHED = $(NUTTX_SRC).patchedpx4common .PHONY: nuttxpatches nuttxpatches: - $(Q) -if [ ! -f $(NUTTX_PATCHED) ]; then \ + $(Q) if [ ! -f $(NUTTX_PATCHED) ]; then \ for patch in $(NUTTX_PATCHES); \ do \ - $(PATCH) -p0 -N < $$patch >/dev/null; \ + $(PATCH) -p0 -N < $$patch; \ done \ fi $(Q) $(TOUCH) $(NUTTX_PATCHED) .PHONY: cleannuttxpatches cleannuttxpatches: - $(Q) -if [ -f $(NUTTX_PATCHED) ]; then \ + $(Q) if [ ! -f $(NUTTX_PATCHED) ]; then \ for patch in $(NUTTX_PATCHES); \ do \ - $(PATCH) -p0 -N -R -r - < $$patch >/dev/null; \ + $(PATCH) -p0 -N -R < $$patch; \ done \ fi - $(Q) $(REMOVE) $(NUTTX_PATCHED) + $(Q) $(TOUCH) $(NUTTX_PATCHED) # # The user can run the NuttX 'menuconfig' tool for a single board configuration with @@ -301,11 +301,11 @@ clean: $(Q) $(REMOVE) $(IMAGE_DIR)*.px4 .PHONY: distclean -distclean: cleannuttxpatches clean +distclean: clean cleannuttxpatches @echo > /dev/null - $(Q) $(REMOVE) $(ARCHIVE_DIR)*.export - $(Q) $(MAKE) -C $(NUTTX_SRC) -r $(MQUIET) distclean - $(Q) (cd $(NUTTX_SRC)/configs && $(FIND) . -maxdepth 1 -type l -delete) + $(Q) $(REMOVE) $(ARCHIVE_DIR)*.export > /dev/null + $(Q) $(MAKE) -C $(NUTTX_SRC) -r $(MQUIET) distclean > /dev/null + $(Q) (cd $(NUTTX_SRC)/configs && $(FIND) . -maxdepth 1 -type l -delete) > /dev/null # # Print some help text diff --git a/makefiles/setup.mk b/makefiles/setup.mk index b41ec0180..ed95dfc37 100644 --- a/makefiles/setup.mk +++ b/makefiles/setup.mk @@ -68,17 +68,17 @@ export INCLUDE_DIRS := $(PX4_MODULE_SRC) \ # # Tools # -export MKFW = $(PX4_BASE)/Tools/px_mkfw.py +export MKFW = $(PX4_BASE)/Tools/px_mkfw.py export UPLOADER = $(PX4_BASE)/Tools/px_uploader.py -export COPY = cp +export COPY = cp export COPYDIR = cp -Rf export REMOVE = rm -f export RMDIR = rm -rf export GENROMFS = genromfs export TOUCH = touch export MKDIR = mkdir -export FIND = find -export ECHO = echo +export FIND = find +export ECHO = echo export UNZIP_CMD = unzip export PYTHON = python export OPENOCD = openocd diff --git a/nuttx-patches/math.patch b/nuttx-patches/math.patch new file mode 100644 index 000000000..6b60e2cae --- /dev/null +++ b/nuttx-patches/math.patch @@ -0,0 +1,590 @@ +diff -ruN NuttX/nuttx/arch/arm/include/m.math,h /tmp/NuttX/nuttx/arch/arm/include/m.math,h +--- NuttX/nuttx/arch/arm/include/m.math,h 2014-12-25 06:02:40.565856919 -1000 ++++ NuttX/nuttx/arch/arm/include/m.math,h 1969-12-31 14:00:00.000000000 -1000 +@@ -1,585 +0,0 @@ +-#ifndef _MATH_H_ +- +-#define _MATH_H_ +- +-#include +-#include "_ansi.h" +- +-_BEGIN_STD_C +- +-/* Natural log of 2 */ +-#define _M_LN2 0.693147180559945309417 +- +-#if defined(__GNUC__) && \ +- ( (__GNUC__ >= 4) || \ +- ( (__GNUC__ >= 3) && defined(__GNUC_MINOR__) && (__GNUC_MINOR__ >= 3) ) ) +- +- /* gcc >= 3.3 implicitly defines builtins for HUGE_VALx values. */ +- +-# ifndef HUGE_VAL +-# define HUGE_VAL (__builtin_huge_val()) +-# endif +- +-# ifndef HUGE_VALF +-# define HUGE_VALF (__builtin_huge_valf()) +-# endif +- +-# ifndef HUGE_VALL +-# define HUGE_VALL (__builtin_huge_vall()) +-# endif +- +-# ifndef INFINITY +-# define INFINITY (__builtin_inff()) +-# endif +- +-# ifndef NAN +-# define NAN (__builtin_nanf("")) +-# endif +- +-#else /* !gcc >= 3.3 */ +- +- /* No builtins. Use fixed defines instead. (All 3 HUGE plus the INFINITY +- * and NAN macros are required to be constant expressions. Using a variable-- +- * even a static const--does not meet this requirement, as it cannot be +- * evaluated at translation time.) +- * The infinities are done using numbers that are far in excess of +- * something that would be expected to be encountered in a floating-point +- * implementation. (A more certain way uses values from float.h, but that is +- * avoided because system includes are not supposed to include each other.) +- * This method might produce warnings from some compilers. (It does in +- * newer GCCs, but not for ones that would hit this #else.) If this happens, +- * please report details to the Newlib mailing list. */ +- +- #ifndef HUGE_VAL +- #define HUGE_VAL (1.0e999999999) +- #endif +- +- #ifndef HUGE_VALF +- #define HUGE_VALF (1.0e999999999F) +- #endif +- +- #if !defined(HUGE_VALL) && defined(_HAVE_LONG_DOUBLE) +- #define HUGE_VALL (1.0e999999999L) +- #endif +- +- #if !defined(INFINITY) +- #define INFINITY (HUGE_VALF) +- #endif +- +- #if !defined(NAN) +- #if defined(__GNUC__) && defined(__cplusplus) +- /* Exception: older g++ versions warn about the divide by 0 used in the +- * normal case (even though older gccs do not). This trick suppresses the +- * warning, but causes errors for plain gcc, so is only used in the one +- * special case. */ +- static const union { __ULong __i[1]; float __d; } __Nanf = {0x7FC00000}; +- #define NAN (__Nanf.__d) +- #else +- #define NAN (0.0F/0.0F) +- #endif +- #endif +- +-#endif /* !gcc >= 3.3 */ +- +-/* Reentrant ANSI C functions. */ +- +-#ifndef __math_68881 +-extern double atan _PARAMS((double)); +-extern double cos _PARAMS((double)); +-extern double sin _PARAMS((double)); +-extern double tan _PARAMS((double)); +-extern double tanh _PARAMS((double)); +-extern double frexp _PARAMS((double, int *)); +-extern double modf _PARAMS((double, double *)); +-extern double ceil _PARAMS((double)); +-extern double fabs _PARAMS((double)); +-extern double floor _PARAMS((double)); +-#endif /* ! defined (__math_68881) */ +- +-/* Non reentrant ANSI C functions. */ +- +-#ifndef _REENT_ONLY +-#ifndef __math_68881 +-extern double acos _PARAMS((double)); +-extern double asin _PARAMS((double)); +-extern double atan2 _PARAMS((double, double)); +-extern double cosh _PARAMS((double)); +-extern double sinh _PARAMS((double)); +-extern double exp _PARAMS((double)); +-extern double ldexp _PARAMS((double, int)); +-extern double log _PARAMS((double)); +-extern double log10 _PARAMS((double)); +-extern double pow _PARAMS((double, double)); +-extern double sqrt _PARAMS((double)); +-extern double fmod _PARAMS((double, double)); +-#endif /* ! defined (__math_68881) */ +-#endif /* ! defined (_REENT_ONLY) */ +- +-#if !defined(__STRICT_ANSI__) || defined(__cplusplus) || __STDC_VERSION__ >= 199901L +- +-/* ISO C99 types and macros. */ +- +-#ifndef FLT_EVAL_METHOD +-#define FLT_EVAL_METHOD 0 +-typedef float float_t; +-typedef double double_t; +-#endif /* FLT_EVAL_METHOD */ +- +-#define FP_NAN 0 +-#define FP_INFINITE 1 +-#define FP_ZERO 2 +-#define FP_SUBNORMAL 3 +-#define FP_NORMAL 4 +- +-#ifndef FP_ILOGB0 +-# define FP_ILOGB0 (-INT_MAX) +-#endif +-#ifndef FP_ILOGBNAN +-# define FP_ILOGBNAN INT_MAX +-#endif +- +-#ifndef MATH_ERRNO +-# define MATH_ERRNO 1 +-#endif +-#ifndef MATH_ERREXCEPT +-# define MATH_ERREXCEPT 2 +-#endif +-#ifndef math_errhandling +-# define math_errhandling MATH_ERRNO +-#endif +- +-extern int __isinff (float x); +-extern int __isinfd (double x); +-extern int __isnanf (float x); +-extern int __isnand (double x); +-extern int __fpclassifyf (float x); +-extern int __fpclassifyd (double x); +-extern int __signbitf (float x); +-extern int __signbitd (double x); +- +-#define fpclassify(__x) \ +- ((sizeof(__x) == sizeof(float)) ? __fpclassifyf(__x) : \ +- __fpclassifyd(__x)) +- +-#ifndef isfinite +- #define isfinite(__y) \ +- (__extension__ ({int __cy = fpclassify(__y); \ +- __cy != FP_INFINITE && __cy != FP_NAN;})) +-#endif +- +-/* Note: isinf and isnan were once functions in newlib that took double +- * arguments. C99 specifies that these names are reserved for macros +- * supporting multiple floating point types. Thus, they are +- * now defined as macros. Implementations of the old functions +- * taking double arguments still exist for compatibility purposes +- * (prototypes for them are in ). */ +-#ifndef isinf +- #define isinf(y) (fpclassify(y) == FP_INFINITE) +-#endif +- +-#ifndef isnan +- #define isnan(y) (fpclassify(y) == FP_NAN) +-#endif +- +-#define isnormal(y) (fpclassify(y) == FP_NORMAL) +-#define signbit(__x) \ +- ((sizeof(__x) == sizeof(float)) ? __signbitf(__x) : \ +- __signbitd(__x)) +- +-#define isgreater(x,y) \ +- (__extension__ ({__typeof__(x) __x = (x); __typeof__(y) __y = (y); \ +- !isunordered(__x,__y) && (__x > __y);})) +-#define isgreaterequal(x,y) \ +- (__extension__ ({__typeof__(x) __x = (x); __typeof__(y) __y = (y); \ +- !isunordered(__x,__y) && (__x >= __y);})) +-#define isless(x,y) \ +- (__extension__ ({__typeof__(x) __x = (x); __typeof__(y) __y = (y); \ +- !isunordered(__x,__y) && (__x < __y);})) +-#define islessequal(x,y) \ +- (__extension__ ({__typeof__(x) __x = (x); __typeof__(y) __y = (y); \ +- !isunordered(__x,__y) && (__x <= __y);})) +-#define islessgreater(x,y) \ +- (__extension__ ({__typeof__(x) __x = (x); __typeof__(y) __y = (y); \ +- !isunordered(__x,__y) && (__x < __y || __x > __y);})) +- +-#define isunordered(a,b) \ +- (__extension__ ({__typeof__(a) __a = (a); __typeof__(b) __b = (b); \ +- fpclassify(__a) == FP_NAN || fpclassify(__b) == FP_NAN;})) +- +-/* Non ANSI double precision functions. */ +- +-extern double infinity _PARAMS((void)); +-extern double nan _PARAMS((const char *)); +-extern int finite _PARAMS((double)); +-extern double copysign _PARAMS((double, double)); +-extern double logb _PARAMS((double)); +-extern int ilogb _PARAMS((double)); +- +-extern double asinh _PARAMS((double)); +-extern double cbrt _PARAMS((double)); +-extern double nextafter _PARAMS((double, double)); +-extern double rint _PARAMS((double)); +-extern double scalbn _PARAMS((double, int)); +- +-extern double exp2 _PARAMS((double)); +-extern double scalbln _PARAMS((double, long int)); +-extern double tgamma _PARAMS((double)); +-extern double nearbyint _PARAMS((double)); +-extern long int lrint _PARAMS((double)); +-extern long long int llrint _PARAMS((double)); +-extern double round _PARAMS((double)); +-extern long int lround _PARAMS((double)); +-extern long long int llround _PARAMS((double)); +-extern double trunc _PARAMS((double)); +-extern double remquo _PARAMS((double, double, int *)); +-extern double fdim _PARAMS((double, double)); +-extern double fmax _PARAMS((double, double)); +-extern double fmin _PARAMS((double, double)); +-extern double fma _PARAMS((double, double, double)); +- +-#ifndef __math_68881 +-extern double log1p _PARAMS((double)); +-extern double expm1 _PARAMS((double)); +-#endif /* ! defined (__math_68881) */ +- +-#ifndef _REENT_ONLY +-extern double acosh _PARAMS((double)); +-extern double atanh _PARAMS((double)); +-extern double remainder _PARAMS((double, double)); +-extern double gamma _PARAMS((double)); +-extern double lgamma _PARAMS((double)); +-extern double erf _PARAMS((double)); +-extern double erfc _PARAMS((double)); +-extern double log2 _PARAMS((double)); +-#if !defined(__cplusplus) +-#define log2(x) (log (x) / _M_LN2) +-#endif +- +-#ifndef __math_68881 +-extern double hypot _PARAMS((double, double)); +-#endif +- +-#endif /* ! defined (_REENT_ONLY) */ +- +-/* Single precision versions of ANSI functions. */ +- +-extern float atanf _PARAMS((float)); +-extern float cosf _PARAMS((float)); +-extern float sinf _PARAMS((float)); +-extern float tanf _PARAMS((float)); +-extern float tanhf _PARAMS((float)); +-extern float frexpf _PARAMS((float, int *)); +-extern float modff _PARAMS((float, float *)); +-extern float ceilf _PARAMS((float)); +-extern float fabsf _PARAMS((float)); +-extern float floorf _PARAMS((float)); +- +-#ifndef _REENT_ONLY +-extern float acosf _PARAMS((float)); +-extern float asinf _PARAMS((float)); +-extern float atan2f _PARAMS((float, float)); +-extern float coshf _PARAMS((float)); +-extern float sinhf _PARAMS((float)); +-extern float expf _PARAMS((float)); +-extern float ldexpf _PARAMS((float, int)); +-extern float logf _PARAMS((float)); +-extern float log10f _PARAMS((float)); +-extern float powf _PARAMS((float, float)); +-extern float sqrtf _PARAMS((float)); +-extern float fmodf _PARAMS((float, float)); +-#endif /* ! defined (_REENT_ONLY) */ +- +-/* Other single precision functions. */ +- +-extern float exp2f _PARAMS((float)); +-extern float scalblnf _PARAMS((float, long int)); +-extern float tgammaf _PARAMS((float)); +-extern float nearbyintf _PARAMS((float)); +-extern long int lrintf _PARAMS((float)); +-extern long long llrintf _PARAMS((float)); +-extern float roundf _PARAMS((float)); +-extern long int lroundf _PARAMS((float)); +-extern long long int llroundf _PARAMS((float)); +-extern float truncf _PARAMS((float)); +-extern float remquof _PARAMS((float, float, int *)); +-extern float fdimf _PARAMS((float, float)); +-extern float fmaxf _PARAMS((float, float)); +-extern float fminf _PARAMS((float, float)); +-extern float fmaf _PARAMS((float, float, float)); +- +-extern float infinityf _PARAMS((void)); +-extern float nanf _PARAMS((const char *)); +-extern int finitef _PARAMS((float)); +-extern float copysignf _PARAMS((float, float)); +-extern float logbf _PARAMS((float)); +-extern int ilogbf _PARAMS((float)); +- +-extern float asinhf _PARAMS((float)); +-extern float cbrtf _PARAMS((float)); +-extern float nextafterf _PARAMS((float, float)); +-extern float rintf _PARAMS((float)); +-extern float scalbnf _PARAMS((float, int)); +-extern float log1pf _PARAMS((float)); +-extern float expm1f _PARAMS((float)); +- +-#ifndef _REENT_ONLY +-extern float acoshf _PARAMS((float)); +-extern float atanhf _PARAMS((float)); +-extern float remainderf _PARAMS((float, float)); +-extern float gammaf _PARAMS((float)); +-extern float lgammaf _PARAMS((float)); +-extern float erff _PARAMS((float)); +-extern float erfcf _PARAMS((float)); +-extern float log2f _PARAMS((float)); +-#if !defined(__cplusplus) +-#define log2f(x) (logf (x) / (float_t) _M_LN2) +-#endif +-extern float hypotf _PARAMS((float, float)); +-#endif /* ! defined (_REENT_ONLY) */ +- +-/* On platforms where long double equals double. */ +-#ifdef _LDBL_EQ_DBL +-/* Reentrant ANSI C functions. */ +-#ifndef __math_68881 +-extern long double atanl _PARAMS((long double)); +-extern long double cosl _PARAMS((long double)); +-extern long double sinl _PARAMS((long double)); +-extern long double tanl _PARAMS((long double)); +-extern long double tanhl _PARAMS((long double)); +-extern long double frexpl _PARAMS((long double value, int *)); +-extern long double modfl _PARAMS((long double, long double *)); +-extern long double ceill _PARAMS((long double)); +-extern long double fabsl _PARAMS((long double)); +-extern long double floorl _PARAMS((long double)); +-extern long double log1pl _PARAMS((long double)); +-extern long double expm1l _PARAMS((long double)); +-#endif /* ! defined (__math_68881) */ +-/* Non reentrant ANSI C functions. */ +-#ifndef _REENT_ONLY +-#ifndef __math_68881 +-extern long double acosl _PARAMS((long double)); +-extern long double asinl _PARAMS((long double)); +-extern long double atan2l _PARAMS((long double, long double)); +-extern long double coshl _PARAMS((long double)); +-extern long double sinhl _PARAMS((long double)); +-extern long double expl _PARAMS((long double)); +-extern long double ldexpl _PARAMS((long double, int)); +-extern long double logl _PARAMS((long double)); +-extern long double log2l _PARAMS((long double)); +-extern long double log10l _PARAMS((long double)); +-extern long double powl _PARAMS((long double, long double)); +-extern long double sqrtl _PARAMS((long double)); +-extern long double fmodl _PARAMS((long double, long double)); +-extern long double hypotl _PARAMS((long double, long double)); +-#endif /* ! defined (__math_68881) */ +-#endif /* ! defined (_REENT_ONLY) */ +-extern long double copysignl _PARAMS((long double, long double)); +-extern long double nanl _PARAMS((const char *)); +-extern int ilogbl _PARAMS((long double)); +-extern long double asinhl _PARAMS((long double)); +-extern long double cbrtl _PARAMS((long double)); +-extern long double nextafterl _PARAMS((long double, long double)); +-extern long double rintl _PARAMS((long double)); +-extern long double scalbnl _PARAMS((long double, int)); +-extern long double exp2l _PARAMS((long double)); +-extern long double scalblnl _PARAMS((long double, long)); +-extern long double tgammal _PARAMS((long double)); +-extern long double nearbyintl _PARAMS((long double)); +-extern long int lrintl _PARAMS((long double)); +-extern long long int llrintl _PARAMS((long double)); +-extern long double roundl _PARAMS((long double)); +-extern long lroundl _PARAMS((long double)); +-extern long long int llroundl _PARAMS((long double)); +-extern long double truncl _PARAMS((long double)); +-extern long double remquol _PARAMS((long double, long double, int *)); +-extern long double fdiml _PARAMS((long double, long double)); +-extern long double fmaxl _PARAMS((long double, long double)); +-extern long double fminl _PARAMS((long double, long double)); +-extern long double fmal _PARAMS((long double, long double, long double)); +-#ifndef _REENT_ONLY +-extern long double acoshl _PARAMS((long double)); +-extern long double atanhl _PARAMS((long double)); +-extern long double remainderl _PARAMS((long double, long double)); +-extern long double lgammal _PARAMS((long double)); +-extern long double erfl _PARAMS((long double)); +-extern long double erfcl _PARAMS((long double)); +-#endif /* ! defined (_REENT_ONLY) */ +-#else /* !_LDBL_EQ_DBL */ +-#ifdef __i386__ +-/* Other long double precision functions. */ +-extern _LONG_DOUBLE rintl _PARAMS((_LONG_DOUBLE)); +-extern long int lrintl _PARAMS((_LONG_DOUBLE)); +-extern long long llrintl _PARAMS((_LONG_DOUBLE)); +-#endif /* __i386__ */ +-#endif /* !_LDBL_EQ_DBL */ +- +-#endif /* !defined (__STRICT_ANSI__) || defined(__cplusplus) || __STDC_VERSION__ >= 199901L */ +- +-#if !defined (__STRICT_ANSI__) || defined(__cplusplus) +- +-extern double drem _PARAMS((double, double)); +-extern void sincos _PARAMS((double, double *, double *)); +-extern double gamma_r _PARAMS((double, int *)); +-extern double lgamma_r _PARAMS((double, int *)); +- +-extern double y0 _PARAMS((double)); +-extern double y1 _PARAMS((double)); +-extern double yn _PARAMS((int, double)); +-extern double j0 _PARAMS((double)); +-extern double j1 _PARAMS((double)); +-extern double jn _PARAMS((int, double)); +- +-extern float dremf _PARAMS((float, float)); +-extern void sincosf _PARAMS((float, float *, float *)); +-extern float gammaf_r _PARAMS((float, int *)); +-extern float lgammaf_r _PARAMS((float, int *)); +- +-extern float y0f _PARAMS((float)); +-extern float y1f _PARAMS((float)); +-extern float ynf _PARAMS((int, float)); +-extern float j0f _PARAMS((float)); +-extern float j1f _PARAMS((float)); +-extern float jnf _PARAMS((int, float)); +- +-/* GNU extensions */ +-# ifndef exp10 +-extern double exp10 _PARAMS((double)); +-# endif +-# ifndef pow10 +-extern double pow10 _PARAMS((double)); +-# endif +-# ifndef exp10f +-extern float exp10f _PARAMS((float)); +-# endif +-# ifndef pow10f +-extern float pow10f _PARAMS((float)); +-# endif +- +-#endif /* !defined (__STRICT_ANSI__) || defined(__cplusplus) */ +- +-#ifndef __STRICT_ANSI__ +- +-/* The gamma functions use a global variable, signgam. */ +-#ifndef _REENT_ONLY +-#define signgam (*__signgam()) +-extern int *__signgam _PARAMS((void)); +-#endif /* ! defined (_REENT_ONLY) */ +- +-#define __signgam_r(ptr) _REENT_SIGNGAM(ptr) +- +-/* The exception structure passed to the matherr routine. */ +-/* We have a problem when using C++ since `exception' is a reserved +- name in C++. */ +-#ifdef __cplusplus +-struct __exception +-#else +-struct exception +-#endif +-{ +- int type; +- char *name; +- double arg1; +- double arg2; +- double retval; +- int err; +-}; +- +-#ifdef __cplusplus +-extern int matherr _PARAMS((struct __exception *e)); +-#else +-extern int matherr _PARAMS((struct exception *e)); +-#endif +- +-/* Values for the type field of struct exception. */ +- +-#define DOMAIN 1 +-#define SING 2 +-#define OVERFLOW 3 +-#define UNDERFLOW 4 +-#define TLOSS 5 +-#define PLOSS 6 +- +-/* Useful constants. */ +- +-#define MAXFLOAT 3.40282347e+38F +- +-#define M_E 2.7182818284590452354 +-#define M_LOG2E 1.4426950408889634074 +-#define M_LOG10E 0.43429448190325182765 +-#define M_LN2 _M_LN2 +-#define M_LN10 2.30258509299404568402 +-#define M_PI 3.14159265358979323846 +-#define M_TWOPI (M_PI * 2.0) +-#define M_PI_2 1.57079632679489661923 +-#define M_PI_4 0.78539816339744830962 +-#define M_3PI_4 2.3561944901923448370E0 +-#define M_SQRTPI 1.77245385090551602792981 +-#define M_1_PI 0.31830988618379067154 +-#define M_2_PI 0.63661977236758134308 +-#define M_2_SQRTPI 1.12837916709551257390 +-#define M_DEG_TO_RAD 0.01745329251994 +-#define M_RAD_TO_DEG 57.2957795130823 +-#define M_SQRT2 1.41421356237309504880 +-#define M_SQRT1_2 0.70710678118654752440 +-#define M_LN2LO 1.9082149292705877000E-10 +-#define M_LN2HI 6.9314718036912381649E-1 +-#define M_SQRT3 1.73205080756887719000 +-#define M_IVLN10 0.43429448190325182765 /* 1 / log(10) */ +-#define M_LOG2_E _M_LN2 +-#define M_INVLN2 1.4426950408889633870E0 /* 1 / log(2) */ +- +- +-#define M_E_F 2.7182818284590452354f +-#define M_LOG2E_F 1.4426950408889634074f +-#define M_LOG10E_F 0.43429448190325182765f +-#define M_LN2_F _M_LN2_F +-#define M_LN10_F 2.30258509299404568402f +-#define M_PI_F 3.14159265358979323846f +-#define M_TWOPI_F (M_PI_F * 2.0f) +-#define M_PI_2_F 1.57079632679489661923f +-#define M_PI_4_F 0.78539816339744830962f +-#define M_3PI_4_F 2.3561944901923448370E0f +-#define M_SQRTPI_F 1.77245385090551602792981f +-#define M_1_PI_F 0.31830988618379067154f +-#define M_2_PI_F 0.63661977236758134308f +-#define M_2_SQRTPI_F 1.12837916709551257390f +-#define M_DEG_TO_RAD_F 0.01745329251994f +-#define M_RAD_TO_DEG_F 57.2957795130823f +-#define M_SQRT2_F 1.41421356237309504880f +-#define M_SQRT1_2_F 0.70710678118654752440f +-#define M_LN2LO_F 1.9082149292705877000E-10f +-#define M_LN2HI_F 6.9314718036912381649E-1f +-#define M_SQRT3_F 1.73205080756887719000f +-#define M_IVLN10_F 0.43429448190325182765f /* 1 / log(10) */ +-#define M_LOG2_E_F _M_LN2_F +-#define M_INVLN2_F 1.4426950408889633870E0f /* 1 / log(2) */ +- +-/* Global control over fdlibm error handling. */ +- +-enum __fdlibm_version +-{ +- __fdlibm_ieee = -1, +- __fdlibm_svid, +- __fdlibm_xopen, +- __fdlibm_posix +-}; +- +-#define _LIB_VERSION_TYPE enum __fdlibm_version +-#define _LIB_VERSION __fdlib_version +- +-extern __IMPORT _LIB_VERSION_TYPE _LIB_VERSION; +- +-#define _IEEE_ __fdlibm_ieee +-#define _SVID_ __fdlibm_svid +-#define _XOPEN_ __fdlibm_xopen +-#define _POSIX_ __fdlibm_posix +- +-#endif /* ! defined (__STRICT_ANSI__) */ +- +-_END_STD_C +- +-#ifdef __FAST_MATH__ +-#include +-#endif +- +-#endif /* _MATH_H_ */ +\ No newline at end of file -- cgit v1.2.3 From 8163199b9fa0be623af480a1b0b48b50e26e4f48 Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Thu, 25 Dec 2014 15:18:43 -1000 Subject: Updated configs --- nuttx-configs/px4fmu-v1/nsh/defconfig | 4 ++++ nuttx-configs/px4fmu-v2/nsh/defconfig | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/nuttx-configs/px4fmu-v1/nsh/defconfig b/nuttx-configs/px4fmu-v1/nsh/defconfig index f7a95c1a7..4e5bb5b44 100644 --- a/nuttx-configs/px4fmu-v1/nsh/defconfig +++ b/nuttx-configs/px4fmu-v1/nsh/defconfig @@ -340,6 +340,10 @@ CONFIG_STM32_DMACAPABLE=y # CONFIG_STM32_TIM4_ADC is not set # CONFIG_STM32_TIM5_ADC is not set CONFIG_STM32_USART=y +CONFIG_STM32_FLOWCONTROL_BROKEN=y +CONFIG_SERIAL_IFLOWCONTROL_DEASSERT_WATERMARK=16 +CONFIG_SERIAL_IFLOWCONTROL_ASSERT_WATERMARK=32 + # # U[S]ART Configuration diff --git a/nuttx-configs/px4fmu-v2/nsh/defconfig b/nuttx-configs/px4fmu-v2/nsh/defconfig index 9f94f0dd3..2871a54d0 100644 --- a/nuttx-configs/px4fmu-v2/nsh/defconfig +++ b/nuttx-configs/px4fmu-v2/nsh/defconfig @@ -339,6 +339,9 @@ CONFIG_STM32_DISABLE_IDLE_SLEEP_DURING_DEBUG=y # CONFIG_ARCH_BOARD_STM32_CUSTOM_CLOCKCONFIG is not set # CONFIG_STM32_CCMEXCLUDE is not set CONFIG_STM32_DMACAPABLE=y +CONFIG_STM32_FLOWCONTROL_BROKEN=y +CONFIG_SERIAL_IFLOWCONTROL_DEASSERT_WATERMARK=16 +CONFIG_SERIAL_IFLOWCONTROL_ASSERT_WATERMARK=32 # CONFIG_STM32_TIM1_PWM is not set # CONFIG_STM32_TIM3_PWM is not set # CONFIG_STM32_TIM4_PWM is not set @@ -1103,6 +1106,7 @@ CONFIG_EXAMPLES_NSH=y # # CONFIG_INTERPRETERS_BAS is not set # CONFIG_INTERPRETERS_FICL is not set +# CONFIG_INTERPRETERS_BAS is not set # CONFIG_INTERPRETERS_PCODE is not set # CONFIG_INTERPRETERS_MICROPYTHON is not set -- cgit v1.2.3 From c884c2f41d5f82fd25e155873c59e78de7a02fa8 Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Thu, 25 Dec 2014 16:37:01 -1000 Subject: Fixed typos --- Makefile | 12 ++++++------ nuttx-patches/math.patch | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 23fbf8f08..1f273aa88 100644 --- a/Makefile +++ b/Makefile @@ -190,23 +190,23 @@ NUTTX_PATCHED = $(NUTTX_SRC).patchedpx4common .PHONY: nuttxpatches nuttxpatches: - $(Q) if [ ! -f $(NUTTX_PATCHED) ]; then \ + $(Q) -if [ ! -f $(NUTTX_PATCHED) ]; then \ for patch in $(NUTTX_PATCHES); \ do \ - $(PATCH) -p0 -N < $$patch; \ + $(PATCH) -p0 -N -R < $$patch >/dev/null; \ done \ fi $(Q) $(TOUCH) $(NUTTX_PATCHED) .PHONY: cleannuttxpatches cleannuttxpatches: - $(Q) if [ ! -f $(NUTTX_PATCHED) ]; then \ + $(Q) -if [ -f $(NUTTX_PATCHED) ]; then \ for patch in $(NUTTX_PATCHES); \ do \ - $(PATCH) -p0 -N -R < $$patch; \ + $(PATCH) -p0 -N < $$patch >/dev/null; \ done \ fi - $(Q) $(TOUCH) $(NUTTX_PATCHED) + $(Q) $(REMOVE) $(NUTTX_PATCHED) # # The user can run the NuttX 'menuconfig' tool for a single board configuration with @@ -301,7 +301,7 @@ clean: $(Q) $(REMOVE) $(IMAGE_DIR)*.px4 .PHONY: distclean -distclean: clean cleannuttxpatches +distclean: cleannuttxpatches clean @echo > /dev/null $(Q) $(REMOVE) $(ARCHIVE_DIR)*.export > /dev/null $(Q) $(MAKE) -C $(NUTTX_SRC) -r $(MQUIET) distclean > /dev/null diff --git a/nuttx-patches/math.patch b/nuttx-patches/math.patch index 6b60e2cae..a93b2daf6 100644 --- a/nuttx-patches/math.patch +++ b/nuttx-patches/math.patch @@ -1,6 +1,6 @@ -diff -ruN NuttX/nuttx/arch/arm/include/m.math,h /tmp/NuttX/nuttx/arch/arm/include/m.math,h ---- NuttX/nuttx/arch/arm/include/m.math,h 2014-12-25 06:02:40.565856919 -1000 -+++ NuttX/nuttx/arch/arm/include/m.math,h 1969-12-31 14:00:00.000000000 -1000 +diff -ruN NuttX/nuttx/arch/arm/include/math.h NuttX/nuttx/arch/arm/include/math.h +--- NuttX/nuttx/arch/arm/include/math.h 2014-12-25 06:02:40.565856919 -1000 ++++ NuttX/nuttx/arch/arm/include/math.h 1969-12-31 14:00:00.000000000 -1000 @@ -1,585 +0,0 @@ -#ifndef _MATH_H_ - -- cgit v1.2.3 From 78b3d08fd09d0b827e47af17f0710f865b046a3d Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Thu, 25 Dec 2014 17:54:02 -1000 Subject: better nameing and direction --- Makefile | 4 +- nuttx-patches/math.patch | 590 ----------------------------------------------- 2 files changed, 2 insertions(+), 592 deletions(-) delete mode 100644 nuttx-patches/math.patch diff --git a/Makefile b/Makefile index 1f273aa88..b72583e6e 100644 --- a/Makefile +++ b/Makefile @@ -193,7 +193,7 @@ nuttxpatches: $(Q) -if [ ! -f $(NUTTX_PATCHED) ]; then \ for patch in $(NUTTX_PATCHES); \ do \ - $(PATCH) -p0 -N -R < $$patch >/dev/null; \ + $(PATCH) -p0 -N < $$patch >/dev/null; \ done \ fi $(Q) $(TOUCH) $(NUTTX_PATCHED) @@ -203,7 +203,7 @@ cleannuttxpatches: $(Q) -if [ -f $(NUTTX_PATCHED) ]; then \ for patch in $(NUTTX_PATCHES); \ do \ - $(PATCH) -p0 -N < $$patch >/dev/null; \ + $(PATCH) -p0 -N -R < $$patch >/dev/null; \ done \ fi $(Q) $(REMOVE) $(NUTTX_PATCHED) diff --git a/nuttx-patches/math.patch b/nuttx-patches/math.patch deleted file mode 100644 index a93b2daf6..000000000 --- a/nuttx-patches/math.patch +++ /dev/null @@ -1,590 +0,0 @@ -diff -ruN NuttX/nuttx/arch/arm/include/math.h NuttX/nuttx/arch/arm/include/math.h ---- NuttX/nuttx/arch/arm/include/math.h 2014-12-25 06:02:40.565856919 -1000 -+++ NuttX/nuttx/arch/arm/include/math.h 1969-12-31 14:00:00.000000000 -1000 -@@ -1,585 +0,0 @@ --#ifndef _MATH_H_ -- --#define _MATH_H_ -- --#include --#include "_ansi.h" -- --_BEGIN_STD_C -- --/* Natural log of 2 */ --#define _M_LN2 0.693147180559945309417 -- --#if defined(__GNUC__) && \ -- ( (__GNUC__ >= 4) || \ -- ( (__GNUC__ >= 3) && defined(__GNUC_MINOR__) && (__GNUC_MINOR__ >= 3) ) ) -- -- /* gcc >= 3.3 implicitly defines builtins for HUGE_VALx values. */ -- --# ifndef HUGE_VAL --# define HUGE_VAL (__builtin_huge_val()) --# endif -- --# ifndef HUGE_VALF --# define HUGE_VALF (__builtin_huge_valf()) --# endif -- --# ifndef HUGE_VALL --# define HUGE_VALL (__builtin_huge_vall()) --# endif -- --# ifndef INFINITY --# define INFINITY (__builtin_inff()) --# endif -- --# ifndef NAN --# define NAN (__builtin_nanf("")) --# endif -- --#else /* !gcc >= 3.3 */ -- -- /* No builtins. Use fixed defines instead. (All 3 HUGE plus the INFINITY -- * and NAN macros are required to be constant expressions. Using a variable-- -- * even a static const--does not meet this requirement, as it cannot be -- * evaluated at translation time.) -- * The infinities are done using numbers that are far in excess of -- * something that would be expected to be encountered in a floating-point -- * implementation. (A more certain way uses values from float.h, but that is -- * avoided because system includes are not supposed to include each other.) -- * This method might produce warnings from some compilers. (It does in -- * newer GCCs, but not for ones that would hit this #else.) If this happens, -- * please report details to the Newlib mailing list. */ -- -- #ifndef HUGE_VAL -- #define HUGE_VAL (1.0e999999999) -- #endif -- -- #ifndef HUGE_VALF -- #define HUGE_VALF (1.0e999999999F) -- #endif -- -- #if !defined(HUGE_VALL) && defined(_HAVE_LONG_DOUBLE) -- #define HUGE_VALL (1.0e999999999L) -- #endif -- -- #if !defined(INFINITY) -- #define INFINITY (HUGE_VALF) -- #endif -- -- #if !defined(NAN) -- #if defined(__GNUC__) && defined(__cplusplus) -- /* Exception: older g++ versions warn about the divide by 0 used in the -- * normal case (even though older gccs do not). This trick suppresses the -- * warning, but causes errors for plain gcc, so is only used in the one -- * special case. */ -- static const union { __ULong __i[1]; float __d; } __Nanf = {0x7FC00000}; -- #define NAN (__Nanf.__d) -- #else -- #define NAN (0.0F/0.0F) -- #endif -- #endif -- --#endif /* !gcc >= 3.3 */ -- --/* Reentrant ANSI C functions. */ -- --#ifndef __math_68881 --extern double atan _PARAMS((double)); --extern double cos _PARAMS((double)); --extern double sin _PARAMS((double)); --extern double tan _PARAMS((double)); --extern double tanh _PARAMS((double)); --extern double frexp _PARAMS((double, int *)); --extern double modf _PARAMS((double, double *)); --extern double ceil _PARAMS((double)); --extern double fabs _PARAMS((double)); --extern double floor _PARAMS((double)); --#endif /* ! defined (__math_68881) */ -- --/* Non reentrant ANSI C functions. */ -- --#ifndef _REENT_ONLY --#ifndef __math_68881 --extern double acos _PARAMS((double)); --extern double asin _PARAMS((double)); --extern double atan2 _PARAMS((double, double)); --extern double cosh _PARAMS((double)); --extern double sinh _PARAMS((double)); --extern double exp _PARAMS((double)); --extern double ldexp _PARAMS((double, int)); --extern double log _PARAMS((double)); --extern double log10 _PARAMS((double)); --extern double pow _PARAMS((double, double)); --extern double sqrt _PARAMS((double)); --extern double fmod _PARAMS((double, double)); --#endif /* ! defined (__math_68881) */ --#endif /* ! defined (_REENT_ONLY) */ -- --#if !defined(__STRICT_ANSI__) || defined(__cplusplus) || __STDC_VERSION__ >= 199901L -- --/* ISO C99 types and macros. */ -- --#ifndef FLT_EVAL_METHOD --#define FLT_EVAL_METHOD 0 --typedef float float_t; --typedef double double_t; --#endif /* FLT_EVAL_METHOD */ -- --#define FP_NAN 0 --#define FP_INFINITE 1 --#define FP_ZERO 2 --#define FP_SUBNORMAL 3 --#define FP_NORMAL 4 -- --#ifndef FP_ILOGB0 --# define FP_ILOGB0 (-INT_MAX) --#endif --#ifndef FP_ILOGBNAN --# define FP_ILOGBNAN INT_MAX --#endif -- --#ifndef MATH_ERRNO --# define MATH_ERRNO 1 --#endif --#ifndef MATH_ERREXCEPT --# define MATH_ERREXCEPT 2 --#endif --#ifndef math_errhandling --# define math_errhandling MATH_ERRNO --#endif -- --extern int __isinff (float x); --extern int __isinfd (double x); --extern int __isnanf (float x); --extern int __isnand (double x); --extern int __fpclassifyf (float x); --extern int __fpclassifyd (double x); --extern int __signbitf (float x); --extern int __signbitd (double x); -- --#define fpclassify(__x) \ -- ((sizeof(__x) == sizeof(float)) ? __fpclassifyf(__x) : \ -- __fpclassifyd(__x)) -- --#ifndef isfinite -- #define isfinite(__y) \ -- (__extension__ ({int __cy = fpclassify(__y); \ -- __cy != FP_INFINITE && __cy != FP_NAN;})) --#endif -- --/* Note: isinf and isnan were once functions in newlib that took double -- * arguments. C99 specifies that these names are reserved for macros -- * supporting multiple floating point types. Thus, they are -- * now defined as macros. Implementations of the old functions -- * taking double arguments still exist for compatibility purposes -- * (prototypes for them are in ). */ --#ifndef isinf -- #define isinf(y) (fpclassify(y) == FP_INFINITE) --#endif -- --#ifndef isnan -- #define isnan(y) (fpclassify(y) == FP_NAN) --#endif -- --#define isnormal(y) (fpclassify(y) == FP_NORMAL) --#define signbit(__x) \ -- ((sizeof(__x) == sizeof(float)) ? __signbitf(__x) : \ -- __signbitd(__x)) -- --#define isgreater(x,y) \ -- (__extension__ ({__typeof__(x) __x = (x); __typeof__(y) __y = (y); \ -- !isunordered(__x,__y) && (__x > __y);})) --#define isgreaterequal(x,y) \ -- (__extension__ ({__typeof__(x) __x = (x); __typeof__(y) __y = (y); \ -- !isunordered(__x,__y) && (__x >= __y);})) --#define isless(x,y) \ -- (__extension__ ({__typeof__(x) __x = (x); __typeof__(y) __y = (y); \ -- !isunordered(__x,__y) && (__x < __y);})) --#define islessequal(x,y) \ -- (__extension__ ({__typeof__(x) __x = (x); __typeof__(y) __y = (y); \ -- !isunordered(__x,__y) && (__x <= __y);})) --#define islessgreater(x,y) \ -- (__extension__ ({__typeof__(x) __x = (x); __typeof__(y) __y = (y); \ -- !isunordered(__x,__y) && (__x < __y || __x > __y);})) -- --#define isunordered(a,b) \ -- (__extension__ ({__typeof__(a) __a = (a); __typeof__(b) __b = (b); \ -- fpclassify(__a) == FP_NAN || fpclassify(__b) == FP_NAN;})) -- --/* Non ANSI double precision functions. */ -- --extern double infinity _PARAMS((void)); --extern double nan _PARAMS((const char *)); --extern int finite _PARAMS((double)); --extern double copysign _PARAMS((double, double)); --extern double logb _PARAMS((double)); --extern int ilogb _PARAMS((double)); -- --extern double asinh _PARAMS((double)); --extern double cbrt _PARAMS((double)); --extern double nextafter _PARAMS((double, double)); --extern double rint _PARAMS((double)); --extern double scalbn _PARAMS((double, int)); -- --extern double exp2 _PARAMS((double)); --extern double scalbln _PARAMS((double, long int)); --extern double tgamma _PARAMS((double)); --extern double nearbyint _PARAMS((double)); --extern long int lrint _PARAMS((double)); --extern long long int llrint _PARAMS((double)); --extern double round _PARAMS((double)); --extern long int lround _PARAMS((double)); --extern long long int llround _PARAMS((double)); --extern double trunc _PARAMS((double)); --extern double remquo _PARAMS((double, double, int *)); --extern double fdim _PARAMS((double, double)); --extern double fmax _PARAMS((double, double)); --extern double fmin _PARAMS((double, double)); --extern double fma _PARAMS((double, double, double)); -- --#ifndef __math_68881 --extern double log1p _PARAMS((double)); --extern double expm1 _PARAMS((double)); --#endif /* ! defined (__math_68881) */ -- --#ifndef _REENT_ONLY --extern double acosh _PARAMS((double)); --extern double atanh _PARAMS((double)); --extern double remainder _PARAMS((double, double)); --extern double gamma _PARAMS((double)); --extern double lgamma _PARAMS((double)); --extern double erf _PARAMS((double)); --extern double erfc _PARAMS((double)); --extern double log2 _PARAMS((double)); --#if !defined(__cplusplus) --#define log2(x) (log (x) / _M_LN2) --#endif -- --#ifndef __math_68881 --extern double hypot _PARAMS((double, double)); --#endif -- --#endif /* ! defined (_REENT_ONLY) */ -- --/* Single precision versions of ANSI functions. */ -- --extern float atanf _PARAMS((float)); --extern float cosf _PARAMS((float)); --extern float sinf _PARAMS((float)); --extern float tanf _PARAMS((float)); --extern float tanhf _PARAMS((float)); --extern float frexpf _PARAMS((float, int *)); --extern float modff _PARAMS((float, float *)); --extern float ceilf _PARAMS((float)); --extern float fabsf _PARAMS((float)); --extern float floorf _PARAMS((float)); -- --#ifndef _REENT_ONLY --extern float acosf _PARAMS((float)); --extern float asinf _PARAMS((float)); --extern float atan2f _PARAMS((float, float)); --extern float coshf _PARAMS((float)); --extern float sinhf _PARAMS((float)); --extern float expf _PARAMS((float)); --extern float ldexpf _PARAMS((float, int)); --extern float logf _PARAMS((float)); --extern float log10f _PARAMS((float)); --extern float powf _PARAMS((float, float)); --extern float sqrtf _PARAMS((float)); --extern float fmodf _PARAMS((float, float)); --#endif /* ! defined (_REENT_ONLY) */ -- --/* Other single precision functions. */ -- --extern float exp2f _PARAMS((float)); --extern float scalblnf _PARAMS((float, long int)); --extern float tgammaf _PARAMS((float)); --extern float nearbyintf _PARAMS((float)); --extern long int lrintf _PARAMS((float)); --extern long long llrintf _PARAMS((float)); --extern float roundf _PARAMS((float)); --extern long int lroundf _PARAMS((float)); --extern long long int llroundf _PARAMS((float)); --extern float truncf _PARAMS((float)); --extern float remquof _PARAMS((float, float, int *)); --extern float fdimf _PARAMS((float, float)); --extern float fmaxf _PARAMS((float, float)); --extern float fminf _PARAMS((float, float)); --extern float fmaf _PARAMS((float, float, float)); -- --extern float infinityf _PARAMS((void)); --extern float nanf _PARAMS((const char *)); --extern int finitef _PARAMS((float)); --extern float copysignf _PARAMS((float, float)); --extern float logbf _PARAMS((float)); --extern int ilogbf _PARAMS((float)); -- --extern float asinhf _PARAMS((float)); --extern float cbrtf _PARAMS((float)); --extern float nextafterf _PARAMS((float, float)); --extern float rintf _PARAMS((float)); --extern float scalbnf _PARAMS((float, int)); --extern float log1pf _PARAMS((float)); --extern float expm1f _PARAMS((float)); -- --#ifndef _REENT_ONLY --extern float acoshf _PARAMS((float)); --extern float atanhf _PARAMS((float)); --extern float remainderf _PARAMS((float, float)); --extern float gammaf _PARAMS((float)); --extern float lgammaf _PARAMS((float)); --extern float erff _PARAMS((float)); --extern float erfcf _PARAMS((float)); --extern float log2f _PARAMS((float)); --#if !defined(__cplusplus) --#define log2f(x) (logf (x) / (float_t) _M_LN2) --#endif --extern float hypotf _PARAMS((float, float)); --#endif /* ! defined (_REENT_ONLY) */ -- --/* On platforms where long double equals double. */ --#ifdef _LDBL_EQ_DBL --/* Reentrant ANSI C functions. */ --#ifndef __math_68881 --extern long double atanl _PARAMS((long double)); --extern long double cosl _PARAMS((long double)); --extern long double sinl _PARAMS((long double)); --extern long double tanl _PARAMS((long double)); --extern long double tanhl _PARAMS((long double)); --extern long double frexpl _PARAMS((long double value, int *)); --extern long double modfl _PARAMS((long double, long double *)); --extern long double ceill _PARAMS((long double)); --extern long double fabsl _PARAMS((long double)); --extern long double floorl _PARAMS((long double)); --extern long double log1pl _PARAMS((long double)); --extern long double expm1l _PARAMS((long double)); --#endif /* ! defined (__math_68881) */ --/* Non reentrant ANSI C functions. */ --#ifndef _REENT_ONLY --#ifndef __math_68881 --extern long double acosl _PARAMS((long double)); --extern long double asinl _PARAMS((long double)); --extern long double atan2l _PARAMS((long double, long double)); --extern long double coshl _PARAMS((long double)); --extern long double sinhl _PARAMS((long double)); --extern long double expl _PARAMS((long double)); --extern long double ldexpl _PARAMS((long double, int)); --extern long double logl _PARAMS((long double)); --extern long double log2l _PARAMS((long double)); --extern long double log10l _PARAMS((long double)); --extern long double powl _PARAMS((long double, long double)); --extern long double sqrtl _PARAMS((long double)); --extern long double fmodl _PARAMS((long double, long double)); --extern long double hypotl _PARAMS((long double, long double)); --#endif /* ! defined (__math_68881) */ --#endif /* ! defined (_REENT_ONLY) */ --extern long double copysignl _PARAMS((long double, long double)); --extern long double nanl _PARAMS((const char *)); --extern int ilogbl _PARAMS((long double)); --extern long double asinhl _PARAMS((long double)); --extern long double cbrtl _PARAMS((long double)); --extern long double nextafterl _PARAMS((long double, long double)); --extern long double rintl _PARAMS((long double)); --extern long double scalbnl _PARAMS((long double, int)); --extern long double exp2l _PARAMS((long double)); --extern long double scalblnl _PARAMS((long double, long)); --extern long double tgammal _PARAMS((long double)); --extern long double nearbyintl _PARAMS((long double)); --extern long int lrintl _PARAMS((long double)); --extern long long int llrintl _PARAMS((long double)); --extern long double roundl _PARAMS((long double)); --extern long lroundl _PARAMS((long double)); --extern long long int llroundl _PARAMS((long double)); --extern long double truncl _PARAMS((long double)); --extern long double remquol _PARAMS((long double, long double, int *)); --extern long double fdiml _PARAMS((long double, long double)); --extern long double fmaxl _PARAMS((long double, long double)); --extern long double fminl _PARAMS((long double, long double)); --extern long double fmal _PARAMS((long double, long double, long double)); --#ifndef _REENT_ONLY --extern long double acoshl _PARAMS((long double)); --extern long double atanhl _PARAMS((long double)); --extern long double remainderl _PARAMS((long double, long double)); --extern long double lgammal _PARAMS((long double)); --extern long double erfl _PARAMS((long double)); --extern long double erfcl _PARAMS((long double)); --#endif /* ! defined (_REENT_ONLY) */ --#else /* !_LDBL_EQ_DBL */ --#ifdef __i386__ --/* Other long double precision functions. */ --extern _LONG_DOUBLE rintl _PARAMS((_LONG_DOUBLE)); --extern long int lrintl _PARAMS((_LONG_DOUBLE)); --extern long long llrintl _PARAMS((_LONG_DOUBLE)); --#endif /* __i386__ */ --#endif /* !_LDBL_EQ_DBL */ -- --#endif /* !defined (__STRICT_ANSI__) || defined(__cplusplus) || __STDC_VERSION__ >= 199901L */ -- --#if !defined (__STRICT_ANSI__) || defined(__cplusplus) -- --extern double drem _PARAMS((double, double)); --extern void sincos _PARAMS((double, double *, double *)); --extern double gamma_r _PARAMS((double, int *)); --extern double lgamma_r _PARAMS((double, int *)); -- --extern double y0 _PARAMS((double)); --extern double y1 _PARAMS((double)); --extern double yn _PARAMS((int, double)); --extern double j0 _PARAMS((double)); --extern double j1 _PARAMS((double)); --extern double jn _PARAMS((int, double)); -- --extern float dremf _PARAMS((float, float)); --extern void sincosf _PARAMS((float, float *, float *)); --extern float gammaf_r _PARAMS((float, int *)); --extern float lgammaf_r _PARAMS((float, int *)); -- --extern float y0f _PARAMS((float)); --extern float y1f _PARAMS((float)); --extern float ynf _PARAMS((int, float)); --extern float j0f _PARAMS((float)); --extern float j1f _PARAMS((float)); --extern float jnf _PARAMS((int, float)); -- --/* GNU extensions */ --# ifndef exp10 --extern double exp10 _PARAMS((double)); --# endif --# ifndef pow10 --extern double pow10 _PARAMS((double)); --# endif --# ifndef exp10f --extern float exp10f _PARAMS((float)); --# endif --# ifndef pow10f --extern float pow10f _PARAMS((float)); --# endif -- --#endif /* !defined (__STRICT_ANSI__) || defined(__cplusplus) */ -- --#ifndef __STRICT_ANSI__ -- --/* The gamma functions use a global variable, signgam. */ --#ifndef _REENT_ONLY --#define signgam (*__signgam()) --extern int *__signgam _PARAMS((void)); --#endif /* ! defined (_REENT_ONLY) */ -- --#define __signgam_r(ptr) _REENT_SIGNGAM(ptr) -- --/* The exception structure passed to the matherr routine. */ --/* We have a problem when using C++ since `exception' is a reserved -- name in C++. */ --#ifdef __cplusplus --struct __exception --#else --struct exception --#endif --{ -- int type; -- char *name; -- double arg1; -- double arg2; -- double retval; -- int err; --}; -- --#ifdef __cplusplus --extern int matherr _PARAMS((struct __exception *e)); --#else --extern int matherr _PARAMS((struct exception *e)); --#endif -- --/* Values for the type field of struct exception. */ -- --#define DOMAIN 1 --#define SING 2 --#define OVERFLOW 3 --#define UNDERFLOW 4 --#define TLOSS 5 --#define PLOSS 6 -- --/* Useful constants. */ -- --#define MAXFLOAT 3.40282347e+38F -- --#define M_E 2.7182818284590452354 --#define M_LOG2E 1.4426950408889634074 --#define M_LOG10E 0.43429448190325182765 --#define M_LN2 _M_LN2 --#define M_LN10 2.30258509299404568402 --#define M_PI 3.14159265358979323846 --#define M_TWOPI (M_PI * 2.0) --#define M_PI_2 1.57079632679489661923 --#define M_PI_4 0.78539816339744830962 --#define M_3PI_4 2.3561944901923448370E0 --#define M_SQRTPI 1.77245385090551602792981 --#define M_1_PI 0.31830988618379067154 --#define M_2_PI 0.63661977236758134308 --#define M_2_SQRTPI 1.12837916709551257390 --#define M_DEG_TO_RAD 0.01745329251994 --#define M_RAD_TO_DEG 57.2957795130823 --#define M_SQRT2 1.41421356237309504880 --#define M_SQRT1_2 0.70710678118654752440 --#define M_LN2LO 1.9082149292705877000E-10 --#define M_LN2HI 6.9314718036912381649E-1 --#define M_SQRT3 1.73205080756887719000 --#define M_IVLN10 0.43429448190325182765 /* 1 / log(10) */ --#define M_LOG2_E _M_LN2 --#define M_INVLN2 1.4426950408889633870E0 /* 1 / log(2) */ -- -- --#define M_E_F 2.7182818284590452354f --#define M_LOG2E_F 1.4426950408889634074f --#define M_LOG10E_F 0.43429448190325182765f --#define M_LN2_F _M_LN2_F --#define M_LN10_F 2.30258509299404568402f --#define M_PI_F 3.14159265358979323846f --#define M_TWOPI_F (M_PI_F * 2.0f) --#define M_PI_2_F 1.57079632679489661923f --#define M_PI_4_F 0.78539816339744830962f --#define M_3PI_4_F 2.3561944901923448370E0f --#define M_SQRTPI_F 1.77245385090551602792981f --#define M_1_PI_F 0.31830988618379067154f --#define M_2_PI_F 0.63661977236758134308f --#define M_2_SQRTPI_F 1.12837916709551257390f --#define M_DEG_TO_RAD_F 0.01745329251994f --#define M_RAD_TO_DEG_F 57.2957795130823f --#define M_SQRT2_F 1.41421356237309504880f --#define M_SQRT1_2_F 0.70710678118654752440f --#define M_LN2LO_F 1.9082149292705877000E-10f --#define M_LN2HI_F 6.9314718036912381649E-1f --#define M_SQRT3_F 1.73205080756887719000f --#define M_IVLN10_F 0.43429448190325182765f /* 1 / log(10) */ --#define M_LOG2_E_F _M_LN2_F --#define M_INVLN2_F 1.4426950408889633870E0f /* 1 / log(2) */ -- --/* Global control over fdlibm error handling. */ -- --enum __fdlibm_version --{ -- __fdlibm_ieee = -1, -- __fdlibm_svid, -- __fdlibm_xopen, -- __fdlibm_posix --}; -- --#define _LIB_VERSION_TYPE enum __fdlibm_version --#define _LIB_VERSION __fdlib_version -- --extern __IMPORT _LIB_VERSION_TYPE _LIB_VERSION; -- --#define _IEEE_ __fdlibm_ieee --#define _SVID_ __fdlibm_svid --#define _XOPEN_ __fdlibm_xopen --#define _POSIX_ __fdlibm_posix -- --#endif /* ! defined (__STRICT_ANSI__) */ -- --_END_STD_C -- --#ifdef __FAST_MATH__ --#include --#endif -- --#endif /* _MATH_H_ */ -\ No newline at end of file -- cgit v1.2.3 From c8f2f9edd3ab9f411999e56da684b13c79330614 Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Fri, 26 Dec 2014 13:27:47 -1000 Subject: repointed NuttX submodule --- .gitmodules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitmodules b/.gitmodules index c869803b7..926453587 100644 --- a/.gitmodules +++ b/.gitmodules @@ -3,7 +3,7 @@ url = git://github.com/mavlink/c_library.git [submodule "NuttX"] path = NuttX - url = git://github.com/PX4/NuttX.git + url = git://github.com/PX4-Works/NuttX.git [submodule "uavcan"] path = src/lib/uavcan url = git://github.com/pavel-kirienko/uavcan.git -- cgit v1.2.3 From d74277b9e7d42c6a3bfac2a6ed27ad25e5656bea Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Fri, 26 Dec 2014 15:22:56 -1000 Subject: Update configs with latest upstream setting --- nuttx-configs/px4fmu-v2/nsh/defconfig | 3 --- 1 file changed, 3 deletions(-) diff --git a/nuttx-configs/px4fmu-v2/nsh/defconfig b/nuttx-configs/px4fmu-v2/nsh/defconfig index 2871a54d0..6c86f39db 100644 --- a/nuttx-configs/px4fmu-v2/nsh/defconfig +++ b/nuttx-configs/px4fmu-v2/nsh/defconfig @@ -339,9 +339,6 @@ CONFIG_STM32_DISABLE_IDLE_SLEEP_DURING_DEBUG=y # CONFIG_ARCH_BOARD_STM32_CUSTOM_CLOCKCONFIG is not set # CONFIG_STM32_CCMEXCLUDE is not set CONFIG_STM32_DMACAPABLE=y -CONFIG_STM32_FLOWCONTROL_BROKEN=y -CONFIG_SERIAL_IFLOWCONTROL_DEASSERT_WATERMARK=16 -CONFIG_SERIAL_IFLOWCONTROL_ASSERT_WATERMARK=32 # CONFIG_STM32_TIM1_PWM is not set # CONFIG_STM32_TIM3_PWM is not set # CONFIG_STM32_TIM4_PWM is not set -- cgit v1.2.3 From 124576d35c11adf67df3f561c3563c6a49b67246 Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Sat, 27 Dec 2014 13:57:27 -1000 Subject: Updated Configs to use the new handshake thresholds --- nuttx-configs/px4fmu-v1/nsh/defconfig | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/nuttx-configs/px4fmu-v1/nsh/defconfig b/nuttx-configs/px4fmu-v1/nsh/defconfig index 4e5bb5b44..05c766769 100644 --- a/nuttx-configs/px4fmu-v1/nsh/defconfig +++ b/nuttx-configs/px4fmu-v1/nsh/defconfig @@ -341,9 +341,6 @@ CONFIG_STM32_DMACAPABLE=y # CONFIG_STM32_TIM5_ADC is not set CONFIG_STM32_USART=y CONFIG_STM32_FLOWCONTROL_BROKEN=y -CONFIG_SERIAL_IFLOWCONTROL_DEASSERT_WATERMARK=16 -CONFIG_SERIAL_IFLOWCONTROL_ASSERT_WATERMARK=32 - # # U[S]ART Configuration @@ -767,6 +764,11 @@ CONFIG_USART6_PARITY=0 CONFIG_USART6_2STOP=0 # CONFIG_USART6_IFLOWCONTROL is not set # CONFIG_USART6_OFLOWCONTROL is not set +CONFIG_SERIAL_IFLOWCONTROL=y +CONFIG_SERIAL_OFLOWCONTROL=y +CONFIG_SERIAL_IFLOWCONTROL_WATERMARKS=y +CONFIG_SERIAL_IFLOWCONTROL_LOWER_WATERMARK=10 +CONFIG_SERIAL_IFLOWCONTROL_UPPER_WATERMARK=90 CONFIG_USBDEV=y # -- cgit v1.2.3 From 98693dbe132dd1107a0dd590a9d9833f3493e4e0 Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Sun, 28 Dec 2014 10:48:21 -1000 Subject: Update .gitmodules Back to PX4 --- .gitmodules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitmodules b/.gitmodules index 926453587..c869803b7 100644 --- a/.gitmodules +++ b/.gitmodules @@ -3,7 +3,7 @@ url = git://github.com/mavlink/c_library.git [submodule "NuttX"] path = NuttX - url = git://github.com/PX4-Works/NuttX.git + url = git://github.com/PX4/NuttX.git [submodule "uavcan"] path = src/lib/uavcan url = git://github.com/pavel-kirienko/uavcan.git -- cgit v1.2.3 From 187a447aa75b895f710969cdd232292616dbc422 Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Mon, 5 Jan 2015 07:44:27 -1000 Subject: Updated with pragmas to remove shadow warning (errors with -Werror) Make file will not create rej files on distclean --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index b72583e6e..d5ece137b 100644 --- a/Makefile +++ b/Makefile @@ -203,7 +203,7 @@ cleannuttxpatches: $(Q) -if [ -f $(NUTTX_PATCHED) ]; then \ for patch in $(NUTTX_PATCHES); \ do \ - $(PATCH) -p0 -N -R < $$patch >/dev/null; \ + $(PATCH) -p0 -N -R -r - < $$patch >/dev/null; \ done \ fi $(Q) $(REMOVE) $(NUTTX_PATCHED) -- cgit v1.2.3 From b62965d38e22829bafdcf99d669e898dfb1ec624 Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Wed, 7 Jan 2015 09:35:41 -1000 Subject: Added Probes --- nuttx-configs/px4fmu-v2/nsh/defconfig | 1 - 1 file changed, 1 deletion(-) diff --git a/nuttx-configs/px4fmu-v2/nsh/defconfig b/nuttx-configs/px4fmu-v2/nsh/defconfig index 6c86f39db..9f94f0dd3 100644 --- a/nuttx-configs/px4fmu-v2/nsh/defconfig +++ b/nuttx-configs/px4fmu-v2/nsh/defconfig @@ -1103,7 +1103,6 @@ CONFIG_EXAMPLES_NSH=y # # CONFIG_INTERPRETERS_BAS is not set # CONFIG_INTERPRETERS_FICL is not set -# CONFIG_INTERPRETERS_BAS is not set # CONFIG_INTERPRETERS_PCODE is not set # CONFIG_INTERPRETERS_MICROPYTHON is not set -- cgit v1.2.3 From 0a459ce8f4d73d685ce84047a474ae735f9b18f2 Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Wed, 7 Jan 2015 16:04:55 -1000 Subject: Probes in board.h but disabled and with Configuation for SDIO fix --- nuttx-configs/px4fmu-v2/nsh/defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/nuttx-configs/px4fmu-v2/nsh/defconfig b/nuttx-configs/px4fmu-v2/nsh/defconfig index 9f94f0dd3..ac08c8dbb 100644 --- a/nuttx-configs/px4fmu-v2/nsh/defconfig +++ b/nuttx-configs/px4fmu-v2/nsh/defconfig @@ -644,6 +644,7 @@ CONFIG_MMCSD_NSLOTS=1 CONFIG_MMCSD_MULTIBLOCK_DISABLE=y # CONFIG_MMCSD_MMCSUPPORT is not set # CONFIG_MMCSD_HAVECARDDETECT is not set +CONFIG_MMCSD_HAVE_SDIOWAIT_WRCOMPLETE=y # CONFIG_MMCSD_SPI is not set CONFIG_ARCH_HAVE_SDIO=y CONFIG_ARCH_HAVE_SDIOWAIT_WRCOMPLETE=y -- cgit v1.2.3 From 81ded1de5cfbc4cc663b8bf6335a12aa8a06ba80 Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Wed, 14 Jan 2015 07:09:10 -1000 Subject: updated to latest upstream --- nuttx-configs/px4fmu-v2/nsh/defconfig | 1 - 1 file changed, 1 deletion(-) diff --git a/nuttx-configs/px4fmu-v2/nsh/defconfig b/nuttx-configs/px4fmu-v2/nsh/defconfig index ac08c8dbb..9f94f0dd3 100644 --- a/nuttx-configs/px4fmu-v2/nsh/defconfig +++ b/nuttx-configs/px4fmu-v2/nsh/defconfig @@ -644,7 +644,6 @@ CONFIG_MMCSD_NSLOTS=1 CONFIG_MMCSD_MULTIBLOCK_DISABLE=y # CONFIG_MMCSD_MMCSUPPORT is not set # CONFIG_MMCSD_HAVECARDDETECT is not set -CONFIG_MMCSD_HAVE_SDIOWAIT_WRCOMPLETE=y # CONFIG_MMCSD_SPI is not set CONFIG_ARCH_HAVE_SDIO=y CONFIG_ARCH_HAVE_SDIOWAIT_WRCOMPLETE=y -- cgit v1.2.3 From 5f4951380a406fa195220aec43e88f9388ba3ad6 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Thu, 22 Jan 2015 08:49:51 +0100 Subject: Fix merge fail in nuttx configs, adjust LP and HP work stack sizes, reduce interrupt stack from excessive 4K to 2K --- nuttx-configs/aerocore/nsh/defconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nuttx-configs/aerocore/nsh/defconfig b/nuttx-configs/aerocore/nsh/defconfig index ca444ad95..d17e7b6b5 100644 --- a/nuttx-configs/aerocore/nsh/defconfig +++ b/nuttx-configs/aerocore/nsh/defconfig @@ -415,8 +415,8 @@ CONFIG_PREALLOC_TIMERS=50 # # Stack and heap information # -# This should be 380 with 28 bytes free -CONFIG_IDLETHREAD_STACKSIZE=1000 +# Set to 500 per LM - This should be 380 with 28 bytes free +CONFIG_IDLETHREAD_STACKSIZE=500 CONFIG_USERMAIN_STACKSIZE=3000 CONFIG_PTHREAD_STACK_MIN=512 CONFIG_PTHREAD_STACK_DEFAULT=2048 -- cgit v1.2.3 From fee931626ade5ce123f40cd42dc2c94531883103 Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Thu, 22 Jan 2015 10:41:33 -1000 Subject: Added Support for C++ static initializers --- src/drivers/boards/px4fmu-v2/module.mk | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/drivers/boards/px4fmu-v2/module.mk b/src/drivers/boards/px4fmu-v2/module.mk index cfe7e675b..f3f522624 100644 --- a/src/drivers/boards/px4fmu-v2/module.mk +++ b/src/drivers/boards/px4fmu-v2/module.mk @@ -10,4 +10,11 @@ SRCS = px4fmu_can.c \ px4fmu2_led.c \ ../../../modules/systemlib/up_cxxinitialize.c + +ENABLE_CXXINITIALIZE=$(call check_nuttx_config ,"CONFIG_HAVE_CXX 1", $(NUTTX_CONFIG_H)) +ENABLE_CXXINITIALIZE+=$(call check_nuttx_config ,"CONFIG_HAVE_CXXINITIALIZE 1", $(NUTTX_CONFIG_H)) +ifeq ("$(ENABLE_CXXINITIALIZE)",$(nuttx_config_2true)) +SRCS += ../../../modules/systemlib/up_cxxinitialize.c +endif + MAXOPTIMIZATION = -Os -- cgit v1.2.3 From 75e0066577f44007e389b1307822d6c921427716 Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Thu, 22 Jan 2015 12:28:18 -1000 Subject: Added Support for C++ static initializers for all boards. Including compile time checking for proper C++ configuration and not calling up_cxxinitialize redundantly --- src/drivers/boards/aerocore/module.mk | 6 ++++++ src/drivers/boards/px4fmu-v1/module.mk | 6 ++++++ src/drivers/boards/px4io-v1/module.mk | 6 ++++++ src/drivers/boards/px4io-v2/module.mk | 6 ++++++ 4 files changed, 24 insertions(+) diff --git a/src/drivers/boards/aerocore/module.mk b/src/drivers/boards/aerocore/module.mk index c1b51cd26..51bf315c0 100644 --- a/src/drivers/boards/aerocore/module.mk +++ b/src/drivers/boards/aerocore/module.mk @@ -8,4 +8,10 @@ SRCS = aerocore_init.c \ aerocore_led.c \ ../../../modules/systemlib/up_cxxinitialize.c +ENABLE_CXXINITIALIZE=$(call check_nuttx_config ,"CONFIG_HAVE_CXX 1", $(NUTTX_CONFIG_H)) +ENABLE_CXXINITIALIZE+=$(call check_nuttx_config ,"CONFIG_HAVE_CXXINITIALIZE 1", $(NUTTX_CONFIG_H)) +ifeq ("$(ENABLE_CXXINITIALIZE)",$(nuttx_config_2true)) +SRCS += ../../../modules/systemlib/up_cxxinitialize.c +endif + MAXOPTIMIZATION = -Os diff --git a/src/drivers/boards/px4fmu-v1/module.mk b/src/drivers/boards/px4fmu-v1/module.mk index 5a3f5f801..0f56e53d9 100644 --- a/src/drivers/boards/px4fmu-v1/module.mk +++ b/src/drivers/boards/px4fmu-v1/module.mk @@ -10,4 +10,10 @@ SRCS = px4fmu_can.c \ px4fmu_led.c \ ../../../modules/systemlib/up_cxxinitialize.c +ENABLE_CXXINITIALIZE=$(call check_nuttx_config ,"CONFIG_HAVE_CXX 1", $(NUTTX_CONFIG_H)) +ENABLE_CXXINITIALIZE+=$(call check_nuttx_config ,"CONFIG_HAVE_CXXINITIALIZE 1", $(NUTTX_CONFIG_H)) +ifeq ("$(ENABLE_CXXINITIALIZE)",$(nuttx_config_2true)) +SRCS += ../../../modules/systemlib/up_cxxinitialize.c +endif + MAXOPTIMIZATION = -Os diff --git a/src/drivers/boards/px4io-v1/module.mk b/src/drivers/boards/px4io-v1/module.mk index 40c79da4e..9b3f38f27 100644 --- a/src/drivers/boards/px4io-v1/module.mk +++ b/src/drivers/boards/px4io-v1/module.mk @@ -6,4 +6,10 @@ SRCS = px4io_init.c \ px4io_pwm_servo.c \ ../../../modules/systemlib/up_cxxinitialize.c +ENABLE_CXXINITIALIZE=$(call check_nuttx_config ,"CONFIG_HAVE_CXX 1", $(NUTTX_CONFIG_H)) +ENABLE_CXXINITIALIZE+=$(call check_nuttx_config ,"CONFIG_HAVE_CXXINITIALIZE 1", $(NUTTX_CONFIG_H)) +ifeq ("$(ENABLE_CXXINITIALIZE)",$(nuttx_config_2true)) +SRCS += ../../../modules/systemlib/up_cxxinitialize.c +endif + MAXOPTIMIZATION = -Os diff --git a/src/drivers/boards/px4io-v2/module.mk b/src/drivers/boards/px4io-v2/module.mk index 15e003599..ff5839c80 100644 --- a/src/drivers/boards/px4io-v2/module.mk +++ b/src/drivers/boards/px4io-v2/module.mk @@ -6,4 +6,10 @@ SRCS = px4iov2_init.c \ px4iov2_pwm_servo.c \ ../../../modules/systemlib/up_cxxinitialize.c +ENABLE_CXXINITIALIZE=$(call check_nuttx_config ,"CONFIG_HAVE_CXX 1", $(NUTTX_CONFIG_H)) +ENABLE_CXXINITIALIZE+=$(call check_nuttx_config ,"CONFIG_HAVE_CXXINITIALIZE 1", $(NUTTX_CONFIG_H)) +ifeq ("$(ENABLE_CXXINITIALIZE)",$(nuttx_config_2true)) +SRCS += ../../../modules/systemlib/up_cxxinitialize.c +endif + MAXOPTIMIZATION = -Os -- cgit v1.2.3 From b61c84103eb41e401a4689121f5cd1636ea1ce27 Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Fri, 23 Jan 2015 13:52:43 -1000 Subject: Using Nuttx stack assessment itnerfaces --- nuttx-configs/px4fmu-v2/nsh/defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/nuttx-configs/px4fmu-v2/nsh/defconfig b/nuttx-configs/px4fmu-v2/nsh/defconfig index 9f94f0dd3..20d392fa5 100644 --- a/nuttx-configs/px4fmu-v2/nsh/defconfig +++ b/nuttx-configs/px4fmu-v2/nsh/defconfig @@ -435,6 +435,7 @@ CONFIG_ARCH_HAVE_MPU=y # CONFIG_ARCH_USE_MPU is not set # CONFIG_ARCH_IRQPRIO is not set CONFIG_ARCH_STACKDUMP=y +CONFIG_STACK_COLORATION=y # CONFIG_ENDIAN_BIG is not set # CONFIG_ARCH_IDLE_CUSTOM is not set # CONFIG_ARCH_HAVE_RAMFUNCS is not set -- cgit v1.2.3 From 177a17324674001093d8d141d7131698e22be7a7 Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Sat, 24 Jan 2015 04:04:21 -1000 Subject: Updated config --- nuttx-configs/px4fmu-v2/nsh/defconfig | 1 - 1 file changed, 1 deletion(-) diff --git a/nuttx-configs/px4fmu-v2/nsh/defconfig b/nuttx-configs/px4fmu-v2/nsh/defconfig index 20d392fa5..9f94f0dd3 100644 --- a/nuttx-configs/px4fmu-v2/nsh/defconfig +++ b/nuttx-configs/px4fmu-v2/nsh/defconfig @@ -435,7 +435,6 @@ CONFIG_ARCH_HAVE_MPU=y # CONFIG_ARCH_USE_MPU is not set # CONFIG_ARCH_IRQPRIO is not set CONFIG_ARCH_STACKDUMP=y -CONFIG_STACK_COLORATION=y # CONFIG_ENDIAN_BIG is not set # CONFIG_ARCH_IDLE_CUSTOM is not set # CONFIG_ARCH_HAVE_RAMFUNCS is not set -- cgit v1.2.3 From 8f9fae8f6eb2907c12c35747c0888820cd541498 Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Mon, 26 Jan 2015 11:24:20 -1000 Subject: Bug fix:The CRC detection on px4io was failing with -1 result, do the the fact that the PX4IO_Uploader had closed the port and Nuttx (now) disabled the clock and PX4IO_serial did not managed the clock --- src/drivers/px4io/px4io_serial.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/drivers/px4io/px4io_serial.cpp b/src/drivers/px4io/px4io_serial.cpp index c6c0126f4..8892690e9 100644 --- a/src/drivers/px4io/px4io_serial.cpp +++ b/src/drivers/px4io/px4io_serial.cpp @@ -252,7 +252,11 @@ PX4IO_serial::init() /* Enable the APB clock for the USART peripheral */ +<<<<<<< HEAD modifyreg32(STM32_RCC_APB2ENR, 0, RCC_APB2ENR_USART6EN); +======= + modifyreg32(STM32_RCC_APB2ENR, 0, RCC_APB2ENR_USART6EN); +>>>>>>> Bug fix:The CRC detection on px4io was failing with -1 result, do the the fact that the PX4IO_Uploader had closed the port and Nuttx (now) disabled the clock and PX4IO_serial did not managed the clock /* configure pins for serial use */ stm32_configgpio(PX4IO_SERIAL_TX_GPIO); -- cgit v1.2.3 From 9be058aac80903ad893ed5185417aa17abfe1422 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Fri, 30 Jan 2015 09:35:46 +0100 Subject: Add export to up_cxxinitialize to make it globally visible --- src/modules/systemlib/up_cxxinitialize.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/systemlib/up_cxxinitialize.c b/src/modules/systemlib/up_cxxinitialize.c index 7b9ca5cb1..b04661b66 100644 --- a/src/modules/systemlib/up_cxxinitialize.c +++ b/src/modules/systemlib/up_cxxinitialize.c @@ -125,7 +125,7 @@ extern uint32_t _etext; * ***************************************************************************/ -void up_cxxinitialize(void) +__EXPORT void up_cxxinitialize(void) { initializer_t *initp; -- cgit v1.2.3 From f1519750d6715c675cee3081daaf5fee6ab090fe Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Fri, 30 Jan 2015 09:59:19 +0100 Subject: Aerocore: board init --- src/drivers/boards/aerocore/aerocore_init.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/drivers/boards/aerocore/aerocore_init.c b/src/drivers/boards/aerocore/aerocore_init.c index 1a6eead3f..f552a1c17 100644 --- a/src/drivers/boards/aerocore/aerocore_init.c +++ b/src/drivers/boards/aerocore/aerocore_init.c @@ -115,6 +115,10 @@ __END_DECLS * Protected Functions ****************************************************************************/ +#if defined(CONFIG_HAVE_CXX) && defined(CONFIG_HAVE_CXXINITIALIZE) +__EXPORT extern void up_cxxinitialize(); +#endif + #if defined(CONFIG_FAT_DMAMEMORY) # if !defined(CONFIG_GRAN) || !defined(CONFIG_FAT_DMAMEMORY) # error microSD DMA support requires CONFIG_GRAN -- cgit v1.2.3 From efdb51f17c27efe24758777870ea27507cba09ce Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Fri, 30 Jan 2015 09:59:50 +0100 Subject: FMUv1: board init --- src/drivers/boards/px4fmu-v1/px4fmu_init.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/drivers/boards/px4fmu-v1/px4fmu_init.c b/src/drivers/boards/px4fmu-v1/px4fmu_init.c index c6207312f..05d19cba1 100644 --- a/src/drivers/boards/px4fmu-v1/px4fmu_init.c +++ b/src/drivers/boards/px4fmu-v1/px4fmu_init.c @@ -96,6 +96,10 @@ __END_DECLS * Public Functions ****************************************************************************/ +#if defined(CONFIG_HAVE_CXX) && defined(CONFIG_HAVE_CXXINITIALIZE) +__EXPORT extern void up_cxxinitialize(); +#endif + /************************************************************************************ * Name: stm32_boardinitialize * -- cgit v1.2.3 From 42b25a0e285abb1fa9f7c0d25c898b650cac3810 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Fri, 30 Jan 2015 09:59:57 +0100 Subject: FMUv2: board init --- src/drivers/boards/px4fmu-v2/px4fmu2_init.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/drivers/boards/px4fmu-v2/px4fmu2_init.c b/src/drivers/boards/px4fmu-v2/px4fmu2_init.c index 74bbfa4c6..a99e24920 100644 --- a/src/drivers/boards/px4fmu-v2/px4fmu2_init.c +++ b/src/drivers/boards/px4fmu-v2/px4fmu2_init.c @@ -96,6 +96,10 @@ __END_DECLS * Protected Functions ****************************************************************************/ +#if defined(CONFIG_HAVE_CXX) && defined(CONFIG_HAVE_CXXINITIALIZE) +__EXPORT extern void up_cxxinitialize(); +#endif + #if defined(CONFIG_FAT_DMAMEMORY) # if !defined(CONFIG_GRAN) || !defined(CONFIG_FAT_DMAMEMORY) # error microSD DMA support requires CONFIG_GRAN -- cgit v1.2.3 From 90aa57394a01acda9d29fa9fbf6e4d292e14a1d9 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Fri, 30 Jan 2015 10:16:51 +0100 Subject: Fix compiler warning on prototypes --- src/drivers/boards/aerocore/aerocore_init.c | 2 +- src/drivers/boards/px4fmu-v1/px4fmu_init.c | 2 +- src/drivers/boards/px4fmu-v2/px4fmu2_init.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/drivers/boards/aerocore/aerocore_init.c b/src/drivers/boards/aerocore/aerocore_init.c index f552a1c17..0048f6e78 100644 --- a/src/drivers/boards/aerocore/aerocore_init.c +++ b/src/drivers/boards/aerocore/aerocore_init.c @@ -116,7 +116,7 @@ __END_DECLS ****************************************************************************/ #if defined(CONFIG_HAVE_CXX) && defined(CONFIG_HAVE_CXXINITIALIZE) -__EXPORT extern void up_cxxinitialize(); +__EXPORT extern void up_cxxinitialize(void); #endif #if defined(CONFIG_FAT_DMAMEMORY) diff --git a/src/drivers/boards/px4fmu-v1/px4fmu_init.c b/src/drivers/boards/px4fmu-v1/px4fmu_init.c index 05d19cba1..66c0def90 100644 --- a/src/drivers/boards/px4fmu-v1/px4fmu_init.c +++ b/src/drivers/boards/px4fmu-v1/px4fmu_init.c @@ -97,7 +97,7 @@ __END_DECLS ****************************************************************************/ #if defined(CONFIG_HAVE_CXX) && defined(CONFIG_HAVE_CXXINITIALIZE) -__EXPORT extern void up_cxxinitialize(); +__EXPORT extern void up_cxxinitialize(void); #endif /************************************************************************************ diff --git a/src/drivers/boards/px4fmu-v2/px4fmu2_init.c b/src/drivers/boards/px4fmu-v2/px4fmu2_init.c index a99e24920..635ae3f2b 100644 --- a/src/drivers/boards/px4fmu-v2/px4fmu2_init.c +++ b/src/drivers/boards/px4fmu-v2/px4fmu2_init.c @@ -97,7 +97,7 @@ __END_DECLS ****************************************************************************/ #if defined(CONFIG_HAVE_CXX) && defined(CONFIG_HAVE_CXXINITIALIZE) -__EXPORT extern void up_cxxinitialize(); +__EXPORT extern void up_cxxinitialize(void); #endif #if defined(CONFIG_FAT_DMAMEMORY) -- cgit v1.2.3 From ae47852a4421eb9c3b2fdf1ea289b9c258db60be Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Fri, 30 Jan 2015 10:39:20 +0100 Subject: Aerocore: CXX init --- src/drivers/boards/aerocore/aerocore_init.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/drivers/boards/aerocore/aerocore_init.c b/src/drivers/boards/aerocore/aerocore_init.c index 0048f6e78..1a6eead3f 100644 --- a/src/drivers/boards/aerocore/aerocore_init.c +++ b/src/drivers/boards/aerocore/aerocore_init.c @@ -115,10 +115,6 @@ __END_DECLS * Protected Functions ****************************************************************************/ -#if defined(CONFIG_HAVE_CXX) && defined(CONFIG_HAVE_CXXINITIALIZE) -__EXPORT extern void up_cxxinitialize(void); -#endif - #if defined(CONFIG_FAT_DMAMEMORY) # if !defined(CONFIG_GRAN) || !defined(CONFIG_FAT_DMAMEMORY) # error microSD DMA support requires CONFIG_GRAN -- cgit v1.2.3 From cc6e8611f5872d06cb4b77c4481c302b7f12ae0e Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Fri, 30 Jan 2015 10:39:34 +0100 Subject: FMUv1: CXX init --- src/drivers/boards/px4fmu-v1/px4fmu_init.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/drivers/boards/px4fmu-v1/px4fmu_init.c b/src/drivers/boards/px4fmu-v1/px4fmu_init.c index 66c0def90..c6207312f 100644 --- a/src/drivers/boards/px4fmu-v1/px4fmu_init.c +++ b/src/drivers/boards/px4fmu-v1/px4fmu_init.c @@ -96,10 +96,6 @@ __END_DECLS * Public Functions ****************************************************************************/ -#if defined(CONFIG_HAVE_CXX) && defined(CONFIG_HAVE_CXXINITIALIZE) -__EXPORT extern void up_cxxinitialize(void); -#endif - /************************************************************************************ * Name: stm32_boardinitialize * -- cgit v1.2.3 From eacb3bef4532d60cd2d1bd2855f8d98583a8f28f Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Fri, 30 Jan 2015 10:39:47 +0100 Subject: FMUv2: CXX init --- src/drivers/boards/px4fmu-v2/px4fmu2_init.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/drivers/boards/px4fmu-v2/px4fmu2_init.c b/src/drivers/boards/px4fmu-v2/px4fmu2_init.c index 635ae3f2b..74bbfa4c6 100644 --- a/src/drivers/boards/px4fmu-v2/px4fmu2_init.c +++ b/src/drivers/boards/px4fmu-v2/px4fmu2_init.c @@ -96,10 +96,6 @@ __END_DECLS * Protected Functions ****************************************************************************/ -#if defined(CONFIG_HAVE_CXX) && defined(CONFIG_HAVE_CXXINITIALIZE) -__EXPORT extern void up_cxxinitialize(void); -#endif - #if defined(CONFIG_FAT_DMAMEMORY) # if !defined(CONFIG_GRAN) || !defined(CONFIG_FAT_DMAMEMORY) # error microSD DMA support requires CONFIG_GRAN -- cgit v1.2.3 From b68032b7bb9627c8d01d94f48754c0977accb1cd Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Fri, 30 Jan 2015 10:40:25 +0100 Subject: Systemlib: proper use of headers for CXX init --- src/modules/systemlib/systemlib.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/modules/systemlib/systemlib.h b/src/modules/systemlib/systemlib.h index 2f24215a9..25f74351c 100644 --- a/src/modules/systemlib/systemlib.h +++ b/src/modules/systemlib/systemlib.h @@ -48,6 +48,9 @@ __BEGIN_DECLS /** Reboots the board */ __EXPORT void systemreset(bool to_bootloader) noreturn_function; +/** Executes the CXX static initializers */ +__EXPORT void up_cxxinitialize(void); + /** Sends SIGUSR1 to all processes */ __EXPORT void killall(void); -- cgit v1.2.3 From 673f7f32fd798bb45f6dad516f7c67eb97b431d0 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Fri, 30 Jan 2015 10:56:07 +0100 Subject: CXX init: Drop export in C file --- src/modules/systemlib/up_cxxinitialize.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/systemlib/up_cxxinitialize.c b/src/modules/systemlib/up_cxxinitialize.c index b04661b66..7b9ca5cb1 100644 --- a/src/modules/systemlib/up_cxxinitialize.c +++ b/src/modules/systemlib/up_cxxinitialize.c @@ -125,7 +125,7 @@ extern uint32_t _etext; * ***************************************************************************/ -__EXPORT void up_cxxinitialize(void) +void up_cxxinitialize(void) { initializer_t *initp; -- cgit v1.2.3 From 7abafff2f004e852730f3ffdaa260b377054eef8 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Fri, 30 Jan 2015 11:05:03 +0100 Subject: Dropping GCC 4.7 support --- makefiles/toolchain_gnu-arm-eabi.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/makefiles/toolchain_gnu-arm-eabi.mk b/makefiles/toolchain_gnu-arm-eabi.mk index 853885a3b..4c49edaab 100644 --- a/makefiles/toolchain_gnu-arm-eabi.mk +++ b/makefiles/toolchain_gnu-arm-eabi.mk @@ -50,7 +50,7 @@ OBJDUMP = $(CROSSDEV)objdump # Check if the right version of the toolchain is available # -CROSSDEV_VER_SUPPORTED = 4.7.4 4.7.5 4.7.6 4.8.4 4.9.3 +CROSSDEV_VER_SUPPORTED = 4.8.4 4.9.3 CROSSDEV_VER_FOUND = $(shell $(CC) -dumpversion) ifeq (,$(findstring $(CROSSDEV_VER_FOUND), $(CROSSDEV_VER_SUPPORTED))) -- cgit v1.2.3 From 5e6315af2c3ba9d1bd0f9a4366a335bf387dd4b4 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Fri, 30 Jan 2015 14:56:42 +0100 Subject: setup.mk: Formatting --- makefiles/setup.mk | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/makefiles/setup.mk b/makefiles/setup.mk index ed95dfc37..b41ec0180 100644 --- a/makefiles/setup.mk +++ b/makefiles/setup.mk @@ -68,17 +68,17 @@ export INCLUDE_DIRS := $(PX4_MODULE_SRC) \ # # Tools # -export MKFW = $(PX4_BASE)/Tools/px_mkfw.py +export MKFW = $(PX4_BASE)/Tools/px_mkfw.py export UPLOADER = $(PX4_BASE)/Tools/px_uploader.py -export COPY = cp +export COPY = cp export COPYDIR = cp -Rf export REMOVE = rm -f export RMDIR = rm -rf export GENROMFS = genromfs export TOUCH = touch export MKDIR = mkdir -export FIND = find -export ECHO = echo +export FIND = find +export ECHO = echo export UNZIP_CMD = unzip export PYTHON = python export OPENOCD = openocd -- cgit v1.2.3 From fd2c45d45bac84e6b6a80f1f80685fdc49591995 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Fri, 30 Jan 2015 14:57:37 +0100 Subject: System lib: exclude up_cxxinit from compile as the board makefiles include it --- src/modules/systemlib/systemlib.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/modules/systemlib/systemlib.h b/src/modules/systemlib/systemlib.h index 25f74351c..2f24215a9 100644 --- a/src/modules/systemlib/systemlib.h +++ b/src/modules/systemlib/systemlib.h @@ -48,9 +48,6 @@ __BEGIN_DECLS /** Reboots the board */ __EXPORT void systemreset(bool to_bootloader) noreturn_function; -/** Executes the CXX static initializers */ -__EXPORT void up_cxxinitialize(void); - /** Sends SIGUSR1 to all processes */ __EXPORT void killall(void); -- cgit v1.2.3 From 34d14ae649077602931fe24834ecec0003e1cf89 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Fri, 30 Jan 2015 15:00:11 +0100 Subject: Simplify aerocore config --- src/drivers/boards/aerocore/module.mk | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/drivers/boards/aerocore/module.mk b/src/drivers/boards/aerocore/module.mk index 51bf315c0..c1b51cd26 100644 --- a/src/drivers/boards/aerocore/module.mk +++ b/src/drivers/boards/aerocore/module.mk @@ -8,10 +8,4 @@ SRCS = aerocore_init.c \ aerocore_led.c \ ../../../modules/systemlib/up_cxxinitialize.c -ENABLE_CXXINITIALIZE=$(call check_nuttx_config ,"CONFIG_HAVE_CXX 1", $(NUTTX_CONFIG_H)) -ENABLE_CXXINITIALIZE+=$(call check_nuttx_config ,"CONFIG_HAVE_CXXINITIALIZE 1", $(NUTTX_CONFIG_H)) -ifeq ("$(ENABLE_CXXINITIALIZE)",$(nuttx_config_2true)) -SRCS += ../../../modules/systemlib/up_cxxinitialize.c -endif - MAXOPTIMIZATION = -Os -- cgit v1.2.3 From fcc23ba0e9517e139a1e605c3080c54d7ae705fb Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Fri, 30 Jan 2015 15:00:24 +0100 Subject: FMUv1: Simplify config --- src/drivers/boards/px4fmu-v1/module.mk | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/drivers/boards/px4fmu-v1/module.mk b/src/drivers/boards/px4fmu-v1/module.mk index 0f56e53d9..5a3f5f801 100644 --- a/src/drivers/boards/px4fmu-v1/module.mk +++ b/src/drivers/boards/px4fmu-v1/module.mk @@ -10,10 +10,4 @@ SRCS = px4fmu_can.c \ px4fmu_led.c \ ../../../modules/systemlib/up_cxxinitialize.c -ENABLE_CXXINITIALIZE=$(call check_nuttx_config ,"CONFIG_HAVE_CXX 1", $(NUTTX_CONFIG_H)) -ENABLE_CXXINITIALIZE+=$(call check_nuttx_config ,"CONFIG_HAVE_CXXINITIALIZE 1", $(NUTTX_CONFIG_H)) -ifeq ("$(ENABLE_CXXINITIALIZE)",$(nuttx_config_2true)) -SRCS += ../../../modules/systemlib/up_cxxinitialize.c -endif - MAXOPTIMIZATION = -Os -- cgit v1.2.3 From 431d6b6713256d967a52109b9f238e06fea16064 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Fri, 30 Jan 2015 15:02:19 +0100 Subject: Simplify v2 config --- src/drivers/boards/px4fmu-v2/module.mk | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/drivers/boards/px4fmu-v2/module.mk b/src/drivers/boards/px4fmu-v2/module.mk index f3f522624..cfe7e675b 100644 --- a/src/drivers/boards/px4fmu-v2/module.mk +++ b/src/drivers/boards/px4fmu-v2/module.mk @@ -10,11 +10,4 @@ SRCS = px4fmu_can.c \ px4fmu2_led.c \ ../../../modules/systemlib/up_cxxinitialize.c - -ENABLE_CXXINITIALIZE=$(call check_nuttx_config ,"CONFIG_HAVE_CXX 1", $(NUTTX_CONFIG_H)) -ENABLE_CXXINITIALIZE+=$(call check_nuttx_config ,"CONFIG_HAVE_CXXINITIALIZE 1", $(NUTTX_CONFIG_H)) -ifeq ("$(ENABLE_CXXINITIALIZE)",$(nuttx_config_2true)) -SRCS += ../../../modules/systemlib/up_cxxinitialize.c -endif - MAXOPTIMIZATION = -Os -- cgit v1.2.3 From de49bc13486a2c02ae0d77554859c389843a8254 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Fri, 30 Jan 2015 15:04:04 +0100 Subject: IOv1: simplify config --- src/drivers/boards/px4io-v1/module.mk | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/drivers/boards/px4io-v1/module.mk b/src/drivers/boards/px4io-v1/module.mk index 9b3f38f27..40c79da4e 100644 --- a/src/drivers/boards/px4io-v1/module.mk +++ b/src/drivers/boards/px4io-v1/module.mk @@ -6,10 +6,4 @@ SRCS = px4io_init.c \ px4io_pwm_servo.c \ ../../../modules/systemlib/up_cxxinitialize.c -ENABLE_CXXINITIALIZE=$(call check_nuttx_config ,"CONFIG_HAVE_CXX 1", $(NUTTX_CONFIG_H)) -ENABLE_CXXINITIALIZE+=$(call check_nuttx_config ,"CONFIG_HAVE_CXXINITIALIZE 1", $(NUTTX_CONFIG_H)) -ifeq ("$(ENABLE_CXXINITIALIZE)",$(nuttx_config_2true)) -SRCS += ../../../modules/systemlib/up_cxxinitialize.c -endif - MAXOPTIMIZATION = -Os -- cgit v1.2.3 From cc685f46ada72762d48bb8733f57daf1056ec019 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Fri, 30 Jan 2015 15:04:47 +0100 Subject: IOv2: simplify config --- src/drivers/boards/px4io-v2/module.mk | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/drivers/boards/px4io-v2/module.mk b/src/drivers/boards/px4io-v2/module.mk index ff5839c80..15e003599 100644 --- a/src/drivers/boards/px4io-v2/module.mk +++ b/src/drivers/boards/px4io-v2/module.mk @@ -6,10 +6,4 @@ SRCS = px4iov2_init.c \ px4iov2_pwm_servo.c \ ../../../modules/systemlib/up_cxxinitialize.c -ENABLE_CXXINITIALIZE=$(call check_nuttx_config ,"CONFIG_HAVE_CXX 1", $(NUTTX_CONFIG_H)) -ENABLE_CXXINITIALIZE+=$(call check_nuttx_config ,"CONFIG_HAVE_CXXINITIALIZE 1", $(NUTTX_CONFIG_H)) -ifeq ("$(ENABLE_CXXINITIALIZE)",$(nuttx_config_2true)) -SRCS += ../../../modules/systemlib/up_cxxinitialize.c -endif - MAXOPTIMIZATION = -Os -- cgit v1.2.3 From 664fbe7de7b9c0143787c30534ff4aab423a2a13 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Sat, 31 Jan 2015 01:13:05 +0100 Subject: Allow GCC 4.7.4 in check --- makefiles/toolchain_gnu-arm-eabi.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/makefiles/toolchain_gnu-arm-eabi.mk b/makefiles/toolchain_gnu-arm-eabi.mk index 4c49edaab..853885a3b 100644 --- a/makefiles/toolchain_gnu-arm-eabi.mk +++ b/makefiles/toolchain_gnu-arm-eabi.mk @@ -50,7 +50,7 @@ OBJDUMP = $(CROSSDEV)objdump # Check if the right version of the toolchain is available # -CROSSDEV_VER_SUPPORTED = 4.8.4 4.9.3 +CROSSDEV_VER_SUPPORTED = 4.7.4 4.7.5 4.7.6 4.8.4 4.9.3 CROSSDEV_VER_FOUND = $(shell $(CC) -dumpversion) ifeq (,$(findstring $(CROSSDEV_VER_FOUND), $(CROSSDEV_VER_SUPPORTED))) -- cgit v1.2.3 From 12dafbf77c15937a29d53763f273472dd6f3fd1d Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Sun, 8 Feb 2015 11:09:48 +0100 Subject: Fix echo output of Makefile --- Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index d5ece137b..7c8fa7a4f 100644 --- a/Makefile +++ b/Makefile @@ -303,9 +303,9 @@ clean: .PHONY: distclean distclean: cleannuttxpatches clean @echo > /dev/null - $(Q) $(REMOVE) $(ARCHIVE_DIR)*.export > /dev/null - $(Q) $(MAKE) -C $(NUTTX_SRC) -r $(MQUIET) distclean > /dev/null - $(Q) (cd $(NUTTX_SRC)/configs && $(FIND) . -maxdepth 1 -type l -delete) > /dev/null + $(Q) $(REMOVE) $(ARCHIVE_DIR)*.export + $(Q) $(MAKE) -C $(NUTTX_SRC) -r $(MQUIET) distclean + $(Q) (cd $(NUTTX_SRC)/configs && $(FIND) . -maxdepth 1 -type l -delete) # # Print some help text -- cgit v1.2.3 From 41cd066591c04ea1699d2e6441e1c274ecec5358 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Sun, 8 Feb 2015 13:11:28 +0100 Subject: Fix code style in IO driver --- src/drivers/px4io/px4io_serial.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/drivers/px4io/px4io_serial.cpp b/src/drivers/px4io/px4io_serial.cpp index 8892690e9..c6c0126f4 100644 --- a/src/drivers/px4io/px4io_serial.cpp +++ b/src/drivers/px4io/px4io_serial.cpp @@ -252,11 +252,7 @@ PX4IO_serial::init() /* Enable the APB clock for the USART peripheral */ -<<<<<<< HEAD modifyreg32(STM32_RCC_APB2ENR, 0, RCC_APB2ENR_USART6EN); -======= - modifyreg32(STM32_RCC_APB2ENR, 0, RCC_APB2ENR_USART6EN); ->>>>>>> Bug fix:The CRC detection on px4io was failing with -1 result, do the the fact that the PX4IO_Uploader had closed the port and Nuttx (now) disabled the clock and PX4IO_serial did not managed the clock /* configure pins for serial use */ stm32_configgpio(PX4IO_SERIAL_TX_GPIO); -- cgit v1.2.3 From eaf1ccf2d119021a69d1156415935e04d70655ff Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Wed, 18 Feb 2015 14:29:34 -1000 Subject: Added patch to build with c++11 --- nuttx-patches/wchar.h.patch | 57 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 nuttx-patches/wchar.h.patch diff --git a/nuttx-patches/wchar.h.patch b/nuttx-patches/wchar.h.patch new file mode 100644 index 000000000..716db992e --- /dev/null +++ b/nuttx-patches/wchar.h.patch @@ -0,0 +1,57 @@ +diff --git NuttX/nuttx/include/wchar.h NuttX/nuttx/include/wchar.h +index 54fa796..889b272 100644 +--- NuttX/nuttx/include/wchar.h ++++ NuttX/nuttx/include/wchar.h +@@ -118,7 +118,19 @@ typedef int wint_t; + * Reference: Opengroup.org + */ + +-struct tm; /* Forward reference (see ) */ ++ struct tm; /* Forward reference (see ) */ ++ ++/* An object type other than an array type that can hold the conversion state ++ * information necessary to convert between sequences of (possibly multi-byte) ++ * characters and wide characters. If a codeset is being ++ * used such that an mbstate_t needs to preserve more than two levels of ++ * reserved state, the results are unspecified. ++ */ ++ ++typedef struct ++{ ++ int __fill[6]; ++} mbstate_t; + + /**************************************************************************** + * Public Data +@@ -142,7 +154,18 @@ extern "C" + * Reference: Opengroup.org + */ + +-#if 0 /* Not yet implemented */ ++ ++#ifndef _WCTYPE_T ++#define _WCTYPE_T ++# ifdef _AEABI_PORTABLE ++typedef void *wctype_t; ++# else ++typedef int wctype_t; ++# endif ++#endif /* !_WCTYPE_T */ ++ ++ /* Not yet implemented */ ++ + wint_t btowc(int); + int fwprintf(FILE *, const wchar_t *, ...); + int fwscanf(FILE *, const wchar_t *, ...); +@@ -218,7 +241,10 @@ wchar_t *wmemmove(wchar_t *, const wchar_t *, size_t); + wchar_t *wmemset(wchar_t *, wchar_t, size_t); + int wprintf(const wchar_t *, ...); + int wscanf(const wchar_t *, ...); +-#endif ++int vfwscanf(FILE *, const wchar_t *, va_list); ++int vswscanf(const wchar_t *, const wchar_t *, va_list); ++int vwscanf(const wchar_t *, va_list); ++float wcstof(const wchar_t *, wchar_t **); + + #undef EXTERN + #ifdef __cplusplus -- cgit v1.2.3 From cde3139baea3247218b687f296c7d1c697378d6d Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Wed, 18 Feb 2015 16:47:35 -1000 Subject: Interim fix for timeval being incorrectly defined in cxx/ctime --- nuttx-patches/ctime.patch | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 nuttx-patches/ctime.patch diff --git a/nuttx-patches/ctime.patch b/nuttx-patches/ctime.patch new file mode 100644 index 000000000..4d8b1fd0f --- /dev/null +++ b/nuttx-patches/ctime.patch @@ -0,0 +1,12 @@ +diff --git NuttX/nuttx/include/cxx/ctime NuttX/nuttx/include/cxx/ctime +index 3d3dfae..18fdded 100644 +--- NuttX/nuttx/include/cxx/ctime ++++ NuttX/nuttx/include/cxx/ctime +@@ -53,7 +53,6 @@ namespace std + using ::clockid_t; + using ::timer_t; + using ::timespec; +- using ::timeval; + using ::tm; + using ::itimerspec; + using ::sigevent; -- cgit v1.2.3 From c4a4fc67739901e25dbf8b91fd3a74d4d613e23c Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Thu, 19 Feb 2015 06:47:13 -1000 Subject: Latest Intrim C++11 workaround waitng on feedback --- nuttx-patches/ctime.patch | 12 ---------- nuttx-patches/wchar.h.patch | 57 --------------------------------------------- 2 files changed, 69 deletions(-) delete mode 100644 nuttx-patches/ctime.patch delete mode 100644 nuttx-patches/wchar.h.patch diff --git a/nuttx-patches/ctime.patch b/nuttx-patches/ctime.patch deleted file mode 100644 index 4d8b1fd0f..000000000 --- a/nuttx-patches/ctime.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git NuttX/nuttx/include/cxx/ctime NuttX/nuttx/include/cxx/ctime -index 3d3dfae..18fdded 100644 ---- NuttX/nuttx/include/cxx/ctime -+++ NuttX/nuttx/include/cxx/ctime -@@ -53,7 +53,6 @@ namespace std - using ::clockid_t; - using ::timer_t; - using ::timespec; -- using ::timeval; - using ::tm; - using ::itimerspec; - using ::sigevent; diff --git a/nuttx-patches/wchar.h.patch b/nuttx-patches/wchar.h.patch deleted file mode 100644 index 716db992e..000000000 --- a/nuttx-patches/wchar.h.patch +++ /dev/null @@ -1,57 +0,0 @@ -diff --git NuttX/nuttx/include/wchar.h NuttX/nuttx/include/wchar.h -index 54fa796..889b272 100644 ---- NuttX/nuttx/include/wchar.h -+++ NuttX/nuttx/include/wchar.h -@@ -118,7 +118,19 @@ typedef int wint_t; - * Reference: Opengroup.org - */ - --struct tm; /* Forward reference (see ) */ -+ struct tm; /* Forward reference (see ) */ -+ -+/* An object type other than an array type that can hold the conversion state -+ * information necessary to convert between sequences of (possibly multi-byte) -+ * characters and wide characters. If a codeset is being -+ * used such that an mbstate_t needs to preserve more than two levels of -+ * reserved state, the results are unspecified. -+ */ -+ -+typedef struct -+{ -+ int __fill[6]; -+} mbstate_t; - - /**************************************************************************** - * Public Data -@@ -142,7 +154,18 @@ extern "C" - * Reference: Opengroup.org - */ - --#if 0 /* Not yet implemented */ -+ -+#ifndef _WCTYPE_T -+#define _WCTYPE_T -+# ifdef _AEABI_PORTABLE -+typedef void *wctype_t; -+# else -+typedef int wctype_t; -+# endif -+#endif /* !_WCTYPE_T */ -+ -+ /* Not yet implemented */ -+ - wint_t btowc(int); - int fwprintf(FILE *, const wchar_t *, ...); - int fwscanf(FILE *, const wchar_t *, ...); -@@ -218,7 +241,10 @@ wchar_t *wmemmove(wchar_t *, const wchar_t *, size_t); - wchar_t *wmemset(wchar_t *, wchar_t, size_t); - int wprintf(const wchar_t *, ...); - int wscanf(const wchar_t *, ...); --#endif -+int vfwscanf(FILE *, const wchar_t *, va_list); -+int vswscanf(const wchar_t *, const wchar_t *, va_list); -+int vwscanf(const wchar_t *, va_list); -+float wcstof(const wchar_t *, wchar_t **); - - #undef EXTERN - #ifdef __cplusplus -- cgit v1.2.3 From c59ff8f39837c42975ef014b2bbae5c97c41902a Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Tue, 3 Mar 2015 14:59:36 -1000 Subject: Rebased on master but using nuttx_next configs --- nuttx-configs/px4fmu-v1/nsh/defconfig | 5 ----- 1 file changed, 5 deletions(-) diff --git a/nuttx-configs/px4fmu-v1/nsh/defconfig b/nuttx-configs/px4fmu-v1/nsh/defconfig index 05c766769..7e0cd2937 100644 --- a/nuttx-configs/px4fmu-v1/nsh/defconfig +++ b/nuttx-configs/px4fmu-v1/nsh/defconfig @@ -764,11 +764,6 @@ CONFIG_USART6_PARITY=0 CONFIG_USART6_2STOP=0 # CONFIG_USART6_IFLOWCONTROL is not set # CONFIG_USART6_OFLOWCONTROL is not set -CONFIG_SERIAL_IFLOWCONTROL=y -CONFIG_SERIAL_OFLOWCONTROL=y -CONFIG_SERIAL_IFLOWCONTROL_WATERMARKS=y -CONFIG_SERIAL_IFLOWCONTROL_LOWER_WATERMARK=10 -CONFIG_SERIAL_IFLOWCONTROL_UPPER_WATERMARK=90 CONFIG_USBDEV=y # -- cgit v1.2.3 From fb0d5c87d5a1acc31702be600061c8be00ab0b87 Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Tue, 3 Mar 2015 16:30:51 -1000 Subject: Hard Fault Logging - one issue remians reduse memory foot print --- nuttx-configs/px4fmu-v2/nsh/defconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nuttx-configs/px4fmu-v2/nsh/defconfig b/nuttx-configs/px4fmu-v2/nsh/defconfig index 9f94f0dd3..649fafc70 100644 --- a/nuttx-configs/px4fmu-v2/nsh/defconfig +++ b/nuttx-configs/px4fmu-v2/nsh/defconfig @@ -588,8 +588,8 @@ CONFIG_SCHED_LPWORKSTACKSIZE=1800 # # Stack and heap information # -# This set to 380 with 28 bytes free -CONFIG_IDLETHREAD_STACKSIZE=380 +# Per LM using 500 This set to 380 with 28 bytes free +CONFIG_IDLETHREAD_STACKSIZE=500 CONFIG_USERMAIN_STACKSIZE=3000 CONFIG_PTHREAD_STACK_MIN=512 CONFIG_PTHREAD_STACK_DEFAULT=2048 -- cgit v1.2.3 From ccc543f8e58924df3e07b817e55a79f23941f85c Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Thu, 5 Mar 2015 10:13:35 -1000 Subject: Rebase on Master with Idle stack at 500 for arch with interrupt stacks and 1024 without --- nuttx-configs/px4fmu-v1/nsh/defconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nuttx-configs/px4fmu-v1/nsh/defconfig b/nuttx-configs/px4fmu-v1/nsh/defconfig index 7e0cd2937..b558a3e9c 100644 --- a/nuttx-configs/px4fmu-v1/nsh/defconfig +++ b/nuttx-configs/px4fmu-v1/nsh/defconfig @@ -577,8 +577,8 @@ CONFIG_SCHED_LPWORKSTACKSIZE=1800 # # Stack and heap information # -# This should be 380 with 28 bytes free -CONFIG_IDLETHREAD_STACKSIZE=1000 +# Per 500 LM This should be 380 with 28 bytes free +CONFIG_IDLETHREAD_STACKSIZE=500 CONFIG_USERMAIN_STACKSIZE=3000 CONFIG_PTHREAD_STACK_MIN=512 CONFIG_PTHREAD_STACK_DEFAULT=2048 -- cgit v1.2.3 From 26171f084d05c566367ed144193fb7f0c10df989 Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Thu, 5 Mar 2015 10:54:10 -1000 Subject: Fixed bug in hardfault_get_desc not retering -ENOENT --- src/systemcmds/hardfault_log/hardfault_log.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/systemcmds/hardfault_log/hardfault_log.c b/src/systemcmds/hardfault_log/hardfault_log.c index d0d67b4fc..f56e47029 100644 --- a/src/systemcmds/hardfault_log/hardfault_log.c +++ b/src/systemcmds/hardfault_log/hardfault_log.c @@ -196,7 +196,7 @@ static void identify(char *caller) ****************************************************************************/ static int hardfault_get_desc(char *caller, struct bbsramd_s *desc, bool silent) { - int ret = ENOENT; + int ret = -ENOENT; int fd = open(HARDFAULT_PATH, O_RDONLY); if (fd < 0 ) { if (!silent) { -- cgit v1.2.3 From 935f6d3c272240c93be01c8c092f6298c7df8f71 Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Thu, 5 Mar 2015 11:09:23 -1000 Subject: Added Build URI to version command --- src/systemcmds/ver/ver.c | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/src/systemcmds/ver/ver.c b/src/systemcmds/ver/ver.c index 087eb52e3..30ac17d8a 100644 --- a/src/systemcmds/ver/ver.c +++ b/src/systemcmds/ver/ver.c @@ -48,13 +48,14 @@ /* string constants for version commands */ static const char sz_ver_hw_str[] = "hw"; -static const char sz_ver_hwcmp_str[] = "hwcmp"; +static const char sz_ver_hwcmp_str[] = "hwcmp"; static const char sz_ver_git_str[] = "git"; -static const char sz_ver_bdate_str[] = "bdate"; +static const char sz_ver_bdate_str[] = "bdate"; +static const char sz_ver_buri_str[] = "uri"; static const char sz_ver_gcc_str[] = "gcc"; static const char sz_ver_all_str[] = "all"; static const char mcu_ver_str[] = "mcu"; -static const char mcu_uid_str[] = "uid"; +static const char mcu_uid_str[] = "uid"; static void usage(const char *reason) { @@ -62,7 +63,7 @@ static void usage(const char *reason) printf("%s\n", reason); } - printf("usage: ver {hw|hwcmp|git|bdate|gcc|all|mcu|uid}\n\n"); + printf("usage: ver {hw|hwcmp|git|bdate|gcc|all|mcu|uid|uri}\n\n"); } __EXPORT int ver_main(int argc, char *argv[]); @@ -106,11 +107,17 @@ int ver_main(int argc, char *argv[]) } - if (show_all || !strncmp(argv[1], sz_ver_bdate_str, sizeof(sz_ver_bdate_str))) { - printf("Build datetime: %s %s\n", __DATE__, __TIME__); - ret = 0; + if (show_all || !strncmp(argv[1], sz_ver_bdate_str, sizeof(sz_ver_bdate_str))) { + printf("Build datetime: %s %s\n", __DATE__, __TIME__); + ret = 0; - } + } + + if (show_all || !strncmp(argv[1], sz_ver_buri_str, sizeof(sz_ver_buri_str))) { + printf("Build uri: %s\n", FW_BUILD_URI); + ret = 0; + + } if (show_all || !strncmp(argv[1], sz_ver_gcc_str, sizeof(sz_ver_gcc_str))) { printf("Toolchain: %s\n", __VERSION__); -- cgit v1.2.3 From 8739db34aa953294895125515b4a53b3863ab28c Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Thu, 5 Mar 2015 11:36:46 -1000 Subject: Ran astyle on ver.c --- src/systemcmds/ver/ver.c | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/src/systemcmds/ver/ver.c b/src/systemcmds/ver/ver.c index 30ac17d8a..15105a0a7 100644 --- a/src/systemcmds/ver/ver.c +++ b/src/systemcmds/ver/ver.c @@ -85,6 +85,7 @@ int ver_main(int argc, char *argv[]) if (ret == 0) { printf("ver hwcmp match: %s\n", HW_ARCH); } + return ret; } else { @@ -107,17 +108,17 @@ int ver_main(int argc, char *argv[]) } - if (show_all || !strncmp(argv[1], sz_ver_bdate_str, sizeof(sz_ver_bdate_str))) { - printf("Build datetime: %s %s\n", __DATE__, __TIME__); - ret = 0; + if (show_all || !strncmp(argv[1], sz_ver_bdate_str, sizeof(sz_ver_bdate_str))) { + printf("Build datetime: %s %s\n", __DATE__, __TIME__); + ret = 0; - } + } - if (show_all || !strncmp(argv[1], sz_ver_buri_str, sizeof(sz_ver_buri_str))) { - printf("Build uri: %s\n", FW_BUILD_URI); - ret = 0; + if (show_all || !strncmp(argv[1], sz_ver_buri_str, sizeof(sz_ver_buri_str))) { + printf("Build uri: %s\n", FW_BUILD_URI); + ret = 0; - } + } if (show_all || !strncmp(argv[1], sz_ver_gcc_str, sizeof(sz_ver_gcc_str))) { printf("Toolchain: %s\n", __VERSION__); @@ -128,7 +129,7 @@ int ver_main(int argc, char *argv[]) if (show_all || !strncmp(argv[1], mcu_ver_str, sizeof(mcu_ver_str))) { char rev; - char* revstr; + char *revstr; int chip_version = mcu_version(&rev, &revstr); @@ -140,9 +141,9 @@ int ver_main(int argc, char *argv[]) if (chip_version < MCU_REV_STM32F4_REV_3) { printf("\nWARNING WARNING WARNING!\n" - "Revision %c has a silicon errata\n" - "This device can only utilize a maximum of 1MB flash safely!\n" - "http://px4.io/help/errata\n\n", rev); + "Revision %c has a silicon errata\n" + "This device can only utilize a maximum of 1MB flash safely!\n" + "http://px4.io/help/errata\n\n", rev); } } @@ -154,7 +155,7 @@ int ver_main(int argc, char *argv[]) mcu_unique_id(uid); - printf("UID: %X:%X:%X \n",uid[0],uid[1],uid[2]); + printf("UID: %X:%X:%X \n", uid[0], uid[1], uid[2]); ret = 0; } -- cgit v1.2.3 From 9272ad2a7378f121131af9389a6082a970444d5c Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Mon, 23 Mar 2015 10:01:30 -1000 Subject: Updated Nuttx to latest with Olimexino-STM32 == upstream --- NuttX | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NuttX b/NuttX index dbca8f554..ad6c69e6e 160000 --- a/NuttX +++ b/NuttX @@ -1 +1 @@ -Subproject commit dbca8f5549a676ec663f67d2bba9776f83b8fbf3 +Subproject commit ad6c69e6edc9367b166cfa743b886c1cff179e3a -- cgit v1.2.3 From a2e55f0248ad42b5706bb2ebc19055f842df0477 Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Mon, 6 Apr 2015 11:46:19 -1000 Subject: Changed to Support boardctrl in upstream NuttX --- NuttX | 2 +- nuttx-configs/aerocore/nsh/defconfig | 5 +++ nuttx-configs/mavstation/nsh/defconfig | 2 +- nuttx-configs/px4fmu-v1/nsh/defconfig | 6 ++- nuttx-configs/px4fmu-v2/nsh/defconfig | 57 +++++++++++++++++++++---- src/drivers/boards/aerocore/aerocore_init.c | 6 +-- src/drivers/boards/aerocore/board_config.h | 19 --------- src/drivers/boards/mavstation/mavstation_init.c | 3 +- src/drivers/boards/px4fmu-v1/board_config.h | 20 +-------- src/drivers/boards/px4fmu-v1/px4fmu_init.c | 6 +-- src/drivers/boards/px4fmu-v2/board_config.h | 19 --------- src/drivers/boards/px4fmu-v2/px4fmu2_init.c | 6 +-- src/drivers/boards/px4io-v1/px4io_init.c | 2 +- src/drivers/boards/px4io-v2/px4iov2_init.c | 2 +- 14 files changed, 74 insertions(+), 81 deletions(-) diff --git a/NuttX b/NuttX index ad6c69e6e..5724bb8a0 160000 --- a/NuttX +++ b/NuttX @@ -1 +1 @@ -Subproject commit ad6c69e6edc9367b166cfa743b886c1cff179e3a +Subproject commit 5724bb8a06a8ffb87dc07fe1f2d9bd2f3c14c8be diff --git a/nuttx-configs/aerocore/nsh/defconfig b/nuttx-configs/aerocore/nsh/defconfig index d17e7b6b5..d284db7fd 100644 --- a/nuttx-configs/aerocore/nsh/defconfig +++ b/nuttx-configs/aerocore/nsh/defconfig @@ -358,6 +358,11 @@ CONFIG_NSH_MMCSDMINOR=0 # # Board-Specific Options # +CONFIG_LIB_BOARDCTL=y +# CONFIG_BOARDCTL_TSCTEST is not set +# CONFIG_BOARDCTL_ADCTEST is not set +# CONFIG_BOARDCTL_GRAPHICS is not set +# CONFIG_BOARDCTL_IOCTL is not set # # RTOS Features diff --git a/nuttx-configs/mavstation/nsh/defconfig b/nuttx-configs/mavstation/nsh/defconfig index 6f752df2d..bcb0e3d22 100644 --- a/nuttx-configs/mavstation/nsh/defconfig +++ b/nuttx-configs/mavstation/nsh/defconfig @@ -618,7 +618,7 @@ CONFIG_NSH_LIBRARY=y # CONFIG_NSH_CONSOLE - Use serial console front end # CONFIG_NSH_TELNET - Use telnetd console front end # CONFIG_NSH_ARCHINIT - Platform provides architecture -# specific initialization (nsh_archinitialize()). +# specific initialization (board_app_initialize()). # # If CONFIG_NSH_TELNET is selected: # CONFIG_NSH_IOBUFFER_SIZE -- Telnetd I/O buffer size diff --git a/nuttx-configs/px4fmu-v1/nsh/defconfig b/nuttx-configs/px4fmu-v1/nsh/defconfig index b558a3e9c..2f85e9e50 100644 --- a/nuttx-configs/px4fmu-v1/nsh/defconfig +++ b/nuttx-configs/px4fmu-v1/nsh/defconfig @@ -470,7 +470,11 @@ CONFIG_NSH_MMCSDSPIPORTNO=3 # # Board-Specific Options # - +CONFIG_LIB_BOARDCTL=y +# CONFIG_BOARDCTL_TSCTEST is not set +# CONFIG_BOARDCTL_ADCTEST is not set +# CONFIG_BOARDCTL_GRAPHICS is not set +# CONFIG_BOARDCTL_IOCTL is not set # # RTOS Features # diff --git a/nuttx-configs/px4fmu-v2/nsh/defconfig b/nuttx-configs/px4fmu-v2/nsh/defconfig index 649fafc70..d05fe8e15 100644 --- a/nuttx-configs/px4fmu-v2/nsh/defconfig +++ b/nuttx-configs/px4fmu-v2/nsh/defconfig @@ -42,8 +42,8 @@ CONFIG_ARCH_MATH_H=y # Debug Options # # CONFIG_DEBUG is not set -CONFIG_ARCH_HAVE_STACKCHECK=y CONFIG_ARCH_HAVE_HEAPCHECK=y +CONFIG_ARCH_HAVE_STACKCHECK=y CONFIG_STACK_COLORATION=y CONFIG_DEBUG_SYMBOLS=y CONFIG_ARCH_HAVE_CUSTOMOPT=y @@ -88,6 +88,7 @@ CONFIG_ARCH="arm" # CONFIG_ARCH_CHIP_SAMA5 is not set # CONFIG_ARCH_CHIP_SAMD is not set # CONFIG_ARCH_CHIP_SAM34 is not set +# CONFIG_ARCH_CHIP_SAMV7 is not set CONFIG_ARCH_CHIP_STM32=y # CONFIG_ARCH_CHIP_STR71X is not set # CONFIG_ARCH_ARM7TDMI is not set @@ -96,6 +97,7 @@ CONFIG_ARCH_CHIP_STM32=y # CONFIG_ARCH_CORTEXM0 is not set # CONFIG_ARCH_CORTEXM3 is not set CONFIG_ARCH_CORTEXM4=y +# CONFIG_ARCH_CORTEXM7 is not set # CONFIG_ARCH_CORTEXA5 is not set # CONFIG_ARCH_CORTEXA8 is not set CONFIG_ARCH_FAMILY="armv7-m" @@ -103,13 +105,19 @@ CONFIG_ARCH_CHIP="stm32" CONFIG_ARMV7M_USEBASEPRI=y CONFIG_ARCH_HAVE_CMNVECTOR=y CONFIG_ARMV7M_CMNVECTOR=y +# CONFIG_ARMV7M_LAZYFPU is not set CONFIG_ARCH_HAVE_FPU=y +# CONFIG_ARCH_HAVE_DPFPU is not set CONFIG_ARCH_FPU=y # CONFIG_ARMV7M_MPU is not set # # ARMV7M Configuration Options # +# CONFIG_ARMV7M_HAVE_ICACHE is not set +# CONFIG_ARMV7M_HAVE_DCACHE is not set +# CONFIG_ARMV7M_HAVE_ITCM is not set +# CONFIG_ARMV7M_HAVE_DTCM is not set # CONFIG_ARMV7M_TOOLCHAIN_BUILDROOT is not set # CONFIG_ARMV7M_TOOLCHAIN_CODEREDL is not set # CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYL is not set @@ -142,6 +150,7 @@ CONFIG_SDIO_DMAPRIO=0x00010000 # CONFIG_ARCH_CHIP_STM32L152V8 is not set # CONFIG_ARCH_CHIP_STM32L152VB is not set # CONFIG_ARCH_CHIP_STM32L162ZD is not set +# CONFIG_ARCH_CHIP_STM32L162VE is not set # CONFIG_ARCH_CHIP_STM32F100C8 is not set # CONFIG_ARCH_CHIP_STM32F100CB is not set # CONFIG_ARCH_CHIP_STM32F100R8 is not set @@ -187,6 +196,24 @@ CONFIG_SDIO_DMAPRIO=0x00010000 # CONFIG_ARCH_CHIP_STM32F303RC is not set # CONFIG_ARCH_CHIP_STM32F303VB is not set # CONFIG_ARCH_CHIP_STM32F303VC is not set +# CONFIG_ARCH_CHIP_STM32F372C8 is not set +# CONFIG_ARCH_CHIP_STM32F372R8 is not set +# CONFIG_ARCH_CHIP_STM32F372V8 is not set +# CONFIG_ARCH_CHIP_STM32F372CB is not set +# CONFIG_ARCH_CHIP_STM32F372RB is not set +# CONFIG_ARCH_CHIP_STM32F372VB is not set +# CONFIG_ARCH_CHIP_STM32F372CC is not set +# CONFIG_ARCH_CHIP_STM32F372RC is not set +# CONFIG_ARCH_CHIP_STM32F372VC is not set +# CONFIG_ARCH_CHIP_STM32F373C8 is not set +# CONFIG_ARCH_CHIP_STM32F373R8 is not set +# CONFIG_ARCH_CHIP_STM32F373V8 is not set +# CONFIG_ARCH_CHIP_STM32F373CB is not set +# CONFIG_ARCH_CHIP_STM32F373RB is not set +# CONFIG_ARCH_CHIP_STM32F373VB is not set +# CONFIG_ARCH_CHIP_STM32F373CC is not set +# CONFIG_ARCH_CHIP_STM32F373RC is not set +# CONFIG_ARCH_CHIP_STM32F373VC is not set # CONFIG_ARCH_CHIP_STM32F401RE is not set # CONFIG_ARCH_CHIP_STM32F411RE is not set # CONFIG_ARCH_CHIP_STM32F405RG is not set @@ -219,6 +246,7 @@ CONFIG_ARCH_CHIP_STM32F427V=y # CONFIG_STM32_STM32F20XX is not set # CONFIG_STM32_STM32F207 is not set # CONFIG_STM32_STM32F30XX is not set +# CONFIG_STM32_STM32F37XX is not set CONFIG_STM32_STM32F40XX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set @@ -266,6 +294,7 @@ CONFIG_STM32_HAVE_SPI2=y CONFIG_STM32_HAVE_SPI3=y CONFIG_STM32_HAVE_SPI4=y CONFIG_STM32_HAVE_SPI5=y +CONFIG_STM32_HAVE_SPI6=y CONFIG_STM32_ADC1=y # CONFIG_STM32_ADC2 is not set # CONFIG_STM32_ADC3 is not set @@ -395,7 +424,7 @@ CONFIG_STM32_BBSRAM_FILES=4 CONFIG_STM32_SAVE_CRASHDUMP=y CONFIG_BOARD_CRASHDUMP=y CONFIG_BOARD_RESET_ON_CRASH=y - +# CONFIG_STM32_HAVE_RTC_SUBSECONDS is not set # CONFIG_RTC_LSECLOCK is not set # CONFIG_RTC_LSICLOCK is not set CONFIG_RTC_HSECLOCK=y @@ -489,6 +518,11 @@ CONFIG_NSH_MMCSDSLOTNO=0 # CONFIG_BOARD_HAS_PROBES=y # CONFIG_BOARD_USE_PROBES is not set +CONFIG_LIB_BOARDCTL=y +# CONFIG_BOARDCTL_TSCTEST is not set +# CONFIG_BOARDCTL_ADCTEST is not set +# CONFIG_BOARDCTL_GRAPHICS is not set +# CONFIG_BOARDCTL_IOCTL is not set # # RTOS Features @@ -624,14 +658,21 @@ CONFIG_SPI=y # CONFIG_SPI_OWNBUS is not set CONFIG_SPI_EXCHANGE=y # CONFIG_SPI_CMDDATA is not set +# CONFIG_SPI_CALLBACK is not set # CONFIG_SPI_BITBANG is not set # CONFIG_I2S is not set + +# +# Timer Driver Support +# +# CONFIG_TIMER is not set CONFIG_RTC=y CONFIG_RTC_DATETIME=y # CONFIG_RTC_ALARM is not set +# CONFIG_RTC_DRIVER is not set CONFIG_WATCHDOG=y CONFIG_WATCHDOG_DEVPATH="/dev/watchdog0" -# CONFIG_TIMER is not set +# CONFIG_TIMERS_CS2100CP is not set # CONFIG_ANALOG is not set # CONFIG_AUDIO_DEVICES is not set # CONFIG_VIDEO_DEVICES is not set @@ -874,6 +915,7 @@ CONFIG_CDCACM_PRODUCTSTR="PX4 FMU v2.x" # System Logging # # CONFIG_RAMLOG is not set +# CONFIG_SYSLOG_CONSOLE is not set # # Networking Support @@ -1114,15 +1156,11 @@ CONFIG_EXAMPLES_NSH=y # Networking Utilities # # CONFIG_NETUTILS_CODECS is not set -# CONFIG_NETUTILS_DHCPD is not set # CONFIG_NETUTILS_FTPC is not set -# CONFIG_NETUTILS_FTPD is not set # CONFIG_NETUTILS_JSON is not set # CONFIG_NETUTILS_SMTP is not set -# CONFIG_NETUTILS_TFTPC is not set # CONFIG_NETUTILS_THTTPD is not set -# CONFIG_NETUTILS_NETLIB is not set -# CONFIG_NETUTILS_WEBCLIENT is not set +# CONFIG_NETUTILS_PPPD is not set # # FreeModBus @@ -1156,6 +1194,7 @@ CONFIG_NSH_BUILTIN_APPS=y # CONFIG_NSH_DISABLE_CD is not set # CONFIG_NSH_DISABLE_CP is not set # CONFIG_NSH_DISABLE_CMP is not set +# CONFIG_NSH_DISABLE_DATE is not set # CONFIG_NSH_DISABLE_DD is not set # CONFIG_NSH_DISABLE_DF is not set # CONFIG_NSH_DISABLE_DELROUTE is not set @@ -1177,6 +1216,7 @@ CONFIG_NSH_BUILTIN_APPS=y # CONFIG_NSH_DISABLE_MKRD is not set # CONFIG_NSH_DISABLE_MH is not set # CONFIG_NSH_DISABLE_MOUNT is not set +# CONFIG_NSH_DISABLE_MV is not set # CONFIG_NSH_DISABLE_MW is not set # CONFIG_NSH_DISABLE_PS is not set # CONFIG_NSH_DISABLE_PUT is not set @@ -1348,6 +1388,7 @@ CONFIG_SYSTEM_SYSINFO_STACKSIZE=1024 # # Stack Monitor # +# CONFIG_SYSTEM_STACKMONITOR is not set # # USB CDC/ACM Device Commands diff --git a/src/drivers/boards/aerocore/aerocore_init.c b/src/drivers/boards/aerocore/aerocore_init.c index 1a6eead3f..8376bad75 100644 --- a/src/drivers/boards/aerocore/aerocore_init.c +++ b/src/drivers/boards/aerocore/aerocore_init.c @@ -35,7 +35,7 @@ * @file aerocore_init.c * * AeroCore-specific early startup code. This file implements the - * nsh_archinitialize() function that is called early by nsh during startup. + * board_app_initialize() function that is called early by nsh during startup. * * Code here is run before the rcS script is invoked; it should start required * subsystems and perform board-specific initialisation. @@ -202,7 +202,7 @@ stm32_boardinitialize(void) } /**************************************************************************** - * Name: nsh_archinitialize + * Name: board_app_initialize * * Description: * Perform architecture specific initialization @@ -226,7 +226,7 @@ __EXPORT int matherr(struct exception *e) } #endif -__EXPORT int nsh_archinitialize(void) +__EXPORT int board_app_initialize(void) { /* configure ADC pins */ diff --git a/src/drivers/boards/aerocore/board_config.h b/src/drivers/boards/aerocore/board_config.h index 776a2071e..70142a314 100644 --- a/src/drivers/boards/aerocore/board_config.h +++ b/src/drivers/boards/aerocore/board_config.h @@ -171,25 +171,6 @@ __BEGIN_DECLS extern void stm32_spiinitialize(void); -/**************************************************************************** - * Name: nsh_archinitialize - * - * Description: - * Perform architecture specific initialization for NSH. - * - * CONFIG_NSH_ARCHINIT=y : - * Called from the NSH library - * - * CONFIG_BOARD_INITIALIZE=y, CONFIG_NSH_LIBRARY=y, && - * CONFIG_NSH_ARCHINIT=n : - * Called from board_initialize(). - * - ****************************************************************************/ - -#ifdef CONFIG_NSH_LIBRARY -int nsh_archinitialize(void); -#endif - #endif /* __ASSEMBLY__ */ __END_DECLS diff --git a/src/drivers/boards/mavstation/mavstation_init.c b/src/drivers/boards/mavstation/mavstation_init.c index a4ded45a8..8a1b8f506 100644 --- a/src/drivers/boards/mavstation/mavstation_init.c +++ b/src/drivers/boards/mavstation/mavstation_init.c @@ -34,8 +34,7 @@ /** * @file mavstation_init.c * - * mavstation-specific early startup code. This file implements the - * nsh_archinitialize() function that is called early by nsh during startup. + * mavstation-specific early startup code. * * Code here is run before the rcS script is invoked; it should start required * subsystems and perform board-specific initialisation. diff --git a/src/drivers/boards/px4fmu-v1/board_config.h b/src/drivers/boards/px4fmu-v1/board_config.h index 882ec6aa2..977b3c330 100644 --- a/src/drivers/boards/px4fmu-v1/board_config.h +++ b/src/drivers/boards/px4fmu-v1/board_config.h @@ -46,6 +46,7 @@ #include #include #include +#include __BEGIN_DECLS @@ -210,25 +211,6 @@ extern void stm32_spiinitialize(void); extern void stm32_usbinitialize(void); -/**************************************************************************** - * Name: nsh_archinitialize - * - * Description: - * Perform architecture specific initialization for NSH. - * - * CONFIG_NSH_ARCHINIT=y : - * Called from the NSH library - * - * CONFIG_BOARD_INITIALIZE=y, CONFIG_NSH_LIBRARY=y, && - * CONFIG_NSH_ARCHINIT=n : - * Called from board_initialize(). - * - ****************************************************************************/ - -#ifdef CONFIG_NSH_LIBRARY -int nsh_archinitialize(void); -#endif - #endif /* __ASSEMBLY__ */ __END_DECLS diff --git a/src/drivers/boards/px4fmu-v1/px4fmu_init.c b/src/drivers/boards/px4fmu-v1/px4fmu_init.c index c6207312f..7dd542366 100644 --- a/src/drivers/boards/px4fmu-v1/px4fmu_init.c +++ b/src/drivers/boards/px4fmu-v1/px4fmu_init.c @@ -35,7 +35,7 @@ * @file px4fmu_init.c * * PX4FMU-specific early startup code. This file implements the - * nsh_archinitialize() function that is called early by nsh during startup. + * board_app_initialize() function that is called early by nsh during startup. * * Code here is run before the rcS script is invoked; it should start required * subsystems and perform board-specific initialisation. @@ -116,7 +116,7 @@ __EXPORT void stm32_boardinitialize(void) } /**************************************************************************** - * Name: nsh_archinitialize + * Name: board_app_initialize * * Description: * Perform architecture specific initialization @@ -141,7 +141,7 @@ __EXPORT int matherr(struct exception *e) } #endif -__EXPORT int nsh_archinitialize(void) +__EXPORT int board_app_initialize(void) { int result; diff --git a/src/drivers/boards/px4fmu-v2/board_config.h b/src/drivers/boards/px4fmu-v2/board_config.h index 273af1023..97177b531 100644 --- a/src/drivers/boards/px4fmu-v2/board_config.h +++ b/src/drivers/boards/px4fmu-v2/board_config.h @@ -238,25 +238,6 @@ extern void stm32_spiinitialize(void); extern void stm32_usbinitialize(void); -/**************************************************************************** - * Name: nsh_archinitialize - * - * Description: - * Perform architecture specific initialization for NSH. - * - * CONFIG_NSH_ARCHINIT=y : - * Called from the NSH library - * - * CONFIG_BOARD_INITIALIZE=y, CONFIG_NSH_LIBRARY=y, && - * CONFIG_NSH_ARCHINIT=n : - * Called from board_initialize(). - * - ****************************************************************************/ - -#ifdef CONFIG_NSH_LIBRARY -int nsh_archinitialize(void); -#endif - #endif /* __ASSEMBLY__ */ __END_DECLS diff --git a/src/drivers/boards/px4fmu-v2/px4fmu2_init.c b/src/drivers/boards/px4fmu-v2/px4fmu2_init.c index 74bbfa4c6..9bb2cc166 100644 --- a/src/drivers/boards/px4fmu-v2/px4fmu2_init.c +++ b/src/drivers/boards/px4fmu-v2/px4fmu2_init.c @@ -35,7 +35,7 @@ * @file px4fmu2_init.c * * PX4FMUv2-specific early startup code. This file implements the - * nsh_archinitialize() function that is called early by nsh during startup. + * board_app_initialize() function that is called early by nsh during startup. * * Code here is run before the rcS script is invoked; it should start required * subsystems and perform board-specific initialization. @@ -186,7 +186,7 @@ stm32_boardinitialize(void) } /**************************************************************************** - * Name: nsh_archinitialize + * Name: board_app_initialize * * Description: * Perform architecture specific initialization @@ -212,7 +212,7 @@ __EXPORT int matherr(struct exception *e) } #endif -__EXPORT int nsh_archinitialize(void) +__EXPORT int board_app_initialize(void) { /* configure ADC pins */ diff --git a/src/drivers/boards/px4io-v1/px4io_init.c b/src/drivers/boards/px4io-v1/px4io_init.c index 6daacfec8..9900b4c1b 100644 --- a/src/drivers/boards/px4io-v1/px4io_init.c +++ b/src/drivers/boards/px4io-v1/px4io_init.c @@ -35,7 +35,7 @@ * @file px4io_init.c * * PX4IO-specific early startup code. This file implements the - * nsh_archinitialize() function that is called early by nsh during startup. + * board_app_initialize() function that is called early by nsh during startup. * * Code here is run before the rcS script is invoked; it should start required * subsystems and perform board-specific initialisation. diff --git a/src/drivers/boards/px4io-v2/px4iov2_init.c b/src/drivers/boards/px4io-v2/px4iov2_init.c index 117791017..2eb1e7a7f 100644 --- a/src/drivers/boards/px4io-v2/px4iov2_init.c +++ b/src/drivers/boards/px4io-v2/px4iov2_init.c @@ -35,7 +35,7 @@ * @file px4iov2_init.c * * PX4FMU-specific early startup code. This file implements the - * nsh_archinitialize() function that is called early by nsh during startup. + * board_app_initialize() function that is called early by nsh during startup. * * Code here is run before the rcS script is invoked; it should start required * subsystems and perform board-specific initialisation. -- cgit v1.2.3 From 9dcd6fd8000145320b5c894e2dcb8b426df19301 Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Mon, 6 Apr 2015 14:04:52 -1000 Subject: Moved the Nuttx RTC magic test to not colide with bootloader --- NuttX | 2 +- nuttx-configs/px4fmu-v2/nsh/defconfig | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/NuttX b/NuttX index 5724bb8a0..76cf23616 160000 --- a/NuttX +++ b/NuttX @@ -1 +1 @@ -Subproject commit 5724bb8a06a8ffb87dc07fe1f2d9bd2f3c14c8be +Subproject commit 76cf23616b1eb151f04ffda19b375ede65639a5d diff --git a/nuttx-configs/px4fmu-v2/nsh/defconfig b/nuttx-configs/px4fmu-v2/nsh/defconfig index d05fe8e15..2688bbbdb 100644 --- a/nuttx-configs/px4fmu-v2/nsh/defconfig +++ b/nuttx-configs/px4fmu-v2/nsh/defconfig @@ -425,6 +425,8 @@ CONFIG_STM32_SAVE_CRASHDUMP=y CONFIG_BOARD_CRASHDUMP=y CONFIG_BOARD_RESET_ON_CRASH=y # CONFIG_STM32_HAVE_RTC_SUBSECONDS is not set +CONFIG_RTC_MAGIC_REG=1 +CONFIG_RTC_MAGIC=0xfacefeee # CONFIG_RTC_LSECLOCK is not set # CONFIG_RTC_LSICLOCK is not set CONFIG_RTC_HSECLOCK=y -- cgit v1.2.3 From a73608c0459faa643e49318bcd4ae22092e734a3 Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Mon, 6 Apr 2015 14:11:44 -1000 Subject: Updated Nuttx Submoule == upstream --- NuttX | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NuttX b/NuttX index 5724bb8a0..76cf23616 160000 --- a/NuttX +++ b/NuttX @@ -1 +1 @@ -Subproject commit 5724bb8a06a8ffb87dc07fe1f2d9bd2f3c14c8be +Subproject commit 76cf23616b1eb151f04ffda19b375ede65639a5d -- cgit v1.2.3