Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UAVCAN sensor node (and px4_fmu-v4_cannode example) #14148

Merged
merged 1 commit into from
Feb 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 21 additions & 5 deletions .ci/Jenkinsfile-compile
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,36 @@ pipeline {
"airmind_mindpx-v2_default",
"av_x-v1_default",
"bitcraze_crazyflie_default",
"holybro_kakutef7", "holybro_durandal-v1_default", "holybro_durandal-v1_stackcheck",
"holybro_durandal-v1_default",
"holybro_durandal-v1_stackcheck",
"holybro_kakutef7",
"intel_aerofc-v1_default",
"modalai_fc-v1_default",
"mro_x21_default", "mro_ctrl-zero-f7_default", "mro_x21-777_default",
"mro_ctrl-zero-f7_default",
"mro_x21-777_default",
"mro_x21_default",
"nxp_fmuk66-v3_default",
"nxp_fmurt1062-v1_default",
"nxp_rddrone-uavcan146_default",
"omnibus_f4sd_default",
"px4_fmu-v2_default", "px4_fmu-v2_fixedwing", "px4_fmu-v2_lpe", "px4_fmu-v2_multicopter", "px4_fmu-v2_rover", "px4_fmu-v2_test",
"px4_fmu-v2_default",
"px4_fmu-v2_fixedwing",
"px4_fmu-v2_lpe",
"px4_fmu-v2_multicopter",
"px4_fmu-v2_rover",
"px4_fmu-v2_test",
"px4_fmu-v3_default",
"px4_fmu-v4_cannode",
"px4_fmu-v4_default",
"px4_fmu-v4pro_default",
"px4_fmu-v5_default", "px4_fmu-v5_fixedwing", "px4_fmu-v5_multicopter", "px4_fmu-v5_rover", "px4_fmu-v5_rtps", "px4_fmu-v5_stackcheck",
"px4_fmu-v5x_default", "px4_fmu-v5x_p2_base_phy_LAN8742Ai",
"px4_fmu-v5_default",
"px4_fmu-v5_fixedwing",
"px4_fmu-v5_multicopter",
"px4_fmu-v5_rover",
"px4_fmu-v5_rtps",
"px4_fmu-v5_stackcheck",
"px4_fmu-v5x_default",
"px4_fmu-v5x_p2_base_phy_LAN8742Ai",
"px4_io-v2_default",
"uvify_core_default"
],
Expand Down
26 changes: 22 additions & 4 deletions .github/workflows/compile_nuttx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,36 @@ jobs:
airmind_mindpx-v2_default,
av_x-v1_default,
bitcraze_crazyflie_default,
holybro_kakutef7, holybro_durandal-v1_default, holybro_durandal-v1_stackcheck,
holybro_durandal-v1_default,
holybro_durandal-v1_stackcheck,
holybro_kakutef7,
intel_aerofc-v1_default,
modalai_fc-v1_default,
mro_x21_default, mro_ctrl-zero-f7_default, mro_x21-777_default,
mro_ctrl-zero-f7_default,
mro_x21-777_default,
mro_x21_default,
nxp_fmuk66-v3_default,
nxp_fmurt1062-v1_default,
nxp_rddrone-uavcan146_default,
omnibus_f4sd_default,
px4_fmu-v2_default, px4_fmu-v2_fixedwing, px4_fmu-v2_lpe, px4_fmu-v2_multicopter, px4_fmu-v2_rover, px4_fmu-v2_test,
px4_fmu-v2_default,
px4_fmu-v2_fixedwing,
px4_fmu-v2_lpe,
px4_fmu-v2_multicopter,
px4_fmu-v2_rover,
px4_fmu-v2_test,
px4_fmu-v3_default,
px4_fmu-v4_cannode,
px4_fmu-v4_default,
px4_fmu-v4pro_default,
px4_fmu-v5_default, px4_fmu-v5_fixedwing, px4_fmu-v5_multicopter, px4_fmu-v5_rover, px4_fmu-v5_rtps, px4_fmu-v5_stackcheck,
px4_fmu-v5_default,
px4_fmu-v5_fixedwing,
px4_fmu-v5_multicopter,
px4_fmu-v5_rover,
px4_fmu-v5_rtps,
px4_fmu-v5_stackcheck,
px4_fmu-v5x_default,
px4_fmu-v5x_p2_base_phy_LAN8742Ai,
px4_io-v2_default,
uvify_core_default
]
Expand Down
4 changes: 0 additions & 4 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,6 @@
path = platforms/nuttx/NuttX/apps
url = https://github.com/PX4/NuttX-apps.git
branch = px4_firmware_nuttx-8.2
[submodule "cmake/configs/uavcan_board_ident"]
path = cmake/configs/uavcan_board_ident
url = https://github.com/PX4/uavcan_board_ident.git
branch = master
[submodule "platforms/qurt/dspal"]
path = platforms/qurt/dspal
url = https://github.com/ATLFlight/dspal.git
9 changes: 2 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ excelsior_rtps: atlflight_excelsior_rtps atlflight_excelsior_qurt-rtps
# Other targets
# --------------------------------------------------------------------

.PHONY: qgc_firmware px4fmu_firmware misc_qgc_extra_firmware alt_firmware check_rtps
.PHONY: qgc_firmware px4fmu_firmware misc_qgc_extra_firmware check_rtps

# QGroundControl flashable NuttX firmware
qgc_firmware: px4fmu_firmware misc_qgc_extra_firmware
Expand All @@ -256,11 +256,6 @@ misc_qgc_extra_firmware: \
check_px4_fmu-v2_lpe \
sizes

# Other NuttX firmware
alt_firmware: \
check_px4_cannode-v1_default \
sizes

