NuttX upgrade cmake wrapper (#7873)

* NuttX cmake

* px4_macros:Pass the stringified predicate as second arg to static assert

   CC_ASSERT mapes to the c++ static_assert or provides the same
   funtionality for c via the other macros. The c++ static assert
   takes 2 argumants the prdicate and a message. This fixes the
   lacking second argument.

* Updated nuttx and apps submodule to upstream nuttx 7.21+==master

   This is the latest uptake of upstream nuttx and apps.

* ROMFS generate with xxd instead of objcopy

* delete nuttx-patches

* NuttX update submodules to latest px4_nuttx-master

* fix nuttx apps and board dependency

* docker_run update to latest container 2017-08-29

* cmake ROMFS portable sed usage

* NuttX update submodules to latest px4_nuttx-master
This commit is contained in:
Daniel Agar 2017-08-29 17:22:05 -04:00
parent 11e518f494
commit 01b3e6fd25
159 changed files with 3220 additions and 4256 deletions

9
.gitmodules vendored
View File

@ -4,9 +4,6 @@
[submodule "mavlink/include/mavlink/v2.0"]
path = mavlink/include/mavlink/v2.0
url = https://github.com/mavlink/c_library_v2.git
[submodule "NuttX"]
path = NuttX
url = https://github.com/PX4/PX4NuttX.git
[submodule "src/modules/uavcan/libuavcan"]
path = src/modules/uavcan/libuavcan
url = https://github.com/UAVCAN/libuavcan.git
@ -40,3 +37,9 @@
[submodule "src/lib/micro-CDR"]
path = src/lib/micro-CDR
url = https://github.com/eProsima/micro-CDR.git
[submodule "platforms/nuttx/NuttX/nuttx"]
path = platforms/nuttx/NuttX/nuttx
url = git@github.com:PX4-NuttX/nuttx.git
[submodule "platforms/nuttx/NuttX/apps"]
path = platforms/nuttx/NuttX/apps
url = git@github.com:PX4-NuttX/apps.git

View File

@ -99,14 +99,8 @@
#
#=============================================================================
if (${CMAKE_VERSION} VERSION_LESS 3.1.0)
message("Not a valid CMake version")
message("On Ubuntu >= 16.04, install or upgrade via:")
message(" sudo apt-get install cmake")
message("")
message("Official website: https://cmake.org/download/")
message(FATAL_ERROR "Update CMake and try again" )
endif()
# check submodules before we do anything
execute_process(COMMAND Tools/check_submodules.sh WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
# Warning: Changing this modifies CMake's internal workings
# and leads to wrong toolchain detection
@ -115,15 +109,18 @@ cmake_minimum_required(VERSION 3.1 FATAL_ERROR)
set(PX4_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
set(PX4_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}")
execute_process(
COMMAND Tools/check_submodules.sh
WORKING_DIRECTORY ${PX4_SOURCE_DIR}
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PX4_BINARY_DIR})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${PX4_BINARY_DIR})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${PX4_BINARY_DIR})
define_property(GLOBAL PROPERTY PX4_LIBRARIES
BRIEF_DOCS "PX4 libs"
FULL_DOCS "List of all PX4 module libraries"
)
#=============================================================================
# configuration
#
# must come before project to set toolchain
set(CONFIG "posix_sitl_default" CACHE STRING "desired configuration")
@ -145,7 +142,6 @@ if (NOT EXTERNAL_MODULES_LOCATION STREQUAL "")
endif()
list(APPEND CMAKE_MODULE_PATH "${PX4_SOURCE_DIR}/cmake")
message(STATUS "CMAKE_MODULE_PATH: ${CMAKE_MODULE_PATH}")
set(config_module "configs/${CONFIG}")
include(${config_module})
@ -176,16 +172,17 @@ message(STATUS "Build Type: ${CMAKE_BUILD_TYPE}")
#
include(common/px4_git)
# version info from git
execute_process(
COMMAND git describe --always --tags
OUTPUT_VARIABLE git_tag
OUTPUT_STRIP_TRAILING_WHITESPACE
COMMAND Tools/tag_to_version.py --root ${PX4_SOURCE_DIR}
OUTPUT_VARIABLE version
WORKING_DIRECTORY ${PX4_SOURCE_DIR}
)
execute_process(
COMMAND Tools/tag_to_version.py --root ${PX4_SOURCE_DIR}
OUTPUT_VARIABLE git_version
COMMAND git describe --always --tags
OUTPUT_VARIABLE git_tag
OUTPUT_STRIP_TRAILING_WHITESPACE
WORKING_DIRECTORY ${PX4_SOURCE_DIR}
)
@ -202,12 +199,10 @@ px4_add_git_submodule(TARGET git_jmavsim PATH "Tools/jMAVSim")
px4_add_git_submodule(TARGET git_matrix PATH "src/lib/matrix")
px4_add_git_submodule(TARGET git_mavlink PATH "mavlink/include/mavlink/v1.0")
px4_add_git_submodule(TARGET git_mavlink2 PATH "mavlink/include/mavlink/v2.0")
px4_add_git_submodule(TARGET git_nuttx PATH "NuttX")
px4_add_git_submodule(TARGET git_nuttx PATH "platforms/nuttx/NuttX")
px4_add_git_submodule(TARGET git_uavcan PATH "src/modules/uavcan/libuavcan")
px4_add_git_submodule(TARGET git_micro_cdr PATH "src/lib/micro-CDR")
px4_create_git_hash_header()
#=============================================================================
message(STATUS "PX4 VERSION: ${git_tag}")
@ -225,18 +220,12 @@ add_definitions(-DBUILD_URI=${BUILD_URI})
# Define GNU standard installation directories
include(GNUInstallDirs)
# Add support for external project building
include(ExternalProject)
# Setup install paths
if (NOT CMAKE_INSTALL_PREFIX)
if (${OS} STREQUAL "posix")
if (NOT CMAKE_INSTALL_PREFIX)
set(CMAKE_INSTALL_PREFIX "/usr" CACHE PATH "Install path prefix" FORCE)
endif()
endif()
if (CMAKE_INSTALL_PREFIX)
message(STATUS "CMAKE_INSTALL_PREFIX: ${CMAKE_INSTALL_PREFIX}")
endif()
#=============================================================================
# require px4 module interface
@ -361,12 +350,11 @@ px4_os_add_flags(
LINK_DIRS link_dirs
DEFINITIONS definitions)
px4_join(OUT CMAKE_EXE_LINKER_FLAGS LIST "${exe_linker_flags}" GLUE " ")
px4_join(OUT CMAKE_C_FLAGS LIST "${c_flags};${optimization_flags}" GLUE " ")
px4_join(OUT CMAKE_CXX_FLAGS LIST "${cxx_flags};${optimization_flags}" GLUE " ")
px4_join(OUT CMAKE_EXE_LINKER_FLAGS LIST "${CMAKE_EXE_LINKER_FLAGS};${exe_linker_flags}" GLUE " ")
px4_join(OUT CMAKE_C_FLAGS LIST "${CMAKE_C_FLAGS};${c_flags};${optimization_flags}" GLUE " ")
px4_join(OUT CMAKE_CXX_FLAGS LIST "${CMAKE_CXX_FLAGS};${cxx_flags};${optimization_flags}" GLUE " ")
include_directories(${include_dirs})
#message("INCLUDE_DIRS=${include_dirs}")
link_directories(${link_dirs})
add_definitions(${definitions})
@ -381,10 +369,8 @@ px4_generate_messages(TARGET msg_gen
MSG_FILES ${msg_files}
OS ${OS}
INCLUDES ${msg_include_paths}
DEPENDS git_genmsg git_gencpp git_micro_cdr prebuild_targets
DEPENDS prebuild_targets
)
include_directories("${PX4_SOURCE_DIR}/src/lib/micro-CDR/include"
"${PX4_BINARY_DIR}/src/lib/micro-CDR/include/microcdr")
px4_generate_airframes_xml(BOARD ${BOARD})
@ -439,7 +425,6 @@ endif()
#=============================================================================
# subdirectories
#
set(module_libraries)
foreach(module ${config_module_list})
string(REGEX MATCH "^[./]" external_module ${module})
if (external_module)
@ -449,19 +434,10 @@ foreach(module ${config_module_list})
else()
add_subdirectory(src/${module})
endif()
px4_mangle_name(${module} mangled_name)
list(APPEND module_libraries ${mangled_name})
endforeach()
# Keep track of external shared libs required for modules
set(module_external_libraries "${module_external_libraries}" CACHE INTERNAL "module_external_libraries")
add_subdirectory(src/firmware/${OS})
if (config_io_board)
add_subdirectory(src/modules/px4iofirmware)
endif()
#=============================================================================
# generate custom target to print for all executable and module cmake targets
#

View File

@ -77,7 +77,7 @@ do
shift
done
[[ -z "$elf" ]] && die "Please specify the ELF file location, e.g.: build_px4fmu-v4_default/src/firmware/nuttx/firmware_nuttx"
[[ -z "$elf" ]] && die "Please specify the ELF file location, e.g.: build/px4fmu-v4_default/src/firmware/nuttx/firmware_nuttx"
#
# Temporary files

View File

@ -53,7 +53,7 @@ endif
# make px4fmu-v2_default test (builds and tests)
#
# This tells cmake to build the nuttx px4fmu-v2 default config in the
# directory build_nuttx_px4fmu-v2_default and then call make
# directory build/nuttx_px4fmu-v2_default and then call make
# in that directory with the target upload.
# explicity set default build target
@ -132,7 +132,7 @@ endif
# --------------------------------------------------------------------
# describe how to build a cmake config
define cmake-build
+@$(eval BUILD_DIR = $(SRC_DIR)/build_$@$(BUILD_DIR_SUFFIX))
+@$(eval BUILD_DIR = $(SRC_DIR)/build/$@$(BUILD_DIR_SUFFIX))
+@if [ $(PX4_CMAKE_GENERATOR) = "Ninja" ] && [ -e $(BUILD_DIR)/Makefile ]; then rm -rf $(BUILD_DIR); fi
+@if [ ! -e $(BUILD_DIR)/CMakeCache.txt ]; then mkdir -p $(BUILD_DIR) && cd $(BUILD_DIR) && cmake $(2) -G"$(PX4_CMAKE_GENERATOR)" -DCONFIG=$(1) $(CMAKE_ARGS) || (rm -rf $(BUILD_DIR)); fi
+@(cd $(BUILD_DIR) && $(PX4_MAKE) $(PX4_MAKE_ARGS) $(ARGS))
@ -191,6 +191,7 @@ qgc_firmware: px4fmu_firmware misc_qgc_extra_firmware sizes
# px4fmu NuttX firmware
px4fmu_firmware: \
check_px4io-v2_default \
check_px4fmu-v2_default \
check_px4fmu-v3_default \
check_px4fmu-v4_default \
@ -229,7 +230,7 @@ checks_bootloaders: \
sizes
sizes:
@-find build_* -name firmware_nuttx -type f | xargs size 2> /dev/null || :
@-find build -name *.elf -type f | xargs size 2> /dev/null || :
# All default targets that don't require a special build environment
check: check_posix_sitl_default px4fmu_firmware misc_qgc_extra_firmware alt_firmware checks_bootloaders tests check_format
@ -277,25 +278,25 @@ s3put_firmware: Firmware.zip
s3put_qgc_firmware: s3put_px4fmu_firmware s3put_misc_qgc_extra_firmware
s3put_px4fmu_firmware: px4fmu_firmware
@find $(SRC_DIR)/build_* -name "*.px4" -exec $(SRC_DIR)/Tools/s3put.sh "{}" \;
@find $(SRC_DIR)/build -name "*.px4" -exec $(SRC_DIR)/Tools/s3put.sh "{}" \;
s3put_misc_qgc_extra_firmware: misc_qgc_extra_firmware
@find $(SRC_DIR)/build_* -name "*.px4" -exec $(SRC_DIR)/Tools/s3put.sh "{}" \;
@find $(SRC_DIR)/build -name "*.px4" -exec $(SRC_DIR)/Tools/s3put.sh "{}" \;
s3put_metadata: px4_metadata
@$(SRC_DIR)/Tools/s3put.sh airframes.md
@$(SRC_DIR)/Tools/s3put.sh airframes.xml
@$(SRC_DIR)/Tools/s3put.sh build_posix_sitl_default/parameters.xml
@$(SRC_DIR)/Tools/s3put.sh build/posix_sitl_default/parameters.xml
@$(SRC_DIR)/Tools/s3put.sh parameters.md
s3put_scan-build: scan-build
@cd $(SRC_DIR) && ./Tools/s3put.sh `find build_scan-build -mindepth 1 -maxdepth 1 -type d`/
@cd $(SRC_DIR) && ./Tools/s3put.sh `find build/scan-build -mindepth 1 -maxdepth 1 -type d`/
s3put_cppcheck: cppcheck
@cd $(SRC_DIR) && ./Tools/s3put.sh cppcheck/
s3put_coverage: tests_coverage
@cd $(SRC_DIR) && ./Tools/s3put.sh build_posix_sitl_default/coverage-html/
@cd $(SRC_DIR) && ./Tools/s3put.sh build/posix_sitl_default/coverage-html/
# Astyle
# --------------------------------------------------------------------
@ -326,7 +327,7 @@ coveralls_upload:
--exclude=src/lib/ecl \
--exclude=src/lib/Matrix \
--exclude=src/modules/uavcan/libuavcan \
--root . --build-root build_posix_sitl_default/ --follow-symlinks
--root . --build-root build/posix_sitl_default/ --follow-symlinks
codecov_upload:
@/bin/bash -c "bash <(curl -s https://codecov.io/bash)"
@ -336,32 +337,32 @@ codecov_upload:
.PHONY: posix_sitl_default-clang scan-build clang-tidy clang-tidy-fix clang-tidy-quiet cppcheck check_stack
posix_sitl_default-clang:
@mkdir -p $(SRC_DIR)/build_posix_sitl_default-clang
@cd $(SRC_DIR)/build_posix_sitl_default-clang && cmake .. -GNinja -DCONFIG=posix_sitl_default -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
@cd $(SRC_DIR)/build_posix_sitl_default-clang && ninja
@mkdir -p $(SRC_DIR)/build/posix_sitl_default-clang
@cd $(SRC_DIR)/build/posix_sitl_default-clang && cmake $(SRC_DIR) -GNinja -DCONFIG=posix_sitl_default -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
@cd $(SRC_DIR)/build/posix_sitl_default-clang && ninja
scan-build:
@export CCC_CC=clang
@export CCC_CXX=clang++
@mkdir -p $(SRC_DIR)/build_posix_sitl_default-scan-build
@cd $(SRC_DIR)/build_posix_sitl_default-scan-build && scan-build cmake .. -GNinja -DCONFIG=posix_sitl_default
@scan-build -o $(SRC_DIR)/build_scan-build cmake --build $(SRC_DIR)/build_posix_sitl_default-scan-build
@mkdir -p $(SRC_DIR)/build/posix_sitl_default-scan-build
@cd $(SRC_DIR)/build/posix_sitl_default-scan-build && scan-build cmake .. -GNinja -DCONFIG=posix_sitl_default
@scan-build -o $(SRC_DIR)/build/scan-build cmake --build $(SRC_DIR)/build/posix_sitl_default-scan-build
clang-tidy: posix_sitl_default-clang
@cd build_posix_sitl_default-clang && run-clang-tidy-4.0.py -header-filter=".*\.hpp" -j$(j) -p .
@cd build/posix_sitl_default-clang && run-clang-tidy-4.0.py -header-filter=".*\.hpp" -j$(j) -p .
# to automatically fix a single check at a time, eg modernize-redundant-void-arg
# % run-clang-tidy-4.0.py -fix -j4 -checks=-\*,modernize-redundant-void-arg -p .
clang-tidy-fix: posix_sitl_default-clang
@cd build_posix_sitl_default-clang && run-clang-tidy-4.0.py -header-filter=".*\.hpp" -j$(j) -fix -p .
@cd build/posix_sitl_default-clang && run-clang-tidy-4.0.py -header-filter=".*\.hpp" -j$(j) -fix -p .
# modified version of run-clang-tidy.py to return error codes and only output relevant results
clang-tidy-quiet: posix_sitl_default-clang
@cd build_posix_sitl_default-clang && $(SRC_DIR)/Tools/run-clang-tidy.py -header-filter=".*\.hpp" -j$(j) -p .
@cd build/posix_sitl_default-clang && $(SRC_DIR)/Tools/run-clang-tidy.py -header-filter=".*\.hpp" -j$(j) -p .
# TODO: Fix cppcheck errors then try --enable=warning,performance,portability,style,unusedFunction or --enable=all
cppcheck: posix_sitl_default
@cppcheck -i$(SRC_DIR)/src/examples --std=c++11 --std=c99 --std=posix --project=build_posix_sitl_default/compile_commands.json --xml-version=2 2> cppcheck-result.xml
@cppcheck -i$(SRC_DIR)/src/examples --std=c++11 --std=c99 --std=posix --project=build/posix_sitl_default/compile_commands.json --xml-version=2 2> cppcheck-result.xml
@cppcheck-htmlreport --source-encoding=ascii --file=cppcheck-result.xml --report-dir=cppcheck --source-dir=$(SRC_DIR)/src/
check_stack: px4fmu-v3_default
@ -384,8 +385,7 @@ check_stack: px4fmu-v3_default
.PHONY: clean submodulesclean submodulesupdate gazeboclean distclean
clean:
@rm -rf $(SRC_DIR)/build_*/
-@$(MAKE) --no-print-directory -C NuttX/nuttx clean
@rm -rf $(SRC_DIR)/build
submodulesclean:
@git submodule foreach --quiet --recursive git clean -ff -x -d

1
NuttX

@ -1 +0,0 @@
Subproject commit ba18501226ee264d21fd95348163d47847de3448

45
ROMFS/CMakeLists.txt Normal file
View File

