purge broken qurt support and atlflight boards

This commit is contained in:
Daniel Agar
2021-07-15 13:17:15 -04:00
parent 4a0fa08953
commit 65745a3676
116 changed files with 58 additions and 11410 deletions
+1 -14
View File
@@ -13,7 +13,6 @@ pipeline {
arm64: "px4io/px4-dev-aarch64:2021-05-04",
base: "px4io/px4-dev-base-bionic:2021-05-04",
nuttx: "px4io/px4-dev-nuttx-focal:2021-05-04",
snapdragon: "lorenzmeier/px4-dev-snapdragon:2020-04-01"
]
def armhf_builds = [
@@ -106,14 +105,8 @@ pipeline {
archive: true
]
def snapdragon_builds = [
target: ["atlflight_eagle_qurt", "atlflight_eagle_default"],
image: docker_images.snapdragon,
archive: false
]
def docker_builds = [
armhf_builds, base_builds, nuttx_builds_archive//, snapdragon_builds
armhf_builds, base_builds, nuttx_builds_archive
]
for (def build_type = 0; build_type < docker_builds.size(); build_type++) {
@@ -165,12 +158,6 @@ pipeline {
def createBuildNode(Boolean archive, String docker_image, String target) {
return {
// TODO: fix the snapdragon image
bypass_entrypoint = ''
if (docker_image == 'lorenzmeier/px4-dev-snapdragon:2020-04-01') {
bypass_entrypoint = ' --entrypoint=""'
}
node {
docker.withRegistry('https://registry.hub.docker.com', 'docker_hub_dagar') {
docker.image(docker_image).inside('-e CCACHE_BASEDIR=${WORKSPACE} -v ${CCACHE_DIR}:${CCACHE_DIR}:rw' + bypass_entrypoint) {
-7
View File
@@ -18,10 +18,6 @@
path = src/lib/matrix
url = https://github.com/PX4/PX4-Matrix.git
branch = master
[submodule "boards/atlflight/cmake_hexagon"]
path = boards/atlflight/cmake_hexagon
url = https://github.com/PX4/cmake_hexagon.git
branch = px4
[submodule "src/drivers/gps/devices"]
path = src/drivers/gps/devices
url = https://github.com/PX4/PX4-GPSDrivers.git
@@ -38,9 +34,6 @@
path = platforms/nuttx/NuttX/apps
url = https://github.com/PX4/NuttX-apps.git
branch = px4_firmware_nuttx-10.0.0+
[submodule "platforms/qurt/dspal"]
path = platforms/qurt/dspal
url = https://github.com/ATLFlight/dspal.git
[submodule "Tools/flightgear_bridge"]
path = Tools/flightgear_bridge
url = https://github.com/PX4/PX4-FlightGear-Bridge.git
+2 -12
View File
@@ -214,7 +214,7 @@ define colorecho
endef
# Get a list of all config targets boards/*/*.cmake
ALL_CONFIG_TARGETS := $(shell find boards -maxdepth 3 -mindepth 3 ! -name '*common*' ! -name '*sdflight*' -name '*.cmake' -print | sed -e 's|boards\/||' | sed -e 's|\.cmake||' | sed -e 's|\/|_|g' | sort)
ALL_CONFIG_TARGETS := $(shell find boards -maxdepth 3 -mindepth 3 -name '*.cmake' -print | sed -e 's|boards\/||' | sed -e 's|\.cmake||' | sed -e 's|\/|_|g' | sort)
# ADD CONFIGS HERE
# --------------------------------------------------------------------
@@ -240,16 +240,6 @@ endef
# All targets with just dependencies but no recipe must either be marked as phony (or have the special @: as recipe).
.PHONY: all px4_sitl_default all_config_targets all_default_targets
# Multi- config targets.
eagle_default: atlflight_eagle_default atlflight_eagle_qurt
eagle_rtps: atlflight_eagle_rtps atlflight_eagle_qurt-rtps
excelsior_default: atlflight_excelsior_default atlflight_excelsior_qurt
excelsior_rtps: atlflight_excelsior_rtps atlflight_excelsior_qurt-rtps
.PHONY: eagle_default eagle_rtps
.PHONY: excelsior_default excelsior_rtps
# Other targets
# --------------------------------------------------------------------
@@ -512,7 +502,7 @@ help:
@echo "Where <target> is one of:"
@$(MAKE) -pRrq -f $(lastword $(MAKEFILE_LIST)) : 2>/dev/null | \
awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' | sort | \
egrep -v -e '^[^[:alnum:]]' -e '^($(subst $(space),|,$(ALL_CONFIG_TARGETS)))$$' -e '_default$$' -e '^(posix|eagle|Makefile)'
egrep -v -e '^[^[:alnum:]]' -e '^($(subst $(space),|,$(ALL_CONFIG_TARGETS)))$$' -e '_default$$' -e '^(Makefile)'
@echo
@echo "Or, $(MAKE) <config_target> [<make_target(s)>]"
@echo "Use '$(MAKE) list_config_targets' for a list of configuration targets."
+1 -1
View File
@@ -8,7 +8,7 @@
This repository holds the [PX4](http://px4.io) flight control solution for drones, with the main applications located in the [src/modules](https://github.com/PX4/PX4-Autopilot/tree/master/src/modules) directory. It also contains the PX4 Drone Middleware Platform, which provides drivers and middleware to run drones.
PX4 is highly portable, OS-independent and supports Linux, NuttX and QuRT out of the box.
PX4 is highly portable, OS-independent and supports Linux, NuttX and MacOS out of the box.
* Official Website: http://px4.io (License: BSD 3-clause, [LICENSE](https://github.com/PX4/PX4-Autopilot/blob/master/LICENSE))
* [Supported airframes](https://docs.px4.io/master/en/airframes/airframe_reference.html) ([portfolio](http://px4.io/#airframes)):
-3
View File
@@ -11,9 +11,6 @@ if [ -z ${PX4_DOCKER_REPO+x} ]; then
elif [[ $@ =~ .*pilotpi.arm64 ]]; then
# scumaker_pilotpi_arm64
PX4_DOCKER_REPO="px4io/px4-dev-aarch64:latest"
elif [[ $@ =~ .*eagle.* ]] || [[ $@ =~ .*excelsior.* ]]; then
# eagle, excelsior
PX4_DOCKER_REPO="lorenzmeier/px4-dev-snapdragon:2020-04-01"
elif [[ $@ =~ .*navio2.* ]] || [[ $@ =~ .*raspberry.* ]] || [[ $@ =~ .*bebop.* ]]; then
# posix_rpi_cross, posix_bebop_default
PX4_DOCKER_REPO="px4io/px4-dev-armhf:2021-02-04"
-32
View File
@@ -1,32 +0,0 @@
############################################################################
#
# Copyright (c) 2018 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.
#
############################################################################
-64
View File
@@ -1,64 +0,0 @@
############################################################################
#
# Copyright (c) 2020 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.
#
############################################################################
if("${PX4_PLATFORM}" MATCHES "qurt")
add_custom_target(upload
COMMAND ${PX4_BOARD_DIR}/scripts/adb_upload.sh
${PX4_BINARY_DIR}/platforms/qurt/libpx4.so ${PX4_BINARY_DIR}/platforms/qurt/libpx4muorb_skel.so ${PX4_SOURCE_DIR}/posix-configs/eagle/flight/px4.config # source
/usr/share/data/adsp # destination
DEPENDS px4 px4muorb_skel ${PX4_BOARD_DIR}/scripts/adb_upload.sh
COMMENT "uploading px4"
USES_TERMINAL
)
else()
add_custom_target(upload
COMMAND ${PX4_BOARD_DIR}/scripts/adb_upload.sh
${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${PX4_SOURCE_DIR}/posix-configs/eagle/flight/mainapp.config ${PX4_BINARY_DIR}/etc # source
/home/linaro # destination
DEPENDS px4 ${PX4_BOARD_DIR}/scripts/adb_upload.sh
COMMENT "uploading px4"
USES_TERMINAL
)
add_custom_target(sanity
COMMAND ./px4_snapflight_sanitytest.sh -i -t
DEPENDS px4
WORKING_DIRECTORY ${PX4_BOARD_DIR}/scripts
COMMENT "uploading px4"
USES_TERMINAL
)
endif()
-128
View File
@@ -1,128 +0,0 @@
# The Eagle board is the first generation Snapdragon Flight board by Qualcomm.
include(px4_git)
px4_add_git_submodule(TARGET git_cmake_hexagon PATH "${PX4_SOURCE_DIR}/boards/atlflight/cmake_hexagon")
list(APPEND CMAKE_MODULE_PATH
"${PX4_SOURCE_DIR}/boards/atlflight/cmake_hexagon"
"${PX4_SOURCE_DIR}/boards/atlflight/cmake_hexagon/toolchain"
)
# Get $QC_SOC_TARGET from environment if existing.
if (DEFINED ENV{QC_SOC_TARGET})
set(QC_SOC_TARGET $ENV{QC_SOC_TARGET})
else()
set(QC_SOC_TARGET "APQ8074")
endif()
# Disable the creation of the parameters.xml file by scanning individual
# source files, and scan all source files. This will create a parameters.xml
# file that contains all possible parameters, even if the associated module
# is not used. This is necessary for parameter synchronization between the
# ARM and DSP processors.
set(DISABLE_PARAMS_MODULE_SCOPING TRUE)
set(CONFIG_SHMEM "1")
add_definitions(-DORB_COMMUNICATOR)
# atlflight toolchain doesn't properly set the compiler, so these aren't set automatically
add_compile_options($<$<COMPILE_LANGUAGE:C>:-std=gnu99>)
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-std=gnu++11>)
add_definitions(
-D__PX4_POSIX_EAGLE
-D__PX4_LINUX
)
px4_add_board(
PLATFORM posix
VENDOR atlflight
MODEL eagle
LABEL default
TOOLCHAIN arm-linux-gnueabihf
ROMFSROOT px4fmu_common
DRIVERS
#barometer # all available barometer drivers
batt_smbus
camera_trigger
differential_pressure # all available differential pressure drivers
distance_sensor # all available distance sensor drivers
gps
#imu # all available imu drivers
#lights/rgbled
#magnetometer # all available magnetometer drivers
pwm_out_sim
qshell/posix
rc_input
smart_battery/batmon
#telemetry # all available telemetry drivers
MODULES
airspeed_selector
attitude_estimator_q
camera_feedback
commander
dataman
ekf2
events
flight_mode_manager
fw_att_control
fw_pos_control_l1
gyro_calibration
gyro_fft
land_detector
landing_target_estimator
#load_mon
local_position_estimator
logger
mavlink
mc_att_control
mc_hover_thrust_estimator
mc_pos_control
mc_rate_control
#micrortps_bridge
muorb/krait
muorb/test
navigator
rc_update
rover_pos_control
sensors
#sih
temperature_compensation
simulator
vmount
vtol_att_control
SYSTEMCMDS
#bl_update
#dumpfile
esc_calib
#hardfault_log
led_control
mixer
motor_ramp
motor_test
#mtd
#nshterm
param
perf
pwm
sd_bench
shutdown
system_time
#top
topic_listener
tune_control
uorb
ver
work_queue
EXAMPLES
#fake_gps
#fixedwing_control # Tutorial code from https://px4.io/dev/example_fixedwing_control
#hello
#hwtest # Hardware test
#matlab_csv_serial
#px4_mavlink_debug # Tutorial code from http://dev.px4.io/en/debug/debug_values.html
#px4_simple_app # Tutorial code from http://dev.px4.io/en/apps/hello_sky.html
#rover_steering_control # Rover example app
#uuv_example_app
#work_item
)
-88
View File
@@ -1,88 +0,0 @@
# The Eagle board is the first generation Snapdragon Flight board by Qualcomm.
#
# This cmake config builds for QURT which is the operating system running on
# the DSP side.
# Get $QC_SOC_TARGET from environment if existing.
if (DEFINED ENV{QC_SOC_TARGET})
set(QC_SOC_TARGET $ENV{QC_SOC_TARGET})
else()
set(QC_SOC_TARGET "APQ8074")
endif()
include(px4_git)
px4_add_git_submodule(TARGET git_cmake_hexagon PATH "${PX4_SOURCE_DIR}/boards/atlflight/cmake_hexagon")
list(APPEND CMAKE_MODULE_PATH "${PX4_SOURCE_DIR}/boards/atlflight/cmake_hexagon")
if ("$ENV{HEXAGON_SDK_ROOT}" STREQUAL "")
message(FATAL_ERROR "Enviroment variable HEXAGON_SDK_ROOT must be set")
else()
set(HEXAGON_SDK_ROOT $ENV{HEXAGON_SDK_ROOT})
endif()
include(toolchain/Toolchain-qurt)
include(qurt_flags)
include_directories(${HEXAGON_SDK_INCLUDES})
set(CONFIG_SHMEM "1")
add_definitions(-DORB_COMMUNICATOR)
# Disable the creation of the parameters.xml file by scanning individual
# source files, and scan all source files. This will create a parameters.xml
# file that contains all possible parameters, even if the associated module
# is not used. This is necessary for parameter synchronization between the
# ARM and DSP processors.
set(DISABLE_PARAMS_MODULE_SCOPING TRUE)
# This definition allows to differentiate the specific board.
add_definitions(-D__PX4_QURT_EAGLE)
px4_add_board(
PLATFORM qurt
VENDOR atlflight
MODEL eagle
LABEL qurt
DRIVERS
barometer/bmp280
gps
imu/invensense/mpu9250
#magnetometer/hmc5883
qshell/qurt
snapdragon_spektrum_rc
MODULES
airspeed_selector
attitude_estimator_q
commander
ekf2
flight_mode_manager
fw_att_control
fw_pos_control_l1
gyro_calibration
gyro_fft
land_detector
landing_target_estimator
local_position_estimator
mc_att_control
mc_hover_thrust_estimator
mc_pos_control
mc_rate_control
muorb/adsp
rc_update
rover_pos_control
sensors
temperature_compensation
vmount
vtol_att_control
SYSTEMCMDS
led_control
mixer
#motor_ramp
motor_test
param
perf
#pwm
#topic_listener
ver
work_queue
)
@@ -1,2 +0,0 @@
minidm.log
px4.log
@@ -1,32 +0,0 @@
#!/bin/bash
if [[ "$#" < 2 ]]; then
echo "usage: adb_upload.sh SRC1 [SRC2 ...] DEST"
exit
fi
# Get last argument
for last; do true; done
echo "Wait for device..."
adb wait-for-device
echo "Creating folder structure..."
adb shell mkdir -p $last
echo "Uploading..."
# Go through source files and push them one by one.
i=0
for arg
do
if [[ $((i+1)) == "$#" ]]; then
break
fi
# echo "Pushing $arg to $last"
adb push $arg $last
((i+=1))
done
# Make sure they are synced to the file system
echo "Syncing FS..."
adb shell sync
@@ -1,288 +0,0 @@
#!/bin/bash
#################################################################################################
#
# This script loads PX4 binaries to the Snapdragon Flight target and does a quick on-target sanity test.
#
# Pre-requisites:
# - Snapdragon Flight board connected to the host computer via USB cable
# - Snapdragon Flight board must have the latest platform BSP and flight controller addon installed"
# - mini-dm installed on host computer (see https://github.com/ATLFlight/ATLFlightDocs/blob/master/UserGuide.md#adsp)
# - PX4 software was built and binaries are in their usual locations in the Firmware tree.
#
# This script supports two modes:
# - Default mode (supported by PX4 community)
# - Legacy mode (uses proprietary drivers for ESC and RC Receiver, supported by Qualcomm)
#
# For help and cmd line options, run the script with the -h option
#
#################################################################################################
# Halt on error
set -e
# Verbose mode
## set -x
# Mode of operation
readonly MODE_DEFAULT=0
readonly MODE_LEGACY=1
readonly MODE_8x96=2
readonly MODE_MAX=$MODE_8x96
readonly RESULT_PASS=0
readonly RESULT_FAIL=3
readonly EXIT_ERROR=3
# List of expected strings from the apps proc
declare -a appsproc_strings_present=(
"on udp port 14556 remote port 14550"
)
# List of unexpected strings from the apps proc
declare -a appsproc_strings_absent=(
"ERROR"
"Getting Bulk data from fastRPC link"
"Segmentation fault"
)
# List of expected strings from the DSP
declare -a dsp_strings_present=(
"EKF aligned"
)
# List of unexpected strings from the DSP
declare -a dsp_strings_absent=(
"Segmentation fault"
)
install=0
test=0
mode=0
result=$RESULT_PASS
# Default mini-dm path (needs to be installed in this location or overriden through cmd line
minidmPath=~/Qualcomm/Hexagon_SDK/3.0/tools/debug/mini-dm/Linux_Debug
# Default workspace path (parent directory of the script location)
workspace=`pwd`/../../../..
verifypx4test() {
#TODO: This needs to be fixed. For now, skip string checks for 8x96 platform.
if [ $mode == 2 ]; then
echo -e "[WARNING] Skipping string checks for 8x96 platform"
return
fi
echo -e "Verifying test results..."
# verify the presence of expected stings in the apps proc console log
for lineString in "${appsproc_strings_present[@]}"
do
if ! grep -Fq "$lineString" px4.log
then
# code if not found
echo -e "[ERROR] Missing expected string in apps proc log: $lineString"
result=$RESULT_FAIL
fi
done
# verify the absence of unexpected stings in the apps proc console log
for lineString in "${appsproc_strings_absent[@]}"
do
if grep -Fq "$lineString" px4.log
then
# code if not found
echo -e "[ERROR] Found unexpected string in apps proc log: $lineString"
result=$RESULT_FAIL
fi
done
echo -e "Displaying the content of the minidm.log"
cat minidm.log
echo -e "Analyzing the log for success and failure indications."
# verify the presence of expected stings in the DSP console log
for lineString in "${dsp_strings_present[@]}"
do
if ! grep -Fq "$lineString" minidm.log
then
# code if not found
echo -e "[ERROR] Missing expected string in DSP log: $lineString"
result=$RESULT_FAIL
fi
done
# verify the absence of unexpected stings in the DSP console log
for lineString in "${dsp_strings_absent[@]}"
do
if grep -Fq "$lineString" minidm.log
then
# code if not found
echo -e "[ERROR] Found unexpected string in DSP log: $lineString"
result=$RESULT_FAIL
fi
done
echo -e "Verification complete."
if [ $result -eq $RESULT_FAIL ]; then
echo -e "PX4 test result: FAIL"
else
echo -e "PX4 test result: PASS"
fi
}
installpx4() {
if [ $install -eq 0 ]; then
echo -e "SKIPPING install"
return 0;
fi
# Reboot the target before beginning the installation
echo -e "Rebooting the target..."
adb reboot
adb wait-for-usb-device
# Wait a bit longer after bootup, before copying binaries to the target.
sleep 30
adb devices
echo -e "Now installing PX4 binaries..."
# Copy binaries to the target
if [ $mode == 0 ]; then
# copy default binaries
echo -e "Copying the PX4 binaries from the eagle_default build tree..."
adb push $workspace/build/atlflight_eagle_qurt/platforms/qurt/libpx4.so /usr/share/data/adsp
adb push $workspace/build/atlflight_eagle_qurt/platforms/qurt/libpx4muorb_skel.so /usr/share/data/adsp
adb push $workspace/build/atlflight_eagle_default/bin/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
fi
echo -e "Installation complete."
}
testpx4() {
if [ $test -eq 0 ]; then
echo -e "SKIPPING test"
return 0;
fi
echo -e "Starting PX4 test..."
# Remove previous instances of the file
rm px4.log | true
rm minidm.log | true
# Start mini-dm
echo -e "Starting mini-dm..."
${minidmPath}/mini-dm > minidm.log &
sleep 5
# Verify that mini-dm is running
checkProc=$(ps -aef | grep mini-dm | grep -v grep)
if [ -z "${checkProc}" ]; then
echo "[ERROR] Unable to start mini-dm from path: ${minidmPath}"
exit $EXIT_ERROR
fi
# Start PX4
echo -e "Starting PX4..."
if [ $mode == 2 ]; then
# 8x96 platform
adb shell "/home/root/px4 /home/root/mainapp.config" > px4.log 2>&1 &
else
# 8x74 platform
adb shell "/home/linaro/px4 /home/linaro/mainapp.config" > px4.log 2>&1 &
fi
sleep 20
# Verify that PX4 is still running
checkProc=$(adb shell "ps -aef | grep px4 | grep -v grep")
if [ -z "${checkProc}" ]; then
echo "[ERROR] PX4 is not running on target!"
exit $EXIT_ERROR
fi
# Stop the PX4 process on target
adb shell "ps -eaf | grep px4 | grep -v grep | awk '{print $2}' | tr -s ' ' | cut -d' ' -f2 | xargs kill"
sleep 5
# Stop the mini-dm
killall mini-dm
echo -e "PX4 test complete."
# Verify the results
verifypx4test
echo -e "For more information, see px4.log and minidm.log."
}
usage() {
echo -e "\nThis script can copy PX4 binaries to the Snapdragon Flight target and do a quick on-target sanity test.\n"
echo -e "Pre-requisites:"
echo -e "- Snapdragon Flight board must be connected to host computer via USB"
echo -e "- Snapdragon Flight board must have the latest platform BSP and flight controller addon installed"
echo -e "- mini-dm must be installed on host computer (see https://github.com/ATLFlight/ATLFlightDocs/blob/master/UserGuide.md#adsp)"
echo -e "- PX4 software was built and binaries are in their usual locations in the tree\n"
echo -e "USAGE:\n ${0} [-m mode] [-i] [-t] [-l <minidm-path>]"
echo -e " -m --> Build mode (0 = default mode, 1 = legacy mode)"
echo -e " -i --> Install the PX4 binaries"
echo -e " -t --> Test PX4 on target"
echo -e " -l --> location of the mini-dm executable (Default: ${minidmPath})"
echo -e " -h --> Display this help information"
}
# Parse the command line options
while getopts "m:l:ith" opt;
do
case $opt in
m)
if [ $OPTARG -gt $MODE_MAX ]; then
echo "Invalid mode: $OPTARG (max allowed is $MODE_MAX)"
exit $EXIT_ERROR
fi
mode=$OPTARG
echo "Will run the script in mode $mode."
;;
i)
install=1
;;
t)
test=1
;;
l)
minidmPath=$OPTARG
;;
h)
usage
exit 0
;;
:)
echo "Option -$OPTARG requires an argument" >&2
exit 1;;
?)
echo "Unknown arg $opt"
usage
exit 1
;;
esac
done
# Install the PX4 binaries
installpx4
# Run the sanity test
testpx4
exit $result
-39
View File
@@ -1,39 +0,0 @@
############################################################################
#
# 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.
#
############################################################################
add_library(drivers_board
board_config.h
i2c.cpp
init.c
spi.cpp
)
-53
View File
@@ -1,53 +0,0 @@
/****************************************************************************
*
* 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.
*
****************************************************************************/
/**
* @file board_config.h
*
* EAGLE internal definitions
*/
#pragma once
#define BOARD_OVERRIDE_UUID "EAGLEID000000000" // must be of length 16
#define PX4_SOC_ARCH_ID PX4_SOC_ARCH_ID_EAGLE
/*
* I2C busses
*/
#define PX4_NUMBER_I2C_BUSES 3
// Battery ADC channels
#include <system_config.h>
#include <px4_platform_common/board_common.h>
-40
View File
@@ -1,40 +0,0 @@
/****************************************************************************
*
* Copyright (C) 2020 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 <px4_arch/i2c_hw_description.h>
constexpr px4_i2c_bus_t px4_i2c_buses[I2C_BUS_MAX_BUS_ITEMS] = {
initI2CBusExternal(2),
initI2CBusExternal(3),
initI2CBusExternal(9),
};
View File
-41
View File
@@ -1,41 +0,0 @@
/****************************************************************************
*
* Copyright (C) 2020 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 <px4_arch/spi_hw_description.h>
#include <drivers/drv_sensor.h>
constexpr px4_spi_bus_t px4_spi_buses[SPI_BUS_MAX_BUS_ITEMS] = {
initSPIBus(1, {
initSPIDevice(DRV_IMU_DEVTYPE_MPU9250),
}),
};
-126
View File
@@ -1,126 +0,0 @@
# Excelsior is the code name of a board currently in development.
include(px4_git)
px4_add_git_submodule(TARGET git_cmake_hexagon PATH "${PX4_SOURCE_DIR}/boards/atlflight/cmake_hexagon")
list(APPEND CMAKE_MODULE_PATH
"${PX4_SOURCE_DIR}/boards/atlflight/cmake_hexagon"
"${PX4_SOURCE_DIR}/boards/atlflight/cmake_hexagon/toolchain"
)
# Get $QC_SOC_TARGET from environment if existing.
if (DEFINED ENV{QC_SOC_TARGET})
set(QC_SOC_TARGET $ENV{QC_SOC_TARGET})
else()
set(QC_SOC_TARGET "APQ8074")
endif()
# Disable the creation of the parameters.xml file by scanning individual
# source files, and scan all source files. This will create a parameters.xml
# file that contains all possible parameters, even if the associated module
# is not used. This is necessary for parameter synchronization between the
# ARM and DSP processors.
set(DISABLE_PARAMS_MODULE_SCOPING TRUE)
set(CONFIG_SHMEM "1")
add_definitions(-DORB_COMMUNICATOR)
# atlflight toolchain doesn't properly set the compiler, so these aren't set automatically
add_compile_options($<$<COMPILE_LANGUAGE:C>:-std=gnu99>)
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-std=gnu++11>)
add_definitions(
-D__PX4_POSIX_EXCELSIOR
-D__PX4_LINUX
)
px4_add_board(
PLATFORM posix
VENDOR atlflight
MODEL excelsior
LABEL default
TOOLCHAIN arm-oemllib32-linux-gnueabi
DRIVERS
#barometer # all available barometer drivers
batt_smbus
camera_trigger
differential_pressure # all available differential pressure drivers
distance_sensor # all available distance sensor drivers
gps
#imu # all available imu drivers
#lights/rgbled
#magnetometer # all available magnetometer drivers
pwm_out_sim
qshell/posix
rc_input
smart_battery/batmon
#telemetry # all available telemetry drivers
MODULES
airspeed_selector
attitude_estimator_q
camera_feedback
commander
dataman
ekf2
events
flight_mode_manager
fw_att_control
fw_pos_control_l1
gyro_calibration
gyro_fft
land_detector
landing_target_estimator
#load_mon
local_position_estimator
logger
mavlink
mc_att_control
mc_hover_thrust_estimator
mc_pos_control
mc_rate_control
#micrortps_bridge
muorb/krait
muorb/test
navigator
rc_update
rover_pos_control
sensors
#sih
simulator
vmount
vtol_att_control
SYSTEMCMDS
#bl_update
#dumpfile
esc_calib
#hardfault_log
led_control
mixer
motor_ramp
motor_test
#mtd
#nshterm
param
perf
pwm
sd_bench
shutdown
system_time
#top
topic_listener
tune_control
uorb
ver
work_queue
EXAMPLES
#fake_gps
#fixedwing_control # Tutorial code from https://px4.io/dev/example_fixedwing_control
#hello
#hwtest # Hardware test
#matlab_csv_serial
#px4_mavlink_debug # Tutorial code from http://dev.px4.io/en/debug/debug_values.html
#px4_simple_app # Tutorial code from http://dev.px4.io/en/apps/hello_sky.html
#rover_steering_control # Rover example app
#uuv_example_app
#work_item
)
-88
View File
@@ -1,88 +0,0 @@
# Excelsior is the code name of a board currently in development.
#
# This cmake config builds for QURT which is the operating system running on
# the DSP side.
# Get $QC_SOC_TARGET from environment if existing.
if (DEFINED ENV{QC_SOC_TARGET})
set(QC_SOC_TARGET $ENV{QC_SOC_TARGET})
else()
set(QC_SOC_TARGET "APQ8074")
endif()
include(px4_git)
px4_add_git_submodule(TARGET git_cmake_hexagon PATH "${PX4_SOURCE_DIR}/boards/atlflight/cmake_hexagon")
list(APPEND CMAKE_MODULE_PATH "${PX4_SOURCE_DIR}/boards/atlflight/cmake_hexagon")
if ("$ENV{HEXAGON_SDK_ROOT}" STREQUAL "")
message(FATAL_ERROR "Enviroment variable HEXAGON_SDK_ROOT must be set")
else()
set(HEXAGON_SDK_ROOT $ENV{HEXAGON_SDK_ROOT})
endif()
include(toolchain/Toolchain-qurt)
include(qurt_flags)
include_directories(${HEXAGON_SDK_INCLUDES})
set(CONFIG_SHMEM "1")
add_definitions(-DORB_COMMUNICATOR)
# Disable the creation of the parameters.xml file by scanning individual
# source files, and scan all source files. This will create a parameters.xml
# file that contains all possible parameters, even if the associated module
# is not used. This is necessary for parameter synchronization between the
# ARM and DSP processors.
set(DISABLE_PARAMS_MODULE_SCOPING TRUE)
# This definition allows to differentiate the specific board.
add_definitions(-D__PX4_QURT_EXCELSIOR)
px4_add_board(
PLATFORM qurt
VENDOR atlflight
MODEL excelsior
LABEL qurt
DRIVERS
barometer/bmp280
gps
imu/invensense/mpu9250
magnetometer/hmc5883
qshell/qurt
snapdragon_spektrum_rc
MODULES
airspeed_selector
attitude_estimator_q
commander
ekf2
flight_mode_manager
fw_att_control
fw_pos_control_l1
gyro_calibration
gyro_fft
land_detector
landing_target_estimator
local_position_estimator
mc_att_control
mc_hover_thrust_estimator
mc_pos_control
mc_rate_control
muorb/adsp
rc_update
rover_pos_control
sensors
temperature_compensation
vmount
vtol_att_control
SYSTEMCMDS
led_control
mixer
#motor_ramp
motor_test
param
perf
#pwm
#topic_listener
ver
work_queue
)
@@ -1,39 +0,0 @@
############################################################################
#
# 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.
#
############################################################################
add_library(drivers_board
board_config.h
init.c
spi.cpp
i2c.cpp
)
@@ -1,51 +0,0 @@
/****************************************************************************
*
* 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.
*
****************************************************************************/
/**
* @file board_config.h
*
* EXCELSIOR internal definitions
*/
#pragma once
#define BOARD_OVERRIDE_UUID "EAGLEID000000000" // must be of length 16
#define PX4_SOC_ARCH_ID PX4_SOC_ARCH_ID_EAGLE
/*
* I2C busses
*/
#define PX4_NUMBER_I2C_BUSES 3
#include <system_config.h>
#include <px4_platform_common/board_common.h>
-40
View File
@@ -1,40 +0,0 @@
/****************************************************************************
*
* Copyright (C) 2020 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 <px4_arch/i2c_hw_description.h>
constexpr px4_i2c_bus_t px4_i2c_buses[I2C_BUS_MAX_BUS_ITEMS] = {
initI2CBusExternal(2),
initI2CBusExternal(3),
initI2CBusExternal(9),
};
-41
View File
@@ -1,41 +0,0 @@
/****************************************************************************
*
* Copyright (C) 2020 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 <px4_arch/spi_hw_description.h>
#include <drivers/drv_sensor.h>
constexpr px4_spi_bus_t px4_spi_buses[SPI_BUS_MAX_BUS_ITEMS] = {
initSPIBus(1, {
initSPIDevice(DRV_IMU_DEVTYPE_MPU9250),
}),
};
@@ -244,22 +244,6 @@ RingBuffer::force(double val)
return force(&val, sizeof(val));
}
// FIXME - clang crashes on this get() call
#ifdef __PX4_QURT
#define __PX4_SBCAP my_sync_bool_compare_and_swap
static inline bool my_sync_bool_compare_and_swap(volatile unsigned *a, unsigned b, unsigned c)
{
if (*a == b) {
*a = c;
return true;
}
return false;
}
#else
#define __PX4_SBCAP __sync_bool_compare_and_swap
#endif
bool
RingBuffer::get(void *val, size_t val_size)
{
@@ -284,7 +268,7 @@ RingBuffer::get(void *val, size_t val_size)
}
/* if the tail pointer didn't change, we got our item */
} while (!__PX4_SBCAP(&_tail, candidate, next));
} while (!__sync_bool_compare_and_swap(&_tail, candidate, next));
return true;
+1 -3
View File
@@ -179,9 +179,7 @@ function(px4_add_module)
endif()
set_target_properties(${MODULE} PROPERTIES STACK_MAX ${STACK_MAX})
if(${PX4_PLATFORM} STREQUAL "qurt")
set_property(TARGET ${MODULE} PROPERTY POSITION_INDEPENDENT_CODE TRUE)
elseif(${PX4_PLATFORM} STREQUAL "nuttx")
if(${PX4_PLATFORM} STREQUAL "nuttx")
target_compile_options(${MODULE} PRIVATE -Wframe-larger-than=${STACK_MAX})
endif()
+1 -1
View File
@@ -33,7 +33,7 @@
set(SRCS)
if (NOT "${PX4_PLATFORM}" MATCHES "qurt" AND NOT "${PX4_BOARD}" MATCHES "io-v2" AND NOT "${PX4_BOARD_LABEL}" MATCHES "bootloader")
if(NOT "${PX4_BOARD}" MATCHES "io-v2" AND NOT "${PX4_BOARD_LABEL}" MATCHES "bootloader")
list(APPEND SRCS
px4_log.cpp
)
@@ -84,10 +84,6 @@ public:
*/
inline T load() const
{
#ifdef __PX4_QURT
return _value;
#else
#if defined(__PX4_NUTTX)
if (!__atomic_always_lock_free(sizeof(T), 0)) {
@@ -101,8 +97,6 @@ public:
{
return __atomic_load_n(&_value, __ATOMIC_SEQ_CST);
}
#endif
}
/**
@@ -110,10 +104,6 @@ public:
*/
inline void store(T value)
{
#ifdef __PX4_QURT
_value = value;
#else
#if defined(__PX4_NUTTX)
if (!__atomic_always_lock_free(sizeof(T), 0)) {
@@ -126,8 +116,6 @@ public:
{
__atomic_store(&_value, &value, __ATOMIC_SEQ_CST);
}
#endif
}
/**
@@ -136,11 +124,6 @@ public:
*/
inline T fetch_add(T num)
{
#ifdef __PX4_QURT
// TODO: fix
return _value++;
#else
#if defined(__PX4_NUTTX)
if (!__atomic_always_lock_free(sizeof(T), 0)) {
@@ -154,8 +137,6 @@ public:
{
return __atomic_fetch_add(&_value, num, __ATOMIC_SEQ_CST);
}
#endif
}
/**
@@ -301,13 +282,7 @@ public:
}
private:
#ifdef __PX4_QURT
// It seems that __atomic_store and __atomic_load are not supported on Qurt,
// so the best that we can do is to use volatile.
volatile T _value{};
#else
T _value {};
#endif
};
using atomic_int = atomic<int>;
@@ -89,33 +89,14 @@ constexpr bool PX4_ISFINITE(double x) { return __builtin_isfinite(x); }
#define USEC_PER_TICK (1000000/PX4_TICKS_PER_SEC)
#define USEC2TICK(x) (((x)+(USEC_PER_TICK/2))/USEC_PER_TICK)
#ifdef __PX4_QURT
// QURT specific
# include "dspal_math.h"
# define PX4_ROOTFSDIR "."
# define PX4_TICKS_PER_SEC 1000L
#else // __PX4_QURT
// All POSIX except QURT.
__BEGIN_DECLS
extern long PX4_TICKS_PER_SEC;
__END_DECLS
# if defined(__PX4_POSIX_EAGLE) || defined(__PX4_POSIX_EXCELSIOR)
# define PX4_ROOTFSDIR "/home/linaro"
# else
# define PX4_ROOTFSDIR "."
# endif
#endif // __PX4_QURT
#define PX4_ROOTFSDIR "."
#define PX4_STORAGEDIR PX4_ROOTFSDIR
#endif // __PX4_POSIX
#if defined(__PX4_POSIX)
/****************************************************************************
* Defines for POSIX and ROS
****************************************************************************/
@@ -1,82 +0,0 @@
/****************************************************************************
*
* Copyright (c) 2015 Ramakrishna Kintada. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name PX4 nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
#pragma once
#include <parameters/param.h>
#define MAX_SHMEM_PARAMS 2000 //MAP_SIZE - (LOCK_SIZE - sizeof(struct shmem_info))
#define PARAM_BUFFER_SIZE (MAX_SHMEM_PARAMS / 8 + 1)
struct shmem_info {
union param_value_u params_val[MAX_SHMEM_PARAMS];
unsigned char krait_changed_index[MAX_SHMEM_PARAMS / 8 + 1]; /*bit map of all params changed by krait*/
unsigned char adsp_changed_index[MAX_SHMEM_PARAMS / 8 + 1]; /*bit map of all params changed by adsp*/
#ifdef __PX4_NUTTX
};
#else
} __attribute__((packed));
#endif
#if (defined(__PX4_POSIX_EXCELSIOR) || defined(__PX4_QURT_EXCELSIOR))
#define MAP_ADDRESS 0x861FC000
#else
#define MAP_ADDRESS 0xfbfc000
#endif
#define MAP_SIZE 16384
#define MAP_MASK (MAP_SIZE - 1)
#define LOCK_OFFSET 0
#define LOCK_SIZE 4
#define LOCK_MEM 1
#define UNLOCK_MEM 2
#define TYPE_MASK 0x1
extern bool handle_in_range(param_t);
#ifdef __PX4_QURT
extern struct shmem_info *shmem_info_p;
int get_shmem_lock(const char *caller_file_name, int caller_line_number);
void release_shmem_lock(const char *caller_file_name, int caller_line_number);
void init_shared_memory(void);
void copy_params_to_shmem(const param_info_s *param_info_base);
#endif
void update_to_shmem(param_t param, union param_value_u value);
int update_from_shmem(param_t param, union param_value_u *value);
void update_index_from_shmem(void);
@@ -45,10 +45,6 @@
#include <queue.h>
#include <px4_platform_types.h>
#ifdef __PX4_QURT
#include <dspal_types.h>
#endif
__BEGIN_DECLS
#define HPWORK 0
@@ -49,7 +49,7 @@ WorkQueue::WorkQueue(const wq_config_t &config) :
// set the threads name
#ifdef __PX4_DARWIN
pthread_setname_np(_config.name);
#elif !defined(__PX4_QURT)
#else
pthread_setname_np(pthread_self(), _config.name);
#endif
+34 -61
View File
@@ -25,73 +25,46 @@ px4_posix_generate_alias(
PREFIX ${PX4_SHELL_COMMAND_PREFIX}
)
if (("${PX4_BOARD}" MATCHES "atlflight_eagle") OR ("${PX4_BOARD}" MATCHES "atlflight_excelsior"))
include(fastrpc)
include(linux_app)
FASTRPC_STUB_GEN(../qurt/px4muorb.idl)
LINUX_APP(
APP_NAME px4
IDL_NAME px4muorb
APPS_DEST "/home/linaro"
SOURCES
px4muorb_stub.c
src/px4/common/main.cpp
apps.cpp
LINK_LIBS
-Wl,--start-group
px4_layer
parameters
${module_libraries}
${FASTRPC_ARM_LIBS}
pthread m rt
-Wl,--end-group
)
else()
add_executable(px4
src/px4/common/main.cpp
apps.cpp
)
target_link_libraries(px4
PRIVATE
${module_libraries}
pthread m
# horrible circular dependencies that need to be teased apart
px4_layer px4_platform
work_queue
parameters
add_executable(px4
src/px4/common/main.cpp
apps.cpp
)
if(NOT APPLE)
target_link_libraries(px4 PRIVATE rt)
endif()
target_link_libraries(px4
PRIVATE
${module_libraries}
pthread m
target_link_libraries(px4 PRIVATE uORB)
#=============================================================================
# install
#
# TODO: extend to snapdragon
# px4 dirs
install(
DIRECTORY
${PROJECT_SOURCE_DIR}/posix-configs
${PROJECT_SOURCE_DIR}/test
${CMAKE_BINARY_DIR}/etc
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
DESTINATION
${PROJECT_NAME}
USE_SOURCE_PERMISSIONS
)
# horrible circular dependencies that need to be teased apart
px4_layer px4_platform
work_queue
parameters
)
if(NOT APPLE)
target_link_libraries(px4 PRIVATE rt)
endif()
target_link_libraries(px4 PRIVATE uORB)
#=============================================================================
# install
#
# TODO: extend to snapdragon
# px4 dirs
install(
DIRECTORY
${PROJECT_SOURCE_DIR}/posix-configs
${PROJECT_SOURCE_DIR}/test
${CMAKE_BINARY_DIR}/etc
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
DESTINATION
${PROJECT_NAME}
USE_SOURCE_PERMISSIONS
)
# Module Symlinks
px4_posix_generate_symlinks(
MODULE_LIST ${module_libraries}
@@ -36,17 +36,6 @@ add_subdirectory(px4_daemon)
add_subdirectory(lockstep_scheduler)
set(EXTRA_DEPENDS)
if("${CONFIG_SHMEM}" STREQUAL "1")
list(APPEND CMAKE_MODULE_PATH "${PX4_SOURCE_DIR}/boards/atlflight/cmake_hexagon")
include(hexagon_sdk)
include_directories(${HEXAGON_SDK_INCLUDES})
include_directories(${PX4_BINARY_DIR}/platforms/posix)
list(APPEND SHMEM_SRCS
shmem_posix.cpp
)
add_definitions(-DCONFIG_SHMEM=1)
set(EXTRA_DEPENDS generate_px4muorb_stubs)
endif()
add_library(px4_layer
px4_posix_impl.cpp
@@ -57,7 +46,6 @@ add_library(px4_layer
drv_hrt.cpp
cpuload.cpp
print_load.cpp
${SHMEM_SRCS}
)
target_compile_definitions(px4_layer PRIVATE MODULE_NAME="px4")
target_compile_options(px4_layer PRIVATE -Wno-cast-align) # TODO: fix and enable
+1 -13
View File
@@ -317,15 +317,6 @@ int main(int argc, char **argv)
pxh.run_pxh();
}
// When we exit, we need to stop muorb on Snapdragon.
#ifdef __PX4_POSIX_EAGLE
// Sending muorb stop is needed if it is running to exit cleanly.
// TODO: we should check with px4_task_is_running("muorb") before stopping it.
std::string muorb_stop_cmd("muorb stop");
px4_daemon::Pxh::process_line(muorb_stop_cmd, true);
#endif
std::string cmd("shutdown");
px4_daemon::Pxh::process_line(cmd, true);
@@ -451,10 +442,7 @@ void sig_int_handler(int sig_num)
void set_cpu_scaling()
{
#ifdef __PX4_POSIX_EAGLE
// On Snapdragon we miss updates in sdlog2 unless all 4 CPUs are run
// at the maximum frequency all the time.
// Interestingely, cpu0 and cpu3 set the scaling for all 4 CPUs on Snapdragon.
#if 0
system("echo performance > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor");
system("echo performance > /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor");
@@ -73,19 +73,6 @@ FILE *get_stdout(bool *isatty_)
return stdout;
}
#ifdef __PX4_POSIX_EAGLE
// XXX FIXME: thread_data_ptr is set to 0x1 in the main thread on Snapdragon
// even though the pthread_key has been created.
// We can catch this using the check below but we have no clue why this happens.
if (thread_data_ptr == (void *)0x1) {
if (isatty_) { *isatty_ = isatty(1); }
return stdout;
}
#endif
if (thread_data_ptr->thread_stdout == nullptr) {
if (isatty_) { *isatty_ = isatty(1); }
@@ -1,125 +0,0 @@
/****************************************************************************
*
* Copyright (c) 2015 Vijay Venkatraman. 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 <px4_platform_common/defines.h>
#include <px4_platform_common/posix.h>
#include <string.h>
#include <stdbool.h>
#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>
#include <systemlib/err.h>
#include <errno.h>
#include <semaphore.h>
#include <sys/stat.h>
#include <drivers/drv_hrt.h>
#include <sys/mman.h>
#include <sys/ioctl.h>
#include <parameters/param.h>
#include <px4_platform_common/shmem.h>
#include "px4muorb.h"
//#define SHMEM_DEBUG
static uint64_t update_from_shmem_prev_time = 0, update_from_shmem_current_time = 0;
extern unsigned char *adsp_changed_index;
struct param_wbuf_s {
union param_value_u val;
param_t param;
bool unsaved;
};
/*update value and param's change bit in shared memory*/
void update_to_shmem(param_t param, union param_value_u value)
{
if (px4muorb_param_update_to_shmem(param, (unsigned char *) &value, sizeof(value))) {
PX4_ERR("krait update param %u failed", param);
}
}
void update_index_from_shmem(void)
{
if (!adsp_changed_index) {
PX4_ERR("%s no param buffer", __FUNCTION__);
return;
}
px4muorb_param_update_index_from_shmem(adsp_changed_index, PARAM_BUFFER_SIZE);
}
static void update_value_from_shmem(param_t param, union param_value_u *value)
{
if (px4muorb_param_update_value_from_shmem(param, (unsigned char *) value, sizeof(union param_value_u))) {
PX4_ERR("%s get param failed", __FUNCTION__);
}
}
int update_from_shmem(param_t param, union param_value_u *value)
{
unsigned int byte_changed, bit_changed;
unsigned int retval = 0;
if (!adsp_changed_index) {
PX4_ERR("%s no param buffer", __FUNCTION__);
return 0;
}
update_from_shmem_current_time = hrt_absolute_time();
if ((update_from_shmem_current_time - update_from_shmem_prev_time)
> 1000000) { //update every 1 second
update_from_shmem_prev_time = update_from_shmem_current_time;
update_index_from_shmem();
}
byte_changed = param / 8;
bit_changed = 1 << param % 8;
if (adsp_changed_index[byte_changed] & bit_changed) {
update_value_from_shmem(param, value);
adsp_changed_index[byte_changed] &= ~bit_changed; //clear the bit
retval = 1;
}
//else {PX4_INFO("no change to param %s", param_name(param));}
PX4_DEBUG("%s %d bit on adsp index[%d]",
(retval) ? "cleared" : "unchanged", bit_changed, byte_changed);
return retval;
}
-58
View File
@@ -1,58 +0,0 @@
px4_add_git_submodule(TARGET git_dspal PATH "${PX4_SOURCE_DIR}/platforms/qurt/dspal")
list(APPEND CMAKE_MODULE_PATH "${PX4_SOURCE_DIR}/platforms/qurt/dspal/cmake_hexagon")
include(toolchain/Toolchain-qurt)
include(fastrpc)
include(qurt_lib)
include(qurt_flags)
include_directories(${CMAKE_CURRENT_BINARY_DIR})
get_property(module_libraries GLOBAL PROPERTY PX4_MODULE_LIBRARIES)
px4_qurt_generate_builtin_commands(
OUT ${PX4_BINARY_DIR}/apps
MODULE_LIST ${module_libraries}
)
FASTRPC_STUB_GEN(px4muorb.idl)
add_definitions(-D__QAIC_SKEL_EXPORT=__EXPORT)
# Enable build without HexagonSDK to check link dependencies
if ("${QURT_ENABLE_STUBS}" STREQUAL "1")
add_definitions(-D QURT_EXE_BUILD=1)
include_directories(
${CMAKE_CURRENT_BINARY_DIR}
${FASTRPC_DSP_INCLUDES}
)
add_executable(px4
${PX4_BINARY_DIR}/apps.cpp
${PX4_BINARY_DIR}/platforms/qurt/px4muorb_skel.c
)
target_link_libraries(px4 PRIVATE ${module_libraries})
else()
# Generate the DSP lib and stubs but not the apps side executable
# The Apps side executable is generated via the posix_eagle_xxxx target
QURT_LIB(LIB_NAME px4
IDL_NAME px4muorb
SOURCES
${PX4_BINARY_DIR}/apps.cpp
LINK_LIBS
modules__muorb__adsp
${module_libraries}
m
)
endif()
# board defined upload helper
if(EXISTS "${PX4_BOARD_DIR}/cmake/upload.cmake")
include(${PX4_BOARD_DIR}/cmake/upload.cmake)
endif()
-188
View File
@@ -1,188 +0,0 @@
############################################################################
#
# 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.
#
############################################################################
#=============================================================================
#
# Defined functions in this file
#
# OS Specific Functions
#
# * px4_qurt_add_firmware
# * px4_qurt_generate_builtin_commands
# * px4_qurt_add_export
# * px4_qurt_generate_romfs
#
# Required OS Inteface Functions
#
# * px4_os_add_flags
# * px4_os_determine_build_chip
# * px4_os_prebuild_targets
#
#=============================================================================
#
# px4_qurt_generate_builtin_commands
#
# This function generates the builtin_commands.c src for qurt
#
# Usage:
# px4_qurt_generate_builtin_commands(
# MODULE_LIST <in-list>
# OUT <file>)
#
# Input:
# MODULE_LIST : list of modules
#
# Output:
# OUT : stem of generated apps.cpp/apps.h ("apps").
#
# Example:
# px4_qurt_generate_builtin_commands(
# OUT <generated-src> MODULE_LIST px4_simple_app)
#
function(px4_qurt_generate_builtin_commands)
px4_parse_function_args(
NAME px4_qurt_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}\tapps[\"${MAIN}\"] = ${MAIN}_main;\n")
set(builtin_apps_decl_string
"${builtin_apps_decl_string}int ${MAIN}_main(int argc, char *argv[]);\n")
math(EXPR command_count "${command_count}+1")
endif()
endforeach()
configure_file(${PX4_SOURCE_DIR}/platforms/common/apps.cpp.in ${OUT}.cpp)
configure_file(${PX4_SOURCE_DIR}/platforms/common/apps.h.in ${OUT}.h)
endfunction()
#=============================================================================
#
# px4_os_add_flags
#
# Set the qurt build flags.
#
# Usage:
# px4_os_add_flags()
#
function(px4_os_add_flags)
set(DSPAL_ROOT platforms/qurt/dspal)
include_directories(
${DSPAL_ROOT}/include
${DSPAL_ROOT}/sys
${DSPAL_ROOT}/sys/sys
platforms/posix/include
platforms/qurt/include
)
add_definitions(
-D__PX4_POSIX
-D__PX4_QURT
)
add_compile_options(
-fPIC
-fmath-errno
-Wno-unknown-warning-option
-Wno-cast-align
)
# Clear -rdynamic flag which fails for hexagon
set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS)
set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS)
endfunction()
#=============================================================================
#
# px4_os_determine_build_chip
#
# Sets PX4_CHIP and PX4_CHIP_MANUFACTURER.
#
# Usage:
# px4_os_determine_build_chip()
#
function(px4_os_determine_build_chip)
# always use generic chip and chip manufacturer
set(PX4_CHIP "generic" CACHE STRING "PX4 Chip" FORCE)
set(PX4_CHIP_MANUFACTURER "generic" CACHE STRING "PX4 Chip Manufacturer" FORCE)
endfunction()
#=============================================================================
#
# px4_os_prebuild_targets
#
# This function generates os dependent targets
#
# Usage:
# px4_os_prebuild_targets(
# OUT <out-list_of_targets>
# BOARD <in-string>
# )
#
# Input:
# BOARD : board
#
# Output:
# OUT : the target list
#
# Example:
# px4_os_prebuild_targets(OUT target_list BOARD px4_fmu-v2)
#
function(px4_os_prebuild_targets)
px4_parse_function_args(
NAME px4_os_prebuild_targets
ONE_VALUE OUT BOARD
REQUIRED OUT
ARGN ${ARGN})
add_library(prebuild_targets INTERFACE)
add_dependencies(prebuild_targets DEPENDS uorb_headers)
endfunction()
-83
View File
@@ -1,83 +0,0 @@
/****************************************************************************
* include/crc.h
*
* Copyright (C) 2010 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
#ifndef __INCLUDE_CRC32_H
#define __INCLUDE_CRC32_H
/****************************************************************************
* Included Files
****************************************************************************/
#include <sys/types.h>
#include <stdint.h>
/****************************************************************************
* Public Function Prototypes
****************************************************************************/
#ifdef __cplusplus
#define EXTERN extern "C"
extern "C" {
#else
#define EXTERN extern
#endif
/****************************************************************************
* Name: crc32part
*
* Description:
* Continue CRC calculation on a part of the buffer.
*
****************************************************************************/
EXTERN uint32_t crc32part(const uint8_t *src, size_t len,
uint32_t crc32val);
/****************************************************************************
* Name: crc32
*
* Description:
* Return a 32-bit CRC of the contents of the 'src' buffer, length 'len'
*
****************************************************************************/
EXTERN uint32_t crc32(const uint8_t *src, size_t len);
#undef EXTERN
#ifdef __cplusplus
}
#endif
#endif /* __INCLUDE_CRC32_H */
-65
View File
@@ -1,65 +0,0 @@
/****************************************************************************
*
* Copyright (C) 2015 Mark Charlebois. 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 <px4_platform_common/log.h>
#include <semaphore.h>
#include <px4_platform_common/workqueue.h>
#pragma once
__BEGIN_DECLS
extern sem_t _hrt_work_lock;
extern struct wqueue_s g_hrt_work;
void hrt_work_queue_init(void);
int hrt_work_queue(struct work_s *work, worker_t worker, void *arg, uint32_t usdelay);
void hrt_work_cancel(struct work_s *work);
static inline void hrt_work_lock(void);
static inline void hrt_work_unlock(void);
static inline void hrt_work_lock()
{
//PX4_INFO("hrt_work_lock");
sem_wait(&_hrt_work_lock);
}
static inline void hrt_work_unlock()
{
//PX4_INFO("hrt_work_unlock");
sem_post(&_hrt_work_lock);
}
__END_DECLS
-134
View File
@@ -1,134 +0,0 @@
/************************************************************************
* include/queue.h
*
* Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
************************************************************************/
#ifndef __INCLUDE_QUEUE_H
#define __INCLUDE_QUEUE_H
/************************************************************************
* Included Files
************************************************************************/
#include <sys/types.h>
#ifdef __cplusplus
#include <cstddef> // NULL
#else
#include <stddef.h> // NULL
#endif
/************************************************************************
* Pre-processor Definitions
************************************************************************/
#define sq_init(q) do { (q)->head = NULL; (q)->tail = NULL; } while (0)
#define dq_init(q) do { (q)->head = NULL; (q)->tail = NULL; } while (0)
#define sq_next(p) ((p)->flink)
#define dq_next(p) ((p)->flink)
#define dq_prev(p) ((p)->blink)
#define sq_empty(q) ((q)->head == NULL)
#define dq_empty(q) ((q)->head == NULL)
#define sq_peek(q) ((q)->head)
#define dq_peek(q) ((q)->head)
// Required for Linux
#define FAR
/************************************************************************
* Global Type Declarations
************************************************************************/
struct sq_entry_s {
FAR struct sq_entry_s *flink;
};
typedef struct sq_entry_s sq_entry_t;
struct dq_entry_s {
FAR struct dq_entry_s *flink;
FAR struct dq_entry_s *blink;
};
typedef struct dq_entry_s dq_entry_t;
struct sq_queue_s {
FAR sq_entry_t *head;
FAR sq_entry_t *tail;
};
typedef struct sq_queue_s sq_queue_t;
struct dq_queue_s {
FAR dq_entry_t *head;
FAR dq_entry_t *tail;
};
typedef struct dq_queue_s dq_queue_t;
/************************************************************************
* Global Function Prototypes
************************************************************************/
#ifdef __cplusplus
#define EXTERN extern "C"
extern "C" {
#else
#define EXTERN extern
#endif
EXTERN void sq_addfirst(FAR sq_entry_t *node, sq_queue_t *queue);
EXTERN void dq_addfirst(FAR dq_entry_t *node, dq_queue_t *queue);
EXTERN void sq_addlast(FAR sq_entry_t *node, sq_queue_t *queue);
EXTERN void dq_addlast(FAR dq_entry_t *node, dq_queue_t *queue);
EXTERN void sq_addafter(FAR sq_entry_t *prev, FAR sq_entry_t *node,
sq_queue_t *queue);
EXTERN void dq_addafter(FAR dq_entry_t *prev, FAR dq_entry_t *node,
dq_queue_t *queue);
EXTERN void dq_addbefore(FAR dq_entry_t *next, FAR dq_entry_t *node,
dq_queue_t *queue);
EXTERN FAR sq_entry_t *sq_remafter(FAR sq_entry_t *node, sq_queue_t *queue);
EXTERN void sq_rem(FAR sq_entry_t *node, sq_queue_t *queue);
EXTERN void dq_rem(FAR dq_entry_t *node, dq_queue_t *queue);
EXTERN FAR sq_entry_t *sq_remlast(sq_queue_t *queue);
EXTERN FAR dq_entry_t *dq_remlast(dq_queue_t *queue);
EXTERN FAR sq_entry_t *sq_remfirst(sq_queue_t *queue);
EXTERN FAR dq_entry_t *dq_remfirst(dq_queue_t *queue);
#undef EXTERN
#ifdef __cplusplus
}
#endif
#endif /* __INCLUDE_QUEUE_H_ */
-64
View File
@@ -1,64 +0,0 @@
/****************************************************************************
*
* Copyright (C) 2015 Mark Charlebois. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name PX4 nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
#pragma once
#include <sys/cdefs.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdint.h>
__BEGIN_DECLS
__EXPORT extern uint64_t hrt_absolute_time(void);
//void qurt_log(int level, const char *file, int line, const char *format, ...);
// declaration to make the compiler happy. This symbol is part of the adsp static image.
void HAP_debug(const char *msg, int level, const char *filename, int line);
#ifndef qurt_log_defined
#define qurt_log_defined
static __inline void qurt_log(int level, const char *file, int line,
const char *format, ...)
{
char buf[256];
va_list args;
va_start(args, format);
vsnprintf(buf, sizeof(buf), format, args);
va_end(args);
HAP_debug(buf, level, file, line);
}
#endif
__END_DECLS
-184
View File
@@ -1,184 +0,0 @@
//=======================================================================
// Copyright (c) 2016, Mark Charlebois. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * 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.
// * Neither the name of The Linux Foundation 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 "AS IS" AND ANY EXPRESS OR IMPLIED
// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
// 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 "AEEStdDef.idl"
interface px4muorb{
/**
* interface method to start the uorb service and initialize the muorb
*/
AEEResult orb_initialize();
/**
* Interface to set an offset to hrt_absolute_time on the DSP.
*
* @param time_diff_us: time difference of the DSP clock to Linux clock.
* A positive number means the Linux clock is ahead of the DSP one.
*/
AEEResult set_absolute_time_offset( in long time_diff_us );
/**
* Interface to request hrt_absolute_time on the DSP.
* @param time_us: pointer to time in us
*/
AEEResult get_absolute_time(rout unsigned long long time_us);
/**
* Interface to update param for krait.
*
* @param param: param index.
* @param value: param value.
*/
AEEResult param_update_to_shmem( in unsigned long param, in sequence<octet> value);
/**
* Interface to update index for krait.
* @param data: param index array.
*/
AEEResult param_update_index_from_shmem( rout sequence<octet> data);
/**
* Interface to get param value for krait.
*
* @param param: param index.
* @param value: param value.
*/
AEEResult param_update_value_from_shmem( in unsigned long param, rout sequence<octet> value);
/**
* Interface called from krait to inform of a published topic.
* @param topic_name: name of the topic being advertised
*/
AEEResult topic_advertised(in string topic_name);
/**
* Interface called from krait to inform of a published topic.
* @param topic_name: name of the topic being advertised
*/
AEEResult topic_unadvertised(in string topic_name);
/**
* Interface to add a subscriber to the identified topic
* @param topic_name
* @return status
* 0 == success
* all others is a failure.
*/
AEEResult add_subscriber( in string topic_name );
/**
* Interface to remove a subscriber for the identified topic.
* @param topic_name
* @return status
* 0 == success
* all others is a failure.
*/
AEEResult remove_subscriber( in string topic_name );
/**
* Interface called from krait for topic data.
* @param topic_name
* @param data
* a sequence of bytes for the passed data stream.
* as per the HExagon Documention, the max size of this stream is 255 bytes.
* @return status
* 0 == success
* all others is a failure.
*/
AEEResult send_topic_data( in string topic_name, in sequence<octet> data );
/**
* Inteface to check if there are subscribers on the remote adsp client
* This inteface is required as the krait app can be restarted without adsp
* being re-started. In this scenario the krait app does not know if there
* is subscriber on the remote end(ie adsp).
* @param topic_name
* The name of the topic for which the subscription needs to be checked.
* @param rout int status
* The status of the subscription, 0=no-subscribers, 1 = more than one subscriber.
* @return status
* 0 == success
* all others is a failure.
*/
AEEResult is_subscriber_present( in string topic_name, rout long status );
/**
* Interface to receive data from adsp. Since there is only one interface, the different message
* types are identified by the msg_type field.
* @param msg_type
* The possible values are:
* 1 ==> add_subscriber
* 2 ==> remove_subscriber
* 3 ==> recieve_topic_data
* 4 ==> advertised_topic
* @note: for message types, 1 & 2, the data pointer returned is null with length of 0.
* @param topic_name
* The topic being returned.
* @param data
* the data stream
* @param bytes_returned
* The number of bytes returned in the byte buffer.
* @return status
* 0 == success
* all others is a failure.
*/
AEEResult receive_msg( rout long msg_type, rout string topic_name, rout sequence<octet> data, rout long bytes_returned );
/**
* Since the receive_msg is a blocking call, the client will not be able to peform a clean shutdown. Calling this
* function will unblock the receive msg an return an error code.
* Ideally this should be implemented as a timeout for the #receive_msg call.
* @param none
* @return status
* 0 = success
* all others is a failure.
**/
AEEResult unblock_recieve_msg();
/**
* This interface will perform a bulk read from the adsp and return the data buffer.
* The structure of the messages is as follows
* +----------------+-----------+---------------+----------+----------------+
* | Topic Name Len | datal_len |TopicName(nullterminated) | data bytes |
* +----------------+-----------+---------------+----------+----------------+
* |<-- 2 bytes -->|<-2bytes-> |<-- topicnamelen bytes -->|<-datalenbytes->|
* +----------------+---------------------------+----------+----------------+
* @param data
* The output buffer where the data needs to be copied
* @param bytes_returned
* The number of bytes the buffer is filled up by.
* @param topic_count
* The numbe of topics filled in the buffer.
* @return status
* 0 = success
* all others is a failure.
**/
AEEResult receive_bulk_data( rout sequence<octet> data, rout long bytes_returned, rout long topic_count );
};
-37
View File
@@ -1,37 +0,0 @@
############################################################################
#
# Copyright (c) 2019 PX4 Development Team. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
# 3. Neither the name PX4 nor the names of its contributors may be
# used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
############################################################################
add_subdirectory(common)
add_subdirectory(${PX4_CHIP_MANUFACTURER})
@@ -1,62 +0,0 @@
############################################################################
#
# 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.
#
############################################################################
list(APPEND CMAKE_MODULE_PATH "${PX4_SOURCE_DIR}/boards/atlflight/cmake_hexagon")
include(hexagon_sdk)
include_directories(${HEXAGON_8074_INCLUDES})
set(QURT_LAYER_SRCS
px4_qurt_impl.cpp
tasks.cpp
lib_crc32.c
drv_hrt.cpp
qurt_stubs.c
main.cpp
shmem_qurt.cpp
px4_init.cpp
)
if ("${QURT_ENABLE_STUBS}" STREQUAL "1")
list(APPEND QURT_LAYER_SRCS
stubs/posix.c
stubs/qurt.c
)
endif()
add_library(px4_layer
${QURT_LAYER_SRCS}
${CONFIG_SRC}
)
target_link_libraries(px4_layer PRIVATE work_queue)
add_dependencies(px4_layer uorb_msgs) # dataman requires mission
@@ -1,107 +0,0 @@
/****************************************************************************
*
* Copyright (C) 2015 Mark Charlebois. 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 commands_muorb_test.c
* Commands to run for the "qurt_muorb_test" config
*
* @author Mark Charlebois <charlebm@gmail.com>
*/
const char *get_commands(void);
const char *get_commands()
{
static const char *commands =
"param set CAL_GYRO0_ID 2293760\n"
"param set CAL_ACC0_ID 1310720\n"
"param set CAL_ACC1_ID 1376256\n"
"param set CAL_MAG0_ID 196608\n"
// "rgbled start\n"
// "tone_alarm start\n"
"rc_update start\n"
"commander start --hil\n"
"sensors start\n"
"ekf2 start\n"
"mc_hover_thrust_estimator start\n"
"flight_mode_manager start\n"
"mc_pos_control start\n"
"mc_att_control start\n"
"mc_rate_control start\n"
"sleep 1\n"
"pwm_out_sim start\n"
"param set RC1_MAX 2015\n"
"param set RC1_MIN 996\n"
"param set RC1_TRIM 1502\n"
"param set RC1_REV -1\n"
"param set RC2_MAX 2016 \n"
"param set RC2_MIN 995\n"
"param set RC2_TRIM 1500\n"
"param set RC3_MAX 2003\n"
"param set RC3_MIN 992\n"
"param set RC3_TRIM 992\n"
"param set RC4_MAX 2011\n"
"param set RC4_MIN 997\n"
"param set RC4_TRIM 1504\n"
"param set RC4_REV -1\n"
"param set RC6_MAX 2016\n"
"param set RC6_MIN 992\n"
"param set RC6_TRIM 1504\n"
"param set RC_CHAN_CNT 8\n"
"param set RC_MAP_MODE_SW 5\n"
"param set RC_MAP_POSCTL_SW 7\n"
"param set RC_MAP_RETURN_SW 8\n"
"param set MC_YAW_P 1.5\n"
"param set MC_PITCH_P 3.0\n"
"param set MC_ROLL_P 3.0\n"
"param set MC_YAWRATE_P 0.2\n"
"param set MC_PITCHRATE_P 0.03\n"
"param set MC_ROLLRATE_P 0.03\n"
"param set ATT_W_ACC 0.0002\n"
"param set ATT_W_MAG 0.002\n"
"param set ATT_W_GYRO_BIAS 0.05\n"
"sleep 1\n"
"param set MAV_TYPE 2\n"
"mixer load /dev/pwm_output0 /startup/quad_x.main.mix\n"
"list_files\n"
"list_tasks\n"
"sleep 10\n"
"list_tasks\n"
"sleep 10\n"
;
return commands;
}
-477
View File
@@ -1,477 +0,0 @@
/****************************************************************************
*
* Copyright (c) 2012 - 2018 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 drv_hrt.cpp
*
* High-resolution timer with callouts and timekeeping.
*/
#include <px4_platform_common/time.h>
#include <px4_platform_common/posix.h>
#include <px4_platform_common/defines.h>
#include <px4_platform_common/workqueue.h>
#include <px4_platform_common/tasks.h>
#include <drivers/drv_hrt.h>
#include <semaphore.h>
#include <time.h>
#include <string.h>
#include <errno.h>
#include "hrt_work.h"
// Intervals in usec
static constexpr unsigned HRT_INTERVAL_MIN = 50;
static constexpr unsigned HRT_INTERVAL_MAX = 50000000;
/*
* Queue of callout entries.
*/
static struct sq_queue_s callout_queue;
/* latency baseline (last compare value applied) */
static uint64_t latency_baseline;
/* timer count at interrupt (for latency purposes) */
static uint64_t latency_actual;
/* latency histogram */
const uint16_t latency_bucket_count = LATENCY_BUCKET_COUNT;
const uint16_t latency_buckets[LATENCY_BUCKET_COUNT] = { 1, 2, 5, 10, 20, 50, 100, 1000 };
__EXPORT uint32_t latency_counters[LATENCY_BUCKET_COUNT + 1];
static px4_sem_t _hrt_lock;
static struct work_s _hrt_work;
static int32_t dsp_offset = 0;
static void hrt_latency_update();
static void hrt_call_reschedule();
static void hrt_call_invoke();
hrt_abstime hrt_absolute_time_offset()
{
return 0;
}
static void hrt_lock()
{
px4_sem_wait(&_hrt_lock);
}
static void hrt_unlock()
{
px4_sem_post(&_hrt_lock);
}
#include "dspal_time.h"
int px4_clock_settime(clockid_t clk_id, struct timespec *tp)
{
/* do nothing right now */
return 0;
}
int px4_clock_gettime(clockid_t clk_id, struct timespec *tp)
{
return clock_gettime(clk_id, tp);
}
/*
* Get absolute time.
*/
hrt_abstime hrt_absolute_time()
{
struct timespec ts;
px4_clock_gettime(CLOCK_MONOTONIC, &ts);
return ts_to_abstime(&ts) + dsp_offset;
}
int hrt_set_absolute_time_offset(int32_t time_diff_us)
{
dsp_offset = time_diff_us;
return 0;
}
/*
* Convert a timespec to absolute time.
*/
hrt_abstime ts_to_abstime(const struct timespec *ts)
{
hrt_abstime result;
result = (hrt_abstime)(ts->tv_sec) * 1000000;
result += ts->tv_nsec / 1000;
return result;
}
/*
* Compute the delta between a timestamp taken in the past
* and now.
*
* This function is safe to use even if the timestamp is updated
* by an interrupt during execution.
*/
hrt_abstime hrt_elapsed_time_atomic(const volatile hrt_abstime *then)
{
// This is not atomic as the value on the application layer of POSIX is limited.
hrt_abstime delta = hrt_absolute_time() - *then;
return delta;
}
/*
* Store the absolute time in an interrupt-safe fashion.
*
* This function ensures that the timestamp cannot be seen half-written by an interrupt handler.
*/
void hrt_store_absolute_time(volatile hrt_abstime *t)
{
*t = hrt_absolute_time();
}
/*
* If this returns true, the entry has been invoked and removed from the callout list,
* or it has never been entered.
*
* Always returns false for repeating callouts.
*/
bool hrt_called(struct hrt_call *entry)
{
return (entry->deadline == 0);
}
/*
* Remove the entry from the callout list.
*/
void hrt_cancel(struct hrt_call *entry)
{
hrt_lock();
sq_rem(&entry->link, &callout_queue);
entry->deadline = 0;
/* if this is a periodic call being removed by the callout, prevent it from
* being re-entered when the callout returns.
*/
entry->period = 0;
hrt_unlock();
// endif
}
static void hrt_latency_update()
{
uint16_t latency = latency_actual - latency_baseline;
unsigned index;
/* bounded buckets */
for (index = 0; index < LATENCY_BUCKET_COUNT; index++) {
if (latency <= latency_buckets[index]) {
latency_counters[index]++;
return;
}
}
/* catch-all at the end */
latency_counters[index]++;
}
/*
* initialise a hrt_call structure
*/
void hrt_call_init(struct hrt_call *entry)
{
memset(entry, 0, sizeof(*entry));
}
/*
* delay a hrt_call_every() periodic call by the given number of
* microseconds. This should be called from within the callout to
* cause the callout to be re-scheduled for a later time. The periodic
* callouts will then continue from that new base time at the
* previously specified period.
*/
void hrt_call_delay(struct hrt_call *entry, hrt_abstime delay)
{
entry->deadline = hrt_absolute_time() + delay;
}
/*
* Initialise the HRT.
*/
void hrt_init()
{
sq_init(&callout_queue);
int sem_ret = px4_sem_init(&_hrt_lock, 0, 1);
if (sem_ret) {
PX4_ERR("SEM INIT FAIL: %s", strerror(errno));
}
memset(&_hrt_work, 0, sizeof(_hrt_work));
}
static void
hrt_call_enter(struct hrt_call *entry)
{
struct hrt_call *call, *next;
call = (struct hrt_call *)sq_peek(&callout_queue);
if ((call == nullptr) || (entry->deadline < call->deadline)) {
sq_addfirst(&entry->link, &callout_queue);
//if (call != nullptr) PX4_INFO("call enter at head, reschedule (%lu %lu)", entry->deadline, call->deadline);
/* we changed the next deadline, reschedule the timer event */
hrt_call_reschedule();
} else {
do {
next = (struct hrt_call *)sq_next(&call->link);
if ((next == nullptr) || (entry->deadline < next->deadline)) {
//lldbg("call enter after head\n");
sq_addafter(&call->link, &entry->link, &callout_queue);
break;
}
} while ((call = next) != nullptr);
}
}
/**
* Timer interrupt handler
*
* This routine simulates a timer interrupt handler
*/
static void
hrt_tim_isr(void *p)
{
/* grab the timer for latency tracking purposes */
latency_actual = hrt_absolute_time();
/* do latency calculations */
hrt_latency_update();
/* run any callouts that have met their deadline */
hrt_call_invoke();
hrt_lock();
/* and schedule the next interrupt */
hrt_call_reschedule();
hrt_unlock();
}
/**
* Reschedule the next timer interrupt.
*
* This routine must be called with interrupts disabled.
*/
static void
hrt_call_reschedule()
{
hrt_abstime now = hrt_absolute_time();
hrt_abstime delay = HRT_INTERVAL_MAX;
struct hrt_call *next = (struct hrt_call *)sq_peek(&callout_queue);
hrt_abstime deadline = now + HRT_INTERVAL_MAX;
/*
* Determine what the next deadline will be.
*
* Note that we ensure that this will be within the counter
* period, so that when we truncate all but the low 16 bits
* the next time the compare matches it will be the deadline
* we want.
*
* It is important for accurate timekeeping that the compare
* interrupt fires sufficiently often that the base_time update in
* hrt_absolute_time runs at least once per timer period.
*/
if (next != nullptr) {
//lldbg("entry in queue\n");
if (next->deadline <= (now + HRT_INTERVAL_MIN)) {
//lldbg("pre-expired\n");
/* set a minimal deadline so that we call ASAP */
delay = HRT_INTERVAL_MIN;
} else if (next->deadline < deadline) {
//lldbg("due soon\n");
delay = next->deadline - now;
}
}
/* set the new compare value and remember it for latency tracking */
latency_baseline = now + delay;
// There is no timer ISR, so simulate one by putting an event on the
// high priority work queue
// Remove the existing expiry and update with the new expiry
hrt_work_cancel(&_hrt_work);
hrt_work_queue(&_hrt_work, (worker_t)&hrt_tim_isr, nullptr, delay);
}
static void
hrt_call_internal(struct hrt_call *entry, hrt_abstime deadline, hrt_abstime interval, hrt_callout callout, void *arg)
{
PX4_DEBUG("hrt_call_internal deadline=%lu interval = %lu", deadline, interval);
hrt_lock();
//PX4_INFO("hrt_call_internal after lock");
/* if the entry is currently queued, remove it */
/* note that we are using a potentially uninitialised
entry->link here, but it is safe as sq_rem() doesn't
dereference the passed node unless it is found in the
list. So we potentially waste a bit of time searching the
queue for the uninitialised entry->link but we don't do
anything actually unsafe.
*/
if (entry->deadline != 0) {
sq_rem(&entry->link, &callout_queue);
}
entry->deadline = deadline;
entry->period = interval;
entry->callout = callout;
entry->arg = arg;
hrt_call_enter(entry);
hrt_unlock();
}
/*
* Call callout(arg) after delay has elapsed.
*
* If callout is nullptr, this can be used to implement a timeout by testing the call
* with hrt_called().
*/
void hrt_call_after(struct hrt_call *entry, hrt_abstime delay, hrt_callout callout, void *arg)
{
//printf("hrt_call_after\n");
hrt_call_internal(entry,
hrt_absolute_time() + delay,
0,
callout,
arg);
}
/*
* Call callout(arg) after delay, and then after every interval.
*
* Note thet the interval is timed between scheduled, not actual, call times, so the call rate may
* jitter but should not drift.
*/
void hrt_call_every(struct hrt_call *entry, hrt_abstime delay, hrt_abstime interval, hrt_callout callout, void *arg)
{
hrt_call_internal(entry,
hrt_absolute_time() + delay,
interval,
callout,
arg);
}
/*
* Call callout(arg) at absolute time calltime.
*/
void hrt_call_at(struct hrt_call *entry, hrt_abstime calltime, hrt_callout callout, void *arg)
{
hrt_call_internal(entry, calltime, 0, callout, arg);
}
static void
hrt_call_invoke()
{
struct hrt_call *call;
hrt_abstime deadline;
hrt_lock();
while (true) {
/* get the current time */
hrt_abstime now = hrt_absolute_time();
call = (struct hrt_call *)sq_peek(&callout_queue);
if (call == nullptr) {
break;
}
if (call->deadline > now) {
break;
}
sq_rem(&call->link, &callout_queue);
//PX4_INFO("call pop");
/* save the intended deadline for periodic calls */
deadline = call->deadline;
/* zero the deadline, as the call has occurred */
call->deadline = 0;
/* invoke the callout (if there is one) */
if (call->callout) {
// Unlock so we don't deadlock in callback
hrt_unlock();
//PX4_INFO("call %p: %p(%p)", call, call->callout, call->arg);
call->callout(call->arg);
hrt_lock();
}
/* if the callout has a non-zero period, it has to be re-entered */
if (call->period != 0) {
// re-check call->deadline to allow for
// callouts to re-schedule themselves
// using hrt_call_delay()
if (call->deadline <= now) {
call->deadline = deadline + call->period;
//PX4_INFO("call deadline set to %lu now=%lu", call->deadline, now);
}
hrt_call_enter(call);
}
}
hrt_unlock();
}
void abstime_to_ts(struct timespec *ts, hrt_abstime abstime)
{
ts->tv_sec = abstime / 1000000;
abstime -= ts->tv_sec * 1000000;
ts->tv_nsec = abstime * 1000;
}

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