Compare commits

..

1 Commits

Author SHA1 Message Date
Hamish Willee 7bccbfecb4 4003_qavr5 : inch in title breaks docs rendering 2021-07-15 11:49:24 +10:00
619 changed files with 21228 additions and 9933 deletions
+14 -1
View File
@@ -13,6 +13,7 @@ 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 = [
@@ -105,8 +106,14 @@ 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
armhf_builds, base_builds, nuttx_builds_archive//, snapdragon_builds
]
for (def build_type = 0; build_type < docker_builds.size(); build_type++) {
@@ -158,6 +165,12 @@ 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) {
+461 -481
View File
File diff suppressed because it is too large Load Diff
-1
View File
@@ -11,7 +11,6 @@ on:
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
-1
View File
@@ -12,7 +12,6 @@ jobs:
build:
runs-on: ubuntu-latest
container: px4io/px4-dev-clang:2021-05-04
timeout-minutes: 60
steps:
- uses: actions/checkout@v1
with:
-1
View File
@@ -12,7 +12,6 @@ jobs:
build:
runs-on: ubuntu-latest
container: px4io/px4-dev-armhf:2021-05-04
timeout-minutes: 60
strategy:
matrix:
config: [
@@ -12,7 +12,6 @@ jobs:
build:
runs-on: ubuntu-latest
container: px4io/px4-dev-aarch64:2021-05-04
timeout-minutes: 60
strategy:
matrix:
config: [
-1
View File
@@ -11,7 +11,6 @@ on:
jobs:
build:
runs-on: macos-10.15
timeout-minutes: 60
strategy:
matrix:
config: [
+78 -45
View File
@@ -12,50 +12,83 @@ jobs:
build:
runs-on: ubuntu-latest
container: px4io/px4-dev-nuttx-focal:2021-05-04
timeout-minutes: 60
strategy:
matrix:
config: [
airmind_mindpx-v2,
ark_can-flow,
ark_can-gps,
av_x-v1,
bitcraze_crazyflie,
bitcraze_crazyflie21,
cuav_can-gps-v1,
cuav_nora,
cuav_x7pro,
cubepilot_cubeorange,
cubepilot_cubeyellow,
freefly_can-rtk-gps,
holybro_can-gps-v1,
holybro_durandal-v1,
holybro_kakutef7,
holybro_pix32v5,
modalai_fc-v1,
modalai_fc-v2,
mro_ctrl-zero-f7,
mro_ctrl-zero-f7-oem,
mro_ctrl-zero-h7,
mro_ctrl-zero-h7-oem,
mro_pixracerpro,
mro_x21,
mro_x21-777,
nxp_fmuk66-e,
nxp_fmuk66-v3,
nxp_fmurt1062-v1,
nxp_ucans32k146,
omnibus_f4sd,
px4_fmu-v2,
px4_fmu-v3,
px4_fmu-v4,
px4_fmu-v4pro,
px4_fmu-v5,
px4_fmu-v5x,
px4_fmu-v6u,
px4_fmu-v6x,
spracing_h7extreme,
uvify_core
airmind_mindpx-v2_default,
ark_can-flow_canbootloader,
ark_can-flow_debug,
ark_can-flow_default,
ark_can-gps_canbootloader,
ark_can-gps_debug,
ark_can-gps_default,
av_x-v1_default,
bitcraze_crazyflie21_default,
bitcraze_crazyflie_default,
cuav_can-gps-v1_canbootloader,
cuav_can-gps-v1_debug,
cuav_can-gps-v1_default,
cuav_nora_default,
cuav_x7pro_default,
cubepilot_cubeorange_default,
cubepilot_cubeorange_test,
cubepilot_cubeyellow_default,
cubepilot_cubeyellow_test,
cubepilot_io-v2_default,
freefly_can-rtk-gps_canbootloader,
freefly_can-rtk-gps_default,
holybro_can-gps-v1_canbootloader,
holybro_can-gps-v1_debug,
holybro_can-gps-v1_default,
holybro_durandal-v1_default,
holybro_kakutef7_default,
holybro_pix32v5_default,
modalai_fc-v1_default,
modalai_fc-v1_rtps,
modalai_fc-v2_default,
mro_ctrl-zero-f7-oem_default,
mro_ctrl-zero-f7_default,
mro_ctrl-zero-h7-oem_default,
mro_ctrl-zero-h7_default,
mro_pixracerpro_default,
mro_x21-777_default,
mro_x21_default,
nxp_fmuk66-e_default,
nxp_fmuk66-e_rtps,
nxp_fmuk66-e_socketcan,
nxp_fmuk66-v3_default,
nxp_fmuk66-v3_rtps,
nxp_fmuk66-v3_socketcan,
nxp_fmurt1062-v1_default,
nxp_ucans32k146_canbootloader,
nxp_ucans32k146_default,
omnibus_f4sd_default,
px4_fmu-v2_default,
px4_fmu-v2_fixedwing,
px4_fmu-v2_multicopter,
px4_fmu-v2_rover,
px4_fmu-v3_default,
px4_fmu-v4_cannode,
px4_fmu-v4_default,
px4_fmu-v4pro_default,
px4_fmu-v5_ctrlalloc,
px4_fmu-v5_debug,
px4_fmu-v5_default,
px4_fmu-v5_fixedwing,
px4_fmu-v5_multicopter,
px4_fmu-v5_optimized,
px4_fmu-v5_rover,
px4_fmu-v5_rtps,
px4_fmu-v5_stackcheck,
px4_fmu-v5_uavcanv0periph,
px4_fmu-v5_uavcanv1,
px4_fmu-v5x_base_phy_DP83848C,
px4_fmu-v5x_default,
px4_fmu-v6u_default,
px4_fmu-v6x_default,
px4_io-v2_default,
spracing_h7extreme_default,
uvify_core_default
]
steps:
- uses: actions/checkout@v1
@@ -84,8 +117,8 @@ jobs:
ccache -s
ccache -z
- name: make all_variants_${{matrix.config}}
run: make all_variants_${{matrix.config}}
- name: make ${{matrix.config}}
run: make ${{matrix.config}}
- name: make ${{matrix.config}} bloaty_compileunits
run: make ${{matrix.config}} bloaty_compileunits || true
- name: make ${{matrix.config}} bloaty_inlines
@@ -104,7 +137,7 @@ jobs:
run: ccache -s
- name: Upload px4 package
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v1
with:
name: px4_package_${{matrix.config}}
path: build/**/*.px4
path: build/${{matrix.config}}/${{matrix.config}}.px4
@@ -12,7 +12,6 @@ jobs:
build:
runs-on: ubuntu-latest
container: px4io/px4-dev-nuttx-focal:2021-05-04
timeout-minutes: 60
strategy:
matrix:
config: [
@@ -8,14 +8,13 @@ jobs:
container: px4io/px4-dev-base-focal:2021-05-04
steps:
- uses: actions/checkout@v2.3.1
with:
fetch-depth: 0
- name: checkout newest version of branch
run: |
git fetch origin pull/${{github.event.pull_request.number}}/head:${{github.head_ref}}
git checkout ${GITHUB_HEAD_REF}
- name: main test
run: make tests TESTFILTER=EKF
run: cd ${GITHUB_WORKSPACE}/src/lib/ecl; make test
working-directory: src/lib/ecl
- name: Check if there is a functional change
run: git diff --exit-code
working-directory: src/modules/ekf2/test/change_indication
working-directory: src/lib/ecl/test/change_indication
@@ -0,0 +1,56 @@
name: EKF Build Tests
on:
push:
branches:
- master
pull_request:
branches:
- '*'
jobs:
Linux-GCC:
runs-on: ubuntu-latest
container: px4io/px4-dev-base-focal:2021-05-04
steps:
- uses: actions/checkout@v1
- name: main build
run: make
working-directory: src/lib/ecl
- name: clean build
run: make clean
working-directory: src/lib/ecl
- name: main test
run: make test
working-directory: src/lib/ecl
Linux-Clang:
runs-on: ubuntu-latest
container: px4io/px4-dev-clang:2021-05-04
env:
CC: clang
CXX: clang++
steps:
- uses: actions/checkout@v1
- name: main build
run: make
working-directory: src/lib/ecl
- name: clean build
run: make clean
working-directory: src/lib/ecl
- name: main test
run: make test
working-directory: src/lib/ecl
Mac-OS:
runs-on: macos-latest
steps:
- uses: actions/checkout@v1
- name: main build
run: make
working-directory: src/lib/ecl
- name: clean build
run: make clean
working-directory: src/lib/ecl
- name: main test
run: make test
working-directory: src/lib/ecl
@@ -11,13 +11,11 @@ jobs:
GIT_COMMITTER_NAME: PX4BuildBot
steps:
- uses: actions/checkout@v2.3.1
with:
fetch-depth: 0
- name: main test updates change indication files
run: make tests TESTFILTER=EKF
run: cd ${GITHUB_WORKSPACE}/src/lib/ecl; make test
- name: Check if there exists diff and save result in variable
run: echo "CHANGE_INDICATED=$(git diff --exit-code --output=/dev/null || echo $?)" >> $GITHUB_ENV
working-directory: src/modules/ekf2/test/change_indication
working-directory: src/lib/ecl/test/change_indication
- name: auto-commit any changes to change indication
uses: stefanzweifel/git-auto-commit-action@v4
with:
-1
View File
@@ -11,7 +11,6 @@ on:
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
+7 -3
View File
@@ -18,6 +18,10 @@
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
@@ -34,6 +38,9 @@
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
@@ -63,6 +70,3 @@
[submodule "src/lib/events/libevents"]
path = src/lib/events/libevents
url = https://github.com/mavlink/libevents.git
[submodule "Tools/simulation-ignition"]
path = Tools/simulation-ignition
url = https://github.com/Auterion/px4-simulation-ignition.git
+19 -10
View File
@@ -174,7 +174,6 @@ endif
# --------------------------------------------------------------------
# describe how to build a cmake config
define cmake-build
$(eval CMAKE_ARGS += -DCONFIG=$(1))
@$(eval BUILD_DIR = "$(SRC_DIR)/build/$(1)")
@# check if the desired cmake configuration matches the cache then CMAKE_CACHE_CHECK stays empty
@$(call cmake-cache-check)
@@ -214,7 +213,7 @@ define colorecho
endef
# Get a list of all config targets boards/*/*.cmake
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)
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)
# ADD CONFIGS HERE
# --------------------------------------------------------------------
@@ -222,12 +221,16 @@ ALL_CONFIG_TARGETS := $(shell find boards -maxdepth 3 -mindepth 3 -name '*.cmake
# All targets.
$(ALL_CONFIG_TARGETS):
@$(call cmake-build,$@$(BUILD_DIR_SUFFIX))
@$(eval PX4_CONFIG = $@)
@$(eval CMAKE_ARGS += -DCONFIG=$(PX4_CONFIG))
@$(call cmake-build,$(PX4_CONFIG)$(BUILD_DIR_SUFFIX))
# Filter for only default targets to allow omiting the "_default" postfix
CONFIG_TARGETS_DEFAULT := $(patsubst %_default,%,$(filter %_default,$(ALL_CONFIG_TARGETS)))
$(CONFIG_TARGETS_DEFAULT):
@$(call cmake-build,$@_default$(BUILD_DIR_SUFFIX))
@$(eval PX4_CONFIG = $@_default)
@$(eval CMAKE_ARGS += -DCONFIG=$(PX4_CONFIG))
@$(call cmake-build,$(PX4_CONFIG)$(BUILD_DIR_SUFFIX))
all_config_targets: $(ALL_CONFIG_TARGETS)
all_default_targets: $(CONFIG_TARGETS_DEFAULT)
@@ -240,6 +243,16 @@ 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
# --------------------------------------------------------------------
@@ -293,11 +306,6 @@ check_%:
@$(MAKE) --no-print-directory $(subst check_,,$@)
@echo
all_variants_%:
@echo 'Building all $(subst all_variants_,,$@) variants:' $(filter $(subst all_variants_,,$@)_%, $(ALL_CONFIG_TARGETS))
@echo
$(foreach a,$(filter $(subst all_variants_,,$@)_%, $(ALL_CONFIG_TARGETS)), $(call cmake-build,$(a)$(BUILD_DIR_SUFFIX)))
uorb_graphs:
@./Tools/uorb_graph/create.py --src-path src --exclude-path src/examples --exclude-path src/lib --file Tools/uorb_graph/graph_full
@$(MAKE) --no-print-directory px4_fmu-v2_default uorb_graph
@@ -352,6 +360,7 @@ format:
.PHONY: rostest python_coverage
tests:
$(eval CMAKE_ARGS += -DCONFIG=px4_sitl_test)
$(eval CMAKE_ARGS += -DTESTFILTER=$(TESTFILTER))
$(eval ARGS += test_results)
$(eval ASAN_OPTIONS += color=always:check_initialization_order=1:detect_stack_use_after_return=1)
@@ -502,7 +511,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 '^(Makefile)'
egrep -v -e '^[^[:alnum:]]' -e '^($(subst $(space),|,$(ALL_CONFIG_TARGETS)))$$' -e '_default$$' -e '^(posix|eagle|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 MacOS out of the box.
PX4 is highly portable, OS-independent and supports Linux, NuttX and QuRT 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)):
@@ -1,6 +1,6 @@
#!/bin/sh
#
# @name Lumenier QAV-R (raceblade) 5" arms
# @name Lumenier QAV-R (raceblade) 5inch arms
#
# @type Quadrotor x
# @class Copter
+22 -38
View File
@@ -5,62 +5,46 @@ import subprocess
from subprocess import call, Popen
from argparse import ArgumentParser
import re
import sys
import datetime
COLOR_RED = "\x1b[31m"
COLOR_GREEN = "\x1b[32m"
COLOR_YELLOW = "\x1b[33m"
COLOR_WHITE = "\x1b[37m"
COLOR_RESET = "\x1b[0m"
def print_line(line):
if "WARNING" in line:
line = line.replace("WARNING", f"{COLOR_YELLOW}WARNING{COLOR_RESET}", 1)
elif "WARN" in line:
line = line.replace("WARN", f"{COLOR_YELLOW}WARN{COLOR_RESET}", 1)
elif "ERROR" in line:
line = line.replace("ERROR", f"{COLOR_RED}ERROR{COLOR_RESET}", 1)
elif "INFO" in line:
line = line.replace("INFO", f"{COLOR_WHITE}INFO{COLOR_RESET}", 1)
if "PASSED" in line:
line = line.replace("PASSED", f"{COLOR_GREEN}PASSED{COLOR_RESET}", 1)
if "FAILED" in line:
line = line.replace("FAILED", f"{COLOR_RED}FAILED{COLOR_RESET}", 1)
current_time = datetime.datetime.now()
print('[{0}] {1}'.format(current_time.isoformat(timespec='milliseconds'), line), end='')
def monitor_firmware_upload(port, baudrate):
ser = serial.Serial(port, baudrate, bytesize=serial.EIGHTBITS, parity=serial.PARITY_NONE, stopbits=serial.STOPBITS_ONE, timeout=1, xonxoff=True, rtscts=False, dsrdtr=False)
databits = serial.EIGHTBITS
stopbits = serial.STOPBITS_ONE
parity = serial.PARITY_NONE
ser = serial.Serial(port, baudrate, databits, parity, stopbits, timeout=1)
timeout = 180 # 3 minutes
finished = 0
timeout = 300 # 5 minutes
timeout_start = time.time()
timeout_newline = time.time()
while True:
while finished == 0:
serial_line = ser.readline().decode("ascii", errors='ignore')
if len(serial_line) > 0:
print_line(serial_line)
if (len(serial_line) > 0):
print(serial_line.replace('\n', ''))
if "NuttShell (NSH)" in serial_line:
sys.exit(0)
elif "nsh>" in serial_line:
sys.exit(0)
finished = 1
break
if time.time() - timeout_start > 10:
if "nsh>" in serial_line:
finished = 1
break
if time.time() > timeout_start + timeout:
print("Error, timeout")
sys.exit(-1)
finished = 1
break
# newline every 10 seconds if still running
if time.time() - timeout_newline > 10:
timeout_newline = time.time()
ser.write("\n".encode("ascii"))
ser.write('\n'.encode("ascii"))
ser.flush()
ser.close()
def main():
parser = ArgumentParser(description=__doc__)
parser.add_argument('--device', "-d", nargs='?', default=None, help='', required=True)
-137
View File
@@ -1,137 +0,0 @@
#! /usr/bin/env python3
import serial, time
import subprocess
from subprocess import call, Popen
from argparse import ArgumentParser
import re
import sys
COLOR_RED = "\x1b[31m"
COLOR_GREEN = "\x1b[32m"
COLOR_YELLOW = "\x1b[33m"
COLOR_WHITE = "\x1b[37m"
COLOR_RESET = "\x1b[0m"
def print_line(line):
if "WARNING" in line:
line = line.replace("WARNING", f"{COLOR_YELLOW}WARNING{COLOR_RESET}", 1)
elif "WARN" in line:
line = line.replace("WARN", f"{COLOR_YELLOW}WARN{COLOR_RESET}", 1)
elif "ERROR" in line:
line = line.replace("ERROR", f"{COLOR_RED}ERROR{COLOR_RESET}", 1)
elif "INFO" in line:
line = line.replace("INFO", f"{COLOR_WHITE}INFO{COLOR_RESET}", 1)
if "PASSED" in line:
line = line.replace("PASSED", f"{COLOR_GREEN}PASSED{COLOR_RESET}", 1)
if "FAILED" in line:
line = line.replace("FAILED", f"{COLOR_RED}FAILED{COLOR_RESET}", 1)
print(line, end='')
def do_param_set_cmd(port, baudrate, param_name, param_value):
ser = serial.Serial(port, baudrate, bytesize=serial.EIGHTBITS, parity=serial.PARITY_NONE, stopbits=serial.STOPBITS_ONE, timeout=0.1, xonxoff=True, rtscts=False, dsrdtr=False)
timeout_start = time.time()
timeout = 10 # 10 seconds
# wait for nsh prompt
while True:
ser.write("\n".encode("ascii"))
ser.flush()
serial_line = ser.readline().decode("ascii", errors='ignore')
if "nsh>" in serial_line:
break
else:
if len(serial_line) > 0:
print_line(serial_line)
if time.time() > timeout_start + timeout:
print("Error, timeout waiting for prompt")
sys.exit(1)
# clear
ser.readlines()
# run command
timeout_start = time.time()
timeout = 10 # 10 seconds
cmd = "param set " + param_name + " " + param_value
# write command (param set) and wait for command echo
serial_cmd = '{0}\r\n'.format(cmd)
ser.write(serial_cmd.encode("ascii"))
ser.flush()
while True:
serial_line = ser.readline().decode("ascii", errors='ignore')
if cmd in serial_line:
print_line(serial_line)
break
else:
if len(serial_line) > 0:
print_line(serial_line)
if time.time() > timeout_start + timeout:
print("Error, timeout waiting for command echo")
break
# verify param value
cmd = "param show " + param_name
serial_cmd = '{0}\r\n'.format(cmd)
ser.write(serial_cmd.encode("ascii"))
ser.flush()
param_show_response = param_name + " ["
timeout_start = time.time()
timeout = 2 # 2 seconds
while True:
serial_line = ser.readline().decode("ascii", errors='ignore')
if param_show_response in serial_line:
print_line(serial_line)
current_param_value = serial_line.split(":")[-1].strip()
if (current_param_value == param_value):
sys.exit(0)
else:
sys.exit(1)
else:
if len(serial_line) > 0:
print_line(serial_line)
if time.time() > timeout_start + timeout:
if "nsh>" in serial_line:
sys.exit(1) # error, command didn't complete successfully
elif "NuttShell (NSH)" in serial_line:
sys.exit(1) # error, command didn't complete successfully
if len(serial_line) <= 0:
ser.write("\r\n".encode("ascii"))
ser.flush()
if time.time() > timeout_start + timeout:
print("Error, timeout")
sys.exit(-1)
ser.close()
def main():
parser = ArgumentParser(description=__doc__)
parser.add_argument('--device', "-d", nargs='?', default=None, help='', required=True)
parser.add_argument("--baudrate", "-b", dest="baudrate", type=int, help="Mavlink port baud rate (default=57600)", default=57600)
parser.add_argument("--name", "-p", dest="param_name", help="Parameter name")
parser.add_argument("--value", "-v", dest="param_value", help="Parameter value")
args = parser.parse_args()
do_param_set_cmd(args.device, args.baudrate, args.param_name, args.param_value)
if __name__ == "__main__":
main()
+37 -72
View File
@@ -6,89 +6,52 @@ from subprocess import call, Popen
from argparse import ArgumentParser
import re
import sys
import datetime
COLOR_RED = "\x1b[31m"
COLOR_GREEN = "\x1b[32m"
COLOR_YELLOW = "\x1b[33m"
COLOR_WHITE = "\x1b[37m"
COLOR_RESET = "\x1b[0m"
def print_line(line):
if "WARNING" in line:
line = line.replace("WARNING", f"{COLOR_YELLOW}WARNING{COLOR_RESET}", 1)
elif "WARN" in line:
line = line.replace("WARN", f"{COLOR_YELLOW}WARN{COLOR_RESET}", 1)
elif "ERROR" in line:
line = line.replace("ERROR", f"{COLOR_RED}ERROR{COLOR_RESET}", 1)
elif "INFO" in line:
line = line.replace("INFO", f"{COLOR_WHITE}INFO{COLOR_RESET}", 1)
if "PASSED" in line:
line = line.replace("PASSED", f"{COLOR_GREEN}PASSED{COLOR_RESET}", 1)
if "FAILED" in line:
line = line.replace("FAILED", f"{COLOR_RED}FAILED{COLOR_RESET}", 1)
current_time = datetime.datetime.now()
print('[{0}] {1}'.format(current_time.isoformat(timespec='milliseconds'), line), end='')
def do_nsh_cmd(port, baudrate, cmd):
ser = serial.Serial(port, baudrate, bytesize=serial.EIGHTBITS, parity=serial.PARITY_NONE, stopbits=serial.STOPBITS_ONE, timeout=0.1, xonxoff=True, rtscts=False, dsrdtr=False)
timeout_start = time.time()
timeout = 10 # 10 seconds
# wait for nsh prompt
while True:
ser.write("\n".encode("ascii"))
ser.flush()
serial_line = ser.readline().decode("ascii", errors='ignore')
if "nsh>" in serial_line:
break
else:
if len(serial_line) > 0:
print_line(serial_line)
if time.time() > timeout_start + timeout:
print("Error, timeout waiting for prompt")
sys.exit(1)
# clear
ser.readlines()
databits = serial.EIGHTBITS
stopbits = serial.STOPBITS_ONE
parity = serial.PARITY_NONE
ser = serial.Serial(port, baudrate, databits, parity, stopbits, timeout=0.1)
# run command
timeout_start = time.time()
timeout = 1 # 1 second
timeout = 10 # 10 seconds
# clear
ser.write("\n".encode("ascii"))
ser.flush()
ser.readline()
success_cmd = "cmd succeeded!"
# wait for command echo
serial_cmd = '{0}; echo "{1}"\r\n'.format(cmd, success_cmd)
serial_cmd = '{0}; echo "{1}"\n'.format(cmd, success_cmd)
ser.write(serial_cmd.encode("ascii"))
ser.flush()
while True:
serial_line = ser.readline().decode("ascii", errors='ignore')
ser.readline()
if cmd in serial_line:
break
elif serial_line.startswith(success_cmd) and len(serial_line) <= len(success_cmd) + 2:
print_line(serial_line)
# we missed the echo, but command ran and succeeded
sys.exit(0)
else:
if len(serial_line) > 0:
print_line(serial_line)
# TODO: require successful command echo
# while True:
# serial_cmd = '{0}; echo "{1}"\n'.format(cmd, success_cmd)
# ser.write(serial_cmd.encode("ascii"))
# ser.flush()
if time.time() > timeout_start + timeout:
print("Error, timeout waiting for command echo")
break
# serial_line = ser.readline().decode("ascii", errors='ignore')
# if cmd in serial_line:
# break
# else:
# print(serial_line, end='')
# if time.time() > timeout_start + timeout:
# print("Error, timeout")
# sys.exit(-1)
# break
# time.sleep(1)
timeout_start = time.time()
timeout = 180 # 3 minutes
timeout = 30 # 30 seconds
while True:
serial_line = ser.readline().decode("ascii", errors='ignore')
@@ -97,15 +60,17 @@ def do_nsh_cmd(port, baudrate, cmd):
break
else:
if len(serial_line) > 0:
print_line(serial_line)
print(serial_line, end='')
if "nsh>" in serial_line:
sys.exit(1) # error, command didn't complete successfully
#sys.exit(-1) # error, command didn't complete successfully
break # TODO: return error on failure
elif "NuttShell (NSH)" in serial_line:
sys.exit(1) # error, command didn't complete successfully
#sys.exit(-1) # error, command didn't complete successfully
break # TODO: return error on failure
if len(serial_line) <= 0:
ser.write("\r\n".encode("ascii"))
ser.write("\n".encode("ascii"))
ser.flush()
if time.time() > timeout_start + timeout:
+50 -86
View File
@@ -8,58 +8,12 @@ import re
import unittest
import os
import sys
import datetime
COLOR_RED = "\x1b[31m"
COLOR_GREEN = "\x1b[32m"
COLOR_YELLOW = "\x1b[33m"
COLOR_WHITE = "\x1b[37m"
COLOR_RESET = "\x1b[0m"
def print_line(line):
if "WARNING" in line:
line = line.replace("WARNING", f"{COLOR_YELLOW}WARNING{COLOR_RESET}", 1)
elif "WARN" in line:
line = line.replace("WARN", f"{COLOR_YELLOW}WARN{COLOR_RESET}", 1)
elif "ERROR" in line:
line = line.replace("ERROR", f"{COLOR_RED}ERROR{COLOR_RESET}", 1)
elif "INFO" in line:
line = line.replace("INFO", f"{COLOR_WHITE}INFO{COLOR_RESET}", 1)
if "PASSED" in line:
line = line.replace("PASSED", f"{COLOR_GREEN}PASSED{COLOR_RESET}", 1)
if "FAILED" in line:
line = line.replace("FAILED", f"{COLOR_RED}FAILED{COLOR_RESET}", 1)
current_time = datetime.datetime.now()
print('[{0}] {1}'.format(current_time.isoformat(timespec='milliseconds'), line), end='')
def do_test(port, baudrate, test_name):
ser = serial.Serial(port, baudrate, bytesize=serial.EIGHTBITS, parity=serial.PARITY_NONE, stopbits=serial.STOPBITS_ONE, timeout=0.2, xonxoff=True, rtscts=False, dsrdtr=False)
timeout_start = time.time()
timeout = 10 # 10 seconds
# wait for nsh prompt
while True:
ser.write("\n".encode("ascii"))
ser.flush()
serial_line = ser.readline().decode("ascii", errors='ignore')
if "nsh>" in serial_line:
break
else:
if len(serial_line) > 0:
print(serial_line, end='')
if time.time() > timeout_start + timeout:
print("Error, timeout waiting for prompt")
return False
# clear
ser.readlines()
databits = serial.EIGHTBITS
stopbits = serial.STOPBITS_ONE
parity = serial.PARITY_NONE
ser = serial.Serial(port, baudrate, databits, parity, stopbits, timeout=1)
success = False
@@ -68,38 +22,48 @@ def do_test(port, baudrate, test_name):
cmd = 'tests ' + test_name
print("| Running:", cmd)
print('|======================================================================')
timeout_start = time.time()
timeout = 2 # 2 seconds
timeout = 10 # 10 seconds
# clear
ser.write("\n".encode("ascii"))
ser.flush()
ser.readline()
# wait for command echo
serial_cmd = '{0}\n'.format(cmd)
ser.write(serial_cmd.encode("ascii"))
ser.flush()
while True:
serial_line = ser.readline().decode("ascii", errors='ignore')
ser.readline()
if cmd in serial_line:
break
else:
if len(serial_line) > 0:
print_line(serial_line)
# TODO: retry command
# while True:
# serial_cmd = '{0}\n'.format(cmd)
# ser.write(serial_cmd.encode("ascii"))
# ser.flush()
if time.time() > timeout_start + timeout:
print("Error, timeout waiting for command echo")
break
# serial_line = ser.readline().decode("ascii", errors='ignore')
# if cmd in serial_line:
# break
# else:
# print(serial_line.replace('\n', ''))
# if time.time() > timeout_start + timeout:
# print("Error, unable to write cmd")
# return False
# time.sleep(1)
# print results, wait for final result (PASSED or FAILED)
timeout = 300 # 5 minutes
timeout = 180 # 3 minutes
timeout_start = time.time()
timeout_newline = timeout_start
while True:
serial_line = ser.readline().decode("ascii", errors='ignore')
if len(serial_line) > 0:
print_line(serial_line)
if (len(serial_line) > 0):
print(serial_line, end='')
if test_name + " PASSED" in serial_line:
success = True
@@ -110,7 +74,7 @@ def do_test(port, baudrate, test_name):
if time.time() > timeout_start + timeout:
print("Error, timeout")
print(test_name + f" {COLOR_RED}FAILED{COLOR_RESET}")
print(test_name + " FAILED")
success = False
break
@@ -139,30 +103,15 @@ class TestHardwareMethods(unittest.TestCase):
def test_bson(self):
self.assertTrue(do_test(self.TEST_DEVICE, self.TEST_BAUDRATE, "bson"))
def test_conv(self):
self.assertTrue(do_test(self.TEST_DEVICE, self.TEST_BAUDRATE, "conv"))
# def test_dataman(self):
# self.assertTrue(do_test(self.TEST_DEVICE, self.TEST_BAUDRATE, "dataman"))
def test_dataman(self):
self.assertTrue(do_test(self.TEST_DEVICE, self.TEST_BAUDRATE, "dataman"))
# def test_file(self):
# self.assertTrue(do_test(self.TEST_DEVICE, self.TEST_BAUDRATE, "file"))
def test_file2(self):
self.assertTrue(do_test(self.TEST_DEVICE, self.TEST_BAUDRATE, "file2"))
def test_float(self):
def floattest_float(self):
self.assertTrue(do_test(self.TEST_DEVICE, self.TEST_BAUDRATE, "float"))
def test_hrt(self):
self.assertTrue(do_test(self.TEST_DEVICE, self.TEST_BAUDRATE, "hrt"))
def test_int(self):
self.assertTrue(do_test(self.TEST_DEVICE, self.TEST_BAUDRATE, "int"))
def test_i2c_spi_cli(self):
self.assertTrue(do_test(self.TEST_DEVICE, self.TEST_BAUDRATE, "i2c_spi_cli"))
def test_IntrusiveQueue(self):
self.assertTrue(do_test(self.TEST_DEVICE, self.TEST_BAUDRATE, "IntrusiveQueue"))
@@ -178,6 +127,21 @@ class TestHardwareMethods(unittest.TestCase):
def test_matrix(self):
self.assertTrue(do_test(self.TEST_DEVICE, self.TEST_BAUDRATE, "matrix"))
def test_microbench_atomic(self):
self.assertTrue(do_test(self.TEST_DEVICE, self.TEST_BAUDRATE, "microbench_atomic"))
def test_microbench_hrt(self):
self.assertTrue(do_test(self.TEST_DEVICE, self.TEST_BAUDRATE, "microbench_hrt"))
def test_microbench_math(self):
self.assertTrue(do_test(self.TEST_DEVICE, self.TEST_BAUDRATE, "microbench_math"))
def test_microbench_matrix(self):
self.assertTrue(do_test(self.TEST_DEVICE, self.TEST_BAUDRATE, "microbench_matrix"))
def test_microbench_uorb(self):
self.assertTrue(do_test(self.TEST_DEVICE, self.TEST_BAUDRATE, "microbench_uorb"))
# def test_mixer(self):
# self.assertTrue(do_test(self.TEST_DEVICE, self.TEST_BAUDRATE, "mixer"))
+3 -3
View File
@@ -12,16 +12,16 @@ exec find boards msg src platforms test \
-path platforms/nuttx/NuttX -prune -o \
-path platforms/qurt/dspal -prune -o \
-path src/drivers/uavcan/libuavcan -prune -o \
-path src/drivers/uavcan/uavcan_drivers/kinetis/driver/include/uavcan_kinetis -prune -o \
-path src/drivers/uavcan_v1/libcanard -prune -o \
-path src/drivers/uavcannode_gps_demo/libcanard -prune -o \
-path src/lib/crypto/monocypher -prune -o \
-path src/drivers/uavcan/uavcan_drivers/kinetis/driver/include/uavcan_kinetis -prune -o \
-path src/lib/ecl -prune -o \
-path src/lib/events/libevents -prune -o \
-path src/lib/matrix -prune -o \
-path src/lib/parameters/uthash -prune -o \
-path src/modules/ekf2/EKF -prune -o \
-path src/modules/gyro_fft/CMSIS_5 -prune -o \
-path src/modules/micrortps_bridge/micro-CDR -prune -o \
-path src/modules/micrortps_bridge/microRTPS_client -prune -o \
-path test/mavsdk_tests/catch2 -prune -o \
-path src/lib/crypto/monocypher -prune -o \
-type f \( -name "*.c" -o -name "*.h" -o -name "*.cpp" -o -name "*.hpp" \) | grep $PATTERN
+3
View File
@@ -11,6 +11,9 @@ 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"
+20 -50
View File
@@ -5,47 +5,17 @@ import html
class MarkdownTablesOutput():
def __init__(self, groups, board, image_path):
result = """# Airframes Reference
result = ("# Airframes Reference\n"
"> **Note** **This list is [auto-generated](https://github.com/PX4/PX4-Autopilot/blob/master/Tools/px4airframes/markdownout.py) from the source code**.\n"
"> \n"
"> **AUX** channels may not be present on some flight controllers.\n"
"> If present, PWM AUX channels are commonly labelled **AUX OUT**.\n"
"> \n"
"\n")
:::note
**This list is [auto-generated](https://github.com/PX4/PX4-Autopilot/blob/master/Tools/px4airframes/markdownout.py) from the source code** using the build command: `make airframe_metadata`.
:::
This page lists all supported airframes and types including the motor assignment and numbering.
The motors in **green** rotate clockwise, the ones in **blue** counterclockwise.
**AUX** channels may not be present on some flight controllers.
If present, PWM AUX channels are commonly labelled **AUX OUT**.
<style>
table {
display: table;
table-layout: fixed;
margin-bottom: 5px;
}
table.common {
float: right;
width: 70%;
}
table.airframes {
width: 100%;
}
table.airframes th:nth-child(1) {
width: 30%;
}
tr > * {
vertical-align : top;
}
td, th {
text-align : left;
}
img {
max-height: 180px;
width: 29%;
padding-top: 10px;
}
</style>\n\n"""
result += """This page lists all supported airframes and types including
the motor assignment and numbering. The motors in **green** rotate clockwise,
the ones in **blue** counterclockwise.\n\n"""
type_set = set()
@@ -63,7 +33,7 @@ img {
image_name = group.GetImageName()
result += '<div>\n'
image_name = image_path + image_name
result += '<img src="%s.svg"/>\n' % (image_name)
result += '<img src="%s.svg" width="29%%" style="max-height: 180px;"/>\n' % (image_name)
# check if all outputs are equal for the group: if so, show them
# only once
@@ -93,17 +63,19 @@ img {
outputs_prev[i] = ''
if outputs_match[0] or outputs_match[1]:
result += '<table class="common">\n'
result += '<table style="float: right; width: 70%; font-size:1.5rem;">\n'
result += ' <colgroup><col></colgroup>\n'
result += ' <thead>\n'
result += ' <tr><th>Common Outputs</th></tr>\n'
result += ' </thead>\n'
result += ' <tbody>\n'
result += '<tr>\n <td><ul>%s%s</ul></td>\n</tr>\n' % (outputs_prev[0], outputs_prev[1])
result += '<tbody>\n'
result += '<tr>\n <td style="vertical-align: top;"><ul>%s%s</ul></td>\n</tr>\n' % (outputs_prev[0], outputs_prev[1])
result += '</tbody></table>\n'
result += '</div>\n\n'
result += '<table class="generic">\n'
result += '<table style="width: 100%; table-layout:fixed; font-size:1.5rem;">\n'
result += ' <colgroup><col style="width: 30%"><col style="width: 70%"></colgroup>\n'
result += ' <thead>\n'
result += ' <tr><th>Name</th><th></th></tr>\n'
result += ' </thead>\n'
@@ -118,12 +90,10 @@ img {
maintainer = param.GetMaintainer()
maintainer_entry = ''
if maintainer != '':
maintainer_entry = 'Maintainer: %s' % (html.escape(maintainer))
maintainer_entry = '<p>Maintainer: %s</p>' % (html.escape(maintainer))
url = param.GetFieldValue('url')
name_anchor='%s_%s_%s' % (group.GetClass(),group.GetName(),name)
name_anchor='id="%s_%s_%s"' % (group.GetClass(),group.GetName(),name)
name_anchor=name_anchor.replace(' ','_').lower()
name_anchor=name_anchor.replace('"','_').lower()
name_anchor='id="%s"' % name_anchor
name_entry = name
if url != '':
name_entry = '<a href="%s">%s</a>' % (url, name)
@@ -150,7 +120,7 @@ img {
else:
outputs_entry = ''
result += ('<tr %s>\n <td>%s</td>\n <td>%s%s%s</td>\n</tr>\n' %
result += ('<tr %s>\n <td style="vertical-align: top;">%s</td>\n <td style="vertical-align: top;">%s%s%s</td>\n\n</tr>\n' %
(name_anchor, name_entry, maintainer_entry, airframe_id_entry,
outputs_entry))
-23
View File
@@ -1,23 +0,0 @@
#!/bin/bash
#
# Setup environment to make PX4 visible to Gazebo.
#
# Note, this is not necessary if using a ROS catkin workspace with the px4
# package as the paths are exported.
#
# License: according to LICENSE.md in the root directory of the PX4 Firmware repository
if [ "$#" != 2 ]; then
echo -e "usage: source setup_gazebo.bash src_dir build_dir\n"
return 1
fi
SRC_DIR=$1
BUILD_DIR=$2
# setup Gazebo env and update package path
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${SRC_DIR}/build/px4_sitl_default/build_ign_gazebo
export IGN_GAZEBO_SYSTEM_PLUGIN_PATH=$IGN_GAZEBO_SYSTEM_PLUGIN_PATH:${SRC_DIR}/build/px4_sitl_default/build_ign_gazebo
export IGN_GAZEBO_RESOURCE_PATH=$IGN_GAZEBO_RESOURCE_PATH:${SRC_DIR}/Tools/simulation-ignition/models
echo -e "LD_LIBRARY_PATH $LD_LIBRARY_PATH"
-4
View File
@@ -177,10 +177,6 @@ elif [ "$program" == "gazebo" ] && [ ! -n "$no_sim" ]; then
echo "You need to have gazebo simulator installed!"
exit 1
fi
elif [ "$program" == "ignition" ] && [ -z "$no_sim" ]; then
echo "Ignition Gazebo"
source "$src_path/Tools/setup_ignition.bash" "${src_path}" "${build_path}"
ign gazebo -r "${src_path}/Tools/simulation-ignition/worlds/ignition.world"&
elif [ "$program" == "flightgear" ] && [ -z "$no_sim" ]; then
echo "FG setup"
cd "${src_path}/Tools/flightgear_bridge/"
+32
View File
@@ -0,0 +1,32 @@
############################################################################
#
# 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
@@ -0,0 +1,64 @@
############################################################################
#
# 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
@@ -0,0 +1,128 @@
# 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
@@ -0,0 +1,88 @@
# 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
)
@@ -0,0 +1,2 @@
minidm.log
px4.log
+32
View File
@@ -0,0 +1,32 @@
#!/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
+288
View File
@@ -0,0 +1,288 @@
#!/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
@@ -1,6 +1,6 @@
############################################################################
#
# Copyright (c) 2018-2021 PX4 Development Team. All rights reserved.
# Copyright (c) 2015 PX4 Development Team. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
@@ -31,8 +31,9 @@
#
############################################################################
add_library(wind_estimator
WindEstimator.cpp
WindEstimator.hpp
add_library(drivers_board
board_config.h
i2c.cpp
init.c
spi.cpp
)
add_dependencies(wind_estimator prebuild_targets)
+53
View File
@@ -0,0 +1,53 @@
/****************************************************************************
*
* 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
@@ -0,0 +1,40 @@
/****************************************************************************
*
* 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
@@ -0,0 +1,41 @@
/****************************************************************************
*
* 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
@@ -0,0 +1,126 @@
# 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
@@ -0,0 +1,88 @@
# 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
)
@@ -0,0 +1,39 @@
############################################################################
#
# 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
)
@@ -0,0 +1,51 @@
/****************************************************************************
*
* 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
@@ -0,0 +1,40 @@
/****************************************************************************
*
* 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
@@ -0,0 +1,41 @@
/****************************************************************************
*
* 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,6 +244,22 @@ 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)
{
@@ -268,7 +284,7 @@ RingBuffer::get(void *val, size_t val_size)
}
/* if the tail pointer didn't change, we got our item */
} while (!__sync_bool_compare_and_swap(&_tail, candidate, next));
} while (!__PX4_SBCAP(&_tail, candidate, next));
return true;
-1
View File
@@ -105,7 +105,6 @@
/* HEATER */
#define GPIO_HEATER_OUTPUT /* PA8 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN8)
#define HEATER_OUTPUT_EN(on_true) px4_arch_gpiowrite(GPIO_HEATER_OUTPUT, (on_true))
/* PWM */
#define DIRECT_PWM_OUTPUT_CHANNELS 14
+1 -2
View File
@@ -31,7 +31,7 @@ px4_add_board(
gps
heater
#imu # all available imu drivers
#imu/analog_devices/adis16448
imu/analog_devices/adis16448
imu/bosch/bmi088
imu/invensense/icm20649
imu/invensense/icm20689
@@ -102,7 +102,6 @@ px4_add_board(
i2cdetect
led_control
mft
microbench
mixer
motor_ramp
motor_test
+2 -3
View File
@@ -105,7 +105,6 @@
/* HEATER */
#define GPIO_HEATER_OUTPUT /* PA8 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN8)
#define HEATER_OUTPUT_EN(on_true) px4_arch_gpiowrite(GPIO_HEATER_OUTPUT, (on_true))
/* PWM */
#define DIRECT_PWM_OUTPUT_CHANNELS 14
@@ -118,8 +117,8 @@
#define GPIO_nPOWER_IN_CAN /* PG2 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTG|GPIO_PIN2)
#define GPIO_nPOWER_IN_C /* PG0 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTG|GPIO_PIN0)
#define GPIO_nVDD_BRICK1_VALID GPIO_nPOWER_IN_ADC /* Brick 1 is Chosen */
#define GPIO_nVDD_BRICK2_VALID GPIO_nPOWER_IN_CAN /* Brick 2 is Chosen */
#define GPIO_nVDD_BRICK1_VALID GPIO_nPOWER_IN_CAN /* Brick 1 is Chosen */
#define GPIO_nVDD_BRICK2_VALID GPIO_nPOWER_IN_ADC /* Brick 2 is Chosen */
#define GPIO_nVDD_USB_VALID GPIO_nPOWER_IN_C /* USB is Chosen */
#define GPIO_VDD_5V_HIPOWER_EN /* PD11 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTD|GPIO_PIN11)
-1
View File
@@ -103,7 +103,6 @@ px4_add_board(
i2cdetect
led_control
mft
microbench
mixer
motor_ramp
motor_test
-1
View File
@@ -100,7 +100,6 @@ px4_add_board(
i2cdetect
led_control
mft
microbench
mixer
motor_ramp
motor_test
-1
View File
@@ -98,7 +98,6 @@ px4_add_board(
i2cdetect
led_control
mft
microbench
mixer
motor_ramp
motor_test
@@ -174,7 +174,6 @@
* PWM in future
*/
#define GPIO_HEATER_OUTPUT /* PA7 T14CH1 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN7)
#define HEATER_OUTPUT_EN(on_true) px4_arch_gpiowrite(GPIO_HEATER_OUTPUT, (on_true))
/* PWM Capture
*
-1
View File
@@ -98,7 +98,6 @@ px4_add_board(
i2cdetect
led_control
mft
microbench
mixer
motor_ramp
motor_test
@@ -209,7 +209,6 @@
* PWM in future
*/
#define GPIO_HEATER_OUTPUT /* PA7 T14CH1 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN7)
#define HEATER_OUTPUT_EN(on_true) px4_arch_gpiowrite(GPIO_HEATER_OUTPUT, (on_true))
/* PWM Capture
*
-1
View File
@@ -102,7 +102,6 @@ px4_add_board(
i2cdetect
led_control
mft
microbench
mixer
motor_ramp
motor_test
-1
View File
@@ -95,7 +95,6 @@ px4_add_board(
i2cdetect
led_control
mft
microbench
mixer
motor_ramp
motor_test
-1
View File
@@ -100,7 +100,6 @@ px4_add_board(
i2cdetect
led_control
mft
microbench
mixer
motor_ramp
motor_test
@@ -80,7 +80,6 @@ CONFIG_KINETIS_I2C0=y
CONFIG_KINETIS_I2C1=y
CONFIG_KINETIS_LPTMR0=y
CONFIG_KINETIS_LPUART0=y
CONFIG_KINETIS_LPUART0_RXDMA=y
CONFIG_KINETIS_MERGE_TTY=y
CONFIG_KINETIS_PDB=y
CONFIG_KINETIS_PIT=y
@@ -81,7 +81,6 @@ CONFIG_KINETIS_I2C0=y
CONFIG_KINETIS_I2C1=y
CONFIG_KINETIS_LPTMR0=y
CONFIG_KINETIS_LPUART0=y
CONFIG_KINETIS_LPUART0_RXDMA=y
CONFIG_KINETIS_MERGE_TTY=y
CONFIG_KINETIS_PDB=y
CONFIG_KINETIS_PIT=y
+2 -40
View File
@@ -64,7 +64,8 @@
#include <kinetis.h>
#include <kinetis_uart.h>
#include <kinetis_lpuart.h>
#include <hardware/kinetis_uart.h>
#include <hardware/kinetis_sim.h>
#include "board_config.h"
#include "arm_arch.h"
@@ -188,26 +189,6 @@ kinetis_boardinitialize(void)
VDD_3V3_SPEKTRUM_POWER_EN(true);
}
/****************************************************************************
* Name: kinetis_serial_dma_poll_all
*
* Description:
* Checks receive DMA buffers for received bytes that have not accumulated
* to the point where the DMA half/full interrupt has triggered.
*
* This function should be called from a timer or other periodic context.
*
****************************************************************************/
void kinetis_lpserial_dma_poll_all(void)
{
#if defined(LPSERIAL_HAVE_DMA)
kinetis_lpserial_dma_poll();
#endif
#if defined(SERIAL_HAVE_DMA)
kinetis_serial_dma_poll();
#endif
}
/****************************************************************************
* Name: board_app_initialize
@@ -254,25 +235,6 @@ __EXPORT int board_app_initialize(uintptr_t arg)
syslog(LOG_ERR, "DMA alloc FAILED\n");
}
/* set up the serial DMA polling */
#if defined(SERIAL_HAVE_DMA) || defined(LPSERIAL_HAVE_DMA)
static struct hrt_call serial_dma_call;
struct timespec ts;
/*
* Poll at 1ms intervals for received bytes that have not triggered
* a DMA event.
*/
ts.tv_sec = 0;
ts.tv_nsec = 1000000;
hrt_call_every(&serial_dma_call,
ts_to_abstime(&ts),
ts_to_abstime(&ts),
(hrt_callout)kinetis_lpserial_dma_poll_all,
NULL);
#endif
/* initial LED state */
drv_led_start();
led_off(LED_RED);
@@ -81,7 +81,6 @@ CONFIG_KINETIS_I2C0=y
CONFIG_KINETIS_I2C1=y
CONFIG_KINETIS_LPTMR0=y
CONFIG_KINETIS_LPUART0=y
CONFIG_KINETIS_LPUART0_RXDMA=y
CONFIG_KINETIS_MERGE_TTY=y
CONFIG_KINETIS_PDB=y
CONFIG_KINETIS_PIT=y
@@ -82,7 +82,6 @@ CONFIG_KINETIS_I2C0=y
CONFIG_KINETIS_I2C1=y
CONFIG_KINETIS_LPTMR0=y
CONFIG_KINETIS_LPUART0=y
CONFIG_KINETIS_LPUART0_RXDMA=y
CONFIG_KINETIS_MERGE_TTY=y
CONFIG_KINETIS_PDB=y
CONFIG_KINETIS_PIT=y
+2 -40
View File
@@ -64,7 +64,8 @@
#include <kinetis.h>
#include <kinetis_uart.h>
#include <kinetis_lpuart.h>
#include <hardware/kinetis_uart.h>
#include <hardware/kinetis_sim.h>
#include "board_config.h"
#include "arm_arch.h"
@@ -188,26 +189,6 @@ kinetis_boardinitialize(void)
VDD_3V3_SPEKTRUM_POWER_EN(true);
}
/****************************************************************************
* Name: kinetis_serial_dma_poll_all
*
* Description:
* Checks receive DMA buffers for received bytes that have not accumulated
* to the point where the DMA half/full interrupt has triggered.
*
* This function should be called from a timer or other periodic context.
*
****************************************************************************/
void kinetis_lpserial_dma_poll_all(void)
{
#if defined(LPSERIAL_HAVE_DMA)
kinetis_lpserial_dma_poll();
#endif
#if defined(SERIAL_HAVE_DMA)
kinetis_serial_dma_poll();
#endif
}
/****************************************************************************
* Name: board_app_initialize
@@ -254,25 +235,6 @@ __EXPORT int board_app_initialize(uintptr_t arg)
syslog(LOG_ERR, "DMA alloc FAILED\n");
}
/* set up the serial DMA polling */
#if defined(SERIAL_HAVE_DMA) || defined(LPSERIAL_HAVE_DMA)
static struct hrt_call serial_dma_call;
struct timespec ts;
/*
* Poll at 1ms intervals for received bytes that have not triggered
* a DMA event.
*/
ts.tv_sec = 0;
ts.tv_nsec = 1000000;
hrt_call_every(&serial_dma_call,
ts_to_abstime(&ts),
ts_to_abstime(&ts),
(hrt_callout)kinetis_lpserial_dma_poll_all,
NULL);
#endif
/* initial LED state */
drv_led_start();
led_off(LED_RED);
-1
View File
@@ -94,7 +94,6 @@ px4_add_board(
i2cdetect
led_control
mft
microbench
mixer
motor_ramp
motor_test
@@ -215,7 +215,6 @@
*/
#define HEATER_IOMUX (IOMUX_CMOS_OUTPUT | IOMUX_PULL_NONE | IOMUX_DRIVE_50OHM | IOMUX_SPEED_MEDIUM | IOMUX_SLEW_FAST)
#define GPIO_HEATER_OUTPUT /* GPIO_B1_09 QTIMER2_TIMER3 GPIO2_IO25 */ (GPIO_QTIMER2_TIMER3_1 | HEATER_IOMUX)
#define HEATER_OUTPUT_EN(on_true) px4_arch_gpiowrite(GPIO_HEATER_OUTPUT, (on_true))
/* PWM Capture
*
+1 -2
View File
@@ -45,7 +45,7 @@ px4_add_board(
#magnetometer # all available magnetometer drivers
magnetometer/hmc5883
#optical_flow # all available optical flow drivers
#optical_flow/px4flow
optical_flow/px4flow
#osd
#pca9685
#protocol_splitter
@@ -97,7 +97,6 @@ px4_add_board(
#i2cdetect
#led_control
mft
microbench
mixer
#motor_ramp
#motor_test
-1
View File
@@ -101,7 +101,6 @@ px4_add_board(
i2cdetect
led_control
mft
microbench
mixer
motor_ramp
motor_test
-1
View File
@@ -147,7 +147,6 @@
/* Heater pins */
#define GPIO_HEATER_INPUT (GPIO_INPUT|GPIO_PULLDOWN|GPIO_PORTC|GPIO_PIN6)
#define GPIO_HEATER_OUTPUT (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTC|GPIO_PIN6)
#define HEATER_OUTPUT_EN(on_true) px4_arch_gpiowrite(GPIO_HEATER_OUTPUT, (on_true))
/* Power switch controls */
-1
View File
@@ -100,7 +100,6 @@ px4_add_board(
i2cdetect
led_control
mft
microbench
mixer
motor_ramp
motor_test
-1
View File
@@ -100,7 +100,6 @@ px4_add_board(
i2cdetect
led_control
mft
microbench
mixer
motor_ramp
motor_test
+1 -1
View File
@@ -69,7 +69,7 @@ px4_add_board(
flight_mode_manager
fw_att_control
fw_pos_control_l1
#gyro_calibration
gyro_calibration
#gyro_fft
land_detector
#landing_target_estimator
+4 -5
View File
@@ -42,13 +42,13 @@ px4_add_board(
#lights/rgbled_pwm
#magnetometer # all available magnetometer drivers
magnetometer/isentek/ist8310
#optical_flow # all available optical flow drivers
optical_flow # all available optical flow drivers
#osd
#pca9685
#pca9685_pwm_out
#power_monitor/ina226
#protocol_splitter
#pwm_input
pwm_input
pwm_out_sim
pwm_out
px4io
@@ -96,9 +96,9 @@ px4_add_board(
#uuv_att_control
#uuv_pos_control
#vmount
#vtol_att_control
vtol_att_control
SYSTEMCMDS
bl_update
#bl_update
dmesg
#dumpfile
#esc_calib
@@ -107,7 +107,6 @@ px4_add_board(
i2cdetect
led_control
mft
microbench
mixer
#motor_ramp
motor_test
-2
View File
@@ -209,8 +209,6 @@
* PWM in future
*/
#define GPIO_HEATER_OUTPUT /* PA7 T14CH1 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN7)
#define HEATER_OUTPUT_EN(on_true) px4_arch_gpiowrite(GPIO_HEATER_OUTPUT, (on_true))
/* PWM Capture
*
+2 -2
View File
@@ -71,8 +71,8 @@ px4_add_board(
flight_mode_manager
fw_att_control
fw_pos_control_l1
#gyro_calibration
#gyro_fft
gyro_calibration
gyro_fft
land_detector
#landing_target_estimator
load_mon
-1
View File
@@ -101,7 +101,6 @@ px4_add_board(
i2cdetect
led_control
mft
microbench
mixer
motor_ramp
motor_test
-1
View File
@@ -202,7 +202,6 @@
* PWM in future
*/
#define GPIO_HEATER_OUTPUT /* PB10 T2CH3 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN10)
#define HEATER_OUTPUT_EN(on_true) px4_arch_gpiowrite(GPIO_HEATER_OUTPUT, (on_true))
/* PWM Capture
*
+4 -7
View File
@@ -34,7 +34,6 @@ px4_add_board(
imu/bosch/bmi088
imu/invensense/icm20602
imu/invensense/icm20948 # required for ak09916 mag
imu/invensense/icm20649
imu/invensense/icm42688p
irlock
lights # all available light drivers
@@ -42,7 +41,7 @@ px4_add_board(
optical_flow # all available optical flow drivers
osd
pca9685
#pca9685_pwm_out
pca9685_pwm_out
power_monitor/ina226
#protocol_splitter
pwm_input
@@ -50,10 +49,9 @@ px4_add_board(
pwm_out
px4io
rc_input
#roboclaw
#rpm
roboclaw
rpm
safety_button
#smart_battery/batmon
telemetry # all available telemetry drivers
test_ppm
tone_alarm
@@ -75,7 +73,7 @@ px4_add_board(
land_detector
landing_target_estimator
load_mon
#local_position_estimator
local_position_estimator
logger
mavlink
mc_att_control
@@ -103,7 +101,6 @@ px4_add_board(
i2cdetect
led_control
mft
microbench
mixer
motor_ramp
motor_test
-1
View File
@@ -189,7 +189,6 @@
* PWM in future
*/
#define GPIO_HEATER_OUTPUT /* PA2 T2CH3 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN2)
#define HEATER_OUTPUT_EN(on_true) px4_arch_gpiowrite(GPIO_HEATER_OUTPUT, (on_true))
/* PWM Capture
*
-1
View File
@@ -99,7 +99,6 @@ px4_add_board(
i2cdetect
led_control
mft
microbench
mixer
motor_ramp
motor_test
-1
View File
@@ -227,7 +227,6 @@
* PWM in future
*/
#define GPIO_HEATER_OUTPUT /* PB10 T2CH3 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN10)
#define HEATER_OUTPUT_EN(on_true) px4_arch_gpiowrite(GPIO_HEATER_OUTPUT, (on_true))
/* PWM Capture
*
+1 -2
View File
@@ -73,7 +73,7 @@ px4_add_board(
land_detector
landing_target_estimator
load_mon
#local_position_estimator
local_position_estimator
logger
mavlink
mc_att_control
@@ -100,7 +100,6 @@ px4_add_board(
i2cdetect
led_control
mft
microbench
mixer
motor_test
mtd
-1
View File
@@ -145,7 +145,6 @@
/* Heater pins (reserved) */
#define GPIO_HEATER_INPUT (GPIO_INPUT|GPIO_PULLDOWN|GPIO_PORTC|GPIO_PIN6)
#define GPIO_HEATER_OUTPUT (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTC|GPIO_PIN6)
#define HEATER_OUTPUT_EN(on_true) px4_arch_gpiowrite(GPIO_HEATER_OUTPUT, (on_true))
/* Power switch controls */
+3 -1
View File
@@ -179,7 +179,9 @@ function(px4_add_module)
endif()
set_target_properties(${MODULE} PROPERTIES STACK_MAX ${STACK_MAX})
if(${PX4_PLATFORM} STREQUAL "nuttx")
if(${PX4_PLATFORM} STREQUAL "qurt")
set_property(TARGET ${MODULE} PROPERTY POSITION_INDEPENDENT_CODE TRUE)
elseif(${PX4_PLATFORM} STREQUAL "nuttx")
target_compile_options(${MODULE} PRIVATE -Wframe-larger-than=${STACK_MAX})
endif()
-1
View File
@@ -44,7 +44,6 @@ set(msg_files
airspeed.msg
airspeed_validated.msg
airspeed_wind.msg
baro_bias_estimate.msg
battery_status.msg
camera_capture.msg
camera_trigger.msg
-10
View File
@@ -1,10 +0,0 @@
uint64 timestamp # time since system start (microseconds)
uint64 timestamp_sample # the timestamp of the raw data (microseconds)
uint32 baro_device_id # unique device ID for the sensor that does not change between power cycles
float32 bias # estimated barometric altitude bias (m)
float32 bias_var # estimated barometric altitude bias variance (m^2)
float32 innov # innovation of the last measurement fusion (m)
float32 innov_var # innovation variance of the last measurement fusion (m^2)
float32 innov_test_ratio # normalized innovation squared test ratio
+4 -4
View File
@@ -331,16 +331,16 @@ int UART_node::init()
}
// Set up the UART for non-canonical binary communication: 8 bits, 1 stop bit, no parity.
uart_config.c_iflag &= ~(INPCK | ISTRIP | INLCR | IGNCR | ICRNL | IXON | IXANY | IXOFF);
uart_config.c_iflag &= !(INPCK | ISTRIP | INLCR | IGNCR | ICRNL | IXON | IXANY | IXOFF);
uart_config.c_iflag |= IGNBRK | IGNPAR;
uart_config.c_oflag &= ~(OPOST | ONLCR | OCRNL | ONOCR | ONLRET | OFILL | NLDLY | VTDLY);
uart_config.c_oflag &= !(OPOST | ONLCR | OCRNL | ONOCR | ONLRET | OFILL | NLDLY | VTDLY);
uart_config.c_oflag |= NL0 | VT0;
uart_config.c_cflag &= ~(CSIZE | CSTOPB | PARENB);
uart_config.c_cflag &= !(CSIZE | CSTOPB | PARENB);
uart_config.c_cflag |= CS8 | CREAD | CLOCAL;
uart_config.c_lflag &= ~(ISIG | ICANON | ECHO | TOSTOP | IEXTEN);
uart_config.c_lflag &= !(ISIG | ICANON | ECHO | TOSTOP | IEXTEN);
// Flow control
if (hw_flow_control) {
-2
View File
@@ -343,8 +343,6 @@ rtps:
id: 159
- msg: event
id: 160
- msg: baro_bias_estimate
id: 161
########## multi topics: begin ##########
- msg: actuator_controls_0
id: 180
+1 -1
View File
@@ -33,7 +33,7 @@
set(SRCS)
if(NOT "${PX4_BOARD}" MATCHES "io-v2" AND NOT "${PX4_BOARD_LABEL}" MATCHES "bootloader")
if (NOT "${PX4_PLATFORM}" MATCHES "qurt" AND NOT "${PX4_BOARD}" MATCHES "io-v2" AND NOT "${PX4_BOARD_LABEL}" MATCHES "bootloader")
list(APPEND SRCS
px4_log.cpp
)
@@ -84,6 +84,10 @@ public:
*/
inline T load() const
{
#ifdef __PX4_QURT
return _value;
#else
#if defined(__PX4_NUTTX)
if (!__atomic_always_lock_free(sizeof(T), 0)) {
@@ -97,6 +101,8 @@ public:
{
return __atomic_load_n(&_value, __ATOMIC_SEQ_CST);
}
#endif
}
/**
@@ -104,6 +110,10 @@ public:
*/
inline void store(T value)
{
#ifdef __PX4_QURT
_value = value;
#else
#if defined(__PX4_NUTTX)
if (!__atomic_always_lock_free(sizeof(T), 0)) {
@@ -116,6 +126,8 @@ public:
{
__atomic_store(&_value, &value, __ATOMIC_SEQ_CST);
}
#endif
}
/**
@@ -124,6 +136,11 @@ 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)) {
@@ -137,6 +154,8 @@ public:
{
return __atomic_fetch_add(&_value, num, __ATOMIC_SEQ_CST);
}
#endif
}
/**
@@ -282,7 +301,13 @@ 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,14 +89,33 @@ 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
#define PX4_ROOTFSDIR "."
# if defined(__PX4_POSIX_EAGLE) || defined(__PX4_POSIX_EXCELSIOR)
# define PX4_ROOTFSDIR "/home/linaro"
# else
# define PX4_ROOTFSDIR "."
# endif
#endif // __PX4_QURT
#define PX4_STORAGEDIR PX4_ROOTFSDIR
#endif // __PX4_POSIX
#if defined(__PX4_POSIX)
/****************************************************************************
* Defines for POSIX and ROS
****************************************************************************/
@@ -0,0 +1,82 @@
/****************************************************************************
*
* 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,6 +45,10 @@
#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);
#else
#elif !defined(__PX4_QURT)
pthread_setname_np(pthread_self(), _config.name);
#endif
+2 -2
View File
@@ -156,9 +156,9 @@ if((DEFINED ENV{SIGNING_TOOL}) AND (NOT NUTTX_DIR MATCHES "external"))
COMMAND $ENV{SIGNING_TOOL} $ENV{SIGNING_ARGS} ${PX4_BINARY_OUTPUT} ${PX4_BINARY_DIR}/${PX4_BOARD}.bin
DEPENDS ${PX4_BINARY_OUTPUT}
WORKING_DIRECTORY ${PX4_SOURCE_DIR}
)
)
else()
set(PX4_BINARY_OUTPUT ${PX4_BINARY_DIR_REL}/${PX4_BOARD}.bin)
set(PX4_BINARY_OUTPUT ${PX4_BINARY_DIR_REL}/${PX4_BOARD}.bin)
endif()
add_custom_command(OUTPUT ${PX4_BINARY_OUTPUT}
+2 -3
View File
@@ -1,5 +1,7 @@
#! /bin/sh
set -o xtrace
@JLinkGDBServerExe_PATH@ -device @DEBUG_DEVICE@ -select usb -endian little -if SWD -speed auto -ir -LocalhostOnly 1 -strict -vd -singlerun &
cd @PX4_BINARY_DIR@ && @CMAKE_GDB@ -silent -nh \
@@ -10,6 +12,3 @@ cd @PX4_BINARY_DIR@ && @CMAKE_GDB@ -silent -nh \
-ex "monitor reset 0" \
-ex "continue" \
@PX4_CONFIG@.elf
# exit with status of last command
exit $?

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