@ -0,0 +1,45 @@
message(STATUS "ROMFS: ${config_romfs_root}")
set(romfs_temp_dir ${PX4_BINARY_DIR}/ROMFS/${config_romfs_root})
set(romfs_src_dir ${PX4_SOURCE_DIR}/ROMFS/${config_romfs_root})
# directory setup
# copy all romfs files, process airframes, prune comments
file(GLOB_RECURSE init_airframes ${PX4_SOURCE_DIR}/ROMFS/${config_romfs_root}/*/[1-9]*)
add_custom_command(OUTPUT ${romfs_temp_dir}/init.d/rcS ${romfs_temp_dir}/init.d/rc.autostart
COMMAND cmake -E copy_directory ${romfs_src_dir} ${romfs_temp_dir}
COMMAND ${PYTHON_EXECUTABLE} ${PX4_SOURCE_DIR}/Tools/px_process_airframes.py
-a ${romfs_temp_dir}/init.d
-s ${romfs_temp_dir}/init.d/rc.autostart
--board ${BOARD}
COMMAND ${PYTHON_EXECUTABLE} ${PX4_SOURCE_DIR}/Tools/px_romfs_pruner.py
--folder ${romfs_temp_dir} --board ${BOARD}
DEPENDS
${romfs_src_files}
${init_airframes}
${PX4_SOURCE_DIR}/ROMFS/${config_romfs_root}/init.d/rcS
${PX4_SOURCE_DIR}/Tools/px_process_airframes.py
)
set(romfs_dependencies)
list(APPEND romfs_dependencies
${romfs_temp_dir}/init.d/rcS
${romfs_temp_dir}/init.d/rc.autostart
)
# create romfs.bin
add_custom_command(OUTPUT romfs.img
COMMAND ${GENROMFS} -f romfs.img -d ${romfs_temp_dir} -V "NSHInitVol" -v > romfs.txt 2>&1
DEPENDS ${romfs_dependencies}
)
# create romfs.o
add_custom_command(OUTPUT nsh_romfsimg.c
COMMAND xxd -i romfs.img nsh_romfsimg.c
COMMAND sed 's/unsigned/const unsigned/g' nsh_romfsimg.c > nsh_romfsimg.c.tmp && mv nsh_romfsimg.c.tmp nsh_romfsimg.c
DEPENDS romfs.img
)
add_library(romfs STATIC nsh_romfsimg.c)
set_target_properties(romfs PROPERTIES LINKER_LANGUAGE C)

View File

@ -4,23 +4,23 @@ if [ -z ${PX4_DOCKER_REPO+x} ]; then
echo "guessing PX4_DOCKER_REPO based on input";
if [[ $@ =~ .*px4fmu.* ]]; then
# nuttx-px4fmu-v{1,2,3,4,5}
PX4_DOCKER_REPO="px4io/px4-dev-nuttx:2017-07-27"
PX4_DOCKER_REPO="px4io/px4-dev-nuttx:2017-08-29"
elif [[ $@ =~ .*rpi.* ]] || [[ $@ =~ .*bebop.* ]]; then
# posix_rpi_cross, posix_bebop_default
PX4_DOCKER_REPO="px4io/px4-dev-raspi:2017-07-27"
PX4_DOCKER_REPO="px4io/px4-dev-raspi:2017-08-29"
elif [[ $@ =~ .*eagle.* ]] || [[ $@ =~ .*excelsior.* ]]; then
# eagle, excelsior
PX4_DOCKER_REPO="lorenzmeier/px4-dev-snapdragon:2017-07-28"
elif [[ $@ =~ .*clang.* ]] || [[ $@ =~ .*scan-build.* ]]; then
# clang tools
PX4_DOCKER_REPO="px4io/px4-dev-clang:2017-07-27"
PX4_DOCKER_REPO="px4io/px4-dev-clang:2017-08-29"
elif [[ $@ =~ .*cppcheck.* ]]; then
# need Ubuntu 17.04 for cppcheck cmake support
# TODO: remove this once px4io/px4-dev-base updates
PX4_DOCKER_REPO=px4io/px4-dev-base:ubuntu17.04
elif [[ $@ =~ .*tests* ]]; then
# run all tests with simulation
PX4_DOCKER_REPO="px4io/px4-dev-simulation:2017-07-27"
PX4_DOCKER_REPO="px4io/px4-dev-simulation:2017-08-29"
fi
else
echo "PX4_DOCKER_REPO is set to '$PX4_DOCKER_REPO'";
@ -28,7 +28,7 @@ fi
# otherwise default to nuttx
if [ -z ${PX4_DOCKER_REPO+x} ]; then
PX4_DOCKER_REPO="px4io/px4-dev-nuttx:2017-07-27"
PX4_DOCKER_REPO="px4io/px4-dev-nuttx:2017-08-29"
fi
# docker hygiene

View File

@ -79,7 +79,7 @@ fi
# Find a reasonable tmp directory.
# First make a list of all build directories by looking for a CMakeCache.txt in them. Sort them so the most recent one is first.
CMAKECACHE_FILES=$(find "$BASEDIR" -mindepth 2 -maxdepth 2 -type f -name CMakeCache.txt -wholename "$BASEDIR/build_*/CMakeCache.txt" | xargs /bin/ls -td)
CMAKECACHE_FILES=$(find "$BASEDIR" -mindepth 2 -maxdepth 2 -type f -name CMakeCache.txt -wholename "$BASEDIR/build/*/CMakeCache.txt" | xargs /bin/ls -td)
# Make a list of all candidate tmp directories.
TMPDIRS=
for f in $CMAKECACHE_FILES; do
@ -195,7 +195,7 @@ for subm in $SUBMODULES; do
done
echo -n "Finding all source files with #include's (excluding submodules and build directory)... "
find $BASEDIR -mindepth 2 -type f ! \( -wholename $BASEDIR/build_* -o $EXCLUDE_ARGS -o $SUBMODULES_ARGS \) \( $INCLUDE_C_ARGS -o $INCLUDE_H_ARGS \) > $TMPDIR/fix_headers_sources
find $BASEDIR -mindepth 2 -type f ! \( -wholename $BASEDIR/build/* -o $EXCLUDE_ARGS -o $SUBMODULES_ARGS \) \( $INCLUDE_C_ARGS -o $INCLUDE_H_ARGS \) > $TMPDIR/fix_headers_sources
cat "$TMPDIR/fix_headers_sources" | xargs grep -l "$INCLUDE_RE" > $TMPDIR/fix_headers_sources_with_includes
echo "done"
number_of_files=$(sed -n '$=' "$TMPDIR/fix_headers_sources_with_includes")
@ -206,7 +206,7 @@ find $BASEDIR -type f ! \( $EXCLUDE_ARGS \) \( $SUBMODULES_ARGS \) \( $INCLUDE_H
echo "done"
echo -n "Finding all header files (excluding stdc++ headers)... "
find $BASEDIR -type f ! \( $EXCLUDE_ARGS \) -wholename $BASEDIR/build_* \( $INCLUDE_H_ARGS \) > $TMPDIR/fix_headers_HEADERS
find $BASEDIR -type f ! \( $EXCLUDE_ARGS \) -wholename $BASEDIR/build/* \( $INCLUDE_H_ARGS \) > $TMPDIR/fix_headers_HEADERS
grep -E "$HEADER_RE" $TMPDIR/fix_headers_sources >> $TMPDIR/fix_headers_HEADERS
cat $TMPDIR/fix_headers_SUBMODULE_HEADERS >> $TMPDIR/fix_headers_HEADERS
echo "done"
@ -233,7 +233,7 @@ function include_path()
foo=0
for includedir in $(grep "/$PATH_RE\$" $TMPDIR/fix_headers_HEADERS | cut -c $striplen-); do
# If the include directory is NuttX header that was copied to the build directory, then it's still a system file.
if [[ $includedir/ =~ ^build_.*/NuttX/ ]]; then
if [[ $includedir/ =~ ^build/.*/NuttX/ ]]; then
issubmodule=1
# If the include directory is a submodule, then treat it as a system file.
elif [[ $includedir/ =~ ^$SUBMODULES_RE/ ]]; then

View File

@ -168,6 +168,6 @@ fi
sed -i -r -e 's%("(magic|description|summary)": ")([^"]*)(",).*%\1FIXME (was: \3)\4%' "Images/${newname}.prototype"
echo "*** The following files contain a reference to $oldconfig (this might take a while):"
find . -path './build_*' -o -path './.git' -o -name 'defconfig' -prune -o -type f -exec grep -l -- "$oldconfig" {} \;
find . -path './build/*' -o -path './.git' -o -name 'defconfig' -prune -o -type f -exec grep -l -- "$oldconfig" {} \;
echo "*** Run 'git diff' to check the changes that this script already made relative to the copied prototype files."
echo "*** Use 'git status' to see other (added) files, that likely need fixing."

View File

@ -156,24 +156,24 @@ installpx4() {
if [ $mode == 0 ]; then
# copy default binaries
echo -e "Copying the PX4 binaries from the eagle_default build tree..."
adb push $workspace/build_qurt_eagle_default/src/firmware/qurt/libpx4.so /usr/share/data/adsp
adb push $workspace/build_qurt_eagle_default/src/firmware/qurt/libpx4muorb_skel.so /usr/share/data/adsp
adb push $workspace/build_posix_eagle_default/src/firmware/posix/px4 /home/linaro
adb push $workspace/build/qurt_eagle_default/src/firmware/qurt/libpx4.so /usr/share/data/adsp
adb push $workspace/build/qurt_eagle_default/src/firmware/qurt/libpx4muorb_skel.so /usr/share/data/adsp
adb push $workspace/build/posix_eagle_default/src/firmware/posix/px4 /home/linaro
adb push $workspace/posix-configs/eagle/flight/px4.config /usr/share/data/adsp
adb push $workspace/posix-configs/eagle/flight/mainapp.config /home/linaro
elif [ $mode == 1 ]; then
# copy legacy binaries
echo -e "Copying the PX4 binaries from the eagle_legacy build tree..."
adb push $workspace/build_qurt_eagle_legacy/src/firmware/qurt/libpx4.so /usr/share/data/adsp
adb push $workspace/build_qurt_eagle_legacy/src/firmware/qurt/libpx4muorb_skel.so /usr/share/data/adsp
adb push $workspace/build_posix_eagle_legacy/src/firmware/posix/px4 /home/linaro
adb push $workspace/build/qurt_eagle_legacy/src/firmware/qurt/libpx4.so /usr/share/data/adsp
adb push $workspace/build/qurt_eagle_legacy/src/firmware/qurt/libpx4muorb_skel.so /usr/share/data/adsp
adb push $workspace/build/posix_eagle_legacy/src/firmware/posix/px4 /home/linaro
adb push $workspace/posix-configs/eagle/200qx/px4.config /usr/share/data/adsp
adb push $workspace/posix-configs/eagle/200qx/mainapp.config /home/linaro
else
echo -e "Copying the PX4 binaries from the excelsior_legacy build tree..."
adb push $workspace/build_qurt_excelsior_legacy/src/firmware/qurt/libpx4.so /usr/lib/rfsa/adsp
adb push $workspace/build_qurt_excelsior_legacy/src/firmware/qurt/libpx4muorb_skel.so /usr/lib/rfsa/adsp
adb push $workspace/build_posix_excelsior_legacy/src/firmware/posix/px4 /home/root
adb push $workspace/build/qurt_excelsior_legacy/src/firmware/qurt/libpx4.so /usr/lib/rfsa/adsp
adb push $workspace/build/qurt_excelsior_legacy/src/firmware/qurt/libpx4muorb_skel.so /usr/lib/rfsa/adsp
adb push $workspace/build/posix_excelsior_legacy/src/firmware/posix/px4 /home/root
adb push $workspace/posix-configs/excelsior/px4.config /usr/lib/rfsa/adsp
adb push $workspace/posix-configs/excelsior/mainapp.config /home/root
fi

View File

@ -1,5 +1,5 @@
#!/usr/bin/env bash
make px4fmu-v4_default
cp build_px4fmu-v4_default/parameters.xml ../qgroundcontrol/src/FirmwarePlugin/PX4/PX4ParameterFactMetaData.xml
cp build_px4fmu-v4_default/airframes.xml ../qgroundcontrol/src/AutoPilotPlugins/PX4/AirframeFactMetaData.xml
cp build/px4fmu-v4_default/parameters.xml ../qgroundcontrol/src/FirmwarePlugin/PX4/PX4ParameterFactMetaData.xml
cp build/px4fmu-v4_default/airframes.xml ../qgroundcontrol/src/AutoPilotPlugins/PX4/AirframeFactMetaData.xml

View File

@ -17,7 +17,7 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
src_path="$SCRIPT_DIR/.."
rc_script="posix-configs/SITL/init/ekf2/multiple_iris"
build_path=${src_path}/build_posix_sitl_default
build_path=${src_path}/build/posix_sitl_default
echo "killing running instances"
pkill -x px4 || true

View File

@ -23,7 +23,6 @@ echo src_path: $src_path
echo build_path: $build_path
working_dir=`pwd`
sitl_bin=$build_path/src/firmware/posix/px4
rootfs=$build_path/tmp/rootfs
if [ "$chroot" == "1" ]

View File

@ -198,10 +198,6 @@ function(px4_add_module)
REQUIRED MODULE
ARGN ${ARGN})
if (EXTERNAL)
px4_mangle_name("${EXTERNAL_MODULES_LOCATION}/src/${MODULE}" MODULE)
endif()
px4_add_library(${MODULE} STATIC EXCLUDE_FROM_ALL ${SRCS})
# set defaults if not set
@ -219,16 +215,14 @@ function(px4_add_module)
if(NOT ${property})
set(${property} ${${property}_DEFAULT})
endif()
set_target_properties(${MODULE} PROPERTIES ${property}
${${property}})
set_target_properties(${MODULE} PROPERTIES ${property} ${${property}})
endforeach()
# default stack max to stack main
if(NOT STACK_MAX)
set(STACK_MAX ${STACK_MAIN})
endif()
set_target_properties(${MODULE} PROPERTIES STACK_MAX
${STACK_MAX})
set_target_properties(${MODULE} PROPERTIES STACK_MAX ${STACK_MAX})
if(${OS} STREQUAL "qurt" )
set_property(TARGET ${MODULE} PROPERTY POSITION_INDEPENDENT_CODE TRUE)
@ -270,7 +264,6 @@ function(px4_add_module)
set_target_properties(${MODULE} PROPERTIES ${prop} ${${prop}})
endif()
endforeach()
endfunction()
#=============================================================================
@ -479,14 +472,6 @@ function(px4_add_common_flags)
-D__STDC_FORMAT_MACROS
)
if (NOT (APPLE AND (${CMAKE_C_COMPILER_ID} MATCHES ".*Clang.*")))
set(added_exe_linker_flags
-Wl,--warn-common
-Wl,--gc-sections
#,--print-gc-sections
)
endif()
# output
foreach(var ${inout_vars})
string(TOLOWER ${var} lower_var)
@ -496,31 +481,6 @@ function(px4_add_common_flags)
endfunction()
#=============================================================================
#
# px4_mangle_name
#
# Convert a path name to a module name
#
# Usage:
# px4_mangle_name(dirname newname)
#
# Input:
# dirname : path to module dir
#
# Output:
# newname : module name
#
# Example:
# px4_mangle_name(${dirpath} mangled_name)
# message(STATUS "module name is ${mangled_name}")
#
function(px4_mangle_name dirname newname)
set(tmp)
string(REPLACE "/" "__" tmp ${dirname})
set(${newname} ${tmp} PARENT_SCOPE)
endfunction()
#=============================================================================
#
# px4_strip_optimization
@ -588,6 +548,8 @@ function(px4_add_library target)
px4_add_optimization_flags_for_target(${target})
# Pass variable to the parent px4_add_module.
set(_no_optimization_for_target ${_no_optimization_for_target} PARENT_SCOPE)
set_property(GLOBAL APPEND PROPERTY PX4_LIBRARIES ${target})
endfunction()
#=============================================================================

View File

@ -68,71 +68,15 @@ function(px4_add_git_submodule)
ONE_VALUE TARGET PATH
REQUIRED TARGET PATH
ARGN ${ARGN})
string(REPLACE "/" "_" NAME ${PATH})
add_custom_command(OUTPUT ${PX4_BINARY_DIR}/git_init_${NAME}.stamp
WORKING_DIRECTORY ${PX4_SOURCE_DIR}
COMMAND touch ${PX4_BINARY_DIR}/git_init_${NAME}.stamp
COMMAND Tools/check_submodules.sh ${PATH}
COMMAND cmake -E touch ${PX4_BINARY_DIR}/git_init_${NAME}.stamp
DEPENDS ${PX4_SOURCE_DIR}/.gitmodules
)
add_custom_target(${TARGET}
WORKING_DIRECTORY ${PX4_SOURCE_DIR}
# todo:Not have 2 list of submodules one (see the end of Tools/check_submodules.sh and Firmware/CMakeLists.txt)
# using the list of submodules from the CMake file to drive the test
# COMMAND Tools/check_submodules.sh ${PATH}
DEPENDS ${PX4_BINARY_DIR}/git_init_${NAME}.stamp
)
endfunction()
#=============================================================================
#
# px4_create_git_hash_header
#
# Create a header file containing the git hash of the current tree
#
# Usage:
# px4_create_git_hash_header()
#
# Example:
# px4_create_git_hash_header()
#
function(px4_create_git_hash_header)
px4_parse_function_args(
NAME px4_create_git_hash_header
ARGN ${ARGN})
set(px4_git_ver_header ${PX4_BINARY_DIR}/build_git_version.h)
# check if px4 source is a git repo
if(EXISTS ${PX4_SOURCE_DIR}/.git)
if (IS_DIRECTORY ${PX4_SOURCE_DIR}/.git)
# standard git repo
set(git_dir_path ${PX4_SOURCE_DIR}/.git)
else()
# git submodule
file(READ ${PX4_SOURCE_DIR}/.git git_dir_path)
string(STRIP ${git_dir_path} git_dir_path)
string(REPLACE "gitdir: " "" git_dir_path ${git_dir_path})
get_filename_component(git_dir_path ${git_dir_path} ABSOLUTE)
endif()
else()
message(FATAL_ERROR "is not a git repository")
endif()
if(NOT IS_DIRECTORY "${git_dir_path}")
message(FATAL_ERROR "${git_dir_path} is not a directory")
endif()
set(deps
${PX4_SOURCE_DIR}/Tools/px_update_git_header.py
${git_dir_path}/index
${git_dir_path}/HEAD)
add_custom_command(
OUTPUT ${px4_git_ver_header}
COMMAND ${PYTHON_EXECUTABLE} ${PX4_SOURCE_DIR}/Tools/px_update_git_header.py ${px4_git_ver_header} > ${PX4_BINARY_DIR}/git_header.log
DEPENDS ${deps}
WORKING_DIRECTORY ${PX4_SOURCE_DIR}
COMMENT "Generating git hash header"
)
set_source_files_properties(${px4_git_ver_header} PROPERTIES GENERATED TRUE)
add_custom_target(ver_gen ALL DEPENDS ${px4_git_ver_header})
add_custom_target(${TARGET} DEPENDS ${PX4_BINARY_DIR}/git_init_${NAME}.stamp)
endfunction()

View File

@ -73,7 +73,7 @@ function(px4_generate_messages)
REQUIRED MSG_FILES OS TARGET
ARGN ${ARGN})
if("${config_nuttx_config}" STREQUAL "bootloader")
if("${nuttx_config_type}" STREQUAL "bootloader")
# do nothing for bootloaders
else()
@ -162,6 +162,12 @@ function(px4_generate_messages)
${msg_multi_files_out}
${msg_files_out}
)
target_include_directories(${TARGET}
PRIVATE ${PX4_SOURCE_DIR}/src/lib/micro-CDR/include
PRIVATE ${PX4_BINARY_DIR}/src/lib/micro-CDR/include/microcdr
)
target_link_libraries(${TARGET} PRIVATE lib__micro-CDR)
endif()
endfunction()

View File