# builds with RTPS
check_rtps: \
check_px4_fmu-v3_rtps \
Expand All @@ -275,7 +270,7 @@ sizes:
@-find build -name *.elf -type f | xargs size 2> /dev/null || :

# All default targets that don't require a special build environment
check: check_px4_sitl_default px4fmu_firmware misc_qgc_extra_firmware alt_firmware tests check_format
check: check_px4_sitl_default px4fmu_firmware misc_qgc_extra_firmware tests check_format

# quick_check builds a single nuttx and SITL target, runs testing, and checks the style
quick_check: check_px4_sitl_test check_px4_fmu-v5_default tests check_format
Expand Down
34 changes: 34 additions & 0 deletions ROMFS/cannode/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
############################################################################
#
# 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.
#
############################################################################

add_subdirectory(init.d)
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
############################################################################
#
# Copyright (c) 2015 PX4 Development Team. All rights reserved.
# 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
Expand Down Expand Up @@ -31,18 +31,6 @@
#
############################################################################

add_library(drivers_board
buttons.c
can.c
init.c
led.c
spi.c
px4_add_romfs_files(
rcS
)

target_link_libraries(drivers_board
PRIVATE
nuttx_arch # sdio
nuttx_drivers # sdio
drivers__led # drv_led_start
px4_layer
)
106 changes: 106 additions & 0 deletions ROMFS/cannode/init.d/rcS
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
#!/bin/sh
# Un comment and use set +e to ignore and set -e to enable 'exit on error control'
set +e
# Un comment the line below to help debug scripts by printing a trace of the script commands
#set -x
# PX4FMU startup script.
#
# NOTE: environment variable references:
# If the dollar sign ('$') is followed by a left bracket ('{') then the
# variable name is terminated with the right bracket character ('}').
# Otherwise, the variable name goes to the end of the argument.
#
#
# NOTE: COMMENT LINES ARE REMOVED BEFORE STORED IN ROMFS.
#
#------------------------------------------------------------------------------

#
# Mount the procfs.
#
mount -t procfs /proc

#
# Start CDC/ACM serial driver.
#
sercon

#
# Print full system version.
#
ver all

#
# Start the ORB (first app to start)
# tone_alarm and tune_control
# is dependent.
#
uorb start

#
# Set the parameter file if mtd starts successfully.
#
if mtd start
then
set PARAM_FILE /fs/mtd_params
fi

#
# Load parameters.
#
param select $PARAM_FILE
if ! param load
then
param reset
fi

#
# Optional board defaults: rc.board_defaults
#
set BOARD_RC_DEFAULTS /etc/init.d/rc.board_defaults
if [ -f $BOARD_RC_DEFAULTS ]
then
echo "Board defaults: ${BOARD_RC_DEFAULTS}"
sh $BOARD_RC_DEFAULTS
fi
unset BOARD_RC_DEFAULTS

#
# Start system state indicator.
#
rgbled start
rgbled_ncp5623c start
rgbled_pwm start

if param greater LIGHT_EN_BLINKM 0
then
if blinkm start
then
blinkm systemstate
fi
fi

#
# board sensors: rc.sensors
#
set BOARD_RC_SENSORS /etc/init.d/rc.board_sensors
if [ -f $BOARD_RC_SENSORS ]
then
echo "Board sensors: ${BOARD_RC_SENSORS}"
sh $BOARD_RC_SENSORS
fi
unset BOARD_RC_SENSORS

#
# Start UART/Serial device drivers.
# Note: rc.serial is auto-generated from Tools/serial/generate_config.py
#
sh /etc/init.d/rc.serial

# Check for flow sensor, launched as a background task to scan
if param compare SENS_EN_PX4FLOW 1
then
px4flow start &
fi

uavcannode start
70 changes: 63 additions & 7 deletions boards/nxp/rddrone-uavcan146/default.cmake
Original file line number Diff line number Diff line change
@@ -1,19 +1,75 @@


# UAVCAN boot loadable Module ID
set(uavcanblid_sw_version_major 0)
set(uavcanblid_sw_version_minor 1)
add_definitions(
-DAPP_VERSION_MAJOR=${uavcanblid_sw_version_major}
-DAPP_VERSION_MINOR=${uavcanblid_sw_version_minor}
)

set(uavcanblid_hw_version_major 1)
set(uavcanblid_hw_version_minor 0)
set(uavcanblid_name "\"org.nxp.rddrone-uavcan146\"")

add_definitions(
-DHW_UAVCAN_NAME=${uavcanblid_name}
-DHW_VERSION_MAJOR=${uavcanblid_hw_version_major}
-DHW_VERSION_MINOR=${uavcanblid_hw_version_minor}
)

px4_add_board(
PLATFORM nuttx
VENDOR nxp
MODEL rddrone-uavcan146
LABEL default
TOOLCHAIN arm-none-eabi
ARCHITECTURE cortex-m4

ROMFSROOT cannode
UAVCAN_INTERFACES 2

DRIVERS

#adc
#barometer # all available barometer drivers
#bootloaders
#differential_pressure # all available differential pressure drivers
#distance_sensor # all available distance sensor drivers
#dshot
#gps
#imu # all available imu drivers
#lights
#magnetometer # all available magnetometer drivers
#optical_flow # all available optical flow drivers
#px4fmu
#safety_button
#tone_alarm
#uavcannode # TODO: CAN driver needed
MODULES

#ekf2
#load_mon
#sensors
#temperature_compensation
SYSTEMCMDS
#bl_update
#dmesg
#dumpfile
#esc_calib
#hardfault_log
i2cdetect

EXAMPLES
)
#led_control
#mixer
#motor_ramp
#motor_test
#nshterm
#param
#perf
#pwm
reboot
#reflect
#sd_bench
shutdown
#top
#topic_listener
#tune_control
ver
#work_queue
)
Loading