@ -2,8 +2,6 @@ include(nuttx/px4_impl_nuttx)
px4_nuttx_configure(HWCLASS m4 CONFIG nsh ROMFS y ROMFSROOT px4fmu_common)
set(CMAKE_TOOLCHAIN_FILE ${PX4_SOURCE_DIR}/cmake/toolchains/Toolchain-arm-none-eabi.cmake)
set(config_uavcan_num_ifaces 2)
set(config_module_list
@ -16,7 +14,7 @@ set(config_module_list
drivers/stm32/tone_alarm
drivers/led
drivers/px4fmu
drivers/boards/aerocore2
drivers/boards
drivers/lsm303d
drivers/l3gd20
drivers/ms5611
@ -63,6 +61,7 @@ set(config_module_list
#modules/commander/commander_tests
#lib/controllib/controllib_test
#modules/mavlink/mavlink_tests
#modules/unit_test
#modules/uORB/uORB_tests
#systemcmds/tests
@ -169,20 +168,3 @@ set(config_module_list
# Hardware test
#examples/hwtest
)
set(config_extra_builtin_cmds
serdis
sercon
)
add_custom_target(sercon)
set_target_properties(sercon PROPERTIES
PRIORITY "SCHED_PRIORITY_DEFAULT"
MAIN "sercon" STACK_MAIN "2048"
COMPILE_FLAGS "-Os")
add_custom_target(serdis)
set_target_properties(serdis PROPERTIES
PRIORITY "SCHED_PRIORITY_DEFAULT"
MAIN "serdis" STACK_MAIN "2048"
COMPILE_FLAGS "-Os")

View File

@ -2,8 +2,6 @@ include(nuttx/px4_impl_nuttx)
px4_nuttx_configure(HWCLASS m4 CONFIG nsh ROMFS y ROMFSROOT px4fmu_common)
set(CMAKE_TOOLCHAIN_FILE ${PX4_SOURCE_DIR}/cmake/toolchains/Toolchain-arm-none-eabi.cmake)
set(config_uavcan_num_ifaces 2)
set(config_module_list
@ -14,7 +12,7 @@ set(config_module_list
drivers/stm32
drivers/led
drivers/px4fmu
drivers/boards/aerofc-v1
drivers/boards
drivers/tap_esc
drivers/mpu9250
drivers/ms5611
@ -95,9 +93,3 @@ set(config_module_list
platforms/common
platforms/nuttx/px4_layer
)
set(config_extra_builtin_cmds
)
set(config_io_board
)

View File

@ -1,8 +1,6 @@
include(nuttx/px4_impl_nuttx)
px4_nuttx_configure(HWCLASS m4 CONFIG nsh ROMFS y ROMFSROOT px4fmu_common)
set(CMAKE_TOOLCHAIN_FILE ${PX4_SOURCE_DIR}/cmake/toolchains/Toolchain-arm-none-eabi.cmake)
px4_nuttx_configure(HWCLASS m4 CONFIG nsh ROMFS y ROMFSROOT px4fmu_common IO px4io-v2)
set(config_uavcan_num_ifaces 1)
@ -17,7 +15,7 @@ set(config_module_list
drivers/led
drivers/px4fmu
drivers/px4io
drivers/boards/auav-x21
drivers/boards
drivers/rgbled
drivers/mpu6000
drivers/mpu9250
@ -190,26 +188,3 @@ set(config_module_list
# Hardware test
#examples/hwtest
)
set(config_extra_builtin_cmds
serdis
sercon
)
set(config_io_board
px4io-v2
)
add_custom_target(sercon)
set_target_properties(sercon PROPERTIES
PRIORITY "SCHED_PRIORITY_DEFAULT"
MAIN "sercon"
STACK_MAIN "2048"
COMPILE_FLAGS "-Os")
add_custom_target(serdis)
set_target_properties(serdis PROPERTIES
PRIORITY "SCHED_PRIORITY_DEFAULT"
MAIN "serdis"
STACK_MAIN "2048"
COMPILE_FLAGS "-Os")

View File

@ -2,8 +2,6 @@ include(nuttx/px4_impl_nuttx)
px4_nuttx_configure(HWCLASS m4 CONFIG nsh ROMFS y ROMFSROOT px4fmu_common)
set(CMAKE_TOOLCHAIN_FILE ${PX4_SOURCE_DIR}/cmake/toolchains/Toolchain-arm-none-eabi.cmake)
set(config_module_list
#
# Board support modules
@ -12,7 +10,7 @@ set(config_module_list
drivers/stm32
drivers/led
drivers/px4fmu
drivers/boards/crazyflie
drivers/boards
drivers/mpu9250
drivers/lps25h
drivers/gps
@ -45,7 +43,6 @@ set(config_module_list
modules/mavlink
#modules/gpio_led
modules/land_detector
modules/syslink
#
@ -138,22 +135,3 @@ set(config_module_list
# Hardware test
#examples/hwtest
)
set(config_extra_builtin_cmds
serdis
sercon
)
add_custom_target(sercon)
set_target_properties(sercon PROPERTIES
PRIORITY "SCHED_PRIORITY_DEFAULT"
MAIN "sercon"
STACK_MAIN "2048"
COMPILE_FLAGS "-Os")
add_custom_target(serdis)
set_target_properties(serdis PROPERTIES
PRIORITY "SCHED_PRIORITY_DEFAULT"
MAIN "serdis"
STACK_MAIN "2048"
COMPILE_FLAGS "-Os")

View File

@ -1,30 +1,2 @@
include(nuttx/px4_impl_nuttx)
include(nuttx/px4_uavcan_bootloader)
px4_nuttx_configure(HWCLASS m4 CONFIG bootloader)
set(px4_src_base ${CMAKE_SOURCE_DIR}/src/)
set(px4_bootloader_base ${px4_src_base}drivers/bootloaders/)
set(px4_module_base ${px4_src_base}modules/)
#
# UAVCAN boot loadable Module ID
#
# Bring in common uavcan hardware identity definitions
#
include(configs/uavcan_board_ident/esc35-v1)
set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/cmake/toolchains/Toolchain-arm-none-eabi.cmake)
set(config_module_list
drivers/boards/esc35-v1/bootloader
)
#
# Bootloaders use a compact vector table not
# from the lib, but exported in startup
#
set(nuttx_startup_files stm32_vectors.o)

View File

@ -9,46 +9,51 @@ add_definitions(
px4_nuttx_configure(HWCLASS m4 CONFIG nsh)
#
# UAVCAN boot loadable Module ID
set(uavcanblid_sw_version_major 0)
set(uavcanblid_sw_version_minor 1)
add_definitions(
-DAPP_VERSION_MAJOR=${uavcanblid_sw_version_major}
-DAPP_VERSION_MINOR=${uavcanblid_sw_version_minor}
)
#
# Bring in common uavcan hardware identity definitions
#
include(configs/uavcan_board_ident/esc35-v1)
add_definitions(
-DHW_UAVCAN_NAME=${uavcanblid_name}
-DHW_VERSION_MAJOR=${uavcanblid_hw_version_major}
-DHW_VERSION_MINOR=${uavcanblid_hw_version_minor}
)
px4_nuttx_make_uavcan_bootloadable(BOARD ${BOARD}
BIN ${CMAKE_CURRENT_BINARY_DIR}/src/firmware/nuttx/firmware_nuttx.bin
BIN ${CMAKE_CURRENT_BINARY_DIR}/src/firmware/nuttx/esc35-v1.bin
HWNAME ${uavcanblid_name}
HW_MAJOR ${uavcanblid_hw_version_major}
HW_MINOR ${uavcanblid_hw_version_minor}
SW_MAJOR ${uavcanblid_sw_version_major}
SW_MINOR ${uavcanblid_sw_version_minor})
SW_MINOR ${uavcanblid_sw_version_minor}
)
set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/cmake/toolchains/Toolchain-arm-none-eabi.cmake)
include_directories(${PX4_SOURCE_DIR}/src/drivers/boards/esc35-v1/bootloader)
set(config_module_list
#
# Board support modules
#
drivers/stm32
drivers/boards
drivers/bootloaders
drivers/device
drivers/led
drivers/boards/esc35-v1
drivers/stm32
#
# System commands
#
systemcmds/config
systemcmds/reboot
systemcmds/top
systemcmds/config
systemcmds/ver
systemcmds/param
systemcmds/ver
#
# General system control
@ -64,34 +69,12 @@ set(config_module_list
#
# Library modules
#
modules/systemlib/param
modules/systemlib
modules/uORB
lib/version
#
# Libraries
#
# had to add for cmake, not sure why wasn't in original config
platforms/nuttx
platforms/common
platforms/nuttx/px4_layer
lib/micro-CDR
lib/version
modules/systemlib
modules/systemlib/param
modules/uORB
platforms/common
platforms/nuttx
platforms/nuttx/px4_layer
)
set(config_extra_builtin_cmds
serdis
sercon
)
add_custom_target(sercon)
set_target_properties(sercon PROPERTIES
PRIORITY "SCHED_PRIORITY_DEFAULT"
MAIN "sercon" STACK_MAIN "2048")
add_custom_target(serdis)
set_target_properties(serdis PROPERTIES
PRIORITY "SCHED_PRIORITY_DEFAULT"
MAIN "serdis" STACK_MAIN "2048")

View File

@ -2,8 +2,6 @@ include(nuttx/px4_impl_nuttx)
px4_nuttx_configure(HWCLASS m4 CONFIG nsh ROMFS y ROMFSROOT px4fmu_common)
set(CMAKE_TOOLCHAIN_FILE ${PX4_SOURCE_DIR}/cmake/toolchains/Toolchain-arm-none-eabi.cmake)
set(config_uavcan_num_ifaces 1)
set(config_module_list
@ -16,8 +14,9 @@ set(config_module_list
drivers/stm32/tone_alarm
drivers/led
drivers/px4fmu
drivers/boards/mindpx-v2
drivers/boards
drivers/rgbled
#drivers/rgbled_pwm
drivers/mpu6000
drivers/mpu9250
drivers/lsm303d
@ -208,20 +207,3 @@ set(config_rtps_send_topics
set(config_rtps_receive_topics
sensor_baro
)
set(config_extra_builtin_cmds
serdis
sercon
)
add_custom_target(sercon)
set_target_properties(sercon PROPERTIES
PRIORITY "SCHED_PRIORITY_DEFAULT"
MAIN "sercon"
STACK_MAIN "2048")
add_custom_target(serdis)
set_target_properties(serdis PROPERTIES
PRIORITY "SCHED_PRIORITY_DEFAULT"
MAIN "serdis"
STACK_MAIN "2048")

View File

@ -2,8 +2,6 @@ include(nuttx/px4_impl_nuttx)
px4_nuttx_configure(HWCLASS m4 CONFIG nsh ROMFS y ROMFSROOT px4fmu_common)
set(CMAKE_TOOLCHAIN_FILE ${PX4_SOURCE_DIR}/cmake/toolchains/Toolchain-arm-none-eabi.cmake)
set(config_uavcan_num_ifaces 1)
set(config_module_list
@ -15,7 +13,7 @@ set(config_module_list
#NOT Supported drivers/bma180
#NOT Supported drivers/bmi160
drivers/bmp280
drivers/boards/nxphlite-v3
drivers/boards
drivers/bst
drivers/camera_trigger
drivers/device
@ -212,30 +210,3 @@ set(config_module_list
# EKF
examples/ekf_att_pos_estimator
)
set(config_extra_builtin_cmds
serdis
sercon
)
set(config_extra_libs
##NO CAN YET uavcan
##NO CAN YET uavcan_stm32_driver
)
set(config_io_extra_libs
)
add_custom_target(sercon)
set_target_properties(sercon PROPERTIES
PRIORITY "SCHED_PRIORITY_DEFAULT"
MAIN "sercon"
STACK_MAIN "2048"
COMPILE_FLAGS "-Os")
add_custom_target(serdis)
set_target_properties(serdis PROPERTIES
PRIORITY "SCHED_PRIORITY_DEFAULT"
MAIN "serdis"
STACK_MAIN "2048"
COMPILE_FLAGS "-Os")

View File

@ -2,8 +2,6 @@ include(nuttx/px4_impl_nuttx)
px4_nuttx_configure(HWCLASS m7 CONFIG nsh ROMFS y ROMFSROOT px4fmu_common)
set(CMAKE_TOOLCHAIN_FILE ${PX4_SOURCE_DIR}/cmake/toolchains/Toolchain-arm-none-eabi.cmake)
##set(config_uavcan_num_ifaces 2)
set(config_module_list
@ -16,8 +14,7 @@ set(config_module_list
drivers/samv7/tone_alarm
drivers/led
drivers/px4fmu
#WIP drivers/px4io
drivers/boards/px4-same70xplained-v1
drivers/boards
drivers/rgbled
drivers/mpu6000
drivers/mpu9250
@ -173,30 +170,3 @@ set(config_module_list
# Hardware test
#examples/hwtest
)
set(config_extra_builtin_cmds
serdis
sercon
)
set(config_extra_libs
# uavcan
# uavcan_stm32_driver
)
set(config_io_extra_libs
)
add_custom_target(sercon)
set_target_properties(sercon PROPERTIES
PRIORITY "SCHED_PRIORITY_DEFAULT"
MAIN "sercon"
STACK_MAIN "2048"
COMPILE_FLAGS "-Os")
add_custom_target(serdis)
set_target_properties(serdis PROPERTIES
PRIORITY "SCHED_PRIORITY_DEFAULT"
MAIN "serdis"
STACK_MAIN "2048"
COMPILE_FLAGS "-Os")

View File

@ -2,8 +2,6 @@ include(nuttx/px4_impl_nuttx)
px4_nuttx_configure(HWCLASS m4 CONFIG nsh ROMFS y ROMFSROOT px4fmu_common)
set(CMAKE_TOOLCHAIN_FILE ${PX4_SOURCE_DIR}/cmake/toolchains/Toolchain-arm-none-eabi.cmake)
set(config_module_list
#
# Board support modules
@ -11,7 +9,7 @@ set(config_module_list
drivers/device
drivers/stm32
drivers/led
drivers/boards/px4-stm32f4discovery
drivers/boards
#
# System commands
@ -77,20 +75,3 @@ set(config_module_list
# Hardware test
#examples/hwtest
)
set(config_extra_builtin_cmds
serdis
sercon
)
add_custom_target(sercon)
set_target_properties(sercon PROPERTIES
PRIORITY "SCHED_PRIORITY_DEFAULT"
MAIN "sercon"
STACK_MAIN "2048")
add_custom_target(serdis)
set_target_properties(serdis PROPERTIES
PRIORITY "SCHED_PRIORITY_DEFAULT"
MAIN "serdis"
STACK_MAIN "2048")

View File

@ -1,30 +1,2 @@
include(nuttx/px4_impl_nuttx)
include(nuttx/px4_uavcan_bootloader)
px4_nuttx_configure(HWCLASS m3 CONFIG bootloader)
set(px4_src_base ${CMAKE_SOURCE_DIR}/src/)
set(px4_bootloader_base ${px4_src_base}drivers/bootloaders/)
set(px4_module_base ${px4_src_base}modules/)
#
# UAVCAN boot loadable Module ID
#
# Bring in common uavcan hardware identity definitions
#
include(configs/uavcan_board_ident/px4cannode-v1)
set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/cmake/toolchains/Toolchain-arm-none-eabi.cmake)
set(config_module_list
drivers/boards/px4cannode-v1/bootloader
)
#
# Bootloaders use a compact vector table not
# from the lib, but exported in startup
#
set(nuttx_startup_files stm32_vectors.o)

View File

@ -7,44 +7,49 @@ add_definitions(
px4_nuttx_configure(HWCLASS m3 CONFIG nsh)
#
# UAVCAN boot loadable Module ID
set(uavcanblid_sw_version_major 0)
set(uavcanblid_sw_version_minor 1)
add_definitions(
-DAPP_VERSION_MAJOR=${uavcanblid_sw_version_major}
-DAPP_VERSION_MINOR=${uavcanblid_sw_version_minor}
)
#
# Bring in common uavcan hardware identity definitions
#
include(configs/uavcan_board_ident/px4cannode-v1)
add_definitions(
-DHW_UAVCAN_NAME=${uavcanblid_name}
-DHW_VERSION_MAJOR=${uavcanblid_hw_version_major}
-DHW_VERSION_MINOR=${uavcanblid_hw_version_minor}
)
px4_nuttx_make_uavcan_bootloadable(BOARD ${BOARD}
BIN ${CMAKE_CURRENT_BINARY_DIR}/src/firmware/nuttx/firmware_nuttx.bin
BIN ${CMAKE_CURRENT_BINARY_DIR}/src/firmware/nuttx/px4cannode-v1.bin
HWNAME ${uavcanblid_name}
HW_MAJOR ${uavcanblid_hw_version_major}
HW_MINOR ${uavcanblid_hw_version_minor}
SW_MAJOR ${uavcanblid_sw_version_major}
SW_MINOR ${uavcanblid_sw_version_minor})
SW_MINOR ${uavcanblid_sw_version_minor}
)
set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/cmake/toolchains/Toolchain-arm-none-eabi.cmake)
include_directories(${PX4_SOURCE_DIR}/src/drivers/boards/px4cannode-v1/bootloader)
set(config_module_list
#
# Board support modules
#
drivers/stm32
drivers/boards
drivers/bootloaders
drivers/device
drivers/led
drivers/boards/px4cannode-v1
drivers/stm32
#
# System commands
#
systemcmds/config
systemcmds/reboot
systemcmds/top
systemcmds/config
systemcmds/ver
#
@ -55,19 +60,12 @@ set(config_module_list
#
# Library modules
#
modules/systemlib/param
modules/systemlib
modules/uORB
lib/version
#
# Libraries
#
# had to add for cmake, not sure why wasn't in original config
platforms/nuttx
platforms/common
platforms/nuttx/px4_layer
lib/micro-CDR
lib/version
modules/systemlib
modules/systemlib/param
modules/uORB
platforms/common
platforms/nuttx
platforms/nuttx/px4_layer
)

View File

@ -1,30 +1,2 @@
include(nuttx/px4_impl_nuttx)
include(nuttx/px4_uavcan_bootloader)
px4_nuttx_configure(HWCLASS m4 CONFIG bootloader)
set(px4_src_base ${CMAKE_SOURCE_DIR}/src/)
set(px4_bootloader_base ${px4_src_base}drivers/bootloaders/)
set(px4_module_base ${px4_src_base}modules/)
#
# UAVCAN boot loadable Module ID
#
# Bring in common uavcan hardware identity definitions
#
include(configs/uavcan_board_ident/px4esc-v1)
set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/cmake/toolchains/Toolchain-arm-none-eabi.cmake)
set(config_module_list
drivers/boards/px4esc-v1/bootloader
)
#
# Bootloaders use a compact vector table not
# from the lib, but exported in startup
#
set(nuttx_startup_files stm32_vectors.o)

View File

@ -9,46 +9,51 @@ add_definitions(
px4_nuttx_configure(HWCLASS m4 CONFIG nsh)
#
# UAVCAN boot loadable Module ID
set(uavcanblid_sw_version_major 0)
set(uavcanblid_sw_version_minor 1)
add_definitions(
-DAPP_VERSION_MAJOR=${uavcanblid_sw_version_major}
-DAPP_VERSION_MINOR=${uavcanblid_sw_version_minor}
)
#
# Bring in common uavcan hardware identity definitions
#
include(configs/uavcan_board_ident/px4esc-v1)
add_definitions(
-DHW_UAVCAN_NAME=${uavcanblid_name}
-DHW_VERSION_MAJOR=${uavcanblid_hw_version_major}
-DHW_VERSION_MINOR=${uavcanblid_hw_version_minor}
)
px4_nuttx_make_uavcan_bootloadable(BOARD ${BOARD}
BIN ${CMAKE_CURRENT_BINARY_DIR}/src/firmware/nuttx/firmware_nuttx.bin
BIN ${CMAKE_CURRENT_BINARY_DIR}/src/firmware/nuttx/px4esc-v1.bin
HWNAME ${uavcanblid_name}
HW_MAJOR ${uavcanblid_hw_version_major}
HW_MINOR ${uavcanblid_hw_version_minor}
SW_MAJOR ${uavcanblid_sw_version_major}
SW_MINOR ${uavcanblid_sw_version_minor})
SW_MINOR ${uavcanblid_sw_version_minor}
)
set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/cmake/toolchains/Toolchain-arm-none-eabi.cmake)
include_directories(${PX4_SOURCE_DIR}/src/drivers/boards/px4esc-v1/bootloader)
set(config_module_list
#
# Board support modules
#
drivers/stm32
drivers/boards
drivers/bootloaders
drivers/device
drivers/led
drivers/boards/px4esc-v1
drivers/stm32
#
# System commands
#
systemcmds/config
systemcmds/reboot
systemcmds/top
systemcmds/config
systemcmds/ver
systemcmds/param
systemcmds/ver
#
# General system control
@ -64,33 +69,12 @@ set(config_module_list
#
# Library modules
#
modules/systemlib/param
modules/systemlib
lib/version
#
# Libraries
#
# had to add for cmake, not sure why wasn't in original config
platforms/nuttx
platforms/common
platforms/nuttx/px4_layer
modules/uORB
lib/micro-CDR
lib/version
modules/systemlib
modules/systemlib/param
modules/uORB
platforms/common
platforms/nuttx
platforms/nuttx/px4_layer
)
set(config_extra_builtin_cmds
serdis
sercon
)
add_custom_target(sercon)
set_target_properties(sercon PROPERTIES
PRIORITY "SCHED_PRIORITY_DEFAULT"
MAIN "sercon" STACK_MAIN "2048")
add_custom_target(serdis)
set_target_properties(serdis PROPERTIES
PRIORITY "SCHED_PRIORITY_DEFAULT"
MAIN "serdis" STACK_MAIN "2048")

View File

@ -1,30 +1,2 @@
include(nuttx/px4_impl_nuttx)
include(nuttx/px4_uavcan_bootloader)
px4_nuttx_configure(HWCLASS m4 CONFIG bootloader)
set(px4_src_base ${CMAKE_SOURCE_DIR}/src/)
set(px4_bootloader_base ${px4_src_base}drivers/bootloaders/)
set(px4_module_base ${px4_src_base}modules/)
#
# UAVCAN boot loadable Module ID
#
# Bring in common uavcan hardware identity definitions
#
include(configs/uavcan_board_ident/px4flow-v2)
set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/cmake/toolchains/Toolchain-arm-none-eabi.cmake)
set(config_module_list
drivers/boards/px4flow-v2/bootloader
)
#
# Bootloaders use a compact vector table not
# from the lib, but exported in startup
#
set(nuttx_startup_files stm32_vectors.o)

View File

@ -1,10 +1,5 @@
include(nuttx/px4_impl_nuttx)
px4_nuttx_configure(HWCLASS m4 CONFIG nsh ROMFS y ROMFSROOT px4fmu_common)
set(CMAKE_TOOLCHAIN_FILE ${PX4_SOURCE_DIR}/cmake/toolchains/Toolchain-arm-none-eabi.cmake)
set(config_uavcan_num_ifaces 2)
px4_nuttx_configure(HWCLASS m4 CONFIG nsh ROMFS y ROMFSROOT px4fmu_common IO px4io-v2)
set(config_module_list
#
@ -17,7 +12,7 @@ set(config_module_list
drivers/led
drivers/px4fmu
drivers/px4io
drivers/boards/px4fmu-v2
drivers/boards
drivers/rgbled
drivers/mpu6000
drivers/mpu9250
@ -193,26 +188,3 @@ set(config_module_list
# Hardware test
#examples/hwtest
)
set(config_extra_builtin_cmds
serdis
sercon
)
set(config_io_board
px4io-v2
)
add_custom_target(sercon)
set_target_properties(sercon PROPERTIES
PRIORITY "SCHED_PRIORITY_DEFAULT"
MAIN "sercon"
STACK_MAIN "2048"
COMPILE_FLAGS "-Os")
add_custom_target(serdis)
set_target_properties(serdis PROPERTIES
PRIORITY "SCHED_PRIORITY_DEFAULT"
MAIN "serdis"
STACK_MAIN "2048"
COMPILE_FLAGS "-Os")

View File

@ -2,10 +2,6 @@ include(nuttx/px4_impl_nuttx)
px4_nuttx_configure(HWCLASS m4 CONFIG nsh ROMFS y ROMFSROOT px4fmu_test)
set(CMAKE_TOOLCHAIN_FILE ${PX4_SOURCE_DIR}/cmake/toolchains/Toolchain-arm-none-eabi.cmake)
set(config_uavcan_num_ifaces 2)
set(config_module_list
#
# Board support modules
@ -17,7 +13,7 @@ set(config_module_list
drivers/led
drivers/px4fmu
drivers/px4io
drivers/boards/px4fmu-v2
drivers/boards
drivers/rgbled
drivers/mpu6000
#TO FIT drivers/mpu9250
@ -188,24 +184,3 @@ set(config_module_list
# Hardware test
#examples/hwtest
)
set(config_extra_builtin_cmds
serdis
sercon
)
set(config_io_board
px4io-v2
)
add_custom_target(sercon)
set_target_properties(sercon PROPERTIES
PRIORITY "SCHED_PRIORITY_DEFAULT"
MAIN "sercon" STACK_MAIN "2048"
COMPILE_FLAGS "-Os")
add_custom_target(serdis)
set_target_properties(serdis PROPERTIES
PRIORITY "SCHED_PRIORITY_DEFAULT"
MAIN "serdis" STACK_MAIN "2048"
COMPILE_FLAGS "-Os")

View File

@ -1,8 +1,5 @@
include(nuttx/px4_impl_nuttx)
px4_nuttx_configure(HWCLASS m4 CONFIG nsh ROMFS y ROMFSROOT px4fmu_common)
set(CMAKE_TOOLCHAIN_FILE ${PX4_SOURCE_DIR}/cmake/toolchains/Toolchain-arm-none-eabi.cmake)
px4_nuttx_configure(HWCLASS m4 CONFIG nsh ROMFS y ROMFSROOT px4fmu_common IO px4io-v2)
set(config_uavcan_num_ifaces 2)
@ -14,7 +11,7 @@ set(config_module_list
drivers/blinkm
drivers/bmi160
drivers/bmp280
drivers/boards/px4fmu-v2
drivers/boards
drivers/bst
drivers/camera_trigger
drivers/device
@ -220,26 +217,3 @@ set(config_rtps_send_topics
set(config_rtps_receive_topics
sensor_baro
)
set(config_extra_builtin_cmds
serdis
sercon
)
set(config_io_board
px4io-v2
)
add_custom_target(sercon)
set_target_properties(sercon PROPERTIES
PRIORITY "SCHED_PRIORITY_DEFAULT"
MAIN "sercon"
STACK_MAIN "2048"
COMPILE_FLAGS "-Os")
add_custom_target(serdis)
set_target_properties(serdis PROPERTIES
PRIORITY "SCHED_PRIORITY_DEFAULT"
MAIN "serdis"
STACK_MAIN "2048"
COMPILE_FLAGS "-Os")

View File

@ -2,8 +2,6 @@ include(nuttx/px4_impl_nuttx)
px4_nuttx_configure(HWCLASS m4 CONFIG nsh ROMFS y ROMFSROOT px4fmu_common)
set(CMAKE_TOOLCHAIN_FILE ${PX4_SOURCE_DIR}/cmake/toolchains/Toolchain-arm-none-eabi.cmake)
set(config_uavcan_num_ifaces 1)
set(config_module_list
@ -17,7 +15,7 @@ set(config_module_list
drivers/bmi160
drivers/bmm150
drivers/bmp280
drivers/boards/px4fmu-v4
drivers/boards
drivers/bst
drivers/camera_trigger
drivers/device
@ -63,56 +61,57 @@ set(config_module_list
# System commands
#
systemcmds/bl_update
systemcmds/config
systemcmds/dumpfile
systemcmds/esc_calib
systemcmds/hardfault_log
systemcmds/led_control
systemcmds/mixer
systemcmds/motor_ramp
systemcmds/mtd
systemcmds/nshterm
systemcmds/param
systemcmds/perf
systemcmds/pwm
systemcmds/esc_calib
systemcmds/hardfault_log
systemcmds/reboot
systemcmds/topic_listener
systemcmds/top
systemcmds/config
systemcmds/nshterm
systemcmds/mtd
systemcmds/dumpfile
systemcmds/ver
systemcmds/sd_bench
systemcmds/motor_ramp
systemcmds/top
systemcmds/topic_listener
systemcmds/ver
#
# Testing
#
drivers/sf0x/sf0x_tests
drivers/test_ppm
#lib/rc/rc_tests
modules/commander/commander_tests
modules/mc_pos_control/mc_pos_control_tests
lib/controllib/controllib_test
modules/mavlink/mavlink_tests
modules/mc_pos_control/mc_pos_control_tests
modules/uORB/uORB_tests
systemcmds/tests
#
# General system control
#
modules/camera_feedback
modules/commander
modules/events
modules/load_mon
modules/navigator
modules/mavlink
modules/gpio_led
modules/uavcan
modules/land_detector
modules/camera_feedback
modules/load_mon
modules/mavlink
modules/navigator
modules/uavcan
#
# Estimation modules (EKF/ SO3 / other filters)
# Estimation modules
#
modules/attitude_estimator_q
modules/position_estimator_inav
modules/ekf2
modules/local_position_estimator
modules/position_estimator_inav
#
# Vehicle Control
@ -128,8 +127,8 @@ set(config_module_list
#
# Logging
#
modules/sdlog2
modules/logger
modules/sdlog2
#
# Library modules
@ -162,11 +161,13 @@ set(config_module_list
lib/tailsitter_recovery
lib/version
lib/DriverFramework/framework
platforms/nuttx
lib/micro-CDR
# had to add for cmake, not sure why wasn't in original config
#
# Platform
#
platforms/common
platforms/nuttx
platforms/nuttx/px4_layer
#
@ -179,28 +180,33 @@ set(config_module_list
#
examples/rover_steering_control
#
# Segway
#
examples/segway
#
# Demo apps
#
#examples/math_demo
# Tutorial code from
# https://px4.io/dev/px4_simple_app
examples/px4_simple_app
# Tutorial code from
# https://px4.io/dev/daemon
#examples/px4_daemon_app
examples/px4_daemon_app
# Tutorial code from
# https://px4.io/dev/debug_values
#examples/px4_mavlink_debug
examples/px4_mavlink_debug
# Tutorial code from
# https://px4.io/dev/example_fixedwing_control
examples/fixedwing_control
# Hardware test
#examples/hwtest
examples/hwtest
# EKF
examples/ekf_att_pos_estimator
@ -213,22 +219,3 @@ set(config_rtps_send_topics
set(config_rtps_receive_topics
sensor_baro
)
set(config_extra_builtin_cmds
serdis
sercon
)
add_custom_target(sercon)
set_target_properties(sercon PROPERTIES
PRIORITY "SCHED_PRIORITY_DEFAULT"
MAIN "sercon"
STACK_MAIN "2048"
COMPILE_FLAGS "-Os")
add_custom_target(serdis)
set_target_properties(serdis PROPERTIES
PRIORITY "SCHED_PRIORITY_DEFAULT"
MAIN "serdis"
STACK_MAIN "2048"
COMPILE_FLAGS "-Os")

View File

@ -1,8 +1,6 @@
include(nuttx/px4_impl_nuttx)
px4_nuttx_configure(HWCLASS m4 CONFIG nsh ROMFS y ROMFSROOT px4fmu_common)
set(CMAKE_TOOLCHAIN_FILE ${PX4_SOURCE_DIR}/cmake/toolchains/Toolchain-arm-none-eabi.cmake)
px4_nuttx_configure(HWCLASS m4 CONFIG nsh ROMFS y ROMFSROOT px4fmu_common IO px4io-v2)
set(config_uavcan_num_ifaces 2)
@ -15,7 +13,7 @@ set(config_module_list
drivers/bma180
drivers/bmi160
drivers/bmp280
drivers/boards/px4fmu-v4pro
drivers/boards
drivers/bst
drivers/camera_trigger
drivers/device
@ -220,26 +218,3 @@ set(config_rtps_send_topics
set(config_rtps_receive_topics
sensor_baro
)
set(config_extra_builtin_cmds
serdis
sercon
)
set(config_io_board
px4io-v2
)
add_custom_target(sercon)
set_target_properties(sercon PROPERTIES
PRIORITY "SCHED_PRIORITY_DEFAULT"
MAIN "sercon"
STACK_MAIN "2048"
COMPILE_FLAGS "-Os")
add_custom_target(serdis)
set_target_properties(serdis PROPERTIES
PRIORITY "SCHED_PRIORITY_DEFAULT"
MAIN "serdis"
STACK_MAIN "2048"
COMPILE_FLAGS "-Os")

View File

@ -2,8 +2,6 @@ include(nuttx/px4_impl_nuttx)
px4_nuttx_configure(HWCLASS m7 CONFIG nsh ROMFS y ROMFSROOT px4fmu_common)
set(CMAKE_TOOLCHAIN_FILE ${PX4_SOURCE_DIR}/cmake/toolchains/Toolchain-arm-none-eabi.cmake)
set(config_uavcan_num_ifaces 2)
set(config_module_list
@ -16,7 +14,7 @@ set(config_module_list
drivers/bmi055
drivers/bmi160
drivers/bmp280
drivers/boards/px4fmu-v5
drivers/boards
drivers/bst
drivers/camera_trigger
drivers/device
@ -221,22 +219,3 @@ set(config_rtps_send_topics
set(config_rtps_receive_topics
sensor_baro
)
set(config_extra_builtin_cmds
serdis
sercon
)
add_custom_target(sercon)
set_target_properties(sercon PROPERTIES
PRIORITY "SCHED_PRIORITY_DEFAULT"
MAIN "sercon"
STACK_MAIN "2048"
COMPILE_FLAGS "-Os")
add_custom_target(serdis)
set_target_properties(serdis PROPERTIES
PRIORITY "SCHED_PRIORITY_DEFAULT"
MAIN "serdis"
STACK_MAIN "2048"
COMPILE_FLAGS "-Os")

View File

@ -0,0 +1,12 @@
include(nuttx/px4_impl_nuttx)
px4_nuttx_configure(HWCLASS m3 CONFIG nsh)
set(config_module_list
drivers/boards
drivers/stm32
lib/rc
modules/px4iofirmware
modules/systemlib/mixer
platforms/common
)

View File

@ -0,0 +1,14 @@
include(nuttx/px4_impl_nuttx)
px4_nuttx_configure(HWCLASS m3 CONFIG nsh)
set(config_module_list
drivers/boards/px4io-v2
drivers/stm32
lib/rc
modules/px4iofirmware
modules/systemlib/mixer
platforms/common
lib/micro-CDR
)

View File

@ -2,8 +2,6 @@ include(nuttx/px4_impl_nuttx)
px4_nuttx_configure(HWCLASS m7 CONFIG nsh ROMFS y ROMFSROOT px4fmu_common)
set(CMAKE_TOOLCHAIN_FILE ${PX4_SOURCE_DIR}/cmake/toolchains/Toolchain-arm-none-eabi.cmake)
set(config_uavcan_num_ifaces 2)
set(config_module_list
@ -15,7 +13,7 @@ set(config_module_list
drivers/bma180
drivers/bmi160
drivers/bmp280
drivers/boards/px4nucleoF767ZI-v1
drivers/boards
drivers/bst
drivers/camera_trigger
drivers/device
@ -178,20 +176,3 @@ set(config_module_list
# Hardware test
#examples/hwtest
)
set(config_extra_builtin_cmds
serdis
sercon
)
add_custom_target(sercon)
set_target_properties(sercon PROPERTIES
PRIORITY "SCHED_PRIORITY_DEFAULT"
MAIN "sercon"
STACK_MAIN "2048")
add_custom_target(serdis)
set_target_properties(serdis PROPERTIES
PRIORITY "SCHED_PRIORITY_DEFAULT"
MAIN "serdis"
STACK_MAIN "2048")

View File

@ -1,30 +1,2 @@
include(nuttx/px4_impl_nuttx)
include(nuttx/px4_uavcan_bootloader)
px4_nuttx_configure(HWCLASS m4 CONFIG bootloader)
set(px4_src_base ${CMAKE_SOURCE_DIR}/src/)
set(px4_bootloader_base ${px4_src_base}drivers/bootloaders/)
set(px4_module_base ${px4_src_base}modules/)
#
# UAVCAN boot loadable Module ID
#
# Bring in common uavcan hardware identity definitions
#
include(configs/uavcan_board_ident/s2740vc-v1)
set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/cmake/toolchains/Toolchain-arm-none-eabi.cmake)
set(config_module_list
drivers/boards/s2740vc-v1/bootloader
)
#
# Bootloaders use a compact vector table not
# from the lib, but exported in startup
#
set(nuttx_startup_files stm32_vectors.o)

View File

@ -12,6 +12,10 @@ px4_nuttx_configure(HWCLASS m4 CONFIG nsh)
set(uavcanblid_sw_version_major 0)
set(uavcanblid_sw_version_minor 1)
add_definitions(
-DAPP_VERSION_MAJOR=${uavcanblid_sw_version_major}
-DAPP_VERSION_MINOR=${uavcanblid_sw_version_minor}
)
#
# Bring in common uavcan hardware identity definitions
@ -21,15 +25,13 @@ include(configs/uavcan_board_ident/s2740vc-v1)
# N.B. this would be uncommented when there is an APP
#px4_nuttx_make_uavcan_bootloadable(BOARD ${BOARD}
# BIN ${CMAKE_CURRENT_BINARY_DIR}/src/firmware/nuttx/firmware_nuttx.bin
# BIN ${CMAKE_CURRENT_BINARY_DIR}/src/firmware/nuttx/s2740vc-v1.bin
# HWNAME ${uavcanblid_name}
# HW_MAJOR ${uavcanblid_hw_version_major}
# HW_MINOR ${uavcanblid_hw_version_minor}
# SW_MAJOR ${uavcanblid_sw_version_major}
# SW_MINOR ${uavcanblid_sw_version_minor})
set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/cmake/toolchains/Toolchain-arm-none-eabi.cmake)
set(config_module_list
#
@ -38,7 +40,7 @@ set(config_module_list
drivers/stm32
drivers/led
drivers/boards/s2740vc-v1
drivers/boards
#
# System commands
@ -67,6 +69,4 @@ set(config_module_list
platforms/nuttx
platforms/common
platforms/nuttx/px4_layer
)

View File

@ -2,8 +2,6 @@ include(nuttx/px4_impl_nuttx)
px4_nuttx_configure(HWCLASS m4 CONFIG nsh ROMFS y ROMFSROOT tap_common)
set(CMAKE_TOOLCHAIN_FILE ${PX4_SOURCE_DIR}/cmake/toolchains/Toolchain-arm-none-eabi.cmake)
set(target_definitions MEMORY_CONSTRAINED_SYSTEM)
set(config_module_list
@ -16,7 +14,7 @@ set(config_module_list
drivers/stm32/tone_alarm
drivers/led
drivers/px4fmu
drivers/boards/tap-v1
drivers/boards
drivers/rgbled_pwm
drivers/tap_esc
drivers/mpu6000
@ -112,23 +110,3 @@ set(config_module_list
platforms/common
platforms/nuttx/px4_layer
)
set(config_extra_builtin_cmds
serdis
sercon
)
set(config_io_board
)
add_custom_target(sercon)
set_target_properties(sercon PROPERTIES
PRIORITY "SCHED_PRIORITY_DEFAULT"
MAIN "sercon"
STACK_MAIN "2048")
add_custom_target(serdis)
set_target_properties(serdis PROPERTIES
PRIORITY "SCHED_PRIORITY_DEFAULT"
MAIN "serdis"
STACK_MAIN "2048")

View File

@ -1,30 +1,2 @@
include(nuttx/px4_impl_nuttx)
include(nuttx/px4_uavcan_bootloader)
px4_nuttx_configure(HWCLASS m3 CONFIG bootloader)
set(px4_src_base ${CMAKE_SOURCE_DIR}/src/)
set(px4_bootloader_base ${px4_src_base}drivers/bootloaders/)
set(px4_module_base ${px4_src_base}modules/)
#
# UAVCAN boot loadable Module ID
#
# Bring in common uavcan hardware identity definitions
#
include(configs/uavcan_board_ident/zubaxgnss-v1)
set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/cmake/toolchains/Toolchain-arm-none-eabi.cmake)
set(config_module_list
drivers/boards/zubaxgnss-v1/bootloader
)
#
# Bootloaders use a compact vector table not
# from the lib, but exported in startup
#
set(nuttx_startup_files stm32_vectors.o)

View File

@ -10,8 +10,6 @@ add_definitions(
set(config_module_list
# examples/px4_simple_app
#
# Board support modules
#

View File

@ -20,7 +20,7 @@ endif()
set(config_module_list
drivers/device
drivers/boards/sitl
drivers/boards
drivers/led
drivers/linux_sbus

View File

@ -34,7 +34,7 @@ set(config_module_list
drivers/pwm_out_sim
drivers/rgbled
drivers/led
drivers/boards/sitl
drivers/boards
drivers/qshell/posix
systemcmds/param

View File

@ -26,7 +26,7 @@ set(config_module_list
drivers/pwm_out_sim
drivers/rgbled
drivers/led
drivers/boards/sitl
drivers/boards
drivers/qshell/posix
systemcmds/param

View File

@ -3,7 +3,7 @@ include(posix/px4_impl_posix)
set(CMAKE_TOOLCHAIN_FILE ${PX4_SOURCE_DIR}/cmake/toolchains/Toolchain-native.cmake)
set(config_module_list
drivers/boards/sitl
drivers/boards
drivers/camera_trigger
drivers/device
drivers/gps
@ -194,11 +194,6 @@ set(config_module_list
lib/micro-CDR
)
set(config_extra_builtin_cmds
serdis
sercon
)
set(config_rtps_send_topics
sensor_baro
)

View File

@ -22,7 +22,7 @@ include_directories(${HEXAGON_SDK_INCLUDES})
set(config_module_list
drivers/device
drivers/boards/sitl
drivers/boards
drivers/pwm_out_sim
drivers/led
drivers/rgbled

View File

@ -27,7 +27,7 @@ include_directories(${HEXAGON_SDK_INCLUDES})
set(config_module_list
drivers/device
drivers/boards/sitl
drivers/boards
drivers/pwm_out_sim
drivers/led
drivers/rgbled

View File

@ -1,98 +0,0 @@
#!/usr/bin/env python
"""
This converts a binary imagge to an object file
"""
from __future__ import print_function
import subprocess
import argparse
import re
from subprocess import PIPE
#pylint: disable=invalid-name
parser = argparse.ArgumentParser(description='Convert bin to obj.')
parser.add_argument('--c_flags', required=True)
parser.add_argument('--c_compiler', required=True)
parser.add_argument('--include_path', required=True)
parser.add_argument('--nm', required=True)
parser.add_argument('--ld', required=True)
parser.add_argument('--objcopy', required=True)
parser.add_argument('--bin', required=True)
parser.add_argument('--obj', required=True)
parser.add_argument('--var', required=True)
args = parser.parse_args()
in_bin = args.bin
c_flags = args.c_flags
c_compiler = args.c_compiler
include_path = args.include_path
nm = args.nm
ld = args.ld
obj = args.obj
var = args.var
objcopy = args.objcopy
sym = "_binary_" + in_bin.replace('/', '_').replace('.', '_').replace('-', '_')
#print("sym: ", sym)
# write empty file
with open('{obj:s}.c'.format(**locals()), 'w') as f:
f.write("")
def run_cmd(cmd, d):
cmd = cmd.format(**d)
#print(cmd)
proc = subprocess.Popen(cmd.split(), stdout=PIPE, stderr=PIPE)
stdout, stderr = proc.communicate()
if stderr.decode() != "":
raise RuntimeError(stderr)
return stdout
# do compile
run_cmd("{c_compiler:s} -I{include_path:s} {c_flags:s} -c {obj:s}.c -o {obj:s}.c.o",
locals())
# link
run_cmd("{ld:s} -r -o {obj:s}.bin.o {obj:s}.c.o -b binary {in_bin:s}",
locals())
# get size of image
stdout = run_cmd("{nm:s} -p --radix=x {obj:s}.bin.o", locals())
re_string = r"^([0-9A-Fa-f]+) .*{sym:s}_size".format(**locals())
re_size = re.compile(re_string, re.MULTILINE)
size_match = re.search(re_size, stdout.decode())
try:
size = size_match.group(1)
except AttributeError as e:
raise RuntimeError("{:s}\nre:{:s}\n{:s}".format(
e, re_string, stdout))
except IndexError as e:
group0 = size_match.group(0)
raise RuntimeError("{:s}\ngroup 0:{:s}\n{:s}".format(
e, group0, stdout))
#print("romfs size: ", size)
# write size to file
with open('{obj:s}.c'.format(**locals()), 'w') as f:
f.write("const unsigned int {var:s}_len = 0x{size:s};".format(
**locals()))
# do compile
run_cmd("{c_compiler:s} -I{include_path:s} {c_flags:s} -c {obj:s}.c -o {obj:s}.c.o",
locals())
# link
run_cmd("{ld:s} -r -o {obj:s} {obj:s}.c.o {obj:s}.bin.o",
locals())
# obj copy
run_cmd("""
{objcopy:s} {obj:s}
--redefine-sym {sym:s}_start={var:s}
--strip-symbol {sym:s}_size
--strip-symbol {sym:s}_end
--rename-section .data=.rodata
""", locals())
# vim: set et ft=python fenc= ff=unix sts=4 sw=4 ts=4 :

View File

@ -1,12 +0,0 @@
/* builtin command list - automatically generated, do not edit */
#include <nuttx/config.h>
#include <nuttx/binfmt/builtin.h>
#include <nuttx/config.h>
#if ${command_count}
${builtin_apps_decl_string}
const struct builtin_s g_builtins[] = {
${builtin_apps_string}
{NULL, 0, 0, NULL}
};
const int g_builtin_count = ${command_count};
#endif

View File

@ -37,11 +37,7 @@
#
# OS Specific Functions
#
# * px4_nuttx_add_firmware
# * px4_nuttx_make_uavcan_bootloadable
# * px4_nuttx_generate_builtin_commands
# * px4_nuttx_add_export
# * px4_nuttx_add_romfs
#
# Required OS Inteface Functions
#
@ -51,63 +47,6 @@
include(common/px4_base)
#=============================================================================
#
# px4_nuttx_add_firmware
#
# This function adds a nuttx firmware target.
#
# Usage:
# px4_nuttx_add_firmware(OUT <out-target> EXE <in-executable>
# PARAM_XML <param_xml> AIRFRAMES_XML <airframes_xml>)
#
# Input:
# EXE : the executable to generate the firmware from
# BOARD : the board
# PARAM_XML : param xml file (optional)
# AIRFRAMES_XML : airframes xml file (optional)
#
# Output:
# OUT : the generated firmware target
#
# Example:
# px4_nuttx_add_firmware(TARGET fw_test EXE test)
#
function(px4_nuttx_add_firmware)
px4_parse_function_args(
NAME px4_nuttx_add_firmware
ONE_VALUE BOARD OUT EXE PARAM_XML AIRFRAMES_XML
REQUIRED OUT EXE BOARD
ARGN ${ARGN})
set(extra_args)
set(dependencies)
if (PARAM_XML)
list(APPEND extra_args
--parameter_xml ${PARAM_XML}
)
list(APPEND dependencies parameters_xml)
endif()
if (AIRFRAMES_XML)
list(APPEND extra_args
--airframe_xml ${AIRFRAMES_XML}
)
list(APPEND dependencies airframes_xml)
endif()
add_custom_command(OUTPUT ${OUT} ${EXE}.bin
COMMAND ${OBJCOPY} -O binary ${EXE} ${EXE}.bin
COMMAND ${PYTHON_EXECUTABLE} ${PX4_SOURCE_DIR}/Tools/px_mkfw.py
--prototype ${PX4_SOURCE_DIR}/Images/${BOARD}.prototype
--git_identity ${PX4_SOURCE_DIR}
${extra_args}
--image ${EXE}.bin > ${OUT}
DEPENDS ${EXE} ${dependencies}
)
add_custom_target(build_firmware_${BOARD} ALL DEPENDS ${OUT})
endfunction()
#=============================================================================
#
# px4_nuttx_make_uavcan_bootloadable
@ -153,13 +92,16 @@ function(px4_nuttx_make_uavcan_bootloadable)
ONE_VALUE BOARD BIN HWNAME HW_MAJOR HW_MINOR SW_MAJOR SW_MINOR
REQUIRED BOARD BIN HWNAME HW_MAJOR HW_MINOR SW_MAJOR SW_MINOR
ARGN ${ARGN})
string(REPLACE "\"" "" HWNAME ${HWNAME})
execute_process(
COMMAND git rev-list HEAD --max-count=1 --abbrev=8 --abbrev-commit
OUTPUT_VARIABLE uavcanbl_git_desc
OUTPUT_STRIP_TRAILING_WHITESPACE
WORKING_DIRECTORY ${PX4_SOURCE_DIR}
)
if ("${uavcanbl_git_desc}" STREQUAL "")
set(uavcanbl_git_desc ffffffff)
endif()
@ -172,323 +114,6 @@ function(px4_nuttx_make_uavcan_bootloadable)
add_custom_target(build_uavcan_bl_${BOARD} ALL DEPENDS ${uavcan_bl_imange_name})
endfunction()
#=============================================================================
#
# px4_nuttx_generate_builtin_commands
#
# This function generates the builtin_commands.c src for nuttx
#
# Usage:
# px4_nuttx_generate_builtin_commands(
# MODULE_LIST <in-list>
# OUT <file>)
#
# Input:
# MODULE_LIST : list of modules
#
# Output:
# OUT : generated builtin_commands.c src
#
# Example:
# px4_nuttx_generate_builtin_commands(
# OUT <generated-src> MODULE_LIST px4_simple_app)
#
function(px4_nuttx_generate_builtin_commands)
px4_parse_function_args(
NAME px4_nuttx_generate_builtin_commands
ONE_VALUE OUT
MULTI_VALUE MODULE_LIST
REQUIRED MODULE_LIST OUT
ARGN ${ARGN})
set(builtin_apps_string)
set(builtin_apps_decl_string)
set(command_count 0)
foreach(module ${MODULE_LIST})
foreach(property MAIN STACK_MAIN PRIORITY)
get_target_property(${property} ${module} ${property})
endforeach()
if (MAIN)
set(builtin_apps_string
"${builtin_apps_string}\t{\"${MAIN}\", ${PRIORITY}, ${STACK_MAIN}, ${MAIN}_main},\n")
set(builtin_apps_decl_string
"${builtin_apps_decl_string}extern int ${MAIN}_main(int argc, char *argv[]);\n")
math(EXPR command_count "${command_count}+1")
endif()
endforeach()
configure_file(${PX4_SOURCE_DIR}/cmake/nuttx/builtin_commands.c.in
${OUT})
endfunction()
#=============================================================================
#
# px4_nuttx_add_export
#
# This function generates a nuttx export.
#
# Usage:
# px4_nuttx_add_export(
# OUT <out-target>
# CONFIG <in-string>
# DEPENDS <in-list>)
#
# Input:
# CONFIG : the board to generate the export for
# DEPENDS : dependencies
#
# Output:
# OUT : the export target
#
# Example:
# px4_nuttx_add_export(OUT nuttx_export CONFIG px4fmu-v2)
#
function(px4_nuttx_add_export)
px4_parse_function_args(
NAME px4_nuttx_add_export
ONE_VALUE OUT CONFIG THREADS
MULTI_VALUE DEPENDS
REQUIRED OUT CONFIG THREADS
ARGN ${ARGN})
set(nuttx_build_options "--quiet")
set(nuttx_build_output ">nuttx_build.log")
if ($ENV{PX4_NUTTX_BUILD_VERBOSE} MATCHES "1")
set(nuttx_build_options)
set(nuttx_build_output)
set(nuttx_build_uses_terminal "USES_TERMINAL")
endif()
if ($ENV{PX4_NUTTX_PATCHES_VERBOSE} MATCHES "1")
set(nuttx_patches_uses_terminal "USES_TERMINAL")
endif()
# nuttx-patches
add_subdirectory(${PX4_SOURCE_DIR}/nuttx-patches ${PX4_BINARY_DIR}/${CONFIG})
set(nuttx_build_src ${PX4_BINARY_DIR}/${CONFIG}/NuttX)
set(nuttx_export_dir ${nuttx_build_src}/nuttx/nuttx-export)
# nuttx cmake dependency files
set(nuttx_copy_stamp ${PX4_BINARY_DIR}/${CONFIG}/nuttx_copy.stamp)
set(nuttx_configure_stamp ${PX4_BINARY_DIR}/${CONFIG}/nuttx_configure.stamp)
set(nuttx_export_stamp ${PX4_BINARY_DIR}/${CONFIG}/nuttx_export.stamp)
# copy
file(GLOB_RECURSE nuttx_all_files ${PX4_SOURCE_DIR}/NuttX/*)
file(RELATIVE_PATH nuttx_cp_src ${PX4_BINARY_DIR} ${PX4_SOURCE_DIR}/NuttX)
add_custom_command(OUTPUT ${nuttx_copy_stamp}
COMMAND ${MKDIR} -p ${nuttx_build_src}
COMMAND rsync -rp --inplace --delete --exclude=.git --exclude=nuttx-export ${nuttx_cp_src}/ ${CONFIG}/NuttX/
COMMAND cmake -E touch ${nuttx_copy_stamp}
DEPENDS ${px4_nuttx_patches} ${nuttx_all_files}
COMMENT "Copying NuttX for ${CONFIG} with ${config_nuttx_config}"
WORKING_DIRECTORY ${PX4_BINARY_DIR})
add_custom_target(nuttx_copy_${CONFIG} DEPENDS ${DEPENDS} ${nuttx_copy_stamp})
unset(last_patch)
add_custom_target(nuttx_patch_${CONFIG})
foreach(patch ${px4_nuttx_patches})
get_filename_component(patch_file_name ${patch} NAME)
string(REPLACE "/" "_" patch_name "${CONFIG}-nuttx_patch_${patch_file_name}")
set(patch_stamp ${nuttx_build_src}/${patch_name}.stamp)
add_custom_command(OUTPUT ${patch_stamp}
COMMAND ${PATCH} --verbose -d ${nuttx_build_src} -s -p1 -N < ${patch}
COMMAND cmake -E touch ${patch_stamp}
DEPENDS nuttx_copy_${CONFIG} ${patch} ${last_patch}
COMMENT "${CONFIG}: nuttx-patches/${patch_file_name} applied"
${nuttx_patches_uses_terminal})
add_custom_target(${patch_name} DEPENDS ${patch_stamp})
add_dependencies(nuttx_patch_${CONFIG} ${patch_name} nuttx_copy_${CONFIG})
set(last_patch ${patch_name})
endforeach()
# Read defconfig to see if CONFIG_ARMV7M_STACKCHECK is yes
# note: CONFIG will be BOARD in the future evaluation of ${hw_stack_check_${CONFIG}
file(STRINGS "${PX4_SOURCE_DIR}/nuttx-configs/${CONFIG}/${config_nuttx_config}/defconfig"
hw_stack_check_${CONFIG}
REGEX "CONFIG_ARMV7M_STACKCHECK=y"
)
if ("${hw_stack_check_${CONFIG}}" STREQUAL "CONFIG_ARMV7M_STACKCHECK=y")
set(config_nuttx_hw_stack_check_${CONFIG} y CACHE INTERNAL "" FORCE)
endif()
# nuttx configure
file(GLOB_RECURSE nuttx-configs ${PX4_SOURCE_DIR}/nuttx-configs/${CONFIG}/*)
add_custom_command(OUTPUT ${nuttx_configure_stamp} ${nuttx_build_src}/nuttx/.config
COMMAND ${CP} -rp ${PX4_SOURCE_DIR}/nuttx-configs/*.mk ${nuttx_build_src}/nuttx/
COMMAND ${CP} -rp ${PX4_SOURCE_DIR}/nuttx-configs/${CONFIG} ${nuttx_build_src}/nuttx/configs
COMMAND ${CP} ${nuttx_build_src}/nuttx/configs/${CONFIG}/${config_nuttx_config}/defconfig ${nuttx_build_src}/nuttx/.config
COMMAND ${CP} ${nuttx_build_src}/nuttx/configs/${CONFIG}/${config_nuttx_config}/Make.defs ${nuttx_build_src}/nuttx/
COMMAND cmake -E touch ${nuttx_configure_stamp}
DEPENDS nuttx_patch_${CONFIG} ${nuttx-configs}
WORKING_DIRECTORY ${PX4_BINARY_DIR}
COMMENT "Configuring NuttX for ${CONFIG} with ${config_nuttx_config}")
add_custom_target(nuttx_configure_${CONFIG} DEPENDS ${nuttx_configure_stamp} nuttx_patch_${CONFIG})
# manual nuttx oldconfig helper
add_custom_target(oldconfig_${CONFIG}
COMMAND ${MAKE} --no-print-directory -C ${nuttx_build_src}/nuttx CONFIG_ARCH_BOARD=${CONFIG} oldconfig
COMMAND ${CP} ${nuttx_build_src}/nuttx/.config ${PX4_SOURCE_DIR}/nuttx-configs/${CONFIG}/${config_nuttx_config}/defconfig
COMMAND ${PX4_SOURCE_DIR}/Tools/nuttx_defconf_tool.sh ${PX4_SOURCE_DIR}/nuttx-configs/${CONFIG}/${config_nuttx_config}/defconfig
DEPENDS nuttx_configure_${CONFIG}
WORKING_DIRECTORY ${nuttx_build_src}/nuttx
COMMENT "Running NuttX make oldconfig for ${CONFIG} with ${config_nuttx_config}"
USES_TERMINAL)
# manual nuttx menuconfig helper
add_custom_target(menuconfig_${CONFIG}
COMMAND ${MAKE} --no-print-directory -C ${nuttx_build_src}/nuttx CONFIG_ARCH_BOARD=${CONFIG} menuconfig
COMMAND ${CP} ${nuttx_build_src}/nuttx/.config ${PX4_SOURCE_DIR}/nuttx-configs/${CONFIG}/${config_nuttx_config}/defconfig
COMMAND ${PX4_SOURCE_DIR}/Tools/nuttx_defconf_tool.sh ${PX4_SOURCE_DIR}/nuttx-configs/${CONFIG}/${config_nuttx_config}/defconfig
DEPENDS nuttx_configure_${CONFIG}
WORKING_DIRECTORY ${nuttx_build_src}/nuttx
COMMENT "Running NuttX make menuconfig for ${CONFIG} with ${config_nuttx_config}"
USES_TERMINAL)
# nuttx build and export
add_custom_command(
OUTPUT ${nuttx_export_stamp}
${nuttx_export_dir}/include/nuttx/config.h
COMMAND ${RM} -rf ${nuttx_export_dir}
COMMAND ${MAKE} ${nuttx_build_options} --no-print-directory -C ${nuttx_build_src}/nuttx -r CONFIG_ARCH_BOARD=${CONFIG} export ${nuttx_build_output}
COMMAND cmake -E touch ${nuttx_export_stamp}
DEPENDS nuttx_configure_${CONFIG}
WORKING_DIRECTORY ${PX4_BINARY_DIR}/${CONFIG}
COMMENT "Building NuttX for ${CONFIG} with ${config_nuttx_config}"
${nuttx_build_uses_terminal})
file(GLOB_RECURSE nuttx_export_src ${nuttx_export_dir})
foreach(nuttx_export_file ${nuttx_export_dir})
set_source_files_properties(${nuttx_export_src} PROPERTIES GENERATED TRUE)
endforeach()
add_custom_target(${OUT} DEPENDS nuttx_copy_${CONFIG} nuttx_patch_${CONFIG} nuttx_configure_${CONFIG} ${nuttx_export_stamp})
endfunction()
#=============================================================================
#
# px4_nuttx_create_bin
#
# The functions generates a bin image for nuttx.
#
# Usage:
# px4_nuttx_create_bin(BIN <out-file> EXE <in-file>)
#
# Input:
# EXE : the exe file
#
# Output:
# OUT : the binary output file
#
# Example:
# px4_nuttx_create_bin(OUT my_exe.bin EXE my_exe)
#
function(px4_nuttx_create_bin)
px4_parse_function_args(
NAME px4_nuttx_create_bin
ONE_VALUE EXE OUT
REQUIRED EXE OUT
ARGN ${ARGN})
add_custom_command(OUTPUT ${OUT}
COMMAND ${OBJCOPY} -O binary ${EXE} ${EXE}.bin
DEPENDS ${EXE})
set(${OUT} ${${OUT}} PARENT_SCOPE)
endfunction()
#=============================================================================
#
# px4_nuttx_add_romfs
#
# The functions creates a ROMFS filesystem for nuttx.
#
# Usage:
# px4_nuttx_add_romfs(
# OUT <out-target>
# ROOT <in-directory>
# EXTRAS <in-list>)
#
# Input:
# ROOT : the root of the ROMFS
# EXTRAS : list of extra files
#
# Output:
# OUT : the ROMFS library target
#
# Example:
# px4_nuttx_add_romfs(OUT my_romfs ROOT "ROMFS/my_board")
#
function(px4_nuttx_add_romfs)
px4_parse_function_args(
NAME px4_nuttx_add_romfs
ONE_VALUE OUT ROOT
MULTI_VALUE EXTRAS
REQUIRED OUT ROOT
ARGN ${ARGN})
set(romfs_used y PARENT_SCOPE)
set(romfs_temp_dir ${PX4_BINARY_DIR}/tmp/${ROOT})
set(romfs_src_dir ${PX4_SOURCE_DIR}/${ROOT})
set(romfs_autostart ${PX4_SOURCE_DIR}/Tools/px_process_airframes.py)
set(romfs_pruner ${PX4_SOURCE_DIR}/Tools/px_romfs_pruner.py)
set(bin_to_obj ${PX4_SOURCE_DIR}/cmake/nuttx/bin_to_obj.py)
set(extras_dir ${CMAKE_CURRENT_BINARY_DIR}/extras)
file(GLOB_RECURSE romfs_src_files ${romfs_src_dir} ${romfs_src_dir}/*)
set(cmake_test ${PX4_SOURCE_DIR}/cmake/test/cmake_tester.py)
set(extras)
foreach(extra ${EXTRAS})
get_filename_component(file_name ${extra} NAME)
set(file_dest ${extras_dir}/${file_name})
add_custom_command(OUTPUT ${file_dest}
COMMAND cmake -E copy ${extra} ${file_dest}
DEPENDS ${extra}
)
list(APPEND extras ${file_dest})
endforeach()
add_custom_target(collect_extras DEPENDS ${extras})
add_custom_command(OUTPUT romfs.o
COMMAND cmake -E remove_directory ${romfs_temp_dir}
COMMAND cmake -E copy_directory ${romfs_src_dir} ${romfs_temp_dir}
COMMAND cmake -E copy_directory ${extras_dir} ${romfs_temp_dir}/extras
COMMAND ${PYTHON_EXECUTABLE} ${romfs_autostart}
-a ${romfs_temp_dir}/init.d
-s ${romfs_temp_dir}/init.d/rc.autostart
--board ${BOARD}
COMMAND ${PYTHON_EXECUTABLE} ${romfs_pruner}
--folder ${romfs_temp_dir}
--board ${BOARD}
COMMAND ${GENROMFS} -f ${CMAKE_CURRENT_BINARY_DIR}/romfs.bin
-d ${romfs_temp_dir} -V "NSHInitVol"
#COMMAND cmake -E remove_directory ${romfs_temp_dir}
COMMAND ${PYTHON_EXECUTABLE} ${bin_to_obj}
--ld ${LD} --c_flags ${CMAKE_C_FLAGS}
--include_path "${PX4_SOURCE_DIR}/src/include"
--c_compiler ${CMAKE_C_COMPILER}
--nm ${NM} --objcopy ${OBJCOPY}
--obj romfs.o
--var romfs_img
--bin romfs.bin
DEPENDS ${romfs_src_files} ${extras}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
)
add_library(${OUT} STATIC romfs.o)
set_target_properties(${OUT} PROPERTIES LINKER_LANGUAGE C)
set(${OUT} ${${OUT}} PARENT_SCOPE)
endfunction()
#=============================================================================
#
# px4_os_add_flags
@ -550,43 +175,23 @@ function(px4_os_add_flags)
LINK_DIRS ${LINK_DIRS}
DEFINITIONS ${DEFINITIONS})
set(nuttx_export_root ${PX4_BINARY_DIR}/${BOARD}/NuttX)
set(nuttx_export_dir ${nuttx_export_root}/nuttx/nuttx-export)
set(added_include_dirs
${nuttx_export_dir}/include
${nuttx_export_dir}/include/cxx
${nuttx_export_dir}/arch/chip
${nuttx_export_dir}/arch/common
${nuttx_export_dir}/arch/armv7-m
${nuttx_export_root}/apps/include
)
set(added_link_dirs
${nuttx_export_dir}/libs
)
set(added_definitions
-D__PX4_NUTTX
${PX4_BINARY_DIR}/NuttX/nuttx/arch/arm/src/armv7-m
${PX4_BINARY_DIR}/NuttX/nuttx/arch/arm/src/chip
${PX4_BINARY_DIR}/NuttX/nuttx/arch/arm/src/common
${PX4_BINARY_DIR}/NuttX/nuttx/include
${PX4_BINARY_DIR}/NuttX/nuttx/include/cxx
${PX4_SOURCE_DIR}/platforms/nuttx/NuttX/apps/include
)
if(NOT "${config_nuttx_config}" STREQUAL "bootloader")
#set(added_exe_linker_flags)
#set(added_link_dirs ${nuttx_export_dir}/libs)
set(added_definitions -D__PX4_NUTTX)
if(NOT ${nuttx_config_type} STREQUAL "bootloader")
list(APPEND added_definitions -D__DF_NUTTX)
endif()
set(added_c_flags
-nodefaultlibs
-nostdlib
-fstack-usage
)
set(added_cxx_flags
-nodefaultlibs
-nostdlib
-fstack-usage
)
set(added_optimization_flags)
set(added_exe_linker_flags) # none currently
set(instrument_flags)
if("${config_nuttx_hw_stack_check_${BOARD}}" STREQUAL "y")
set(instrument_flags
-finstrument-functions
@ -596,39 +201,12 @@ function(px4_os_add_flags)
list(APPEND cxx_flags ${instrument_flags})
endif()
set(cpu_flags)
if (${config_nuttx_hw} STREQUAL "m7")
set(cpu_flags
-mcpu=cortex-m7
-mthumb
-mfpu=fpv5-sp-d16
-mfloat-abi=hard
)
elseif (${config_nuttx_hw} STREQUAL "m4")
set(cpu_flags
-mcpu=cortex-m4
-mthumb
-march=armv7e-m
-mfpu=fpv4-sp-d16
-mfloat-abi=hard
)
elseif (${config_nuttx_hw} STREQUAL "m3")
set(cpu_flags
-mcpu=cortex-m3
-mthumb
-march=armv7-m
)
endif()
list(APPEND c_flags ${cpu_flags})
list(APPEND cxx_flags ${cpu_flags})
# output
foreach(var ${inout_vars})
string(TOLOWER ${var} lower_var)
set(${${var}} ${${${var}}} ${added_${lower_var}} PARENT_SCOPE)
#message(STATUS "nuttx: set(${${var}} ${${${var}}} ${added_${lower_var}} PARENT_SCOPE)")
endforeach()
endfunction()
#=============================================================================
@ -659,11 +237,29 @@ function(px4_os_prebuild_targets)
ONE_VALUE OUT BOARD THREADS
REQUIRED OUT BOARD
ARGN ${ARGN})
px4_nuttx_add_export(OUT nuttx_export_${BOARD}
CONFIG ${BOARD}
THREADS ${THREADS}
DEPENDS git_nuttx)
add_custom_target(${OUT} DEPENDS nuttx_export_${BOARD})
add_custom_target(${OUT} DEPENDS nuttx_context)
# parse nuttx config options for cmake
file(STRINGS ${PX4_SOURCE_DIR}/nuttx-configs/${BOARD}/${nuttx_config_type}/defconfig ConfigContents)
foreach(NameAndValue ${ConfigContents})
# Strip leading spaces
string(REGEX REPLACE "^[ ]+" "" NameAndValue ${NameAndValue})
# Find variable name
string(REGEX MATCH "^CONFIG[^=]+" Name ${NameAndValue})
if (Name)
# Find the value
string(REPLACE "${Name}=" "" Value ${NameAndValue})
# remove extra quotes
string(REPLACE "\"" "" Value ${Value})
# Set the variable
set(${Name} ${Value} PARENT_SCOPE)
endif()
endforeach()
endfunction()
#=============================================================================
@ -682,7 +278,7 @@ endfunction()
#
# Input:
# HWCLASS : the class of hardware
# CONFIG : the nuttx condufiguration to use
# CONFIG : the nuttx configuration to use
# ROMFS : whether or not to use incllude theROMFS
# ROMFSROOT : If ROMFS used set the root the default is px4fmu_common
#
@ -695,22 +291,42 @@ endfunction()
function(px4_nuttx_configure)
px4_parse_function_args(
NAME px4_nuttx_configure
ONE_VALUE HWCLASS CONFIG ROMFS ROMFSROOT
REQUIRED HWCLASS CONFIG
ONE_VALUE HWCLASS CONFIG ROMFS ROMFSROOT IO
REQUIRED HWCLASS
ARGN ${ARGN})
set(config_nuttx_config ${CONFIG} PARENT_SCOPE)
set(config_nuttx_hw ${HWCLASS} PARENT_SCOPE)
# HWCLASS -> CMAKE_SYSTEM_PROCESSOR
if(HWCLASS STREQUAL "m7")
set(CMAKE_SYSTEM_PROCESSOR "cortex-m7" PARENT_SCOPE)
elseif(HWCLASS STREQUAL "m4")
set(CMAKE_SYSTEM_PROCESSOR "cortex-m4" PARENT_SCOPE)
elseif(HWCLASS STREQUAL "m3")
set(CMAKE_SYSTEM_PROCESSOR "cortex-m3" PARENT_SCOPE)
endif()
set(CMAKE_SYSTEM_PROCESSOR ${CMAKE_SYSTEM_PROCESSOR} CACHE INTERNAL "system processor" FORCE)
set(CMAKE_TOOLCHAIN_FILE ${PX4_SOURCE_DIR}/cmake/toolchains/Toolchain-arm-none-eabi.cmake CACHE INTERNAL "toolchain file" FORCE)
# CONFIG (nsh/bootloader)
if(CONFIG)
set(nuttx_config_type ${CONFIG} PARENT_SCOPE)
else()
set(nuttx_config_type "nsh" PARENT_SCOPE)
endif()
# ROMFS
if("${ROMFS}" STREQUAL "y")
set(romfs_used ${ROMFS} PARENT_SCOPE)
if (NOT DEFINED ROMFSROOT)
set(config_romfs_root px4fmu_common)
else()
set(config_romfs_root ${ROMFSROOT})
endif()
set(HASROMFS "with ROMFS on ${config_romfs_root}")
set(config_romfs_root ${config_romfs_root} PARENT_SCOPE)
endif()
message(STATUS "Nuttx build for ${BOARD} on ${HWCLASS} hardware, using ${CONFIG} ${HASROMFS}")
# IO board placed in ROMFS
if(config_romfs_root)
set(config_io_board ${IO} PARENT_SCOPE)
endif()
endfunction()
# vim: set noet fenc=utf-8 ff=unix nowrap:

View File

@ -0,0 +1,56 @@
############################################################################
#
# Copyright (c) 2017 PX4 Development Team. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
# 3. Neither the name PX4 nor the names of its contributors may be
# used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
############################################################################
include(nuttx/px4_impl_nuttx)
message(STATUS "PX4 bootloader: ${BOARD}")
# Bring in common uavcan hardware identity definitions
include(configs/uavcan_board_ident/${BOARD})
add_definitions(
-DHW_UAVCAN_NAME=${uavcanblid_name}
-DHW_VERSION_MAJOR=${uavcanblid_hw_version_major}
-DHW_VERSION_MINOR=${uavcanblid_hw_version_minor}
)
include_directories(src/drivers/boards/${BOARD}/bootloader)
set(config_module_list
drivers/boards/common
drivers/boards/${BOARD}/bootloader
drivers/bootloaders
)
add_library(nuttx_startup ${PX4_SOURCE_DIR}/platforms/nuttx/NuttX/nuttx/arch/arm/src/stm32/gnu/stm32_vectors.S)
target_compile_definitions(nuttx_startup PRIVATE -D__ASSEMBLY__)
add_dependencies(nuttx_startup nuttx_arch_build)

View File

@ -37,10 +37,7 @@
#
# OS Specific Functions
#
# * px4_posix_add_firmware
# * px4_posix_generate_builtin_commands
# * px4_posix_add_export
# * px4_posix_generate_romfs
#
# Required OS Interface Functions
#
@ -168,7 +165,9 @@ function(px4_os_add_flags)
DEFINITIONS ${DEFINITIONS})
set(added_include_dirs
src/modules/systemlib
src/platforms/posix/include
mavlink/include/mavlink
)
# This block sets added_definitions and added_cxx_flags.

View File

@ -72,8 +72,24 @@ foreach(tool ddd)
endif()
endforeach()
set(LINKER_FLAGS "-Wl,-gc-sections")
set(CMAKE_EXE_LINKER_FLAGS ${LINKER_FLAGS})
set(cpu_flags)
if (CMAKE_SYSTEM_PROCESSOR STREQUAL "cortex-m7")
set(cpu_flags "-mcpu=cortex-m7 -mthumb -mfpu=fpv5-sp-d16 -mfloat-abi=hard")
elseif (CMAKE_SYSTEM_PROCESSOR STREQUAL "cortex-m4")
set(cpu_flags "-mcpu=cortex-m4 -mthumb -march=armv7e-m -mfpu=fpv4-sp-d16 -mfloat-abi=hard")
elseif (CMAKE_SYSTEM_PROCESSOR STREQUAL "cortex-m3")
set(cpu_flags "-mcpu=cortex-m3 -mthumb -march=armv7-m")
else ()
message(FATAL_ERROR "Processor not recognised in toolchain file")
endif()
set(c_flags "-fno-common -ffunction-sections -fdata-sections")
set(cxx_flags "-fno-common -ffunction-sections -fdata-sections")
set(CMAKE_C_FLAGS "${c_flags} ${cpu_flags}" CACHE INTERNAL "" FORCE)
set(CMAKE_CXX_FLAGS "${cxx_flags} ${cpu_flags}" CACHE INTERNAL "" FORCE)
set(CMAKE_ASM_FLAGS "${cpu_flags} -D__ASSEMBLY__ " CACHE INTERNAL "" FORCE)
set(CMAKE_EXE_LINKER_FLAGS "${cpu_flags} -nodefaultlibs -nostdlib -Wl,--warn-common,--gc-sections" CACHE INTERNAL "" FORCE)
# where is the target environment
set(CMAKE_FIND_ROOT_PATH get_file_component(${C_COMPILER} PATH))

View File

@ -20,7 +20,7 @@
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="cdt.managedbuild.target.gnu.platform.base.328447809" name="Debug Platform" osList="linux,hpux,aix,qnx" superClass="cdt.managedbuild.target.gnu.platform.base"/>
<builder id="cdt.managedbuild.target.gnu.builder.base.977864740" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" superClass="cdt.managedbuild.target.gnu.builder.base">
<outputEntries>
<entry excluding="build_*" flags="VALUE_WORKSPACE_PATH" kind="outputPath" name=""/>
<entry excluding="build*" flags="VALUE_WORKSPACE_PATH" kind="outputPath" name=""/>
</outputEntries>
</builder>
<tool id="cdt.managedbuild.tool.gnu.archiver.base.1653222719" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.base"/>

View File

@ -52,18 +52,18 @@
<type>10</type>
<matcher>
<id>org.eclipse.ui.ide.multiFilter</id>
<arguments>1.0-name-matches-true-false-build_*</arguments>
<arguments>1.0-name-matches-true-false-build*</arguments>
</matcher>
</filter>
</filteredResources>
<variableList>
<variable>
<name>uORB_LOC</name>
<value>$%7BPROJECT_LOC%7D/build_posix_sitl_default/src/modules/uORB</value>
<value>$%7BPROJECT_LOC%7D/build/posix_sitl_default/src/modules/uORB</value>
</variable>
<variable>
<name>uORB_SRC</name>
<value>$%7BPROJECT_LOC%7D/build_posix_sitl_default/topics_sources</value>
<value>$%7BPROJECT_LOC%7D/build/posix_sitl_default/topics_sources</value>
</variable>
</variableList>
</projectDescription>

View File

@ -667,7 +667,7 @@ CONFIG_RAM_SIZE=262144
# Board Selection
#
CONFIG_ARCH_BOARD_AEROCORE2=y
CONFIG_ARCH_BOARD="AeroCore2"
CONFIG_ARCH_BOARD="aerocore2"
#
# Custom Board Configuration

View File

@ -677,7 +677,7 @@ CONFIG_ARCH_BOARD="aerofc-v1"
#
# Board-Specific Options
#
CONFIG_BOARD_CRASHDUMP=y
CONFIG_BOARD_CRASHDUMP=n
CONFIG_BOARD_RESET_ON_CRASH=y
CONFIG_LIB_BOARDCTL=y
CONFIG_BOARDCTL_RESET=y

View File

@ -681,7 +681,7 @@ CONFIG_RAM_SIZE=262144
# Board Selection
#
CONFIG_ARCH_BOARD_AUAV_X21=y
CONFIG_ARCH_BOARD="auav_x21"
CONFIG_ARCH_BOARD="auav-x21"
#
# Custom Board Configuration

View File

@ -612,8 +612,7 @@ CONFIG_ARCH_BOARD="px4esc-v1"
#
# Custom Board Configuration
#
CONFIG_BOARD_CRASHDUMP=y
CONFIG_BOARD_RESET_ON_CRASH=y
# CONFIG_BOARD_CRASHDUMP is not set
# CONFIG_BOARD_CUSTOM_LEDS is not set
# CONFIG_BOARD_CUSTOM_BUTTONS is not set
@ -626,8 +625,7 @@ CONFIG_ARCH_LEDS=y
#
# Board-Specific Options
#
CONFIG_BOARD_CRASHDUMP=y
CONFIG_BOARD_RESET_ON_CRASH=y
# CONFIG_BOARD_CRASHDUMP is not set
CONFIG_LIB_BOARDCTL=y
CONFIG_BOARDCTL_RESET=y
# CONFIG_BOARDCTL_UNIQUEID is not set

View File

@ -162,4 +162,3 @@ HOSTCC = gcc
HOSTINCLUDES = -I.
HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe
HOSTLDFLAGS =

View File

@ -1,5 +1,5 @@
/************************************************************************************
* configs/px4fmu-v3/include/board.h
* nuttx-configs/px4fmu-v3/include/board.h
* include/arch/board/board.h
*
* Copyright (C) 2009 Gregory Nutt. All rights reserved.

View File

@ -1,5 +1,5 @@
############################################################################
# configs/px4fmu-v3/nsh/Make.defs
# nuttx-configs/px4fmu-v3/nsh/Make.defs
#
# Copyright (C) 2011 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org>

View File

@ -680,8 +680,8 @@ CONFIG_RAM_SIZE=262144
#
# Board Selection
#
CONFIG_ARCH_BOARD_PX4FMU_V2=y
CONFIG_ARCH_BOARD="px4fmu-v2"
CONFIG_ARCH_BOARD_PX4FMU_V3=y
CONFIG_ARCH_BOARD="px4fmu-v3"
#
# Custom Board Configuration

View File

@ -1,583 +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 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 <machine/ieeefp.h>
+#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 <ieeefp.h>). */
+#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));
+
+#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));
+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 <machine/fastmath.h>
+#endif
+
+#endif /* _MATH_H_ */

View File

@ -1,64 +0,0 @@
diff --git NuttX/nuttx/include/signal.h NuttX/nuttx/include/signal.h
index bd8ee9f..7ee242a 100644
--- NuttX/nuttx/include/signal.h
+++ NuttX/nuttx/include/signal.h
@@ -282,8 +282,11 @@ extern "C"
int kill(pid_t pid, int signo);
int raise(int signo);
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow"
int sigaction(int signo, FAR const struct sigaction *act,
FAR struct sigaction *oact);
+#pragma GCC diagnostic pop
int sigaddset(FAR sigset_t *set, int signo);
int sigdelset(FAR sigset_t *set, int signo);
int sigemptyset(FAR sigset_t *set);
diff --git NuttX/nuttx/include/stdlib.h NuttX/nuttx/include/stdlib.h
index aa259c9..f2b0640 100644
--- NuttX/nuttx/include/stdlib.h
+++ NuttX/nuttx/include/stdlib.h
@@ -202,7 +202,10 @@ FAR void *zalloc(size_t);
FAR void *calloc(size_t, size_t);
#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(FAR struct mallinfo *info);
#endif
diff --git NuttX/nuttx/include/sys/statfs.h NuttX/nuttx/include/sys/statfs.h
index 1d1786a..12f802b 100644
--- NuttX/nuttx/include/sys/statfs.h
+++ NuttX/nuttx/include/sys/statfs.h
@@ -139,8 +139,11 @@ extern "C"
* form of the struct statfs.
*/
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow"
int statfs(FAR const char *path, FAR struct statfs *buf);
int fstatfs(int fd, FAR struct statfs *buf);
+#pragma GCC diagnostic pop
#undef EXTERN
#if defined(__cplusplus)
diff --git NuttX/nuttx/include/sys/stat.h NuttX/nuttx/include/sys/stat.h
index 4d82f62..4d35fcb 100644
--- NuttX/nuttx/include/sys/stat.h
+++ NuttX/nuttx/include/sys/stat.h
@@ -154,9 +154,11 @@ 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);
int fstat(int fd, FAR struct stat *buf);
-
+#pragma GCC diagnostic pop
#undef EXTERN
#if defined(__cplusplus)
}

View File

@ -1,271 +0,0 @@
diff --git NuttX/apps/nshlib/nsh_parse.c NuttX/apps/nshlib/nsh_parse.c
index 30f7ef5..f6fa2e0 100644
--- NuttX/apps/nshlib/nsh_parse.c
+++ NuttX/apps/nshlib/nsh_parse.c
@@ -156,9 +156,9 @@ static FAR char *nsh_envexpand(FAR struct nsh_vtbl_s *vtbl,
#endif
static FAR char *nsh_argexpand(FAR struct nsh_vtbl_s *vtbl, FAR char *cmdline,
- FAR char **allocation);
+ FAR char **allocation, int* isenvvar);
static FAR char *nsh_argument(FAR struct nsh_vtbl_s *vtbl, char **saveptr,
- FAR NSH_MEMLIST_TYPE *memlist);
+ FAR NSH_MEMLIST_TYPE *memlist, int* isenvvar);
#ifndef CONFIG_NSH_DISABLESCRIPT
#ifndef CONFIG_NSH_DISABLE_LOOPS
@@ -1009,7 +1009,7 @@ static FAR char *nsh_envexpand(FAR struct nsh_vtbl_s *vtbl,
#if defined(CONFIG_NSH_ARGCAT) && defined(HAVE_MEMLIST)
static FAR char *nsh_argexpand(FAR struct nsh_vtbl_s *vtbl, FAR char *cmdline,
- FAR char **allocation)
+ FAR char **allocation, int* isenvvar)
{
FAR char *working = cmdline;
FAR char *argument = NULL;
@@ -1128,8 +1128,8 @@ static FAR char *nsh_argexpand(FAR struct nsh_vtbl_s *vtbl, FAR char *cmdline,
*allocation = argument;
/* Find the end of the environment variable reference. If the
- * dollar sign ('$') is followed by a right bracket ('{') then the
- * variable name is terminated with the left bracket character
+ * dollar sign ('$') is followed by a left bracket ('{') then the
+ * variable name is terminated with the right bracket character
* ('}'). Otherwise, the variable name goes to the end of the
* argument.
*/
@@ -1167,6 +1167,10 @@ static FAR char *nsh_argexpand(FAR struct nsh_vtbl_s *vtbl, FAR char *cmdline,
* nsh_envexpand will return the NULL string.
*/
+ if (isenvvar) {
+ *isenvvar = 1;
+ }
+
envstr = nsh_envexpand(vtbl, ptr);
/* Concatenate the result of the operation with the accumulated
@@ -1187,7 +1191,7 @@ static FAR char *nsh_argexpand(FAR struct nsh_vtbl_s *vtbl, FAR char *cmdline,
#else
static FAR char *nsh_argexpand(FAR struct nsh_vtbl_s *vtbl, FAR char *cmdline,
- FAR char **allocation)
+ FAR char **allocation, int* isenvvar)
{
FAR char *argument = (FAR char *)g_nullstring;
@@ -1223,6 +1227,9 @@ static FAR char *nsh_argexpand(FAR struct nsh_vtbl_s *vtbl, FAR char *cmdline,
if (*cmdline == '$')
{
+ if (isenvvar) {
+ *isenvvar = 1;
+ }
argument = nsh_envexpand(vtbl, cmdline + 1);
}
else
@@ -1245,7 +1252,7 @@ static FAR char *nsh_argexpand(FAR struct nsh_vtbl_s *vtbl, FAR char *cmdline,
****************************************************************************/
static FAR char *nsh_argument(FAR struct nsh_vtbl_s *vtbl, FAR char **saveptr,
- FAR NSH_MEMLIST_TYPE *memlist)
+ FAR NSH_MEMLIST_TYPE *memlist, int* isenvvar)
{
FAR char *pbegin = *saveptr;
FAR char *pend = NULL;
@@ -1317,6 +1324,13 @@ static FAR char *nsh_argument(FAR struct nsh_vtbl_s *vtbl, FAR char **saveptr,
pbegin++;
term = "\"";
+
+ /* If this is an environment variable in double quotes, we don't want it split into
+ * multiple argument should CONFIG_NSH_ENABLEPX4PARSING be defined
+ * So just invalidate the flag pointer which would otherwise communictate such
+ * back up the call tree.
+ */
+ isenvvar = NULL;
}
else
{
@@ -1376,11 +1390,11 @@ static FAR char *nsh_argument(FAR struct nsh_vtbl_s *vtbl, FAR char **saveptr,
/* Perform expansions as necessary for the argument */
- argument = nsh_argexpand(vtbl, pbegin, &allocation);
+ argument = nsh_argexpand(vtbl, pbegin, &allocation, isenvvar);
}
/* If any memory was allocated for this argument, make sure that it is
- * added to the list of memory to be freed at the end of commend
+ * added to the list of memory to be freed at the end of command
* processing.
*/
@@ -1497,7 +1511,7 @@ static int nsh_loop(FAR struct nsh_vtbl_s *vtbl, FAR char **ppcmd,
/* Get the cmd following the "while" or "until" */
- *ppcmd = nsh_argument(vtbl, saveptr, memlist);
+ *ppcmd = nsh_argument(vtbl, saveptr, memlist, 0);
if (!*ppcmd)
{
nsh_output(vtbl, g_fmtarginvalid, "if");
@@ -1554,7 +1568,7 @@ static int nsh_loop(FAR struct nsh_vtbl_s *vtbl, FAR char **ppcmd,
{
/* Get the cmd following the "do" -- there may or may not be one */
- *ppcmd = nsh_argument(vtbl, saveptr, memlist);
+ *ppcmd = nsh_argument(vtbl, saveptr, memlist, 0);
/* Verify that "do" is valid in this context */
@@ -1574,7 +1588,7 @@ static int nsh_loop(FAR struct nsh_vtbl_s *vtbl, FAR char **ppcmd,
{
/* Get the cmd following the "done" -- there should be one */
- *ppcmd = nsh_argument(vtbl, saveptr, memlist);
+ *ppcmd = nsh_argument(vtbl, saveptr, memlist, 0);
if (*ppcmd)
{
nsh_output(vtbl, g_fmtarginvalid, "done");
@@ -1679,7 +1693,7 @@ static int nsh_itef(FAR struct nsh_vtbl_s *vtbl, FAR char **ppcmd,
{
/* Get the cmd following the if */
- *ppcmd = nsh_argument(vtbl, saveptr, memlist);
+ *ppcmd = nsh_argument(vtbl, saveptr, memlist, 0);
if (!*ppcmd)
{
nsh_output(vtbl, g_fmtarginvalid, "if");
@@ -1717,7 +1731,7 @@ static int nsh_itef(FAR struct nsh_vtbl_s *vtbl, FAR char **ppcmd,
{
/* Get the cmd following the "then" -- there may or may not be one */
- *ppcmd = nsh_argument(vtbl, saveptr, memlist);
+ *ppcmd = nsh_argument(vtbl, saveptr, memlist, 0);
/* Verify that "then" is valid in this context */
@@ -1736,7 +1750,7 @@ static int nsh_itef(FAR struct nsh_vtbl_s *vtbl, FAR char **ppcmd,
{
/* Get the cmd following the "else" -- there may or may not be one */
- *ppcmd = nsh_argument(vtbl, saveptr, memlist);
+ *ppcmd = nsh_argument(vtbl, saveptr, memlist, 0);
/* Verify that "else" is valid in this context */
@@ -1755,7 +1769,7 @@ static int nsh_itef(FAR struct nsh_vtbl_s *vtbl, FAR char **ppcmd,
{
/* Get the cmd following the fi -- there should be one */
- *ppcmd = nsh_argument(vtbl, saveptr, memlist);
+ *ppcmd = nsh_argument(vtbl, saveptr, memlist, 0);
if (*ppcmd)
{
nsh_output(vtbl, g_fmtarginvalid, "fi");
@@ -1827,10 +1841,10 @@ static int nsh_nice(FAR struct nsh_vtbl_s *vtbl, FAR char **ppcmd,
/* Get the cmd (or -d option of nice command) */
- cmd = nsh_argument(vtbl, saveptr, memlist);
+ cmd = nsh_argument(vtbl, saveptr, memlist, 0);
if (cmd && strcmp(cmd, "-d") == 0)
{
- FAR char *val = nsh_argument(vtbl, saveptr, memlist);
+ FAR char *val = nsh_argument(vtbl, saveptr, memlist, 0);
if (val)
{
char *endptr;
@@ -1841,7 +1855,7 @@ static int nsh_nice(FAR struct nsh_vtbl_s *vtbl, FAR char **ppcmd,
nsh_output(vtbl, g_fmtarginvalid, "nice");
return ERROR;
}
- cmd = nsh_argument(vtbl, saveptr, memlist);
+ cmd = nsh_argument(vtbl, saveptr, memlist, 0);
}
}
@@ -1909,7 +1923,7 @@ static int nsh_parse_cmdparm(FAR struct nsh_vtbl_s *vtbl, FAR char *cmdline,
/* Parse out the command at the beginning of the line */
saveptr = cmdline;
- cmd = nsh_argument(vtbl, &saveptr, &memlist);
+ cmd = nsh_argument(vtbl, &saveptr, &memlist, 0);
/* Check if any command was provided -OR- if command processing is
* currently disabled.
@@ -1943,7 +1957,7 @@ static int nsh_parse_cmdparm(FAR struct nsh_vtbl_s *vtbl, FAR char *cmdline,
argv[0] = cmd;
for (argc = 1; argc < MAX_ARGV_ENTRIES-1; argc++)
{
- argv[argc] = nsh_argument(vtbl, &saveptr, &memlist);
+ argv[argc] = nsh_argument(vtbl, &saveptr, &memlist, 0);
if (!argv[argc])
{
break;
@@ -2010,7 +2024,7 @@ static int nsh_parse_command(FAR struct nsh_vtbl_s *vtbl, FAR char *cmdline)
/* Parse out the command at the beginning of the line */
saveptr = cmdline;
- cmd = nsh_argument(vtbl, &saveptr, &memlist);
+ cmd = nsh_argument(vtbl, &saveptr, &memlist, 0);
#ifndef CONFIG_NSH_DISABLESCRIPT
#ifndef CONFIG_NSH_DISABLE_LOOPS
@@ -2078,15 +2092,54 @@ static int nsh_parse_command(FAR struct nsh_vtbl_s *vtbl, FAR char *cmdline)
*/
argv[0] = cmd;
+
+#define CONFIG_NSH_ENABLEPX4PARSING
+
for (argc = 1; argc < MAX_ARGV_ENTRIES-1; argc++)
{
- argv[argc] = nsh_argument(vtbl, &saveptr, &memlist);
+ int isenvvar = 0; /* flag for if an enviroment variable gets expanded */
+ argv[argc] = nsh_argument(vtbl, &saveptr, &memlist, &isenvvar);
if (!argv[argc])
{
break;
}
+
+#ifdef CONFIG_NSH_ENABLEPX4PARSING
+ if (isenvvar)
+ {
+ while (argc < MAX_ARGV_ENTRIES-1) /* TODO: check this bounds check is correct */
+ {
+ FAR char *pbegin = argv[argc];
+
+ /* Find the end of the current token */
+ for (; *pbegin && !strchr(g_token_separator, *pbegin); pbegin++);
+
+ /* If end of string, we've processed the last token and we're done */
+ if ('\0' == *pbegin)
+ {
+ break;
+ }
+
+ /* Terminate the token to complete the argv variable */
+ *pbegin = '\0';
+
+ /* We've inserted an extra parameter, so bump the count */
+ argc++;
+
+ /* Move to the next character in the string of tokens */
+ pbegin++;
+
+ /* Throw away any extra separator chars between tokens */
+ for (; *pbegin && strchr(g_token_separator, *pbegin) != NULL; pbegin++);
+
+ /* Prepare to loop again on the next argument token */
+ argv[argc] = pbegin;
+ }
+ }
+#endif /* CONFIG_NSH_ENABLEPX4PARSING */
}
+ /* Last argument vector must be empty */
argv[argc] = NULL;
/* Check if the command should run in background */

View File

@ -1,56 +0,0 @@
diff --git NuttX/nuttx/tools/mkexport.sh NuttX/nuttx/tools/mkexport.sh
index 348a14c..3cc9182 100755
--- NuttX/nuttx/tools/mkexport.sh
+++ NuttX/nuttx/tools/mkexport.sh
@@ -34,19 +34,23 @@
# Get the input parameter list
-USAGE="USAGE: $0 [-d] [-z] [-u] [-w|wy|wn] -t <top-dir> [-x <lib-ext>] -l \"lib1 [lib2 [lib3 ...]]\""
+USAGE="USAGE: $0 [-d] [-e] [-z] [-u] [-w|wy|wn] -t <top-dir> [-x <lib-ext>] -l \"lib1 [lib2 [lib3 ...]]\""
unset TOPDIR
unset LIBLIST
unset TGZ
USRONLY=n
WINTOOL=n
LIBEXT=.a
+INSITU=y
while [ ! -z "$1" ]; do
case $1 in
-d )
set -x
;;
+ -e )
+ INSITU=n
+ ;;
-l )
shift
LIBLIST=$1
@@ -373,13 +377,17 @@ done
cd "${TOPDIR}" || \
{ echo "MK: 'cd ${TOPDIR}' failed"; exit 1; }
-if [ "X${TGZ}" = "Xy" ]; then
- tar cvf "${EXPORTSUBDIR}.tar" "${EXPORTSUBDIR}" 1>/dev/null 2>&1
- gzip -f "${EXPORTSUBDIR}.tar"
-else
- zip -r "${EXPORTSUBDIR}.zip" "${EXPORTSUBDIR}" 1>/dev/null 2>&1
-fi
+# Should we leave the export insitu
+
+if [ "X${INSITU}" = "Xn" ]; then
+ if [ "X${TGZ}" = "Xy" ]; then
+ tar cvf "${EXPORTSUBDIR}.tar" "${EXPORTSUBDIR}" 1>/dev/null 2>&1
+ gzip -f "${EXPORTSUBDIR}.tar"
+ else
+ zip -r "${EXPORTSUBDIR}.zip" "${EXPORTSUBDIR}" 1>/dev/null 2>&1
+ fi
-# Clean up after ourselves
+ # Clean up after ourselves
-rm -rf "${EXPORTSUBDIR}"
+ rm -rf "${EXPORTSUBDIR}"
+fi
\ No newline at end of file

View File

@ -1,24 +0,0 @@
diff --git NuttX/nuttx/include/cxx/cstdint NuttX/nuttx/include/cxx/cstdint
index d662c5d..95334e9 100644
--- NuttX/nuttx/include/cxx/cstdint
+++ NuttX/nuttx/include/cxx/cstdint
@@ -46,6 +46,9 @@
// Namespace
//***************************************************************************
+ #define GCC_VERSION (__GNUC__ * 10000 \
+ + __GNUC_MINOR__ * 100 \
+ + __GNUC_PATCHLEVEL__)
namespace std
{
using ::int8_t;
@@ -72,7 +75,9 @@ namespace std
using ::uint_fast64_t;
using ::uint_least8_t;
using ::uint_least16_t;
+#if GCC_VERSION <= 40804
using ::uint_least32_t;
+#endif
using ::uint_least64_t;
using ::uintmax_t;
using ::uintptr_t;

View File

@ -1,40 +0,0 @@
diff --git NuttX/apps/Makefile NuttX/apps/Makefile
index 4093b0e..3bdc36a 100644
--- NuttX/apps/Makefile
+++ NuttX/apps/Makefile
@@ -79,13 +79,13 @@ all: $(BIN)
.PHONY: import install dirlinks context context_serialize context_rest .depdirs preconfig depend clean distclean
define MAKE_template
- $(Q) cd $(1) && $(MAKE) $(2) TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)" BIN_DIR="$(BIN_DIR)"
+ +$(Q) cd $(1) && $(MAKE) $(2) TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)" BIN_DIR="$(BIN_DIR)"
endef
define SDIR_template
$(1)_$(2):
- $(Q) cd $(1) && $(MAKE) $(2) TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)" BIN_DIR="$(BIN_DIR)"
+ +$(Q) cd $(1) && $(MAKE) $(2) TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)" BIN_DIR="$(BIN_DIR)"
endef
@@ -108,7 +108,7 @@ install: $(BIN_DIR) .install
.import: $(BIN) install
import:
- $(Q) $(MAKE) .import TOPDIR="$(APPDIR)$(DELIM)import"
+ +$(Q) $(MAKE) .import TOPDIR="$(APPDIR)$(DELIM)import"
dirlinks:
$(Q) $(MAKE) -C platform dirlinks TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)"
@@ -116,8 +116,8 @@ dirlinks:
context_rest: $(foreach SDIR, $(CONFIGURED_APPS), $(SDIR)_context)
context_serialize:
- $(Q) $(MAKE) -C builtin context TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)"
- $(Q) $(MAKE) context_rest
+ +$(Q) $(MAKE) -C builtin context TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)"
+ +$(Q) $(MAKE) context_rest
context: context_serialize

View File

@ -1,13 +0,0 @@
diff --git NuttX/nuttx/include/assert.h NuttX/nuttx/include/assert.h
index 88254f6..b9fb6c2 100644
--- NuttX/nuttx/include/assert.h
+++ NuttX/nuttx/include/assert.h
@@ -94,7 +94,7 @@
*/
#ifndef __cplusplus
-# define static_assert _Static_assert
+//# define static_assert _Static_assert
#endif
/****************************************************************************

View File

@ -1,20 +0,0 @@
diff --git NuttX/nuttx/include/ctype.h NuttX/nuttx/include/ctype.h
index dcf918b..65706b7 100644
--- NuttX/nuttx/include/ctype.h
+++ NuttX/nuttx/include/ctype.h
@@ -50,6 +50,8 @@
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow"
/****************************************************************************
* Name: isspace
@@ -340,5 +342,6 @@ extern "C"
#ifdef __cplusplus
}
#endif
+#pragma GCC diagnostic pop
#endif /* __INCLUDE_CTYPE_H */

View File

@ -1,60 +0,0 @@
diff --git NuttX/nuttx/sched/irq/irq.h NuttX/nuttx/sched/irq/irq.h
index ffb6e98..f01318b 100644
--- NuttX/nuttx/sched/irq/irq.h
+++ NuttX/nuttx/sched/irq/irq.h
@@ -72,7 +72,9 @@
struct irq_info_s
{
xcpt_t handler; /* Address of the interrupt handler */
+#if !defined(CONFIG_NOIRQARGS)
FAR void *arg; /* The argument provided to the interrupt handler. */
+#endif
};
/****************************************************************************
diff --git NuttX/nuttx/sched/irq/irq_attach.c NuttX/nuttx/sched/irq/irq_attach.c
index 9d45d9c..3707906 100644
--- NuttX/nuttx/sched/irq/irq_attach.c
+++ NuttX/nuttx/sched/irq/irq_attach.c
@@ -112,7 +112,11 @@ int irq_attach(int irq, xcpt_t isr, FAR void *arg)
/* Save the new ISR and its argument in the table. */
g_irqvector[ndx].handler = isr;
+#if defined(CONFIG_NOIRQARGS)
+ ASSERT(arg == NULL);
+#else
g_irqvector[ndx].arg = arg;
+#endif
leave_critical_section(flags);
ret = OK;
diff --git NuttX/nuttx/sched/irq/irq_dispatch.c NuttX/nuttx/sched/irq/irq_dispatch.c
index b507c06..66cb1fe 100644
--- NuttX/nuttx/sched/irq/irq_dispatch.c
+++ NuttX/nuttx/sched/irq/irq_dispatch.c
@@ -88,7 +88,11 @@ void irq_dispatch(int irq, FAR void *context)
}
#else
vector = g_irqvector[irq].handler;
- arg = g_irqvector[irq].arg;
+# if defined(CONFIG_NOIRQARGS)
+ arg = NULL;
+# else
+ arg = g_irqvector[irq].arg;
+# endif
#endif
}
diff --git NuttX/nuttx/sched/irq/irq_initialize.c NuttX/nuttx/sched/irq/irq_initialize.c
index 18bbafc..2018788 100644
--- NuttX/nuttx/sched/irq/irq_initialize.c
+++ NuttX/nuttx/sched/irq/irq_initialize.c
@@ -88,6 +88,8 @@ void irq_initialize(void)
for (i = 0; i < TAB_SIZE; i++)
{
g_irqvector[i].handler = irq_unexpected_isr;
+#if !defined(CONFIG_NOIRQARGS)
g_irqvector[i].arg = NULL;
+#endif
}
}

View File

@ -1,222 +0,0 @@
diff --git NuttX/nuttx/arch/arm/src/stm32/stm32_serial.c NuttX/nuttx/arch/arm/src/stm32/stm32_serial.c
index a6a2d07..ea8ba61 100644
--- NuttX/nuttx/arch/arm/src/stm32/stm32_serial.c
+++ NuttX/nuttx/arch/arm/src/stm32/stm32_serial.c
@@ -315,6 +315,9 @@ struct up_dev_s
const unsigned int rxdma_channel; /* DMA channel assigned */
#endif
+#if defined(CONFIG_NOIRQARGS)
+ int (*const vector)(int irq, void *context, void *arg); /* Interrupt handler */
+#endif
/* RX DMA state */
#ifdef SERIAL_HAVE_DMA
@@ -371,6 +374,32 @@ static int up_pm_prepare(struct pm_callback_s *cb, int domain,
enum pm_state_e pmstate);
#endif
+#if defined(CONFIG_NOIRQARGS)
+# ifdef CONFIG_STM32_USART1_SERIALDRIVER
+static int up_interrupt_usart1(int irq, void *context, void *arg);
+# endif
+# ifdef CONFIG_STM32_USART2_SERIALDRIVER
+static int up_interrupt_usart2(int irq, void *context, void *arg);
+# endif
+# ifdef CONFIG_STM32_USART3_SERIALDRIVER
+static int up_interrupt_usart3(int irq, void *context, void *arg);
+# endif
+# ifdef CONFIG_STM32_UART4_SERIALDRIVER
+static int up_interrupt_uart4(int irq, void *context, void *arg);
+# endif
+# ifdef CONFIG_STM32_UART5_SERIALDRIVER
+static int up_interrupt_uart5(int irq, void *context, void *arg);
+# endif
+# ifdef CONFIG_STM32_USART6_SERIALDRIVER
+static int up_interrupt_usart6(int irq, void *context, void *arg);
+# endif
+# ifdef CONFIG_STM32_UART7_SERIALDRIVER
+static int up_interrupt_uart7(int irq, void *context, void *arg);
+# endif
+# ifdef CONFIG_STM32_UART8_SERIALDRIVER
+static int up_interrupt_uart8(int irq, void *context, void *arg);
+# endif
+#endif
/****************************************************************************
* Private Data
****************************************************************************/
@@ -536,7 +565,9 @@ static struct up_dev_s g_usart1priv =
.rxdma_channel = DMAMAP_USART1_RX,
.rxfifo = g_usart1rxfifo,
#endif
-
+#if defined(CONFIG_NOIRQARGS)
+ .vector = up_interrupt_usart1,
+#endif
#ifdef CONFIG_USART1_RS485
.rs485_dir_gpio = GPIO_USART1_RS485_DIR,
# if (CONFIG_USART1_RS485_DIR_POLARITY == 0)
@@ -597,6 +628,9 @@ static struct up_dev_s g_usart2priv =
.rxdma_channel = DMAMAP_USART2_RX,
.rxfifo = g_usart2rxfifo,
#endif
+#if defined(CONFIG_NOIRQARGS)
+ .vector = up_interrupt_usart2,
+#endif
#ifdef CONFIG_USART2_RS485
.rs485_dir_gpio = GPIO_USART2_RS485_DIR,
@@ -658,6 +692,9 @@ static struct up_dev_s g_usart3priv =
.rxdma_channel = DMAMAP_USART3_RX,
.rxfifo = g_usart3rxfifo,
#endif
+#if defined(CONFIG_NOIRQARGS)
+ .vector = up_interrupt_usart3,
+#endif
#ifdef CONFIG_USART3_RS485
.rs485_dir_gpio = GPIO_USART3_RS485_DIR,
@@ -723,6 +760,9 @@ static struct up_dev_s g_uart4priv =
.rxdma_channel = DMAMAP_UART4_RX,
.rxfifo = g_uart4rxfifo,
#endif
+#if defined(CONFIG_NOIRQARGS)
+ .vector = up_interrupt_uart4,
+#endif
#ifdef CONFIG_UART4_RS485
.rs485_dir_gpio = GPIO_UART4_RS485_DIR,
@@ -788,6 +828,9 @@ static struct up_dev_s g_uart5priv =
.rxdma_channel = DMAMAP_UART5_RX,
.rxfifo = g_uart5rxfifo,
#endif
+#if defined(CONFIG_NOIRQARGS)
+ .vector = up_interrupt_uart5,
+#endif
#ifdef CONFIG_UART5_RS485
.rs485_dir_gpio = GPIO_UART5_RS485_DIR,
@@ -849,6 +892,9 @@ static struct up_dev_s g_usart6priv =
.rxdma_channel = DMAMAP_USART6_RX,
.rxfifo = g_usart6rxfifo,
#endif
+#if defined(CONFIG_NOIRQARGS)
+ .vector = up_interrupt_uart6,
+#endif
#ifdef CONFIG_USART6_RS485
.rs485_dir_gpio = GPIO_USART6_RS485_DIR,
@@ -910,6 +956,9 @@ static struct up_dev_s g_uart7priv =
.rxdma_channel = DMAMAP_UART7_RX,
.rxfifo = g_uart7rxfifo,
#endif
+#if defined(CONFIG_NOIRQARGS)
+ .vector = up_interrupt_uart7,
+#endif
#ifdef CONFIG_UART7_RS485
.rs485_dir_gpio = GPIO_UART7_RS485_DIR,
@@ -971,6 +1020,9 @@ static struct up_dev_s g_uart8priv =
.rxdma_channel = DMAMAP_UART8_RX,
.rxfifo = g_uart8rxfifo,
#endif
+#if defined(CONFIG_NOIRQARGS)
+ .vector = up_interrupt_uart8,
+#endif
#ifdef CONFIG_UART8_RS485
.rs485_dir_gpio = GPIO_UART8_RS485_DIR,
@@ -1709,7 +1761,11 @@ static int up_attach(struct uart_dev_s *dev)
/* Attach and enable the IRQ */
+#if defined(CONFIG_NOIRQARGS)
+ ret = irq_attach(priv->irq, priv->vector, NULL);
+#else
ret = irq_attach(priv->irq, up_interrupt, priv);
+#endif
if (ret == OK)
{
/* Enable the interrupt (RX and TX interrupts are still disabled
@@ -1740,7 +1796,7 @@ static void up_detach(struct uart_dev_s *dev)
}
/****************************************************************************
- * Name: up_interrupt
+ * Name: up_interrupt_common
*
* Description:
* This is the USART interrupt handler. It will be invoked when an
@@ -2480,6 +2536,72 @@ static bool up_txready(struct uart_dev_s *dev)
return ((up_serialin(priv, STM32_USART_SR_OFFSET) & USART_SR_TXE) != 0);
}
+#if defined(CONFIG_NOIRQARGS)
+/****************************************************************************
+ * Name: up_interrupt_u[s]art[n]
+ *
+ * Description:
+ * Interrupt handlers for U[S]ART[n] where n=1,..,6.
+ *
+ ****************************************************************************/
+
+# ifdef CONFIG_STM32_USART1_SERIALDRIVER
+static int up_interrupt_usart1(int irq, void *context, void *arg)
+{
+ return up_interrupt(irq, context, &g_usart1priv);
+}
+# endif
+
+# ifdef CONFIG_STM32_USART2_SERIALDRIVER
+static int up_interrupt_usart2(int irq, void *context, void *arg)
+{
+ return up_interrupt(irq, context, &g_usart2priv);
+}
+# endif
+
+# ifdef CONFIG_STM32_USART3_SERIALDRIVER
+static int up_interrupt_usart3(int irq, void *context, void *arg)
+{
+ return up_interrupt(irq, context, &g_usart3priv);
+}
+# endif
+
+# ifdef CONFIG_STM32_UART4_SERIALDRIVER
+static int up_interrupt_uart4(int irq, void *context, void *arg)
+{
+ return up_interrupt(irq, context, &g_uart4priv);
+}
+# endif
+
+# ifdef CONFIG_STM32_UART5_SERIALDRIVER
+static int up_interrupt_uart5(int irq, void *context, void *arg)
+{
+ return up_interrupt(irq, context, &g_uart5priv);
+}
+# endif
+
+# ifdef CONFIG_STM32_USART6_SERIALDRIVER
+static int up_interrupt_usart6(int irq, void *context, void *arg)
+{
+ return up_interrupt(irq, context, &g_usart6priv);
+}
+# endif
+
+# ifdef CONFIG_STM32_UART7_SERIALDRIVER
+static int up_interrupt_uart7(int irq, void *context, void *arg)
+{
+ return up_interrupt(irq, context, &g_uart7priv);
+}
+# endif
+
+# ifdef CONFIG_STM32_UART8_SERIALDRIVER
+static int up_interrupt_uart8(int irq, void *context, void *arg)
+{
+ return up_interrupt(irq, context, &g_uart8priv);
+}
+# endif
+#endif
+
/****************************************************************************
* Name: up_dma_rxcallback
*

View File

@ -0,0 +1,215 @@
cmake_minimum_required(VERSION 3.2)
if(NOT BOARD)
message(FATAL_ERROR "BOARD must be set (eg px4fmu-v2)")
endif()
if(NOT nuttx_config_type)
# default to nsh if not specified
set(nuttx_config_type "nsh")
endif()
project(NuttX_${BOARD} LANGUAGES ASM C CXX)
message(STATUS "NuttX: " ${BOARD} " " ${nuttx_config_type} " " ${CMAKE_SYSTEM_PROCESSOR})
if (CMAKE_HOST_APPLE OR TRUE)
# copy with rsync and create file dependencies
set(cp_cmd "rsync")
set(cp_opts)
list(APPEND cp_opts
-rp
--inplace
)
else()
# copy with hard links
# archive, recursive, force, link (hardlinks)
set(cp_cmd "cp")
set(cp_opts "-aRfl")
endif()
file(GLOB_RECURSE copy_nuttx_files
LIST_DIRECTORIES false
${CMAKE_CURRENT_SOURCE_DIR}/nuttx/*)
file(GLOB_RECURSE copy_apps_files
LIST_DIRECTORIES false
${CMAKE_CURRENT_SOURCE_DIR}/apps/*)
# copy nuttx to build directory
add_custom_command(OUTPUT nuttx_copy.stamp
COMMAND ${cp_cmd} ${cp_opts} ${CMAKE_CURRENT_SOURCE_DIR}/nuttx ${CMAKE_CURRENT_BINARY_DIR}
COMMAND cmake -E touch nuttx_copy.stamp
DEPENDS ${copy_nuttx_files}
COMMENT "Copying NuttX/nuttx to ${CMAKE_CURRENT_BINARY_DIR}"
)
set(NUTTX_DIR ${CMAKE_CURRENT_BINARY_DIR}/nuttx)
set(NUTTX_CONFIG_DIR ${PX4_SOURCE_DIR}/nuttx-configs)
# copy apps to build directory
add_custom_command(OUTPUT apps_copy.stamp
COMMAND ${cp_cmd} ${cp_opts} ${CMAKE_CURRENT_SOURCE_DIR}/apps ${CMAKE_CURRENT_BINARY_DIR}
COMMAND cmake -E touch apps_copy.stamp
DEPENDS ${copy_apps_files}
COMMENT "Copying NuttX/apps to ${CMAKE_CURRENT_BINARY_DIR}"
)
set(APPS_DIR ${CMAKE_CURRENT_BINARY_DIR}/apps)
# copy PX4 board config into nuttx
file(GLOB_RECURSE board_config_files ${NUTTX_CONFIG_DIR}/${BOARD})
add_custom_command(OUTPUT
${NUTTX_DIR}/PX4_Config.mk
${NUTTX_DIR}/PX4_Warnings.mk
${NUTTX_DIR}/.config
${NUTTX_DIR}/Make.defs
${NUTTX_DIR}/configs/${BOARD}/${nuttx_config_type}/defconfig
COMMAND ${CMAKE_COMMAND} -E copy ${NUTTX_CONFIG_DIR}/PX4_Config.mk ${NUTTX_DIR}/PX4_Config.mk
COMMAND ${CMAKE_COMMAND} -E copy ${NUTTX_CONFIG_DIR}/PX4_Warnings.mk ${NUTTX_DIR}/PX4_Warnings.mk
COMMAND ${CMAKE_COMMAND} -E copy ${NUTTX_CONFIG_DIR}/${BOARD}/${nuttx_config_type}/defconfig ${NUTTX_DIR}/.config
COMMAND ${CMAKE_COMMAND} -E remove -f ${NUTTX_DIR}/include/nuttx/config.h
COMMAND ${CMAKE_COMMAND} -E copy ${NUTTX_CONFIG_DIR}/${BOARD}/${nuttx_config_type}/Make.defs ${NUTTX_DIR}/Make.defs
COMMAND ${cp_cmd} ${cp_opts} ${NUTTX_CONFIG_DIR}/${BOARD} ${NUTTX_DIR}/configs/
DEPENDS
${NUTTX_CONFIG_DIR}/PX4_Config.mk
${NUTTX_CONFIG_DIR}/PX4_Warnings.mk
${NUTTX_CONFIG_DIR}/${BOARD}/${nuttx_config_type}/defconfig
${NUTTX_CONFIG_DIR}/${BOARD}/${nuttx_config_type}/Make.defs
${board_config_files}
nuttx_copy.stamp apps_copy.stamp
WORKING_DIRECTORY ${NUTTX_DIR}/tools
COMMENT "Copying NuttX config ${BOARD} and configuring"
)
add_custom_target(nuttx_configure DEPENDS ${NUTTX_DIR}/.config)
# context
add_custom_command(OUTPUT ${NUTTX_DIR}/include/nuttx/version.h ${NUTTX_DIR}/include/nuttx/config.h
COMMAND make --no-print-directory --silent context > /dev/null
DEPENDS nuttx_configure ${NUTTX_DIR}/.config
WORKING_DIRECTORY ${NUTTX_DIR}
)
add_custom_target(nuttx_context DEPENDS ${NUTTX_DIR}/include/nuttx/version.h)
# library of NuttX libraries
add_library(nuttx_build INTERFACE)
# builtins
if ("${BOARD}" MATCHES "px4io")
# no apps for px4io
set(nuttx_builtin_list)
else()
# add additional commands to nuttx builtins
set(builtin_registry ${APPS_DIR}/builtin/registry)
set(nuttx_builtin_list)
foreach(module ${module_libraries})
get_target_property(MAIN ${module} MAIN)
get_target_property(STACK_MAIN ${module} STACK_MAIN)
get_target_property(PRIORITY ${module} PRIORITY)
if(MAIN)
add_custom_command(OUTPUT ${builtin_registry}/${MAIN}_main.bdat
COMMAND echo "{ \"${MAIN}\", ${PRIORITY}, ${STACK_MAIN}, ${MAIN}_main }," > ${builtin_registry}/${MAIN}_main.bdat
VERBATIM
)
list(APPEND nuttx_builtin_list ${builtin_registry}/${MAIN}_main.bdat)
add_custom_command(OUTPUT ${builtin_registry}/${MAIN}_main.pdat
COMMAND echo "int ${MAIN}_main(int argc, char *argv[]);" > ${builtin_registry}/${MAIN}_main.pdat
VERBATIM
)
list(APPEND nuttx_builtin_list ${builtin_registry}/${MAIN}_main.pdat)
endif()
endforeach()
endif()
# APPS
# libapps.a
add_custom_command(OUTPUT ${APPS_DIR}/libapps.a
${APPS_DIR}/platform/.built
COMMAND find ${APPS_DIR} -name \*.o -o -name \*.built -delete
COMMAND make --silent --no-print-directory -C ../apps TOPDIR="${NUTTX_DIR}" libapps.a > /dev/null
DEPENDS nuttx_context ${nuttx_builtin_list}
WORKING_DIRECTORY ${NUTTX_DIR}
)
add_custom_target(nuttx_apps_build DEPENDS ${APPS_DIR}/libapps.a)
add_library(nuttx_apps STATIC IMPORTED GLOBAL)
set_property(TARGET nuttx_apps PROPERTY IMPORTED_LOCATION ${APPS_DIR}/libapps.a)
add_dependencies(nuttx_build nuttx_apps_build)
target_link_libraries(nuttx_build INTERFACE nuttx_apps)
# libboard.a
add_custom_command(OUTPUT ${NUTTX_DIR}/arch/arm/src/board/libboard.a
COMMAND make --silent --no-print-directory -C board TOPDIR="${NUTTX_DIR}" libboard.a EXTRADEFINES=-D__KERNEL__ > /dev/null
DEPENDS nuttx_context
WORKING_DIRECTORY ${NUTTX_DIR}/arch/arm/src
)
add_custom_target(nuttx_board_build DEPENDS ${NUTTX_DIR}/arch/arm/src/board/libboard.a)
add_library(nuttx_board STATIC IMPORTED GLOBAL)
set_property(TARGET nuttx_board PROPERTY IMPORTED_LOCATION ${NUTTX_DIR}/arch/arm/src/board/libboard.a)
add_dependencies(nuttx_build nuttx_board_build)
target_link_libraries(nuttx_build INTERFACE nuttx_board)
# helper for all targets
function(add_nuttx_dir nuttx_lib nuttx_lib_dir kernel extra)
file(GLOB_RECURSE nuttx_lib_files
LIST_DIRECTORIES false
${CMAKE_CURRENT_SOURCE_DIR}/nuttx/${nuttx_lib_dir}/*)
add_custom_command(OUTPUT ${NUTTX_DIR}/${nuttx_lib_dir}/lib${nuttx_lib}.a
COMMAND find ${nuttx_lib_dir} -type f -name *.o -o -name .built -delete
COMMAND make -C ${nuttx_lib_dir} -j2 --silent --no-print-directory lib${nuttx_lib}.a TOPDIR="${NUTTX_DIR}" KERNEL=${kernel} EXTRADEFINES=${extra} > /dev/null
DEPENDS ${nuttx_lib_files} nuttx_context
WORKING_DIRECTORY ${NUTTX_DIR}
)
add_custom_target(nuttx_${nuttx_lib}_build DEPENDS ${NUTTX_DIR}/${nuttx_lib_dir}/lib${nuttx_lib}.a)
add_library(nuttx_${nuttx_lib} STATIC IMPORTED GLOBAL)
set_property(TARGET nuttx_${nuttx_lib} PROPERTY IMPORTED_LOCATION ${NUTTX_DIR}/${nuttx_lib_dir}/lib${nuttx_lib}.a)
add_dependencies(nuttx_build nuttx_${nuttx_lib}_build)
target_link_libraries(nuttx_build INTERFACE nuttx_${nuttx_lib})
endfunction()
# add_nuttx_dir(NAME DIRECTORY KERNEL EXTRA)
add_nuttx_dir(arch arch/arm/src y -D__KERNEL__)
add_nuttx_dir(binfmt binfmt y -D__KERNEL__)
add_nuttx_dir(configs configs y -D__KERNEL__)
add_nuttx_dir(drivers drivers y -D__KERNEL__)
add_nuttx_dir(fs fs y -D__KERNEL__)
add_nuttx_dir(sched sched y -D__KERNEL__)
add_nuttx_dir(c libc n "")
add_nuttx_dir(cxx libxx n "")
add_nuttx_dir(mm mm n "")
# oldconfig helper
add_custom_target(oldconfig
COMMAND make --no-print-directory -C ${NUTTX_DIR} CONFIG_ARCH_BOARD=${BOARD} oldconfig
COMMAND cp ${NUTTX_DIR}/.config ${NUTTX_CONFIG_DIR}/${BOARD}/${nuttx_config_type}/defconfig
COMMAND ${PX4_SOURCE_DIR}/Tools/nuttx_defconf_tool.sh ${NUTTX_CONFIG_DIR}/${BOARD}/${nuttx_config_type}/defconfig
DEPENDS nuttx_configure
WORKING_DIRECTORY ${NUTTX_DIR}
COMMENT "Running NuttX make oldconfig for ${BOARD} with ${nuttx_config_type}"
USES_TERMINAL
)
# menuconfig helper
add_custom_target(menuconfig
COMMAND make --no-print-directory -C ${NUTTX_DIR} CONFIG_ARCH_BOARD=${BOARD} menuconfig
COMMAND cp ${NUTTX_DIR}/nuttx/.config ${NUTTX_CONFIG_DIR}/${BOARD}/${nuttx_config_type}/defconfig
COMMAND ${PX4_SOURCE_DIR}/Tools/nuttx_defconf_tool.sh ${NUTTX_CONFIG_DIR}/${BOARD}/${nuttx_config_type}/defconfig
DEPENDS nuttx_configure
WORKING_DIRECTORY ${NUTTX_DIR}
COMMENT "Running NuttX make menuconfig for ${BOARD} with ${nuttx_config_type}"
USES_TERMINAL
)
# qconfig helper
add_custom_target(qconfig
COMMAND make --no-print-directory -C ${NUTTX_DIR} CONFIG_ARCH_BOARD=${BOARD} qconfig
COMMAND cp .config ${NUTTX_CONFIG_DIR}/${BOARD}/${nuttx_config_type}/defconfig
DEPENDS nuttx_configure
WORKING_DIRECTORY ${NUTTX_DIR}
COMMENT "Running NuttX make qconfig for ${BOARD} with ${nuttx_config_type}"
USES_TERMINAL
)

@ -0,0 +1 @@
Subproject commit 42dbbb2038c83532e367c6813f0ece691ea04524

@ -0,0 +1 @@
Subproject commit 94da3bef49efaacee7ec5b1a1aa237c3e2915163

View File

@ -38,4 +38,3 @@ px4_add_module(
DEPENDS
platforms__common
)
# vim: set noet ft=cmake fenc=utf-8 ff=unix :

View File

@ -39,4 +39,3 @@ px4_add_module(
DEPENDS
platforms__common
)
# vim: set noet ft=cmake fenc=utf-8 ff=unix :

View File

@ -308,10 +308,6 @@ BMI160::accel_set_sample_rate(float frequency)
setbits |= BMI_ACCEL_RATE_25_16;
_accel_sample_rate = 25 / 16;
} else if (frequency <= 25 / 16) {
setbits |= BMI_ACCEL_RATE_25_16;
_accel_sample_rate = 25 / 16;
} else if (frequency <= 25 / 8) {
setbits |= BMI_ACCEL_RATE_25_8;
_accel_sample_rate = 25 / 8;

View File

@ -1,6 +1,6 @@
############################################################################
#
# Copyright (c) 2012, 2013 PX4 Development Team. All rights reserved.
# Copyright (c) 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
@ -31,14 +31,11 @@
#
############################################################################
#
# STM32 ADC driver
#
if (BOARD)
add_subdirectory(common)
add_subdirectory(${BOARD})
else()
message(FATAL_ERROR "BOARD not defined")
endif()
MODULE_COMMAND = adc
SRCS = adc.cpp
INCLUDE_DIRS += $(NUTTX_SRC)/arch/arm/src/stm32 $(NUTTX_SRC)/arch/arm/src/common
MAXOPTIMIZATION = -Os

View File

@ -32,12 +32,7 @@
############################################################################
px4_add_module(
MODULE drivers__boards__aerocore
COMPILE_FLAGS
SRCS
../common/board_dma_alloc.c
../common/stm32/board_reset.c
../common/stm32/board_identity.c
../common/stm32/board_mcu_version.c
aerocore_init.c
aerocore_timer_config.c
aerocore_spi.c
@ -45,4 +40,3 @@ px4_add_module(
DEPENDS
platforms__common
)
# vim: set noet ft=cmake fenc=utf-8 ff=unix :

View File

@ -32,12 +32,7 @@
############################################################################
px4_add_module(
MODULE drivers__boards__aerocore2
COMPILE_FLAGS
SRCS
../common/board_dma_alloc.c
../common/stm32/board_reset.c
../common/stm32/board_identity.c
../common/stm32/board_mcu_version.c
aerocore2_can.c
aerocore2_init.c
aerocore2_timer_config.c
@ -47,4 +42,3 @@ px4_add_module(
DEPENDS
platforms__common
)
# vim: set noet ft=cmake fenc=utf-8 ff=unix :

View File

@ -33,11 +33,7 @@
############################################################################
px4_add_module(
MODULE drivers__boards__aerofc-v1
COMPILE_FLAGS
SRCS
../common/stm32/board_reset.c
../common/stm32/board_identity.c
../common/stm32/board_mcu_version.c
aerofc_init.c
aerofc_spi.c
aerofc_led.c
@ -45,4 +41,3 @@ px4_add_module(
DEPENDS
platforms__common
)
# vim: set noet ft=cmake fenc=utf-8 ff=unix :

View File

@ -397,10 +397,3 @@ __EXPORT int board_app_initialize(uintptr_t arg)
return OK;
}
__EXPORT void board_crashdump(uintptr_t currentsp, FAR void *tcb, FAR const uint8_t *filename, int lineno)
{
#if defined(CONFIG_BOARD_RESET_ON_CRASH)
board_reset(0);
#endif
}

View File

@ -150,6 +150,8 @@
#define MEMORY_CONSTRAINED_SYSTEM
#define CRASHDUMP_RESET_ONLY
__BEGIN_DECLS
/****************************************************************************************************

View File

@ -32,13 +32,7 @@
############################################################################
px4_add_module(
MODULE drivers__boards__auav-x21
COMPILE_FLAGS
SRCS
../common/board_crashdump.c
../common/board_dma_alloc.c
../common/stm32/board_reset.c
../common/stm32/board_identity.c
../common/stm32/board_mcu_version.c
auav_can.c
auav_init.c
auav_timer_config.c
@ -48,4 +42,3 @@ px4_add_module(
DEPENDS
platforms__common
)
# vim: set noet ft=cmake fenc=utf-8 ff=unix :

View File

@ -31,32 +31,22 @@
#
############################################################################
set(nuttx_patches
00001-REJECTED-add-math.h.patch
00002-REJECTED-fix-shadow-wanings.patch
00003-REJECTED-add-var-expansion-in-nsh-parse.patch
00004-REJECTED-avoid-export-copy-with-export-insitu.patch
00006-REJECTED-cstdint-fix.patch
00007-REJECTED-silence-jobserver-warnings.patch
00008-REJECTED-static-assert-fix.patch
00009-REJECTED-ctype-fix-shadow-wanings.patch
00010-REJECTED-no-irq-args.patch
00011-REJECTED-stm32_serial_no_irq_args.patch
90000-PENDING-wip-inflight-to-upstream.patch
if (${OS} MATCHES "nuttx")
if (NOT ${LABEL} STREQUAL "bootloader")
px4_add_library(boards_common
board_crashdump.c
board_dma_alloc.c
board_gpio_init.c
)
# add absolute path and sort
set(px4_nuttx_patches)
foreach(patch_file ${nuttx_patches})
list(APPEND px4_nuttx_patches ${CMAKE_CURRENT_SOURCE_DIR}/${patch_file})
endforeach()
list(SORT px4_nuttx_patches)
set(px4_nuttx_patches ${px4_nuttx_patches} PARENT_SCOPE)
file(GLOB patches_found *.patch)
foreach(patch_file ${patches_found})
list (FIND px4_nuttx_patches ${patch_file} _index)
if (${_index} EQUAL -1)
message(FATAL_ERROR "${patch_file} missing from nuttx-patches/CMakeLists.txt")
add_dependencies(boards_common nuttx_build)
endif()
if (${CONFIG_ARCH_CHIP} MATCHES "kinetis")
add_subdirectory(kinetis)
elseif (${CONFIG_ARCH_CHIP} MATCHES "samv7")
add_subdirectory(samv7)
elseif (${CONFIG_ARCH_CHIP} MATCHES "stm32")
add_subdirectory(stm32)
endif()
endif()
endforeach()

View File

@ -1,3 +1,5 @@
#ifdef CONFIG_BOARD_CRASHDUMP
#include <px4_config.h>
#include <px4_tasks.h>
@ -21,8 +23,10 @@ static uint32_t *__attribute__((noinline)) __sdata_addr(void)
return &_sdata;
}
__EXPORT void board_crashdump(uintptr_t currentsp, FAR void *tcb, FAR const uint8_t *filename, int lineno)
{
#ifndef CRASHDUMP_RESET_ONLY
/* 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
@ -162,7 +166,11 @@ __EXPORT void board_crashdump(uintptr_t currentsp, FAR void *tcb, FAR const uint
up_lowputc('!');
}
#endif /* CRASHDUMP_RESET_ONLY */
#if defined(CONFIG_BOARD_RESET_ON_CRASH)
board_reset(0);
#endif
}
#endif /* CONFIG_BOARD_CRASHDUMP */

View File

@ -0,0 +1,39 @@
############################################################################
#
# Copyright (c) 2017 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.
#
############################################################################
px4_add_library(board_kinetis
board_identity.c
board_mcu_version.c
board_reset.c
)
add_dependencies(board_kinetis nuttx_build)

View File

@ -0,0 +1,39 @@
############################################################################
#
# Copyright (c) 2017 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.
#
############################################################################
px4_add_library(board_samv7
board_identity.c
board_mcu_version.c
board_reset.c
)
add_dependencies(board_samv7 nuttx_build)

View File

@ -0,0 +1,46 @@
############################################################################
#
# Copyright (c) 2017 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.
#
############################################################################
set(SRCS
board_identity.c
)
if (NOT ${LABEL} STREQUAL "bootloader")
list(APPEND SRCS
board_mcu_version.c
board_reset.c
)
endif()
px4_add_library(board_stm32 ${SRCS})
add_dependencies(board_stm32 nuttx_build)

View File

@ -33,11 +33,6 @@
px4_add_module(
MODULE drivers__boards__crazyflie
SRCS
../common/board_crashdump.c
../common/board_dma_alloc.c
../common/stm32/board_reset.c
../common/stm32/board_identity.c
../common/stm32/board_mcu_version.c
crazyflie_init.c
crazyflie_usb.c
crazyflie_led.c
@ -45,4 +40,3 @@ px4_add_module(
DEPENDS
platforms__common
)
# vim: set noet ft=cmake fenc=utf-8 ff=unix :

View File

@ -0,0 +1,41 @@
############################################################################
#
# Copyright (c) 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.
#
############################################################################
px4_add_module(
MODULE drivers__boards__sitl
COMPILE_FLAGS
SRCS
sitl_led.c
DEPENDS
platforms__common
)
# vim: set noet ft=cmake fenc=utf-8 ff=unix :

View File

@ -34,17 +34,21 @@
/**
* @file board_config.h
*
* EAGLE internal definitions
* SITL internal definitions
*/
#pragma once
#define BOARD_OVERRIDE_UUID "EAGLEID " // must be of length 12 (PX4_CPU_UUID_BYTE_LENGTH)
#define BOARD_OVERRIDE_UUID "EAGLE" // must be of length 12 (PX4_CPU_UUID_BYTE_LENGTH)
#define BOARD_OVERRIDE_MFGUID BOARD_OVERRIDE_UUID
#define BOARD_NAME "EAGLE"
#define BOARD_BATTERY1_V_DIV (10.177939394f)
#define BOARD_BATTERY1_A_PER_V (15.391030303f)
#define BOARD_HAS_NO_RESET
#define BOARD_HAS_NO_BOOTLOADER
#define CONFIG_ARCH_BOARD_SITL 1
/*
* I2C busses

View File

@ -0,0 +1,81 @@
/****************************************************************************
*
* 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.
*
****************************************************************************/
/**
* @file sitl_led.c
*
* sitl LED backend.
*/
#include <px4_config.h>
#include <px4_log.h>
#include <stdbool.h>
__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
static bool _led_state[2] = { false, false };
__EXPORT void led_init()
{
PX4_DEBUG("LED_INIT");
}
__EXPORT void led_on(int led)
{
if (led == 1 || led == 0) {
PX4_DEBUG("LED%d_ON", led);
_led_state[led] = true;
}
}
__EXPORT void led_off(int led)
{
if (led == 1 || led == 0) {
PX4_DEBUG("LED%d_OFF", led);
_led_state[led] = false;
}
}
__EXPORT void led_toggle(int led)
{
if (led == 1 || led == 0) {
_led_state[led] = !_led_state[led];
PX4_DEBUG("LED%d_TOGGLE: %s", led, _led_state[led] ? "ON" : "OFF");
}
}

Some files were not shown because too many files have changed in this diff Show More