Compare commits

..

1 Commits

Author SHA1 Message Date
Hamish Willee d74af6d1f8 Delete simpleapp CMakeLists 2021-10-18 08:33:52 +11:00
1351 changed files with 21126 additions and 45389 deletions
+2 -5
View File
@@ -59,18 +59,14 @@ pipeline {
"holybro_durandal-v1_default",
"holybro_kakutef7_default",
"holybro_pix32v5_default",
"matek_h743-slim",
"modalai_fc-v1_default",
"modalai_fc-v1_rtps",
"modalai_fc-v2_default",
"mro_ctrl-zero-f7_default",
"mro_ctrl-zero-f7-oem_default",
"mro_ctrl-zero-h7_default",
"mro_ctrl-zero-h7_rtps",
"mro_ctrl-zero-h7-oem_default",
"mro_ctrl-zero-h7-oem_rtps",
"mro_pixracerpro_default",
"mro_pixracerpro_rtps",
"mro_x21-777_default",
"mro_x21_default",
"nxp_fmuk66-e_default",
@@ -83,7 +79,6 @@ pipeline {
"nxp_ucans32k146_canbootloader",
"nxp_ucans32k146_default",
"omnibus_f4sd_default",
"raspberrypi_pico_default",
"px4_fmu-v2_default",
"px4_fmu-v2_fixedwing",
"px4_fmu-v2_multicopter",
@@ -91,12 +86,14 @@ pipeline {
"px4_fmu-v3_default",
"px4_fmu-v4_default",
"px4_fmu-v4pro_default",
"px4_fmu-v5_ctrlalloc",
"px4_fmu-v5_debug",
"px4_fmu-v5_default",
"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",
+109 -92
View File
@@ -18,10 +18,10 @@ pipeline {
}
steps {
checkoutSCM()
sh 'make cubepilot_cubeorange_bootloader'
sh 'make cubepilot_cubeorange_test'
sh 'make cubepilot_cubeorange_test bootloader_elf'
sh 'ccache -s'
stash includes: 'build/*/*.elf, platforms/nuttx/Debug/*, platforms/nuttx/NuttX/nuttx/tools/nuttx-gdbinit, Tools/HIL/*, build/cubepilot_cubeorange_test/etc/init.d/airframes/*', name: 'cubepilot_cubeorange_test'
stash includes: 'build/*/*.elf, platforms/nuttx/Debug/upload_jlink_gdb.sh, Tools/HIL/*.py', name: 'cubepilot_cubeorange_test'
}
post {
always {
@@ -39,19 +39,15 @@ pipeline {
sh 'export'
sh 'find /dev/serial'
unstash 'cubepilot_cubeorange_test'
sh './platforms/nuttx/Debug/upload_jlink_gdb.sh build/cubepilot_cubeorange_bootloader/cubepilot_cubeorange_bootloader.elf'
sh './platforms/nuttx/Debug/upload_jlink_gdb.sh build/cubepilot_cubeorange_test/cubepilot_cubeorange_bootloader.elf'
// flash board and watch bootup
sh './platforms/nuttx/Debug/upload_jlink_gdb.sh build/cubepilot_cubeorange_test/cubepilot_cubeorange_test.elf && ./Tools/HIL/monitor_firmware_upload.py --device `find /dev/serial -name *usb-*` --baudrate 57600'
resetBoard()
}
}
stage("tests") {
steps {
// run tests
runTests()
// load all airframes
// sh("./Tools/HIL/test_airframes.sh `find /dev/serial -name *usb-*` `cd build/cubepilot_cubeorange_test/etc/init.d/airframes/; find . -regex '.*/[0-9].*' -exec basename {} \\; | cut -d '_' -f 1` || true") // test loading all airframes\
}
}
stage("status") {
@@ -74,7 +70,7 @@ pipeline {
}
post {
always {
sh './platforms/nuttx/Debug/jlink_gdb_backtrace_simple.sh build/cubepilot_cubeorange_test/cubepilot_cubeorange_test.elf || true'
resetBoard()
}
}
} // stage test
@@ -92,10 +88,10 @@ pipeline {
}
steps {
checkoutSCM()
sh 'make cuav_x7pro_bootloader'
sh 'make cuav_x7pro_test'
sh 'make cuav_x7pro_test bootloader_elf'
sh 'ccache -s'
stash includes: 'build/*/*.elf, platforms/nuttx/Debug/*, platforms/nuttx/NuttX/nuttx/tools/nuttx-gdbinit, Tools/HIL/*', name: 'cuav_x7pro_test'
stash includes: 'build/*/*.elf, platforms/nuttx/Debug/upload_jlink_gdb.sh, Tools/HIL/*.py', name: 'cuav_x7pro_test'
}
post {
always {
@@ -113,10 +109,9 @@ pipeline {
sh 'export'
sh 'find /dev/serial'
unstash 'cuav_x7pro_test'
sh './platforms/nuttx/Debug/upload_jlink_gdb.sh build/cuav_x7pro_bootloader/cuav_x7pro_bootloader.elf'
sh './platforms/nuttx/Debug/upload_jlink_gdb.sh build/cuav_x7pro_test/cuav_x7pro_bootloader.elf'
// flash board and watch bootup
sh './platforms/nuttx/Debug/upload_jlink_gdb.sh build/cuav_x7pro_test/cuav_x7pro_test.elf && ./Tools/HIL/monitor_firmware_upload.py --device `find /dev/serial -name *usb-*` --baudrate 57600'
resetBoard()
}
}
stage("tests") {
@@ -143,7 +138,7 @@ pipeline {
}
post {
always {
sh './platforms/nuttx/Debug/jlink_gdb_backtrace_simple.sh build/cuav_x7pro_test/cuav_x7pro_test.elf || true'
resetBoard()
}
}
} // stage test
@@ -164,7 +159,7 @@ pipeline {
sh 'make px4_fmu-v3_test'
sh 'make px4_fmu-v3_test bootloader_elf'
sh 'ccache -s'
stash includes: 'build/*/*.elf, platforms/nuttx/Debug/*, platforms/nuttx/NuttX/nuttx/tools/nuttx-gdbinit, Tools/HIL/*', name: 'px4_fmu-v3_test'
stash includes: 'build/*/*.elf, platforms/nuttx/Debug/upload_jlink_gdb.sh, Tools/HIL/*.py', name: 'px4_fmu-v3_test'
}
post {
always {
@@ -185,7 +180,6 @@ pipeline {
sh './platforms/nuttx/Debug/upload_jlink_gdb.sh build/px4_fmu-v3_test/px4_fmu-v3_bootloader.elf'
// flash board and watch bootup
sh './platforms/nuttx/Debug/upload_jlink_gdb.sh build/px4_fmu-v3_test/px4_fmu-v3_test.elf && ./Tools/HIL/monitor_firmware_upload.py --device `find /dev/serial -name *usb-*` --baudrate 57600'
resetBoard()
}
}
stage("tests") {
@@ -212,7 +206,7 @@ pipeline {
}
post {
always {
sh './platforms/nuttx/Debug/jlink_gdb_backtrace_simple.sh build/px4_fmu-v3_test/px4_fmu-v3_test.elf || true'
resetBoard()
}
}
} // stage test
@@ -233,7 +227,7 @@ pipeline {
sh 'make px4_fmu-v4_test'
sh 'make px4_fmu-v4_test bootloader_elf'
sh 'ccache -s'
stash includes: 'build/*/*.elf, platforms/nuttx/Debug/*, platforms/nuttx/NuttX/nuttx/tools/nuttx-gdbinit, Tools/HIL/*', name: 'px4_fmu-v4_test'
stash includes: 'build/*/*.elf, platforms/nuttx/Debug/upload_jlink_gdb.sh, Tools/HIL/*.py', name: 'px4_fmu-v4_test'
}
post {
always {
@@ -254,7 +248,6 @@ pipeline {
sh './platforms/nuttx/Debug/upload_jlink_gdb.sh build/px4_fmu-v4_test/px4_fmu-v4_bootloader.elf'
// flash board and watch bootup
sh './platforms/nuttx/Debug/upload_jlink_gdb.sh build/px4_fmu-v4_test/px4_fmu-v4_test.elf && ./Tools/HIL/monitor_firmware_upload.py --device `find /dev/serial -name *usb-*` --baudrate 57600'
resetBoard()
}
}
stage("tests") {
@@ -280,7 +273,7 @@ pipeline {
}
post {
always {
sh './platforms/nuttx/Debug/jlink_gdb_backtrace_simple.sh build/px4_fmu-v4_test/px4_fmu-v4_test.elf || true'
resetBoard()
}
}
} // stage test
@@ -301,7 +294,7 @@ pipeline {
sh 'make px4_fmu-v4pro_test'
sh 'make px4_fmu-v4pro_test bootloader_elf'
sh 'ccache -s'
stash includes: 'build/*/*.elf, platforms/nuttx/Debug/*, platforms/nuttx/NuttX/nuttx/tools/nuttx-gdbinit, Tools/HIL/*', name: 'px4_fmu-v4pro_test'
stash includes: 'build/*/*.elf, platforms/nuttx/Debug/upload_jlink_gdb.sh, Tools/HIL/*.py', name: 'px4_fmu-v4pro_test'
}
post {
always {
@@ -322,7 +315,6 @@ pipeline {
sh './platforms/nuttx/Debug/upload_jlink_gdb.sh build/px4_fmu-v4pro_test/px4_fmu-v4pro_bootloader.elf'
// flash board and watch bootup
sh './platforms/nuttx/Debug/upload_jlink_gdb.sh build/px4_fmu-v4pro_test/px4_fmu-v4pro_test.elf && ./Tools/HIL/monitor_firmware_upload.py --device `find /dev/serial -name *usb-*` --baudrate 57600'
resetBoard()
}
}
stage("tests") {
@@ -349,7 +341,7 @@ pipeline {
}
post {
always {
sh './platforms/nuttx/Debug/jlink_gdb_backtrace_simple.sh build/px4_fmu-v4pro_test/px4_fmu-v4pro_test.elf || true'
resetBoard()
}
}
} // stage test
@@ -370,7 +362,7 @@ pipeline {
sh 'make px4_fmu-v5_debug'
sh 'make px4_fmu-v5_debug bootloader_elf'
sh 'ccache -s'
stash includes: 'build/*/*.elf, platforms/nuttx/Debug/*, platforms/nuttx/NuttX/nuttx/tools/nuttx-gdbinit, Tools/HIL/*', name: 'px4_fmu-v5_debug'
stash includes: 'build/*/*.elf, platforms/nuttx/Debug/upload_jlink_gdb.sh, Tools/HIL/*.py', name: 'px4_fmu-v5_debug'
}
post {
always {
@@ -396,24 +388,13 @@ pipeline {
sh './platforms/nuttx/Debug/upload_jlink_gdb.sh build/px4_fmu-v5_debug/px4_fmu-v5_bootloader.elf'
// flash board and watch bootup
sh './platforms/nuttx/Debug/upload_jlink_gdb.sh build/px4_fmu-v5_debug/px4_fmu-v5_debug.elf && ./Tools/HIL/monitor_firmware_upload.py --device `find /dev/serial -name *usb-*` --baudrate 57600 || true'
resetBoard()
}
}
stage("tests") {
steps {
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "top once"'
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "uorb top -1"'
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "work_queue status"'
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "sd_bench"'
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "sd_bench -v"'
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "sd_bench -u -v"'
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "sd_stress"'
// test dataman
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "tests dataman"'
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "tests file" || true'
//sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "sd_stress"'
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "uorb_tests"'
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "uorb_tests latency_test" || true'
}
@@ -439,7 +420,7 @@ pipeline {
}
post {
always {
sh './platforms/nuttx/Debug/jlink_gdb_backtrace_simple.sh build/px4_fmu-v5_debug/px4_fmu-v5_debug.elf || true'
resetBoard()
}
}
} // stage test
@@ -460,7 +441,7 @@ pipeline {
sh 'make px4_fmu-v5_stackcheck'
sh 'make px4_fmu-v5_stackcheck bootloader_elf'
sh 'ccache -s'
stash includes: 'build/*/*.elf, platforms/nuttx/Debug/*, platforms/nuttx/NuttX/nuttx/tools/nuttx-gdbinit, Tools/HIL/*', name: 'px4_fmu-v5_stackcheck'
stash includes: 'build/*/*.elf, platforms/nuttx/Debug/upload_jlink_gdb.sh, Tools/HIL/*.py', name: 'px4_fmu-v5_stackcheck'
}
post {
always {
@@ -486,7 +467,6 @@ pipeline {
sh './platforms/nuttx/Debug/upload_jlink_gdb.sh build/px4_fmu-v5_stackcheck/px4_fmu-v5_bootloader.elf'
// flash board and watch bootup
sh './platforms/nuttx/Debug/upload_jlink_gdb.sh build/px4_fmu-v5_stackcheck/px4_fmu-v5_stackcheck.elf && ./Tools/HIL/monitor_firmware_upload.py --device `find /dev/serial -name *usb-*` --baudrate 57600'
resetBoard()
}
}
stage("tests") {
@@ -495,9 +475,6 @@ pipeline {
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "work_queue status"'
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "uorb_tests"'
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "uorb_tests latency_test" || true'
// test dataman
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "tests dataman"'
}
}
stage("status") {
@@ -521,7 +498,7 @@ pipeline {
}
post {
always {
sh './platforms/nuttx/Debug/jlink_gdb_backtrace_simple.sh build/px4_fmu-v5_stackcheck/px4_fmu-v5_stackcheck.elf || true'
resetBoard()
}
}
} // stage test
@@ -542,7 +519,7 @@ pipeline {
sh 'make px4_fmu-v5_test'
sh 'make px4_fmu-v5_test bootloader_elf'
sh 'ccache -s'
stash includes: 'build/*/*.elf, platforms/nuttx/Debug/*, platforms/nuttx/NuttX/nuttx/tools/nuttx-gdbinit, Tools/HIL/*', name: 'px4_fmu-v5_test'
stash includes: 'build/*/*.elf, platforms/nuttx/Debug/upload_jlink_gdb.sh, Tools/HIL/*.py', name: 'px4_fmu-v5_test'
}
post {
always {
@@ -563,7 +540,6 @@ pipeline {
sh './platforms/nuttx/Debug/upload_jlink_gdb.sh build/px4_fmu-v5_test/px4_fmu-v5_bootloader.elf'
// flash board and watch bootup
sh './platforms/nuttx/Debug/upload_jlink_gdb.sh build/px4_fmu-v5_test/px4_fmu-v5_test.elf && ./Tools/HIL/monitor_firmware_upload.py --device `find /dev/serial -name *usb-*` --baudrate 57600'
resetBoard()
}
}
stage("tests") {
@@ -590,13 +566,80 @@ pipeline {
}
post {
always {
sh './platforms/nuttx/Debug/jlink_gdb_backtrace_simple.sh build/px4_fmu-v5_test/px4_fmu-v5_test.elf || true'
resetBoard()
}
}
} // stage test
}
}
// stage("modalai_fc-v1_test") {
// stages {
// stage("build modalai_fc-v1_test") {
// agent {
// docker {
// image 'px4io/px4-dev-nuttx-focal:2021-09-08'
// args '--cpu-shares 512 -e CCACHE_BASEDIR=$WORKSPACE -v ${CCACHE_DIR}:${CCACHE_DIR}:rw'
// }
// }
// steps {
// checkout scm
// sh 'export'
// sh 'make distclean'
// sh 'ccache -s'
// sh 'git fetch --tags'
// sh 'make modalai_fc-v1_test'
// sh 'make modalai_fc-v1_test bootloader_elf'
// sh 'ccache -s'
// stash includes: 'build/*/*.elf, platforms/nuttx/Debug/upload_jlink_gdb.sh, Tools/HIL/*.py', name: 'modalai_fc-v1_test'
// }
// post {
// always {
// sh 'make distclean'
// }
// }
// } // stage build
// stage("hardware") {
// agent {
// label 'modalai_fc-v1'
// }
// stages {
// stage("flash") {
// steps {
// sh 'export'
// sh 'find /dev/serial'
// unstash 'modalai_fc-v1_test'
// sh './platforms/nuttx/Debug/upload_jlink_gdb.sh build/modalai_fc-v1_test/modalai_fc-v1_bootloader.elf'
// // flash board and watch bootup
// sh './platforms/nuttx/Debug/upload_jlink_gdb.sh build/modalai_fc-v1_test/modalai_fc-v1_test.elf && ./Tools/HIL/monitor_firmware_upload.py --device `find /dev/serial -name *usb-*` --baudrate 57600'
// }
// }
// stage("tests") {
// steps {
// runTests()
// }
// }
// stage("status") {
// steps {
// // configure
// resetParameters()
// sh './Tools/HIL/nsh_param_set.py --device `find /dev/serial -name *usb-*` --name "SYS_AUTOSTART" --value "4001"' // generic quadcopter
// sh './Tools/HIL/nsh_param_set.py --device `find /dev/serial -name *usb-*` --name "SYS_BL_UPDATE" --value "1"' // update bootloader
// checkStatus()
// quickCalibrate()
// }
// }
// stage("print topics") {
// steps {
// printTopics()
// }
// }
// }
// } // stage test
// }
// }
stage("nxp_fmuk66-v3_test") {
stages {
stage("build nxp_fmuk66-v3_test") {
@@ -611,7 +654,7 @@ pipeline {
sh 'make nxp_fmuk66-v3_test'
//sh 'make nxp_fmuk66-v3_test bootloader_elf'
sh 'ccache -s'
stash includes: 'build/*/*.elf, platforms/nuttx/Debug/*, platforms/nuttx/NuttX/nuttx/tools/nuttx-gdbinit, Tools/HIL/*', name: 'nxp_fmuk66-v3_test'
stash includes: 'build/*/*.elf, platforms/nuttx/Debug/upload_jlink_gdb.sh, Tools/HIL/*.py', name: 'nxp_fmuk66-v3_test'
}
post {
always {
@@ -632,7 +675,6 @@ pipeline {
//sh './platforms/nuttx/Debug/upload_jlink_gdb.sh build/nxp_fmuk66-v3_test/nxp_fmuk66-v3_bootloader.elf'
// flash board and watch bootup
sh './platforms/nuttx/Debug/upload_jlink_gdb.sh build/nxp_fmuk66-v3_test/nxp_fmuk66-v3_test.elf && ./Tools/HIL/monitor_firmware_upload.py --device `find /dev/serial -name *usb-*` --baudrate 57600'
resetBoard()
}
}
stage("tests") {
@@ -659,7 +701,7 @@ pipeline {
}
post {
always {
sh './platforms/nuttx/Debug/jlink_gdb_backtrace_simple.sh build/nxp_fmuk66-v3_test/nxp_fmuk66-v3_test.elf || true'
resetBoard()
}
}
} // stage test
@@ -718,7 +760,7 @@ void checkStatus() {
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "param save"'
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "param status"'
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "param show SYS*"'
sh './Tools/HIL/reboot.py --device `find /dev/serial -name *usb-*`' // reboot to apply
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "reboot" || true' // reboot to apply
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "param show SYS*"'
// run logger
@@ -772,17 +814,13 @@ void resetParameters() {
}
void runTests() {
// test loading a range of airframes
sh './Tools/HIL/test_airframes.sh `find /dev/serial -name *usb-*` 1000 1001 2100 3000 4001 6001 8001 10016'
resetParameters()
sh './Tools/HIL/nsh_param_set.py --device `find /dev/serial -name *usb-*` --name "IMU_GYRO_CAL_EN" --value "0" || true' // disable during testing
sh './Tools/HIL/nsh_param_set.py --device `find /dev/serial -name *usb-*` --name "IMU_GYRO_FFT_EN" --value "0" || true' // disable during testing
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "param save"'
sh './Tools/HIL/reboot.py --device `find /dev/serial -name *usb-*`' // reboot to apply
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "reboot" || true' // reboot to apply
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "top once"'
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "work_queue status"'
@@ -794,49 +832,35 @@ void runTests() {
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "uorb_tests"'
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "uorb_tests latency_test" || true'
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "tests file" || true'
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "param dump /fs/mtd_params"'
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "mtd readtest"'
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "param dump /fs/mtd_params"'
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "mtd rwtest"'
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "param dump /fs/mtd_params"'
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "mtd erase"'
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "param dump /fs/mtd_params"'
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "sd_bench"'
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "sd_bench -v"'
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "sd_bench -u -v"'
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "sd_stress"'
// tests (stop modules first)
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "commander stop"'
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "mavlink stop-all"'
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "navigator stop"'
sh './Tools/HIL/run_tests.py --device `find /dev/serial -name *usb-*`'
//sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "tests file" || true'
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "mtd readtest"'
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "mtd rwtest"'
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "mtd erase"'
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "sd_bench"'
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "sd_bench -u"'
//sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "sd_stress"'
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "commander stop"'
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "sensors stop"' // ignore irrelevant sensor timeouts during microbenchmarks
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "microbench all"'
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "calib_udelay"'
// test rebooting multiple times
resetParameters()
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "param dump"'
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "param set SYS_AUTOSTART 4001" || true'
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "param dump"'
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "param save"'
sh './Tools/HIL/reboot.py --device `find /dev/serial -name *usb-*`'
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "reboot" || true'
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "param show CBRK*; param show SYS*"' // check that CBRK_BUZZER and SYS_AUTOSTART haven't been lost
sh './Tools/HIL/reboot.py --device `find /dev/serial -name *usb-*`'
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "reboot" || true'
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "param show CBRK*; param show SYS*"' // check that CBRK_BUZZER and SYS_AUTOSTART haven't been lost
sh './Tools/HIL/reboot.py --device `find /dev/serial -name *usb-*`'
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "reboot" || true'
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "param show CBRK*; param show SYS*"' // check that CBRK_BUZZER and SYS_AUTOSTART haven't been lost
sh './Tools/HIL/reboot.py --device `find /dev/serial -name *usb-*`'
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "reboot" || true'
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "param show CBRK*; param show SYS*"' // check that CBRK_BUZZER and SYS_AUTOSTART haven't been lost
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "param dump"'
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "param dump /fs/microsd/parameters_backup.bson" || true'
}
void printTopics() {
@@ -936,10 +960,6 @@ void printTopics() {
}
void resetBoard() {
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "df -h" || true'
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "ls /fs/" || true'
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "ls /fs/microsd" || true'
resetParameters()
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "param set SYS_AUTOSTART 0" || true'
@@ -947,8 +967,7 @@ void resetBoard() {
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "param set MAV_0_CONFIG 0" || true' // limit cpu usage
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "param set MAV_1_CONFIG 0" || true' // limit cpu usage
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "param set SDLOG_MODE -1" || true' // limit cpu usage
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "echo > /fs/microsd/.format" || true'
sh './Tools/HIL/reboot.py --device `find /dev/serial -name *usb-*`' // reboot to apply
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "reboot" || true' // reboot to apply
// check SD card
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "df -h" || true'
@@ -972,6 +991,4 @@ void resetBoard() {
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "cat /proc/fs/blocks" || true'
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "cat /proc/fs/mount" || true'
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "cat /proc/fs/usage" || true'
sh './Tools/HIL/reboot.py --device `find /dev/serial -name *usb-*`' // reboot to apply
}
+1 -2
View File
@@ -74,7 +74,6 @@ Checks: '*,
-modernize-deprecated-headers,
-modernize-loop-convert,
-modernize-pass-by-value,
-modernize-raw-string-literal,
-modernize-return-braced-init-list,
-modernize-use-auto,
-modernize-use-bool-literals,
@@ -82,8 +81,8 @@ Checks: '*,
-modernize-use-equals-default,
-modernize-use-equals-delete,
-modernize-use-override,
-modernize-use-trailing-return-type,
-modernize-use-using,
-modernize-use-trailing-return-type,
-performance-inefficient-string-concatenation,
-readability-avoid-const-params-in-decls,
-readability-container-size-empty,
+1 -4
View File
@@ -13,7 +13,6 @@ jobs:
runs-on: ubuntu-latest
container: px4io/px4-dev-nuttx-focal:2021-09-08
strategy:
fail-fast: false
matrix:
config: [
airmind_mindpx-v2,
@@ -34,7 +33,6 @@ jobs:
holybro_durandal-v1,
holybro_kakutef7,
holybro_pix32v5,
matek_h743-slim,
modalai_fc-v1,
modalai_fc-v2,
mro_ctrl-zero-f7,
@@ -49,7 +47,6 @@ jobs:
nxp_fmurt1062-v1,
nxp_ucans32k146,
omnibus_f4sd,
raspberrypi_pico,
px4_fmu-v2,
px4_fmu-v3,
px4_fmu-v4,
@@ -84,7 +81,7 @@ jobs:
echo "base_dir = ${GITHUB_WORKSPACE}" > ~/.ccache/ccache.conf
echo "compression = true" >> ~/.ccache/ccache.conf
echo "compression_level = 6" >> ~/.ccache/ccache.conf
echo "max_size = 120M" >> ~/.ccache/ccache.conf
echo "max_size = 100M" >> ~/.ccache/ccache.conf
echo "hash_dir = false" >> ~/.ccache/ccache.conf
ccache -s
ccache -z
+2 -3
View File
@@ -10,7 +10,6 @@ on:
jobs:
enumerate_targets:
runs-on: ubuntu-latest
container: px4io/px4-dev-base-focal:2021-09-08
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
@@ -35,11 +34,11 @@ jobs:
- name: parameter & events metadata
run: |
make ${{matrix.target}} ver_gen events_json actuators_json
make ${{matrix.target}} ver_gen events_json
./src/lib/version/get_git_tag_or_branch_version.sh build/${{ matrix.target }} >> $GITHUB_ENV
cd build/${{ matrix.target }}
mkdir _metadata || true
cp parameters.* events/*.xz actuators.json* _metadata
cp parameters.* events/*.xz _metadata
- uses: jakejarvis/s3-sync-action@master
with:
+5 -5
View File
@@ -15,10 +15,10 @@ jobs:
fail-fast: false
matrix:
config:
- {model: "iris", latitude: "59.617693", longitude: "-151.145316", altitude: "48", build_type: "RelWithDebInfo" } # Alaska
- {model: "standard_vtol", latitude: "-38.071235", longitude: "145.281220", altitude: "31", build_type: "AddressSanitizer" } # Australia
- {model: "tailsitter" , latitude: "29.660316", longitude: "-82.316658", altitude: "30", build_type: "RelWithDebInfo" } # Florida
- {model: "standard_vtol", latitude: "47.397742", longitude: "8.545594", altitude: "488", build_type: "Coverage" } # Zurich
- {latitude: "59.617693", longitude: "-151.145316", altitude: "48", build_type: "RelWithDebInfo", model: "iris" } # Alaska
- {latitude: "-38.071235", longitude: "145.281220", altitude: "31", build_type: "AddressSanitizer", model: "standard_vtol" } # Australia
- {latitude: "29.660316", longitude: "-82.316658", altitude: "30", build_type: "RelWithDebInfo", model: "tailsitter" } # Florida
- {latitude: "47.397742", longitude: "8.545594", altitude: "488", build_type: "Coverage", model: "standard_vtol" } # Zurich
container:
image: px4io/px4-dev-simulation-focal:2021-09-08
@@ -96,7 +96,7 @@ jobs:
PX4_HOME_LON: ${{matrix.config.longitude}}
PX4_HOME_ALT: ${{matrix.config.altitude}}
PX4_CMAKE_BUILD_TYPE: ${{matrix.config.build_type}}
run: test/mavsdk_tests/mavsdk_test_runner.py --speed-factor 20 --abort-early --model ${{matrix.config.model}} --upload test/mavsdk_tests/configs/sitl.json --verbose
run: test/mavsdk_tests/mavsdk_test_runner.py --speed-factor 20 --abort-early --model ${{matrix.config.model}} --upload test/mavsdk_tests/configs/sitl.json
timeout-minutes: 45
- name: Look at core files
+4
View File
@@ -105,4 +105,8 @@ src/lib/version/build_git_version.h
src/modules/simulator/simulator_config.h
src/systemcmds/topic_listener/listener_generated.cpp
# SITL
dataman
eeprom/
!src/drivers/distance_sensor/broadcom/afbrs50/Lib/*
+16 -6
View File
@@ -1,11 +1,11 @@
[submodule "src/modules/mavlink/mavlink"]
path = src/modules/mavlink/mavlink
url = https://github.com/mavlink/mavlink.git
[submodule "mavlink/include/mavlink/v2.0"]
path = mavlink/include/mavlink/v2.0
url = https://github.com/mavlink/c_library_v2.git
branch = master
[submodule "src/drivers/uavcan/libuavcan"]
path = src/drivers/uavcan/libuavcan
url = https://github.com/dronecan/libuavcan.git
branch = main
url = https://github.com/PX4/libuavcan.git
branch = px4
[submodule "Tools/jMAVSim"]
path = Tools/jMAVSim
url = https://github.com/PX4/jMAVSim.git
@@ -14,6 +14,10 @@
path = Tools/sitl_gazebo
url = https://github.com/PX4/PX4-SITL_gazebo.git
branch = master
[submodule "src/lib/matrix"]
path = src/lib/matrix
url = https://github.com/PX4/PX4-Matrix.git
branch = master
[submodule "src/drivers/gps/devices"]
path = src/drivers/gps/devices
url = https://github.com/PX4/PX4-GPSDrivers.git
@@ -42,6 +46,12 @@
[submodule "src/drivers/uavcan_v1/public_regulated_data_types"]
path = src/drivers/uavcan_v1/public_regulated_data_types
url = https://github.com/UAVCAN/public_regulated_data_types.git
[submodule "src/drivers/uavcannode_gps_demo/public_regulated_data_types"]
path = src/drivers/uavcannode_gps_demo/public_regulated_data_types
url = https://github.com/UAVCAN/public_regulated_data_types.git
[submodule "src/drivers/uavcannode_gps_demo/libcanard"]
path = src/drivers/uavcannode_gps_demo/libcanard
url = https://github.com/UAVCAN/libcanard.git
[submodule "src/drivers/uavcan_v1/legacy_data_types"]
path = src/drivers/uavcan_v1/legacy_data_types
url = https://github.com/PX4/public_regulated_data_types.git
@@ -55,7 +65,7 @@
url = https://github.com/mavlink/libevents.git
[submodule "Tools/simulation-ignition"]
path = Tools/simulation-ignition
url = https://github.com/PX4/px4-simulation-ignition.git
url = https://github.com/Auterion/px4-simulation-ignition.git
[submodule "src/lib/crypto/libtomcrypt"]
path = src/lib/crypto/libtomcrypt
url = https://github.com/PX4/libtomcrypt.git
-20
View File
@@ -61,11 +61,6 @@ CONFIG:
buildType: MinSizeRel
settings:
CONFIG: px4_fmu-v5_default
px4_fmu-v5_debug:
short: px4_fmu-v5_debug
buildType: MinSizeRel
settings:
CONFIG: px4_fmu-v5_debug
px4_fmu-v5x_default:
short: px4_fmu-v5x
buildType: MinSizeRel
@@ -111,11 +106,6 @@ CONFIG:
buildType: MinSizeRel
settings:
CONFIG: ark_can-rtk-gps_default
ark_can-rtk-gps_debug:
short: ark_can-rtk-gps_debug
buildType: MinSizeRel
settings:
CONFIG: ark_can-rtk-gps_debug
ark_can-rtk-gps_canbootloader:
short: ark_can-rtk-gps_canbootloader
buildType: MinSizeRel
@@ -191,11 +181,6 @@ CONFIG:
buildType: MinSizeRel
settings:
CONFIG: holybro_durandal-v1_default
matek_h743-slim_default:
short: matek_h743-slim
buildType: MinSizeRel
settings:
CONFIG: matek_h743-slim_default
modalai_fc-v1_default:
short: modalai_fc-v1
buildType: MinSizeRel
@@ -231,8 +216,3 @@ CONFIG:
buildType: MinSizeRel
settings:
CONFIG: nxp_fmuk66-v3_default
raspberrypi_pico_default:
short: raspberrypi_pico
buildType: MinSizeRel
settings:
CONFIG: raspberrypi_pico_default
+2 -2
View File
@@ -14,6 +14,7 @@
"C_Cpp.workspaceParsingPriority": "low",
"cmake.buildBeforeRun": true,
"cmake.buildDirectory": "${workspaceFolder}/build/${variant:CONFIG}",
"cmake.buildTask": true,
"cmake.configureOnOpen": true,
"cmake.ctest.parallelJobs": 1,
"cmake.skipConfigureIfCachePresent": true,
@@ -135,6 +136,5 @@
"workbench.settings.enableNaturalLanguageSearch": false,
"yaml.schemas": {
"${workspaceFolder}/validation/module_schema.yaml": "${workspaceFolder}/src/modules/*/module.yaml"
},
"cortex-debug.openocdPath": "${env:PICO_SDK_PATH}/../openocd/src/openocd" // Added for rp2040
}
}
+3 -5
View File
@@ -40,7 +40,7 @@
# * Common functions should be included in px_base.cmake.
#
# * OS/ board specific fucntions should be include in
# px_impl_${PX4_PLATFORM}.cmake
# px_impl_${PX4_PLATFORM}.cmake or px4_impl_${PX4_PLATFORM}_${PX4_BOARD}.cmake.
#
# Formatting
# ---------------------------------------------------------------------------
@@ -101,8 +101,8 @@
cmake_minimum_required(VERSION 3.2 FATAL_ERROR)
set(PX4_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}" CACHE FILEPATH "PX4 source directory" FORCE)
set(PX4_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}" CACHE FILEPATH "PX4 binary directory" FORCE)
set(PX4_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
set(PX4_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}")
list(APPEND CMAKE_MODULE_PATH ${PX4_SOURCE_DIR}/cmake)
include(px4_parse_function_args)
@@ -423,8 +423,6 @@ endforeach()
# add events lib after modules and libs as it needs to know all source files (PX4_SRC_FILES)
add_subdirectory(src/lib/events EXCLUDE_FROM_ALL)
# metadata needs PX4_MODULE_CONFIG_FILES
add_subdirectory(src/lib/metadata EXCLUDE_FROM_ALL)
# must be the last module before firmware
add_subdirectory(src/lib/parameters EXCLUDE_FROM_ALL)
+12 -13
View File
@@ -63,10 +63,13 @@ menu "Toolchain"
help
relative path to the ROMFS root directory
config BOARD_BUILD_BOOTLOADER
bool "Enable bootloader"
help
flag to enable building and including the bootloader config
config BOARD_IO
string "IO board name"
default "px4_io-v2_default"
depends on DRIVERS_PX4IO
help
name of IO board to be built and included in the ROMFS (requires a valid ROMFSROOT)
@@ -114,15 +117,17 @@ config BOARD_ETHERNET
flag to indicate that ethernet is enabled
config BOARD_CRYPTO
bool "Crypto support"
string "Crypto"
help
Enable PX4 Crypto Support. Select the implementation under drivers
Crypto implementation selection
config BOARD_KEYSTORE
string "Keystore"
help
Keystore implememntation selection
menu "Serial ports"
config BOARD_SERIAL_URT6
string "URT6 tty port"
config BOARD_SERIAL_GPS1
string "GPS1 tty port"
@@ -153,14 +158,8 @@ menu "Serial ports"
config BOARD_SERIAL_TEL5
string "TEL5 tty port"
config BOARD_SERIAL_RC
string "RC tty port"
config BOARD_SERIAL_WIFI
string "WIFI tty port"
config BOARD_SERIAL_PPB
string "PPB (Pixhawk Payload Bus) tty port"
endmenu
menu "drivers"
+1 -19
View File
@@ -309,24 +309,6 @@ uorb_graphs:
@$(MAKE) --no-print-directory px4_fmu-v5_default uorb_graph
@$(MAKE) --no-print-directory px4_sitl_default uorb_graph
px4io_update: px4_io-v2_default cubepilot_io-v2_default
# px4_io-v2_default
cp build/px4_io-v2_default/px4_io-v2_default.bin boards/holybro/durandal-v1/extras/px4_io-v2_default.bin
cp build/px4_io-v2_default/px4_io-v2_default.bin boards/holybro/pix32v5/extras/px4_io-v2_default.bin
cp build/px4_io-v2_default/px4_io-v2_default.bin boards/mro/x21-777/extras/px4_io-v2_default.bin
cp build/px4_io-v2_default/px4_io-v2_default.bin boards/px4/fmu-v2/extras/px4_io-v2_default.bin
cp build/px4_io-v2_default/px4_io-v2_default.bin boards/px4/fmu-v3/extras/px4_io-v2_default.bin
cp build/px4_io-v2_default/px4_io-v2_default.bin boards/px4/fmu-v4pro/extras/px4_io-v2_default.bin
cp build/px4_io-v2_default/px4_io-v2_default.bin boards/px4/fmu-v5/extras/px4_io-v2_default.bin
cp build/px4_io-v2_default/px4_io-v2_default.bin boards/px4/fmu-v5x/extras/px4_io-v2_default.bin
cp build/px4_io-v2_default/px4_io-v2_default.bin boards/px4/fmu-v6x/extras/px4_io-v2_default.bin
# cubepilot_io-v2_default
cp build/cubepilot_io-v2_default/cubepilot_io-v2_default.bin boards/cubepilot/cubeorange/extras/cubepilot_io-v2_default.bin
cp build/cubepilot_io-v2_default/cubepilot_io-v2_default.bin boards/cubepilot/cubeyellow/extras/cubepilot_io-v2_default.bin
git status
bootloaders_update: cuav_nora_bootloader cuav_x7pro_bootloader cubepilot_cubeorange_bootloader holybro_durandal-v1_bootloader matek_h743-slim_bootloader modalai_fc-v2_bootloader mro_ctrl-zero-h7_bootloader mro_ctrl-zero-h7-oem_bootloader mro_pixracerpro_bootloader px4_fmu-v6u_bootloader px4_fmu-v6x_bootloader
git status
.PHONY: coverity_scan
@@ -482,7 +464,7 @@ shellcheck_all:
@make px4_fmu-v5_default shellcheck
validate_module_configs:
@find "$(SRC_DIR)"/src/modules "$(SRC_DIR)"/src/drivers "$(SRC_DIR)"/src/lib -name *.yaml -type f -not -path "$(SRC_DIR)/src/lib/mixer_module/*" -print0 | xargs -0 "$(SRC_DIR)"/Tools/validate_yaml.py --schema-file "$(SRC_DIR)"/validation/module_schema.yaml
@find "$(SRC_DIR)"/src/modules "$(SRC_DIR)"/src/drivers "$(SRC_DIR)"/src/lib -name *.yaml -type f -print0 | xargs -0 "$(SRC_DIR)"/Tools/validate_yaml.py --schema-file "$(SRC_DIR)"/validation/module_schema.yaml
# Cleanup
# --------------------------------------------------------------------
+34 -49
View File
@@ -143,14 +143,38 @@ add_custom_command(
COMMENT "ROMFS: copying, generating airframes"
)
if(EXISTS ${PX4_BOARD_DIR}/extras/${PX4_BOARD_VENDOR}_${PX4_BOARD_MODEL}_bootloader.bin)
set(BOARD_FIRMWARE_BIN "${PX4_BOARD_VENDOR}_${PX4_BOARD_MODEL}_bootloader.bin")
configure_file(${PX4_SOURCE_DIR}/platforms/nuttx/init/rc.board_bootloader_upgrade.in ${romfs_gen_root_dir}/init.d/rc.board_bootloader_upgrade @ONLY)
endif()
# copy extras into ROMFS
set(extras_dependencies)
# copy px4io binary if configured
if(config_io_board)
list(APPEND extras_dependencies
copy_px4io_bin
${fw_io_bin}
)
file(RELATIVE_PATH iofw_file_relative ${PX4_SOURCE_DIR} ${fw_io_bin})
message(STATUS "ROMFS: Adding ${iofw_file_relative} -> /etc/extras/${config_io_board}.bin")
endif()
# board bootloader (built or included)
if(TARGET copy_bootloader_bin)
if(board_bootloader_firmware)
file(RELATIVE_PATH bl_file_relative ${PX4_SOURCE_DIR} ${board_bootloader_firmware})
message(STATUS "ROMFS: Adding ${bl_file_relative} -> /etc/extras/bootloader.bin")
else()
file(RELATIVE_PATH bl_file_relative ${PX4_SOURCE_DIR} ${bootloader_bin})
message(STATUS "ROMFS: Adding ${bl_file_relative} -> /etc/extras/bootloader.bin")
endif()
list(APPEND extras_dependencies
copy_bootloader_bin
${bootloader_bin}
)
endif()
# optional board architecture defaults
set(board_arch_rc_file "rc.board_arch_defaults")
if(EXISTS "${PX4_SOURCE_DIR}/platforms/${PX4_PLATFORM}/init/${CONFIG_ARCH_CHIP}/${board_arch_rc_file}")
@@ -175,7 +199,6 @@ if(EXISTS "${PX4_SOURCE_DIR}/platforms/${PX4_PLATFORM}/init/${CONFIG_ARCH_CHIP}/
endif()
# board custom init files
set(OPTIONAL_BOARD_RC)
list(APPEND OPTIONAL_BOARD_RC
rc.board_defaults
@@ -210,59 +233,21 @@ foreach(board_rc_file ${OPTIONAL_BOARD_RC})
endforeach()
# board extras
set(OPTIONAL_BOARD_EXTRAS)
file(GLOB OPTIONAL_BOARD_EXTRAS ${PX4_BOARD_DIR}/extras/*)
foreach(board_extra_file ${OPTIONAL_BOARD_EXTRAS})
if(EXISTS "${board_extra_file}")
file(RELATIVE_PATH extra_file_base_name ${PX4_BOARD_DIR}/extras/ ${board_extra_file})
file(RELATIVE_PATH extra_file_relative_source ${PX4_SOURCE_DIR} ${board_extra_file})
message(STATUS "ROMFS: Adding ${extra_file_relative_source} -> /etc/extras/${extra_file_base_name}")
add_custom_command(
OUTPUT
${romfs_gen_root_dir}/extras/${extra_file_base_name}
${extra_file_base_name}.stamp
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${PX4_BOARD_DIR}/extras/${extra_file_base_name} ${romfs_gen_root_dir}/extras/${extra_file_base_name}
COMMAND ${CMAKE_COMMAND} -E touch ${extra_file_base_name}.stamp
DEPENDS
${board_extra_file}
romfs_copy.stamp
COMMENT "ROMFS: copying ${board_extra_file}"
)
list(APPEND extras_dependencies
${extra_file_base_name}.stamp
)
endif()
endforeach()
if(config_uavcan_peripheral_firmware)
include(ExternalProject)
foreach(uavcan_peripheral_config ${config_uavcan_peripheral_firmware})
# include the UAVCAN peripheral binaries in ROMFS
# include the px4io binary in ROMFS
message(STATUS "ROMFS: Adding UAVCAN peripheral ${uavcan_peripheral_config} -> /etc/uavcan/fw/")
# ExternalProject_Add() with GIT_SUBMODULES "" initializes no submodules.
cmake_policy(SET CMP0097 NEW)
include(ExternalProject)
ExternalProject_Add(build_${uavcan_peripheral_config}
GIT_REPOSITORY ${CMAKE_SOURCE_DIR}
GIT_TAG ${PX4_GIT_TAG}
GIT_SUBMODULES ""
DOWNLOAD_NO_PROGRESS true
SOURCE_DIR ${CMAKE_SOURCE_DIR}
DOWNLOAD_COMMAND ""
UPDATE_COMMAND ""
CMAKE_ARGS -DCONFIG=${uavcan_peripheral_config}
INSTALL_COMMAND ""
USES_TERMINAL_BUILD true
DEPENDS git_nuttx git_nuttx_apps
BUILD_ALWAYS 1
)
@@ -8,30 +8,41 @@
#
. ${R}etc/init.d/rc.mc_defaults
. ${R}etc/init.d/rc.ctrlalloc
param set-default SYS_CTRL_ALLOC 1
param set-default MPC_USE_HTE 0
param set-default VM_MASS 1.5
param set-default VM_INERTIA_XX 0.03
param set-default VM_INERTIA_YY 0.03
param set-default VM_INERTIA_ZZ 0.05
param set-default CA_AIRFRAME 0
param set-default CA_METHOD 1
param set-default CA_ACT0_MIN 0.0
param set-default CA_ACT1_MIN 0.0
param set-default CA_ACT2_MIN 0.0
param set-default CA_ACT3_MIN 0.0
param set-default CA_ACT0_MAX 1.0
param set-default CA_ACT1_MAX 1.0
param set-default CA_ACT2_MAX 1.0
param set-default CA_ACT3_MAX 1.0
param set-default CA_MC_R_COUNT 4
param set-default CA_MC_R0_PX 0.1515
param set-default CA_MC_R0_PY 0.245
param set-default CA_MC_R0_CT 6.5
param set-default CA_MC_R0_KM 0.05
param set-default CA_MC_R1_PX -0.1515
param set-default CA_MC_R1_PY -0.1875
param set-default CA_MC_R1_CT 6.5
param set-default CA_MC_R1_KM 0.05
param set-default CA_MC_R2_PX 0.1515
param set-default CA_MC_R2_PY -0.245
param set-default CA_MC_R2_CT 6.5
param set-default CA_MC_R2_KM -0.05
param set-default CA_MC_R3_PX -0.1515
param set-default CA_MC_R3_PY 0.1875
param set-default CA_MC_R3_CT 6.5
param set-default CA_MC_R3_KM -0.05
param set-default PWM_MAIN_FUNC1 101
param set-default PWM_MAIN_FUNC2 102
param set-default PWM_MAIN_FUNC3 103
param set-default PWM_MAIN_FUNC4 104
set MIXER skip
set MIXER_AUX none
set MIXER direct
@@ -5,6 +5,8 @@
. ${R}etc/init.d/rc.uuv_defaults
#Set data link loss failsafe mode (0: disabled)
# disable circuit breaker for airspeed sensor
param set-default CBRK_AIRSPD_CHK 162128
@@ -5,6 +5,8 @@
. ${R}etc/init.d/rc.uuv_defaults
#Set data link loss failsafe mode (0: disabled)
# disable circuit breaker for airspeed sensor
param set-default CBRK_AIRSPD_CHK 162128
@@ -5,6 +5,8 @@
. ${R}etc/init.d/rc.uuv_defaults
#Set data link loss failsafe mode (0: disabled)
# disable circuit breaker for airspeed sensor
param set-default CBRK_AIRSPD_CHK 162128
@@ -29,9 +29,12 @@ param set-default FW_THR_MAX 0.6
param set-default FW_THR_MIN 0.05
param set-default FW_THR_CRUISE 0.25
param set-default FW_T_ALT_TC 2
param set-default FW_T_CLMB_MAX 8
param set-default FW_T_HRATE_FF 0.5
param set-default FW_T_SINK_MAX 2.7
param set-default FW_T_SINK_MIN 2.2
param set-default FW_T_TAS_TC 2
param set-default FW_W_EN 1
@@ -7,3 +7,4 @@
param set-default FW_THR_CRUISE 0.0
param set-default RWTO_TKOFF 0
@@ -19,9 +19,12 @@ param set-default FW_RR_P 0.3
param set-default FW_THR_CRUISE 0.25
param set-default FW_THR_MAX 0.6
param set-default FW_THR_MIN 0.05
param set-default FW_T_ALT_TC 2
param set-default FW_T_CLMB_MAX 8
param set-default FW_T_HRATE_FF 0.5
param set-default FW_T_SINK_MAX 2.7
param set-default FW_T_SINK_MIN 2.2
param set-default FW_T_TAS_TC 2
param set-default MC_ROLLRATE_P 0.3
param set-default MC_YAW_P 1.6
@@ -19,9 +19,12 @@ param set-default FW_RR_P 0.3
param set-default FW_THR_CRUISE 0.38
param set-default FW_THR_MAX 0.6
param set-default FW_THR_MIN 0.05
param set-default FW_T_ALT_TC 2
param set-default FW_T_CLMB_MAX 8
param set-default FW_T_HRATE_FF 0.5
param set-default FW_T_SINK_MAX 2.7
param set-default FW_T_SINK_MIN 2.2
param set-default FW_T_TAS_TC 2
param set-default MC_YAW_P 1.6
@@ -6,8 +6,7 @@
#
. ${R}etc/init.d/rc.mc_defaults
param set-default SYS_CTRL_ALLOC 1
. ${R}etc/init.d/rc.ctrlalloc
param set-default MC_PITCHRATE_P 0.0800
param set-default MC_PITCHRATE_I 0.0400
@@ -29,36 +28,54 @@ param set-default TRIG_MODE 4
param set-default MNT_MODE_IN 0
param set-default MAV_PROTO_VER 2
param set-default MPC_USE_HTE 0
param set-default VM_MASS 2.66
param set-default VM_INERTIA_XX 0.06
param set-default VM_INERTIA_YY 0.06
param set-default VM_INERTIA_ZZ 0.10
param set-default CA_AIRFRAME 0
param set-default CA_MC_R_COUNT 6
param set-default CA_METHOD 1
param set-default CA_ACT0_MIN 0.0
param set-default CA_ACT1_MIN 0.0
param set-default CA_ACT2_MIN 0.0
param set-default CA_ACT3_MIN 0.0
param set-default CA_ACT4_MIN 0.0
param set-default CA_ACT5_MIN 0.0
param set-default CA_ACT0_MAX 1.0
param set-default CA_ACT1_MAX 1.0
param set-default CA_ACT2_MAX 1.0
param set-default CA_ACT3_MAX 1.0
param set-default CA_ACT4_MAX 1.0
param set-default CA_ACT5_MAX 1.0
param set-default CA_MC_R0_PX 0.0
param set-default CA_MC_R0_PY 1.0
param set-default CA_MC_R0_CT 9.5
param set-default CA_MC_R0_KM -0.05
param set-default CA_MC_R1_PX 0.0
param set-default CA_MC_R1_PY -1.0
param set-default CA_MC_R1_CT 9.5
param set-default CA_MC_R1_KM 0.05
param set-default CA_MC_R2_PX 0.866025
param set-default CA_MC_R2_PY -0.5
param set-default CA_MC_R2_CT 9.5
param set-default CA_MC_R2_KM -0.05
param set-default CA_MC_R3_PX -0.866025
param set-default CA_MC_R3_PY 0.5
param set-default CA_MC_R3_CT 9.5
param set-default CA_MC_R3_KM 0.05
param set-default CA_MC_R4_PX 0.866025
param set-default CA_MC_R4_PY 0.5
param set-default CA_MC_R4_CT 9.5
param set-default CA_MC_R4_KM 0.05
param set-default CA_MC_R5_PX -0.866025
param set-default CA_MC_R5_PY -0.5
param set-default CA_MC_R5_CT 9.5
param set-default CA_MC_R5_KM -0.05
param set-default PWM_MAIN_FUNC1 101
param set-default PWM_MAIN_FUNC2 102
param set-default PWM_MAIN_FUNC3 103
param set-default PWM_MAIN_FUNC4 104
param set-default PWM_MAIN_FUNC5 105
param set-default PWM_MAIN_FUNC6 106
set MAV_TYPE 13
set MIXER skip
set MIXER_AUX none
# set MIXER hexa_x
set MIXER direct
-5
View File
@@ -1,7 +1,5 @@
#!/bin/sh
set -e
# PX4 commands need the 'px4-' prefix in bash.
# (px4-alias.sh is expected to be in the PATH)
# shellcheck disable=SC1091
@@ -146,8 +144,6 @@ param set-default SENS_MAG_MODE 0
param set-default IMU_GYRO_FFT_EN 1
param set-default -s MC_AT_EN 1
# By default log from boot until first disarm.
param set-default SDLOG_MODE 1
# enable default, estimator replay and vision/avoidance logging profiles
@@ -221,7 +217,6 @@ load_mon start
battery_simulator start
tone_alarm start
rc_update start
manual_control start
sensors start
commander start
navigator start
@@ -55,4 +55,5 @@ px4_add_romfs_files(
rc.vehicle_setup
rc.vtol_apps
rc.vtol_defaults
rc.ctrlalloc
)
@@ -9,7 +9,6 @@
#
# @board px4_fmu-v2 exclude
# @board bitcraze_crazyflie exclude
# @board holybro_kakutef7 exclude
#
. ${R}etc/init.d/rc.vtol_defaults
@@ -19,7 +19,6 @@
#
# @board px4_fmu-v2 exclude
# @board bitcraze_crazyflie exclude
# @board holybro_kakutef7 exclude
#
. ${R}etc/init.d/rc.vtol_defaults
@@ -14,7 +14,6 @@
#
# @board px4_fmu-v2 exclude
# @board bitcraze_crazyflie exclude
# @board holybro_kakutef7 exclude
#
. ${R}etc/init.d/rc.vtol_defaults
@@ -19,7 +19,6 @@
#
# @board px4_fmu-v2 exclude
# @board bitcraze_crazyflie exclude
# @board holybro_kakutef7 exclude
#
. ${R}etc/init.d/rc.vtol_defaults
@@ -17,7 +17,6 @@
#
# @board px4_fmu-v2 exclude
# @board bitcraze_crazyflie exclude
# @board holybro_kakutef7 exclude
#
. ${R}etc/init.d/rc.vtol_defaults
@@ -9,7 +9,6 @@
#
# @board px4_fmu-v2 exclude
# @board bitcraze_crazyflie exclude
# @board holybro_kakutef7 exclude
#
. ${R}etc/init.d/rc.vtol_defaults
@@ -9,7 +9,6 @@
#
# @board px4_fmu-v2 exclude
# @board bitcraze_crazyflie exclude
# @board holybro_kakutef7 exclude
#
. ${R}etc/init.d/rc.vtol_defaults
@@ -18,7 +18,6 @@
#
# @board px4_fmu-v2 exclude
# @board bitcraze_crazyflie exclude
# @board holybro_kakutef7 exclude
#
. ${R}etc/init.d/rc.vtol_defaults
@@ -22,7 +22,6 @@
#
# @board px4_fmu-v2 exclude
# @board bitcraze_crazyflie exclude
# @board holybro_kakutef7 exclude
#
. ${R}etc/init.d/rc.vtol_defaults
@@ -21,7 +21,6 @@
#
# @board px4_fmu-v2 exclude
# @board bitcraze_crazyflie exclude
# @board holybro_kakutef7 exclude
#
. ${R}etc/init.d/rc.vtol_defaults
@@ -14,7 +14,6 @@
#
# @board px4_fmu-v2 exclude
# @board bitcraze_crazyflie exclude
# @board holybro_kakutef7 exclude
#
. ${R}etc/init.d/rc.vtol_defaults
@@ -84,8 +84,6 @@ param set-default MPC_Z_VEL_P_ACC 5
param set-default MPC_Z_VEL_I_ACC 3
param set-default MPC_LAND_ALT1 3
param set-default MPC_LAND_ALT2 1
param set-default MPC_POS_MODE 3
param set-default CP_GO_NO_DATA 1
# Navigator Parameters
param set-default NAV_ACC_RAD 2
@@ -11,29 +11,45 @@
#
. ${R}etc/init.d/rc.mc_defaults
. ${R}etc/init.d/rc.ctrlalloc
set MIXER skip
set MIXER_AUX none
set MIXER none
param set-default SYS_CTRL_ALLOC 1
param set-default MPC_USE_HTE 0
param set-default VM_MASS 1.5
param set-default VM_INERTIA_XX 0.03
param set-default VM_INERTIA_YY 0.03
param set-default VM_INERTIA_ZZ 0.05
param set-default CA_AIRFRAME 0
param set-default CA_METHOD 1
param set-default CA_ACT0_MIN 0.0
param set-default CA_ACT1_MIN 0.0
param set-default CA_ACT2_MIN 0.0
param set-default CA_ACT3_MIN 0.0
param set-default CA_ACT0_MAX 1.0
param set-default CA_ACT1_MAX 1.0
param set-default CA_ACT2_MAX 1.0
param set-default CA_ACT3_MAX 1.0
param set-default CA_MC_R_COUNT 4
param set-default CA_MC_R0_PX 0.177
param set-default CA_MC_R0_PY 0.177
param set-default CA_MC_R0_CT 6.5
param set-default CA_MC_R0_KM 0.05
param set-default CA_MC_R1_PX -0.177
param set-default CA_MC_R1_PY -0.177
param set-default CA_MC_R1_CT 6.5
param set-default CA_MC_R1_KM 0.05
param set-default CA_MC_R2_PX 0.177
param set-default CA_MC_R2_PY -0.177
param set-default CA_MC_R2_CT 6.5
param set-default CA_MC_R2_KM -0.05
param set-default CA_MC_R3_PX -0.177
param set-default CA_MC_R3_PY 0.177
param set-default CA_MC_R3_CT 6.5
param set-default CA_MC_R3_KM -0.05
param set-default PWM_MAIN_FUNC1 101
param set-default PWM_MAIN_FUNC2 102
param set-default PWM_MAIN_FUNC3 103
param set-default PWM_MAIN_FUNC4 104
set MIXER direct
set MIXER_AUX direct_aux
@@ -77,3 +77,4 @@ param set-default IMU_DGYRO_CUTOFF 100
# enable to use high-rate logging for better rate tracking analysis
param set-default SDLOG_PROFILE 27
@@ -13,6 +13,9 @@
. ${R}etc/init.d/rc.uuv_defaults
#Set data link loss failsafe mode (0: disabled)
# disable circuit breaker for airspeed sensor
param set-default CBRK_AIRSPD_CHK 162128
@@ -13,6 +13,9 @@
. ${R}etc/init.d/rc.uuv_defaults
#Set data link loss failsafe mode (0: disabled)
# disable circuit breaker for airspeed sensor
param set-default CBRK_AIRSPD_CHK 162128
@@ -22,6 +22,7 @@
. ${R}etc/init.d/rc.uuv_defaults
#Set data link loss failsafe mode (0: disabled)
# disable circuit breaker for airspeed sensor
param set-default CBRK_AIRSPD_CHK 162128
@@ -11,42 +11,63 @@
#
. ${R}etc/init.d/rc.mc_defaults
. ${R}etc/init.d/rc.ctrlalloc
param set-default SYS_CTRL_ALLOC 1
param set-default MPC_USE_HTE 0
param set-default VM_MASS 1.5
param set-default VM_INERTIA_XX 0.03
param set-default VM_INERTIA_YY 0.03
param set-default VM_INERTIA_ZZ 0.05
param set-default CA_AIRFRAME 0
param set-default CA_MC_R_COUNT 6
param set-default CA_METHOD 1
param set-default CA_ACT0_MIN 0.0
param set-default CA_ACT1_MIN 0.0
param set-default CA_ACT2_MIN 0.0
param set-default CA_ACT3_MIN 0.0
param set-default CA_ACT4_MIN 0.0
param set-default CA_ACT5_MIN 0.0
param set-default CA_ACT0_MAX 1.0
param set-default CA_ACT1_MAX 1.0
param set-default CA_ACT2_MAX 1.0
param set-default CA_ACT3_MAX 1.0
param set-default CA_ACT4_MAX 1.0
param set-default CA_ACT5_MAX 1.0
param set-default CA_MC_R0_PX 0.0
param set-default CA_MC_R0_PY 0.275
param set-default CA_MC_R0_CT 6.5
param set-default CA_MC_R0_KM -0.05
param set-default CA_MC_R1_PX 0.0
param set-default CA_MC_R1_PY -0.275
param set-default CA_MC_R1_CT 6.5
param set-default CA_MC_R1_KM 0.05
param set-default CA_MC_R2_PX 0.238
param set-default CA_MC_R2_PY -0.1375
param set-default CA_MC_R2_CT 6.5
param set-default CA_MC_R2_KM -0.05
param set-default CA_MC_R3_PX -0.238
param set-default CA_MC_R3_PY 0.1375
param set-default CA_MC_R3_CT 6.5
param set-default CA_MC_R3_KM 0.05
param set-default CA_MC_R4_PX 0.238
param set-default CA_MC_R4_PY 0.1375
param set-default CA_MC_R4_CT 6.5
param set-default CA_MC_R4_KM 0.05
param set-default CA_MC_R5_PX -0.238
param set-default CA_MC_R5_PY -0.1375
param set-default CA_MC_R5_CT 6.5
param set-default CA_MC_R5_KM -0.05
param set-default PWM_MAIN_FUNC1 101
param set-default PWM_MAIN_FUNC2 102
param set-default PWM_MAIN_FUNC3 103
param set-default PWM_MAIN_FUNC4 104
param set-default PWM_MAIN_FUNC5 105
param set-default PWM_MAIN_FUNC6 106
set MIXER direct
set PWM_OUT 123456
set MIXER skip
set MIXER_AUX none
set MIXER_AUX direct_aux
set PWM_AUX_OUT 123456
@@ -1,12 +0,0 @@
#!/bin/sh
#
# External airframe startup script (on SD card)
#
set SDCARD_MIXERS_PATH ${SDCARD_EXT_PATH}/mixers
if [ -e ${SDCARD_EXT_PATH}/rc.autostart ]
then
. ${SDCARD_EXT_PATH}/rc.autostart
else
echo "Error: ${SDCARD_EXT_PATH}/rc.autostart does not exist"
fi
+26
View File
@@ -0,0 +1,26 @@
#!/bin/sh
#
# Standard apps for new control allocation and controllers
#
# NOTE: Script variables are declared/initialized/unset in the rcS script.
#
#
# Start angular velocity controller
#
# angular_velocity_controller start
# mc_rate_control stop
#
# Start Control Allocator
#
control_allocator start
#
# Disable hover thrust estimator and prearming
# These features are currently incompatible with control allocation
#
# TODO: fix
#
param set MPC_USE_HTE 0
param set COM_PREARM_MODE 0
-6
View File
@@ -16,12 +16,6 @@ ekf2 start &
fw_att_control start
fw_pos_control_l1 start
airspeed_selector start
#
# Start attitude control auto-tuner
#
fw_autotune_attitude_control start
#
# Start Land Detector.
#
+7 -22
View File
@@ -18,17 +18,8 @@ set OUTPUT_AUX_DEV /dev/pwm_output1
set OUTPUT_EXTRA_DEV /dev/pwm_output0
# set these before starting the modules
if [ $PWM_AUX_OUT != none ]
then
param set PWM_AUX_OUT ${PWM_AUX_OUT}
fi
if [ $PWM_OUT != none ]
then
param set PWM_MAIN_OUT ${PWM_OUT}
fi
param set PWM_AUX_OUT ${PWM_AUX_OUT}
param set PWM_MAIN_OUT ${PWM_OUT}
#
# If mount (gimbal) control is enabled and output mode is AUX, set the aux
@@ -105,16 +96,10 @@ then
if [ $OUTPUT_MODE = $OUTPUT_CMD -o $OUTPUT_MODE = io ]
then
if param compare SYS_CTRL_ALLOC 1
if ! $OUTPUT_CMD start
then
pwm_out start
dshot start
else
if ! $OUTPUT_CMD start
then
echo "$OUTPUT_CMD start failed"
tune_control play error
fi
echo "$OUTPUT_CMD start failed"
tune_control play error
fi
fi
fi
@@ -229,10 +214,10 @@ fi
if [ $OUTPUT_MODE = pwm_out -o $OUTPUT_MODE = io ]
then
if [ $PWM_OUT != none -a $PWM_MAIN_RATE != none ]
if [ $PWM_OUT != none ]
then
# Set PWM output frequency.
if ! param compare SYS_CTRL_ALLOC 1
if [ $PWM_MAIN_RATE != none ]
then
pwm rate -c ${PWM_OUT} -r ${PWM_MAIN_RATE}
fi
+1 -13
View File
@@ -48,14 +48,6 @@ fi
# End Estimator Group Selection #
###############################################################################
if param compare SYS_CTRL_ALLOC 1
then
#
# Start Control Allocator
#
control_allocator start
fi
#
# Start Multicopter Rate Controller.
#
@@ -65,11 +57,7 @@ mc_rate_control start
# Start Multicopter Attitude Controller.
#
mc_att_control start
if param greater -s MC_AT_EN 0
then
mc_autotune_attitude_control start
fi
mc_autotune_attitude_control start
#
# Start Multicopter Position Controller.
-6
View File
@@ -25,14 +25,8 @@ flight_mode_manager start
mc_pos_control start vtol
mc_hover_thrust_estimator start
if param greater -s MC_AT_EN 0
then
mc_autotune_attitude_control start
fi
fw_att_control start vtol
fw_pos_control_l1 start vtol
fw_autotune_attitude_control start vtol
# Start Land Detector
# Multicopter for now until we have something for VTOL
+57 -131
View File
@@ -35,7 +35,7 @@ set MIXER_AUX none
set MIXER_FILE none
set MIXER_EXTRA none
set OUTPUT_MODE none
set PARAM_FILE ""
set PARAM_FILE /fs/microsd/params
set PWM_OUT none
set PWM_MAIN_RATE p:PWM_MAIN_RATE
set PWM_AUX_OUT none
@@ -44,9 +44,6 @@ set PWM_EXTRA_OUT none
set PWM_EXTRA_RATE p:PWM_EXTRA_RATE
set EXTRA_MIXER_MODE none
set RC_INPUT_ARGS ""
set SDCARD_AVAILABLE no
set SDCARD_EXT_PATH /fs/microsd/ext_autostart
set SDCARD_FORMAT no
set SDCARD_MIXERS_PATH /fs/microsd/etc/mixers
set STARTUP_TUNE 1
set USE_IO no
@@ -60,78 +57,55 @@ ver all
#
# Try to mount the microSD card.
#
if [ -b "/dev/mmcsd0" ]
set SDCARD_AVAILABLE no
# REBOOTWORK this needs to start after the flight control loop.
if mount -t vfat /dev/mmcsd0 /fs/microsd
then
if mount -t vfat /dev/mmcsd0 /fs/microsd
set PX4_INIT_TEST_FILE "/fs/microsd/.px4_init_test_file"
date >> $PX4_INIT_TEST_FILE
if [ -f $PX4_INIT_TEST_FILE ]
then
if [ -f "/fs/microsd/.format" ]
cat $PX4_INIT_TEST_FILE
rm $PX4_INIT_TEST_FILE
if [ ! -f $PX4_INIT_TEST_FILE ]
then
echo "INFO [init] format /dev/mmcsd0 requested (/fs/microsd/.format)"
set SDCARD_FORMAT yes
rm /fs/microsd/.format
umount /fs/microsd
else
# very basic I/O test
set PX4_INIT_TEST_FILE "/fs/microsd/.px4_init_test_file"
date >> $PX4_INIT_TEST_FILE
if [ $? -eq 0 -a -f $PX4_INIT_TEST_FILE ]
then
cat $PX4_INIT_TEST_FILE
rm $PX4_INIT_TEST_FILE
if [ $? -eq 0 -a ! -f $PX4_INIT_TEST_FILE ]
then
set SDCARD_AVAILABLE yes
fi
fi
unset PX4_INIT_TEST_FILE
if [ $SDCARD_AVAILABLE = no ]
then
echo "ERROR [init] card I/O failure, formatting"
set SDCARD_FORMAT yes
umount /fs/microsd
fi
set SDCARD_AVAILABLE yes
fi
fi
fi
if [ $SDCARD_AVAILABLE = no -o $SDCARD_FORMAT = yes ]
if [ $SDCARD_AVAILABLE = no ]
then
set STARTUP_TUNE 14 # tune 14 = SD_INIT
if mkfatfs -F 32 /dev/mmcsd0
then
echo "INFO [init] formatting /dev/mmcsd0"
set STARTUP_TUNE 15 # tune 15 = SD_ERROR (overridden to SD_INIT if format + mount succeeds)
if mkfatfs -F 32 /dev/mmcsd0
if mount -t vfat /dev/mmcsd0 /fs/microsd
then
set SDCARD_AVAILABLE yes
echo "INFO [init] card formatted"
if mount -t vfat /dev/mmcsd0 /fs/microsd
then
set SDCARD_AVAILABLE yes
set STARTUP_TUNE 14 # tune 14 = SD_INIT
else
echo "ERROR [init] card mount failed"
fi
else
set STARTUP_TUNE 15 # tune 15 = SD_ERROR
echo "ERROR [init] format failed"
fi
fi
fi
if [ $SDCARD_AVAILABLE = yes ]
if [ $SDCARD_AVAILABLE = yes ]
then
if hardfault_log check
then
if hardfault_log check
# Error tune.
set STARTUP_TUNE 2
if hardfault_log commit
then
set STARTUP_TUNE 2 # tune 2 = ERROR_TUNE
if hardfault_log commit
then
hardfault_log reset
fi
hardfault_log reset
fi
fi
set PARAM_FILE /fs/microsd/params
fi
unset SDCARD_AVAILABLE
#
# Look for an init script on the microSD card.
@@ -163,31 +137,8 @@ else
param select $PARAM_FILE
if ! param import
then
echo "ERROR [init] param import failed"
set STARTUP_TUNE 2 # tune 2 = ERROR_TUNE
param dump $PARAM_FILE
if [ -d "/fs/microsd" ]
then
dmesg >> /fs/microsd/param_import_fail.txt &
# try to make a backup copy
cp $PARAM_FILE /fs/microsd/param_import_fail.bson &
fi
# try importing from backup file
if [ -f "/fs/microsd/parameters_backup.bson" ]
then
param import /fs/microsd/parameters_backup.bson
fi
param reset_all
fi
if [ $SDCARD_AVAILABLE = yes ]
then
param select-backup /fs/microsd/parameters_backup.bson
fi
if ver hwcmp PX4_FMU_V5X PX4_FMU_V6X
then
netman update -i eth0
@@ -231,20 +182,20 @@ else
#
tone_alarm start
#
# Play the startup tune (if not disabled or there is an error)
#
param compare CBRK_BUZZER 782090
if [ $? != 0 -o $STARTUP_TUNE != 1 ]
then
tune_control play -t $STARTUP_TUNE
fi
#
# Waypoint storage.
# REBOOTWORK this needs to start in parallel.
#
if param compare SYS_DM_BACKEND 1
then
dataman start -r
else
if param compare SYS_DM_BACKEND 0
then
# dataman start default
dataman start
fi
fi
dataman start
#
# Start the socket communication send_event handler.
@@ -265,22 +216,10 @@ else
#
# Set parameters and env variables for selected AUTOSTART.
#
set AUTOSTART_PATH etc/init.d/rc.autostart
if ! param compare SYS_AUTOSTART 0
then
if param greater SYS_AUTOSTART 1000000
then
# Use external startup file
if [ $SDCARD_AVAILABLE = yes ]
then
set AUTOSTART_PATH etc/init.d/rc.autostart_ext
else
echo "ERROR [init] SD card not mounted - trying to load airframe from ROMFS"
fi
fi
. ${R}$AUTOSTART_PATH
. ${R}etc/init.d/rc.autostart
fi
unset AUTOSTART_PATH
#
# Override parameters from user configuration file.
@@ -311,7 +250,7 @@ else
then
# Start UAVCAN firmware update server and dynamic node ID allocation server.
uavcan start fw
tune_control play -t 1
if param greater UAVCAN_ENABLE 2
then
set OUTPUT_MODE uavcan_esc
@@ -376,7 +315,7 @@ else
if [ $USE_IO = yes -a $IO_PRESENT = no ]
then
echo "PX4IO not found"
set STARTUP_TUNE 2 # tune 2 = ERROR_TUNE
tune_control play error
fi
#
@@ -384,7 +323,6 @@ else
# start before commander
#
rc_update start
manual_control start
#
# Sensors System (start before Commander so Preflight checks are properly run).
@@ -431,17 +369,6 @@ else
commander start
fi
#
# Play the startup tune (if not disabled or there is an error)
#
param compare CBRK_BUZZER 782090
if [ $? != 0 -o $STARTUP_TUNE != 1 ]
then
tune_control play -t $STARTUP_TUNE
fi
# Pre-takeoff continuous magnetometer calibration
if param compare -s MBE_ENABLE 1
then
@@ -477,12 +404,6 @@ else
rc_input start $RC_INPUT_ARGS
fi
# PPS capture driver (before pwm_out)
if param greater -s PPS_CAP_ENABLE 0
then
pps_capture start
fi
# Camera capture driver (before pwm_out)
if param greater -s CAM_CAP_FBACK 0
then
@@ -572,13 +493,21 @@ else
. ${R}etc/init.d/rc.autostart.post
fi
set BOARD_BOOTLOADER_UPGRADE ${R}etc/init.d/rc.board_bootloader_upgrade
if [ -f $BOARD_BOOTLOADER_UPGRADE ]
#
# Bootloader upgrade
#
if param compare -s SYS_BL_UPDATE 1
then
sh $BOARD_BOOTLOADER_UPGRADE
if [ -f "/etc/extras/bootloader.bin" ]
then
param set SYS_BL_UPDATE 0
param save
echo "bootloader update..."
bl_update "/etc/extras/bootloader.bin"
echo "bootloader update done, rebooting"
reboot
fi
fi
unset BOARD_BOOTLOADER_UPGRADE
#
# End of autostart.
@@ -610,9 +539,6 @@ unset PWM_OUT
unset PWM_EXTRA_OUT
unset PWM_EXTRA_RATE
unset RC_INPUT_ARGS
unset SDCARD_AVAILABLE
unset SDCARD_EXT_PATH
unset SDCARD_FORMAT
unset SDCARD_MIXERS_PATH
unset STARTUP_TUNE
unset USE_IO
@@ -44,4 +44,5 @@ px4_add_romfs_files(
tiltrotor_sitl.main.mix
uuv_x_sitl.main.mix
vectored6dof_sitl.main.mix
tiltrotor_sitl_direct.main.mix
)
@@ -0,0 +1,14 @@
Mixer for quad tiltrotor (x motor configuration)
================================================
A: 0
A: 1
A: 2
A: 3
A: 4
A: 5
A: 6
A: 7
A: 8
A: 9
A: 10
@@ -46,6 +46,7 @@ px4_add_romfs_files(
coax.main.mix
delta.main.mix
deltaquad.main.mix
direct.main.mix
dodeca_bottom_cox.aux.mix
dodeca_top_cox.main.mix
firefly6.aux.mix
@@ -0,0 +1,11 @@
# Direct mixer
# @board px4_fmu-v2 exclude
A: 0
A: 1
A: 2
A: 3
A: 4
A: 5
A: 6
A: 7
+5 -5
View File
@@ -40,8 +40,8 @@ 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)
timeout = 180 # 3 minutes
timeout_start = time.monotonic()
timeout_newline = time.monotonic()
timeout_start = time.time()
timeout_newline = time.time()
return_code = 0
@@ -59,13 +59,13 @@ def monitor_firmware_upload(port, baudrate):
elif "nsh>" in serial_line:
sys.exit(return_code)
if time.monotonic() > timeout_start + timeout:
if time.time() > timeout_start + timeout:
print("Error, timeout")
sys.exit(-1)
# newline every 10 seconds if still running
if time.monotonic() - timeout_newline > 10:
timeout_newline = time.monotonic()
if time.time() - timeout_newline > 10:
timeout_newline = time.time()
ser.write("\n".encode("ascii"))
ser.flush()
+11 -13
View File
@@ -34,7 +34,7 @@ def print_line(line):
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.monotonic()
timeout_start = time.time()
timeout = 30 # 30 seconds
# wait for nsh prompt
@@ -50,7 +50,7 @@ def do_param_set_cmd(port, baudrate, param_name, param_value):
if len(serial_line) > 0:
print_line(serial_line)
if time.monotonic() > timeout_start + timeout:
if time.time() > timeout_start + timeout:
print("Error, timeout waiting for prompt")
sys.exit(1)
@@ -58,13 +58,12 @@ def do_param_set_cmd(port, baudrate, param_name, param_value):
ser.readlines()
# run command
timeout_start = time.monotonic()
timeout_start = time.time()
timeout = 10 # 10 seconds
cmd = "param set " + param_name + " " + param_value
# write command (param set) and wait for command echo
print("Running command: \'{0}\'".format(cmd))
serial_cmd = '{0}\r\n'.format(cmd)
ser.write(serial_cmd.encode("ascii"))
ser.flush()
@@ -78,7 +77,7 @@ def do_param_set_cmd(port, baudrate, param_name, param_value):
if len(serial_line) > 0:
print_line(serial_line)
if time.monotonic() > timeout_start + timeout:
if time.time() > timeout_start + timeout:
print("Error, timeout waiting for command echo")
break
@@ -90,8 +89,8 @@ def do_param_set_cmd(port, baudrate, param_name, param_value):
param_show_response = param_name + " ["
timeout_start = time.monotonic()
timeout = 3 # 3 seconds
timeout_start = time.time()
timeout = 2 # 2 seconds
while True:
serial_line = ser.readline().decode("ascii", errors='ignore')
@@ -108,20 +107,19 @@ def do_param_set_cmd(port, baudrate, param_name, param_value):
if len(serial_line) > 0:
print_line(serial_line)
if time.monotonic() > timeout_start + timeout:
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 time.monotonic() > timeout_start + timeout:
print("Error, timeout")
sys.exit(-1)
if len(serial_line) <= 0:
ser.write("\r\n".encode("ascii"))
ser.flush()
time.sleep(0.2)
if time.time() > timeout_start + timeout:
print("Error, timeout")
sys.exit(-1)
ser.close()
-87
View File
@@ -1,87 +0,0 @@
#! /usr/bin/env python3
import serial, time
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)
if "\n" in line:
current_time = datetime.datetime.now()
print('[{0}] {1}'.format(current_time.isoformat(timespec='milliseconds'), line), end='')
else:
print('{0}'.format(line), end='')
def reboot(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)
# clear
ser.readlines()
time_start = time.monotonic()
ser.write("\nreboot\n".encode("ascii"))
ser.flush()
time_reboot_cmd = time_start
timeout_reboot_cmd = 90
timeout = 300 # 5 minutes
return_code = 0
while True:
if time.monotonic() > time_reboot_cmd + timeout_reboot_cmd:
time_reboot_cmd = time.monotonic()
print("sending reboot cmd again")
ser.write("reboot\n".encode("ascii"))
ser.flush()
time.sleep(0.2)
serial_line = ser.readline().decode("ascii", errors='ignore')
if len(serial_line) > 0:
if "ERROR" in serial_line:
return_code = -1
print_line(serial_line)
if "NuttShell (NSH)" in serial_line:
sys.exit(return_code)
if time.monotonic() > time_start + timeout:
print("Error, timeout")
sys.exit(-1)
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)
args = parser.parse_args()
reboot(args.device, args.baudrate)
if __name__ == "__main__":
main()
+10 -12
View File
@@ -40,7 +40,7 @@ def print_line(line):
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.2, xonxoff=True, rtscts=False, dsrdtr=False)
timeout_start = time.monotonic()
timeout_start = time.time()
timeout = 30 # 30 seconds
# wait for nsh prompt
@@ -56,7 +56,7 @@ def do_nsh_cmd(port, baudrate, cmd):
if len(serial_line) > 0:
print_line(serial_line)
if time.monotonic() > timeout_start + timeout:
if time.time() > timeout_start + timeout:
print("Error, timeout waiting for prompt")
sys.exit(1)
@@ -64,13 +64,12 @@ def do_nsh_cmd(port, baudrate, cmd):
ser.readlines()
# run command
timeout_start = time.monotonic()
timeout_start = time.time()
timeout = 1 # 1 second
success_cmd = "cmd succeeded!"
# wait for command echo
print("Running command: \'{0}\'".format(cmd))
serial_cmd = '{0}; echo "{1}"; echo "{2}";\r\n'.format(cmd, success_cmd, success_cmd)
ser.write(serial_cmd.encode("ascii"))
ser.flush()
@@ -87,13 +86,13 @@ def do_nsh_cmd(port, baudrate, cmd):
if len(serial_line) > 0:
print_line(serial_line)
if (len(serial_line) <= 0) and (time.monotonic() > timeout_start + timeout):
if time.time() > timeout_start + timeout:
print("Error, timeout waiting for command echo")
break
timeout_start = time.monotonic()
timeout = 240 # 4 minutes
timeout_start = time.time()
timeout = 180 # 3 minutes
return_code = 0
@@ -115,14 +114,13 @@ def do_nsh_cmd(port, baudrate, cmd):
elif "NuttShell (NSH)" in serial_line:
sys.exit(1) # error, command didn't complete successfully
if (len(serial_line) <= 0) and (time.monotonic() > timeout_start + timeout):
print("Error, timeout")
sys.exit(-1)
if len(serial_line) <= 0:
ser.write("\r\n".encode("ascii"))
ser.flush()
time.sleep(0.2)
if time.time() > timeout_start + timeout:
print("Error, timeout")
sys.exit(-1)
ser.close()
+11 -11
View File
@@ -41,7 +41,7 @@ def print_line(line):
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.monotonic()
timeout_start = time.time()
timeout = 30 # 30 seconds
# wait for nsh prompt
@@ -57,7 +57,7 @@ def do_test(port, baudrate, test_name):
if len(serial_line) > 0:
print(serial_line, end='')
if time.monotonic() > timeout_start + timeout:
if time.time() > timeout_start + timeout:
print("Error, timeout waiting for prompt")
return False
@@ -72,11 +72,10 @@ def do_test(port, baudrate, test_name):
print("| Running:", cmd)
print('|======================================================================')
timeout_start = time.monotonic()
timeout_start = time.time()
timeout = 2 # 2 seconds
# wait for command echo
print("Running command: \'{0}\'".format(cmd))
serial_cmd = '{0}\n'.format(cmd)
ser.write(serial_cmd.encode("ascii"))
ser.flush()
@@ -89,14 +88,14 @@ def do_test(port, baudrate, test_name):
if len(serial_line) > 0:
print_line(serial_line)
if time.monotonic() > timeout_start + timeout:
if time.time() > timeout_start + timeout:
print("Error, timeout waiting for command echo")
break
# print results, wait for final result (PASSED or FAILED)
timeout = 300 # 5 minutes
timeout_start = time.monotonic()
timeout_start = time.time()
timeout_newline = timeout_start
while True:
@@ -112,16 +111,16 @@ def do_test(port, baudrate, test_name):
success = False
break
if time.monotonic() > timeout_start + timeout:
if time.time() > timeout_start + timeout:
print("Error, timeout")
print(test_name + f" {COLOR_RED}FAILED{COLOR_RESET}")
success = False
break
# newline every 10 seconds if still running
if (len(serial_line) <= 0) and (time.monotonic() - timeout_newline > 10):
if time.time() - timeout_newline > 10:
ser.write("\n".encode("ascii"))
timeout_newline = time.monotonic()
timeout_newline = time.time()
ser.close()
@@ -143,8 +142,9 @@ class TestHardwareMethods(unittest.TestCase):
def test_bson(self):
self.assertTrue(do_test(self.TEST_DEVICE, self.TEST_BAUDRATE, "bson"))
def test_dataman(self):
self.assertTrue(do_test(self.TEST_DEVICE, self.TEST_BAUDRATE, "dataman"))
# TODO: review
# 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"))
-41
View File
@@ -1,41 +0,0 @@
#! /bin/bash
# exit when any command fails
set -e
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
SERIAL_DEVICE=$1
if [ ! -e "${SERIAL_DEVICE}" ]
then
echo "Invalid serial device ${SERIAL_DEVICE}"
exit -1
fi
# all airframes (from ROMFS/px4fmu_common/init.d/airframes/)
# $(find . -regex '.*/[0-9].*' -exec basename {} \; | cut -d "_" -f 1)
ALL_AIRFRAMES=${@:2}
echo "airframes: ${ALL_AIRFRAMES}"
for airframe in $ALL_AIRFRAMES
do
echo
echo "##########################################################################################"
echo " Airframe: $airframe"
echo "##########################################################################################"
echo
${DIR}/nsh_param_set.py --device ${SERIAL_DEVICE} --name SYS_AUTOSTART --value $airframe
${DIR}/nsh_param_set.py --device ${SERIAL_DEVICE} --name CBRK_BUZZER --value 782097
${DIR}/run_nsh_cmd.py --device ${SERIAL_DEVICE} --cmd 'param reset SYS_HITL'
${DIR}/run_nsh_cmd.py --device ${SERIAL_DEVICE} --cmd 'param save'
${DIR}/reboot.py --device ${SERIAL_DEVICE}
${DIR}/run_nsh_cmd.py --device ${SERIAL_DEVICE} --cmd 'ps'
${DIR}/run_nsh_cmd.py --device ${SERIAL_DEVICE} --cmd 'work_queue status'
${DIR}/run_nsh_cmd.py --device ${SERIAL_DEVICE} --cmd 'pwm info'
done
+5 -3
View File
@@ -8,16 +8,18 @@ if [ -f "$FILE" ]; then
if [ -n "$CHECK_FAILED" ]; then
${DIR}/fix_code_style.sh --quiet < $FILE > $FILE.pretty
echo -e 'Formatting issue found in' $FILE
echo
git --no-pager diff --no-index --minimal --histogram --color=always $FILE $FILE.pretty | grep -vE -e "^.{,4}diff.*\.pretty.{,3}$" -e "^.{,4}--- a/.*$" -e "^.{,4}\+\+\+ b/.*$" -e "^.{,5}@@ .* @@.*$" -e "^.{,4}index .{10}\.\."
git --no-pager diff --no-index --minimal --histogram --color=always $FILE $FILE.pretty
rm -f $FILE.pretty
echo
if [[ $PX4_ASTYLE_FIX -eq 1 ]]; then
${DIR}/fix_code_style.sh $FILE
else
echo 'to fix automatically run "make format" or "./Tools/astyle/fix_code_style.sh' $FILE'"'
# Make sure this file is not staged for comitting
git reset $FILE
# Provide instructions
echo $FILE 'bad formatting, please run "make format" or "./Tools/astyle/fix_code_style.sh' $FILE'"'
exit 1
fi
fi
+1 -1
View File
@@ -17,10 +17,10 @@ exec find boards msg src platforms test \
-path src/drivers/uavcannode_gps_demo/libcanard -prune -o \
-path src/lib/crypto/monocypher -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/mavlink/mavlink -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 \
+9 -6
View File
@@ -54,9 +54,12 @@ if [ $? -ne 0 ]; then
fi
# Check for code style, only in changed files
bash -c "comm -12 <(./Tools/astyle/files_to_check_code_style.sh | sort) <(git diff --cached --name-only --diff-filter=ACM) | xargs -P 8 -I % ./Tools/astyle/check_code_style.sh %"
if [ $? -ne 0 ]
then
echo "Pre-commit style error: Bad formatting according to astyle rules"
exit 1
fi
for i in `git diff --cached --name-only --diff-filter=ACM`
do
./Tools/astyle/files_to_check_code_style.sh $i | xargs -n 1 -P 8 -I % ./Tools/astyle/check_code_style.sh %
if [ $? -ne 0 ]
then
echo "Pre-commit style error: Bad formatting according to astyle rules"
exit 1
fi
done
-2
View File
@@ -9,7 +9,6 @@ if [[ -f $1"/.git" || -d $1"/.git" ]]; then
if [ "$CI" == "true" ] || [ -n "${VSCODE_PID+set}" ]; then
git submodule --quiet sync --recursive -- $1
git submodule --quiet update --init --recursive --jobs=8 -- $1 || true
git submodule --quiet sync --recursive -- $1
git submodule --quiet update --init --recursive --jobs=8 -- $1
exit 0
fi
@@ -52,7 +51,6 @@ if [[ -f $1"/.git" || -d $1"/.git" ]]; then
else
git submodule --quiet sync --recursive --quiet -- $1
git submodule --quiet update --init --recursive -- $1 || true
git submodule --quiet sync --recursive --quiet -- $1
git submodule --quiet update --init --recursive -- $1
fi
+1
View File
@@ -17,3 +17,4 @@ def save_compressed(filename):
f.write(content_file.read())
save_compressed(filename)
+2 -2
View File
@@ -69,7 +69,7 @@ num_vehicles=${NUM_VEHICLES:=3}
world=${WORLD:=empty}
target=${TARGET:=px4_sitl_default}
vehicle_model=${VEHICLE_MODEL:="iris"}
export PX4_SIM_MODEL=${vehicle_model}
export PX4_SIM_MODEL=${vehicle_model}${LABEL}
echo ${SCRIPT}
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
@@ -126,7 +126,7 @@ else
m=0
while [ $m -lt ${target_number} ]; do
export PX4_SIM_MODEL=${target_vehicle}
export PX4_SIM_MODEL=${target_vehicle}${LABEL}
spawn_model ${target_vehicle}${LABEL} $n $target_x $target_y
m=$(($m + 1))
n=$(($n + 1))
+30 -41
View File
@@ -6,14 +6,6 @@ import os
import sys
import json
import re
from kconfiglib import Kconfig
kconf = Kconfig()
# Supress warning output
kconf.warn_assign_undef = False
kconf.warn_assign_override = False
kconf.warn_assign_redun = False
source_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), '..')
@@ -36,45 +28,42 @@ excluded_labels = [
'uavcanv1' # TODO: fix and enable
]
def process_target(px4board_file, target_name):
def process_target(cmake_file, target_name):
ret = None
is_board_def = False
platform = None
toolchain = None
for line in open(cmake_file, 'r'):
if 'px4_add_board' in line:
is_board_def = True
if not is_board_def:
continue
if px4board_file.endswith("default.px4board") or \
px4board_file.endswith("recovery.px4board") or \
px4board_file.endswith("bootloader.px4board"):
kconf.load_config(px4board_file, replace=True)
else: # Merge config with default.px4board
default_kconfig = re.sub(r'[a-zA-Z\d_]+\.px4board', 'default.px4board', px4board_file)
kconf.load_config(default_kconfig, replace=True)
kconf.load_config(px4board_file, replace=False)
re_platform = re.search('PLATFORM\s+([^\s]+)', line)
if re_platform: platform = re_platform.group(1)
if "BOARD_TOOLCHAIN" in kconf.syms:
toolchain = kconf.syms["BOARD_TOOLCHAIN"].str_value
re_toolchain = re.search('TOOLCHAIN\s+([^\s]+)', line)
if re_toolchain: toolchain = re_toolchain.group(1)
if "BOARD_PLATFORM" in kconf.syms:
platform = kconf.syms["BOARD_PLATFORM"].str_value
if is_board_def:
assert platform, f"PLATFORM not found in {cmake_file}"
assert platform, f"PLATFORM not found in {px4board_file}"
if platform not in excluded_platforms:
# get the container based on the platform and toolchain
container = platform
if platform == 'posix':
container = 'base-focal'
if toolchain:
if toolchain.startswith('aarch64'):
container = 'aarch64'
elif toolchain == 'arm-linux-gnueabihf':
container = 'armhf'
else:
if verbose: print(f'possibly unmatched toolchain: {toolchain}')
elif platform == 'nuttx':
container = 'nuttx-focal'
ret = {'target': target_name, 'container': container}
if platform not in excluded_platforms:
# get the container based on the platform and toolchain
container = platform
if platform == 'posix':
container = 'base-focal'
if toolchain:
if toolchain.startswith('aarch64'):
container = 'aarch64'
elif toolchain == 'arm-linux-gnueabihf':
container = 'armhf'
else:
if verbose: print(f'possibly unmatched toolchain: {toolchain}')
elif platform == 'nuttx':
container = 'nuttx-focal'
ret = {'target': target_name, 'container': container}
return ret
for manufacturer in os.scandir(os.path.join(source_dir, 'boards')):
@@ -88,8 +77,8 @@ for manufacturer in os.scandir(os.path.join(source_dir, 'boards')):
if not board.is_dir():
continue
for files in os.scandir(board.path):
if files.is_file() and files.name.endswith('.px4board'):
label = files.name[:-9]
if files.is_file() and files.name.endswith('.cmake'):
label = files.name[:-6]
target_name = manufacturer.name + '_' + board.name + '_' + label
if label in excluded_labels:
if verbose: print(f'excluding label {label} ({target_name})')
-1
View File
@@ -92,7 +92,6 @@ pca9685,CONFIG_DRIVERS_PCA9685=y
pca9685_pwm_out,CONFIG_DRIVERS_PCA9685_PWM_OUT=y
power_monitor/ina226,CONFIG_DRIVERS_POWER_MONITOR_INA226=y
power_monitor/voxlpm,CONFIG_DRIVERS_POWER_MONITOR_VOXLPM=y
pps_capture,CONFIG_DRIVERS_PPS_CAPTURE=y
protocol_splitter,CONFIG_DRIVERS_PROTOCOL_SPLITTER=y
pwm_input,CONFIG_DRIVERS_PWM_INPUT=y
pwm_out_sim,CONFIG_DRIVERS_PWM_OUT_SIM=y
+1 -8
View File
@@ -110,17 +110,10 @@ def main(kconfig_file, config1, config2):
for line in f:
match = unset_match(line)
#pprint.pprint(line)
#pprint.pprint(match)
if match is not None:
sym_name = match.group(1)
kconf.syms[sym_name].unset_value()
if kconf.syms[sym_name].type is BOOL:
for default, cond in kconf.syms[sym_name].orig_defaults:
if(cond.str_value == 'y'):
# Default is y, our diff is unset thus we've set it to no
kconf.syms[sym_name].set_value(0)
f.close()
# Print warnings for symbols whose actual value doesn't match the assigned
@@ -1,470 +0,0 @@
#!/usr/bin/env python3
""" Script to generate actuators.json metadata from module.yaml config file(s)
"""
import argparse
import lzma #to create .xz file
import json
import os
import sys
from output_groups_from_timer_config import get_timer_groups, get_output_groups
try:
import yaml
except ImportError as e:
print("Failed to import yaml: " + str(e))
print("")
print("You may need to install it using:")
print(" pip3 install --user pyyaml")
print("")
sys.exit(1)
parser = argparse.ArgumentParser(description='Generate actuators.json from module.yaml file(s)')
parser.add_argument('--config-files', type=str, nargs='*', default=[],
help='YAML module config file(s)')
parser.add_argument('--output-file', type=str, action='store',
help='JSON output file', required=True)
parser.add_argument('--compress', action='store_true', help='Add a compressed output file')
parser.add_argument('-v', '--verbose', dest='verbose', action='store_true',
help='Verbose Output')
parser.add_argument('--timer-config', type=str, action='store',
help='board-specific timer_config.cpp file')
parser.add_argument('--board', type=str, action='store',
help='board name, e.g. ')
parser.add_argument('--board-with-io', dest='board_with_io', action='store_true',
help='Indicate that the board as an IO for extra PWM',
default=False)
args = parser.parse_args()
compress = args.compress
verbose = args.verbose
output_file = args.output_file
timer_config_file = args.timer_config
board_with_io = args.board_with_io
board = args.board
root_dir = os.path.join(os.path.dirname(os.path.realpath(__file__)),"../..")
output_functions_file = os.path.join(root_dir,"src/lib/mixer_module/output_functions.yaml")
def save_compressed(filename):
#create lzma compressed version
xz_filename=filename+'.xz'
with lzma.open(xz_filename, 'wt', preset=9) as f:
with open(filename, 'r') as content_file:
f.write(content_file.read())
def load_yaml_file(file_name):
with open(file_name, 'r') as stream:
try:
return yaml.safe_load(stream)
except yaml.YAMLError as exc:
print(exc)
raise
# functions
output_functions_yaml = load_yaml_file(output_functions_file)
output_functions = output_functions_yaml['functions']
functions = {}
def add_function(functions, index, name, function_obj=None):
functions[index] = {
"label": name
}
if function_obj is not None:
if function_obj.get('exclude_from_actuator_testing', False):
functions[index]['exclude-from-actuator-testing'] = True
if 'note' in function_obj:
functions[index]['note'] = function_obj['note']
for group_key in output_functions:
group = output_functions[group_key]
for function_name in group:
function_name_label = function_name.replace('_', ' ')
if isinstance(group[function_name], int):
add_function(functions, group[function_name], function_name_label)
elif not 'count' in group[function_name]:
add_function(functions, group[function_name]['start'], function_name_label, group[function_name])
else:
start = group[function_name]['start']
count = group[function_name]['count']
for i in range(count):
add_function(functions, start+i, function_name_label+' '+str(i+1), group[function_name])
# outputs
outputs = []
def process_module_name(module_name):
if module_name == '${PWM_MAIN_OR_AUX}':
if board_with_io: return 'PWM AUX'
return 'PWM MAIN'
if '${' in module_name:
raise Exception('unhandled variable in {:}'.format(module_name))
return module_name
def process_param_prefix(param_prefix):
if param_prefix == '${PWM_MAIN_OR_AUX}':
if board_with_io: return 'PWM_AUX'
return 'PWM_MAIN'
if '${' in param_prefix:
raise Exception('unhandled variable in {:}'.format(param_prefix))
return param_prefix
def process_channel_label(module_name, channel_label, no_prefix):
if channel_label == '${PWM_MAIN_OR_AUX_CAP}':
return 'CAP'
if channel_label == '${PWM_MAIN_OR_AUX}':
if board_with_io: return 'AUX'
return 'MAIN'
if '${' in channel_label:
raise Exception('unhandled variable in {:}'.format(channel_label))
if no_prefix: return channel_label
return channel_label
def get_actuator_output(yaml_config, output_functions, timer_config_file, verbose):
""" parse the actuator_output section from the yaml config file
"""
if not 'actuator_output' in yaml_config:
return None
output_groups = yaml_config['actuator_output']['output_groups']
module_name = process_module_name(yaml_config['module_name'])
group_idx = 0
if verbose: print('processing module: {}'.format(module_name))
actuator_output = {
'label': module_name
}
if 'show_subgroups_if' in yaml_config['actuator_output']:
actuator_output['show-subgroups-if'] = yaml_config['actuator_output']['show_subgroups_if']
# config parameters
def get_config_params(param_list):
""" convert config parameter list (per group or per subgroup) """
parameters = []
for config_param in param_list:
if verbose:
print('config param: {}'.format(config_param))
param = {
'name': config_param['param'],
}
if 'label' in config_param:
param['label'] = config_param['label']
if 'function' in config_param:
param['function'] = config_param['function']
parameters.append(param)
return parameters
parameters = get_config_params(yaml_config['actuator_output'].get('config_parameters', []))
if len(parameters) > 0:
actuator_output['parameters'] = parameters
subgroups = []
while group_idx < len(output_groups):
group = output_groups[group_idx]
group_idx += 1
if verbose: print("processing group: {:}".format(group))
# Check for generator and generate additional data.
if 'generator' in group:
if group['generator'] == 'pwm':
param_prefix = process_param_prefix(group['param_prefix'])
no_prefix = not group.get('channel_label_module_name_prefix', True)
channel_labels = [process_channel_label(module_name, label, no_prefix)
for label in group['channel_labels']]
standard_params = group.get('standard_params', [])
extra_function_groups = group.get('extra_function_groups', [])
pwm_timer_param = group.get('pwm_timer_param', None)
if 'timer_config_file' in group:
timer_config_file = os.path.join(root_dir, group['timer_config_file'])
if timer_config_file is None:
raise Exception('trying to generate pwm outputs, but --timer-config not set')
timer_groups = get_timer_groups(timer_config_file, verbose)
timer_output_groups, timer_params = get_output_groups(timer_groups,
param_prefix, channel_labels,
standard_params, extra_function_groups, pwm_timer_param,
verbose=verbose)
output_groups.extend(timer_output_groups)
else:
raise Exception('unknown generator {:}'.format(group['generator']))
continue
subgroup = {}
# supported actions
if 'supported_actions' in group:
actions = {}
for action_name in group['supported_actions']:
action = group['supported_actions'][action_name]
action_name = action_name.replace('_', '-')
actions[action_name] = {}
if 'supported_if' in action:
actions[action_name]['supported-if'] = action['supported_if']
if 'actuator_types' in action:
actions[action_name]['actuator-types'] = action['actuator_types']
subgroup['supported-actions'] = actions
# channels
num_channels = group['num_channels']
no_prefix = not group.get('channel_label_module_name_prefix', True)
channel_label = process_channel_label(module_name, group['channel_label'], no_prefix)
instance_start = group.get('instance_start', 1)
instance_start_label = group.get('instance_start_label', instance_start)
channels = []
for channel in range(num_channels):
channels.append({
'label': channel_label + ' ' +str(channel+instance_start_label),
'param-index': channel+instance_start
})
subgroup['channels'] = channels
if 'group_label' in group:
subgroup['label'] = group['group_label']
# per-channel-params
per_channel_params = []
param_prefix = process_param_prefix(group['param_prefix'])
standard_params = group.get('standard_params', {})
standard_params_array = [
( 'function', 'Function', 'FUNC', False ),
( 'disarmed', 'Disarmed', 'DIS', False ),
( 'min', 'Minimum', 'MIN', False ),
( 'max', 'Maximum', 'MAX', False ),
( 'failsafe', 'Failsafe', 'FAIL', True ),
]
for key, label, param_suffix, advanced in standard_params_array:
show_if = None
if key in standard_params and 'show_if' in standard_params[key]:
show_if = standard_params[key]['show_if']
if key in standard_params or key == 'function':
param = {
'label': label,
'name': param_prefix+'_'+param_suffix+'${i}',
'function': key,
}
if advanced: param['advanced'] = True
if show_if: param['show-if'] = show_if
per_channel_params.append(param)
# TODO: support non-standard per-channel parameters
subgroup['per-channel-parameters'] = per_channel_params
# group config params
parameters = get_config_params(group.get('config_parameters', []))
if len(parameters) > 0:
subgroup['parameters'] = parameters
subgroups.append(subgroup)
actuator_output['subgroups'] = subgroups
return actuator_output
# Mixers
mixers = None
def get_mixers(yaml_config, output_functions, verbose):
if not 'mixer' in yaml_config:
return None
actuator_types = {}
for actuator_type_key in yaml_config['mixer']['actuator_types']:
actuator_type_conf = yaml_config['mixer']['actuator_types'][actuator_type_key]
actuator_type = { }
if actuator_type_key != 'DEFAULT':
actuator_type['label-index-offset'] = 1 # always 1
if 'functions' in actuator_type_conf:
function_name = actuator_type_conf['functions']
# we expect the function to be in 'common' (this is not a requirement, just simplicity)
output_function = output_functions['common'][function_name]
actuator_type['function-min'] = output_function['start']
actuator_type['function-max'] = output_function['start'] + output_function['count'] - 1
values = actuator_type_conf['actuator_testing_values']
actuator_type['values'] = {
'min': values['min'],
'max': values['max'],
}
if values.get('default_is_nan', False):
actuator_type['values']['default-is-nan'] = True
else:
actuator_type['values']['default'] = values['default']
if values.get('reversible', False):
actuator_type['values']['reversible'] = True
# per item params
per_item_params = []
for per_item_param in actuator_type_conf.get('per_item_parameters', []):
per_item_params.append({k.replace('_','-'): v for k, v in per_item_param.items()})
if len(per_item_params) > 0:
actuator_type['per-item-parameters'] = per_item_params
actuator_types[actuator_type_key] = actuator_type
if verbose:
print('Actuator types: {}'.format(actuator_types))
config = []
yaml_mixer_config = yaml_config['mixer']['config']
select_param = yaml_mixer_config['param']
types = yaml_mixer_config['types']
for type_index in types:
current_type = types[type_index]
option = select_param + '==' + str(type_index)
mixer_config = {
'option': option,
}
if 'type' in current_type:
mixer_config['type'] = current_type['type']
actuators = []
for actuator_conf in current_type['actuators']:
actuator = {
'actuator-type': actuator_conf['actuator_type'],
'required': True, # for now always set as required
}
# sanity check that actuator type exists
if actuator_conf['actuator_type'] not in actuator_types:
raise Exception('actuator type "{}" does not exist (valid: {})'.format(actuator_conf['actuator_type'], actuator_types.keys()))
if 'group_label' in actuator_conf:
actuator['group-label'] = actuator_conf['group_label']
else:
# infer from actuator type
if actuator_conf['actuator_type'] == 'motor':
actuator['group-label'] = 'Motors'
elif actuator_conf['actuator_type'] == 'servo':
actuator['group-label'] = 'Servos'
else:
raise Exception('Missing group label for actuator type "{}"'.format(actuator_conf['actuator_type']))
if 'count' in actuator_conf: # possibly dynamic size
actuator['count'] = actuator_conf['count']
per_item_params = actuator_conf['per_item_parameters']
params = []
if 'standard' in per_item_params:
standard_params = per_item_params['standard']
if 'position' in standard_params:
params.extend([
{
'label': 'Position X',
'function': 'posx',
'name': standard_params['position'][0],
},
{
'label': 'Position Y',
'function': 'posy',
'name': standard_params['position'][1],
},
{
'label': 'Position Z',
'function': 'posz',
'name': standard_params['position'][2],
'advanced': True,
},
])
if 'extra' in per_item_params:
for extra_param in per_item_params['extra']:
params.append({k.replace('_','-'): v for k, v in extra_param.items()})
actuator['per-item-parameters'] = params
else: # fixed size
labels = []
pos_x = []
pos_y = []
pos_z = []
for instance in actuator_conf['instances']:
labels.append(instance['name'])
pos_x.append(instance['position'][0])
pos_y.append(instance['position'][1])
pos_z.append(instance['position'][2])
actuator['count'] = len(labels)
actuator['item-label-prefix'] = labels
actuator['per-item-parameters'] = [
{
'label': 'Position X',
'function': 'posx',
'value': pos_x,
},
{
'label': 'Position Y',
'function': 'posy',
'value': pos_y,
},
{
'label': 'Position Z',
'function': 'posz',
'value': pos_z,
'advanced': True,
},
]
# actuator parameters
parameters = []
for param in actuator_conf.get('parameters', []):
parameters.append({k.replace('_','-'): v for k, v in param.items()})
actuator['parameters'] = parameters
actuators.append(actuator)
mixer_config['actuators'] = actuators
config.append(mixer_config)
if verbose:
print('Mixer configs: {}'.format(config))
mixers = {
'actuator-types': actuator_types,
'config': config,
}
return mixers
for yaml_file in args.config_files:
yaml_config = load_yaml_file(yaml_file)
try:
actuator_output = get_actuator_output(yaml_config,
output_functions, timer_config_file, verbose)
if actuator_output:
outputs.append(actuator_output)
parsed_mixers = get_mixers(yaml_config, output_functions, verbose)
if parsed_mixers is not None:
if mixers is not None:
# only expected to be configured in one module
raise Exception('multiple "mixer" sections in module config files')
mixers = parsed_mixers
except Exception as e:
print('Exception while parsing {:}:'.format(yaml_file))
raise e
if mixers is None:
if len(outputs) > 0:
raise Exception('Missing "mixer" section in yaml configs (CONFIG_MODULES_CONTROL_ALLOCATOR not added to the build?)')
else:
# set a minimal default
mixers = {
'actuator-types': { 'DEFAULT': { 'values': { 'min': 0, 'max': 1 } } },
'config': [],
}
actuators = {
'version': 1,
'show-ui-if': 'SYS_CTRL_ALLOC==1',
'outputs_v1': outputs,
'functions_v1': functions,
'mixer_v1': mixers,
}
with open(output_file, 'w') as outfile:
indent = 2 if verbose else None
json.dump(actuators, outfile, indent=indent)
if compress:
save_compressed(output_file)
-368
View File
@@ -1,368 +0,0 @@
#!/usr/bin/env python3
""" Script to generate params from module.yaml config file(s)
Note: serial params are handled in Tools/serial/generate_config.py
"""
import argparse
import os
import sys
from copy import deepcopy
from output_groups_from_timer_config import get_timer_groups, get_output_groups
try:
import yaml
except ImportError as e:
print("Failed to import yaml: " + str(e))
print("")
print("You may need to install it using:")
print(" pip3 install --user pyyaml")
print("")
sys.exit(1)
parser = argparse.ArgumentParser(description='Generate params from module.yaml file(s)')
parser.add_argument('--config-files', type=str, nargs='*', default=[],
help='YAML module config file(s)')
parser.add_argument('--params-file', type=str, action='store',
help='Parameter output file')
parser.add_argument('--timer-config', type=str, action='store',
help='board-specific timer_config.cpp file')
parser.add_argument('--ethernet', action='store_true',
help='Ethernet support')
parser.add_argument('--board', type=str, action='store',
help='board name, e.g. ')
parser.add_argument('--board-with-io', dest='board_with_io', action='store_true',
help='Indicate that the board as an IO for extra PWM',
default=False)
parser.add_argument('-v', '--verbose', dest='verbose', action='store_true',
help='Verbose Output')
args = parser.parse_args()
verbose = args.verbose
params_output_file = args.params_file
timer_config_file = args.timer_config
ethernet_supported = args.ethernet
board_with_io = args.board_with_io
board = args.board
root_dir = os.path.join(os.path.dirname(os.path.realpath(__file__)),"../..")
output_functions_file = os.path.join(root_dir,"src/lib/mixer_module/output_functions.yaml")
def process_module_name(module_name):
if module_name == '${PWM_MAIN_OR_AUX}':
if board_with_io: return 'PWM AUX'
return 'PWM MAIN'
if '${' in module_name:
raise Exception('unhandled variable in {:}'.format(module_name))
return module_name
def process_param_prefix(param_prefix):
if param_prefix == '${PWM_MAIN_OR_AUX}':
if board_with_io: return 'PWM_AUX'
return 'PWM_MAIN'
if '${' in param_prefix:
raise Exception('unhandled variable in {:}'.format(param_prefix))
return param_prefix
def process_channel_label(module_name, channel_label, no_prefix):
if channel_label == '${PWM_MAIN_OR_AUX_CAP}':
return 'PWM Capture'
if channel_label == '${PWM_MAIN_OR_AUX}':
if board_with_io: return 'PWM Aux'
return 'PWM Main'
if '${' in channel_label:
raise Exception('unhandled variable in {:}'.format(channel_label))
if no_prefix: return channel_label
return module_name + ' ' + channel_label
def parse_yaml_parameters_config(yaml_config, ethernet_supported):
""" parse the parameters section from the yaml config file """
if 'parameters' not in yaml_config:
return ''
parameters_section_list = yaml_config['parameters']
ret = ''
for parameters_section in parameters_section_list:
if 'definitions' not in parameters_section:
continue
definitions = parameters_section['definitions']
param_group = parameters_section.get('group', None)
for param_name in definitions:
# 'definitions' either contains the param definition directly (dict),
# or a list of definitions with that name (multiple entries for a
# multi-instance param with different instance_start)
param_list = definitions[param_name]
if not isinstance(param_list, list):
param_list = [param_list]
for param in param_list:
if param.get('requires_ethernet', False) and not ethernet_supported:
continue
num_instances = param.get('num_instances', 1)
instance_start = param.get('instance_start', 0) # offset
instance_start_label = param.get('instance_start_label', instance_start)
# get the type and extract all tags
tags = '@group {:}'.format(param_group)
if param['type'] == 'enum':
param_type = 'INT32'
for key in param['values']:
tags += '\n * @value {:} {:}'.format(key, param['values'][key])
elif param['type'] == 'boolean':
param_type = 'BOOL'
tags += '\n * @boolean'
elif param['type'] == 'int32':
param_type = 'INT32'
elif param['type'] == 'float':
param_type = 'FLOAT'
else:
raise Exception("unknown param type {:}".format(param['type']))
for tag in ['decimal', 'increment', 'category', 'volatile', 'bit',
'min', 'max', 'unit', 'reboot_required']:
if tag in param:
tags += '\n * @{:} {:}'.format(tag, param[tag])
for i in range(num_instances):
# default value
default_value = 0
if 'default' in param:
# default can be a list of num_instances or a single value
if type(param['default']) == list:
assert len(param['default']) == num_instances
default_value = param['default'][i]
else:
default_value = param['default']
# output the existing C-style format
ret += '''
/**
* {short_descr}
*
* {long_descr}
*
* {tags}
*/
PARAM_DEFINE_{param_type}({name}, {default_value});
'''.format(short_descr=param['description']['short'].replace("\n", "\n * "),
long_descr=param['description'].get('long', "").replace("\n", "\n * "),
tags=tags,
param_type=param_type,
name=param_name.replace('${i}', str(i+instance_start)),
default_value=default_value,
).replace('${i}', str(i+instance_start_label))
return ret
def get_actuator_output_params(yaml_config, output_functions,
timer_config_file, verbose):
""" parse the actuator_output section from the yaml config file
:return: dict of param definitions
"""
if not 'actuator_output' in yaml_config:
return {}
output_groups = yaml_config['actuator_output']['output_groups']
module_name = process_module_name(yaml_config['module_name'])
all_params = {}
group_idx = 0
def add_local_param(param_name, param_def):
nonlocal all_params
# add as a list, as there can be multiple entries with the same param_name
if not param_name in all_params:
all_params[param_name] = []
all_params[param_name].append(param_def)
while group_idx < len(output_groups):
group = output_groups[group_idx]
group_idx += 1
if verbose: print("processing group: {:}".format(group))
# Check for generator and generate additional data.
# We do this by extending the output_groups list and parse in a later iteration
if 'generator' in group:
if group['generator'] == 'pwm':
param_prefix = process_param_prefix(group['param_prefix'])
no_prefix = not group.get('channel_label_module_name_prefix', True)
channel_labels = [process_channel_label(module_name, label, no_prefix)
for label in group['channel_labels']]
standard_params = group.get('standard_params', [])
extra_function_groups = group.get('extra_function_groups', [])
pwm_timer_param = group.get('pwm_timer_param', None)
if 'timer_config_file' in group:
timer_config_file = os.path.join(root_dir, group['timer_config_file'])
if timer_config_file is None:
raise Exception('trying to generate pwm outputs, but --timer-config not set')
timer_groups = get_timer_groups(timer_config_file, verbose)
timer_output_groups, timer_params = get_output_groups(timer_groups,
param_prefix, channel_labels,
standard_params, extra_function_groups, pwm_timer_param,
verbose=verbose)
all_params.update(timer_params)
output_groups.extend(timer_output_groups)
# In case of a board w/o IO and >8 PWM channels, pwm_out splits
# into 2 instances (if SYS_CTRL_ALLOC==0) and we need to add the
# PWM_AUX min/max/disarmed params as well.
num_channels = len(timer_groups['types'])
if not board_with_io and num_channels > 8:
output_groups.append(
{
'param_prefix': 'PWM_AUX',
'channel_label': 'PWM AUX',
'instance_start': 1,
'num_channels': num_channels - 8,
'standard_params': deepcopy(timer_output_groups[0]['standard_params'])
})
else:
raise Exception('unknown generator {:}'.format(group['generator']))
continue
num_channels = group['num_channels']
param_prefix = process_param_prefix(group['param_prefix'])
no_prefix = not group.get('channel_label_module_name_prefix', True)
channel_label = process_channel_label(module_name, group['channel_label'], no_prefix)
standard_params = group.get('standard_params', {})
instance_start = group.get('instance_start', 1)
instance_start_label = group.get('instance_start_label', instance_start)
if len(param_prefix) > 9: # 16 - len('_FAIL') - 2 (2 digits for index)
raise Exception("param prefix {:} too long (max length=10)".format(param_prefix))
# collect the functions
function_groups = ['common']
function_groups.extend(group.get('extra_function_groups', []))
output_function_values = {}
for function_group in function_groups:
group = output_functions[function_group]
for function_name in group:
function_name_label = function_name.replace('_', ' ')
if isinstance(group[function_name], int):
output_function_values[group[function_name]] = function_name_label
elif not 'count' in group[function_name]:
output_function_values[group[function_name]['start']] = function_name_label
else:
start = group[function_name]['start']
count = group[function_name]['count']
for i in range(count):
output_function_values[start+i] = function_name_label+' '+str(i+1)
# function param
param = {
'description': {
'short': channel_label+' ${i} Output Function',
'long':
'''Select what should be output on {:} ${{i}}.
The default failsafe value is set according to the selected function:
- 'Min' for ConstantMin
- 'Max' for ConstantMax
- 'Max' for Parachute
- ('Max'+'Min')/2 for Servos
- 'Disarmed' for the rest
'''.format(channel_label),
},
'type': 'enum',
'instance_start': instance_start,
'instance_start_label': instance_start_label,
'num_instances': num_channels,
'default': 0,
'values': output_function_values
}
add_local_param(param_prefix+'_FUNC${i}', param)
# handle standard_params
disarmed_description = \
'''This is the output value that is set when not armed.
Note that non-motor outputs might already be active in prearm state if COM_PREARM_MODE is set.
'''
minimum_description = \
'''Minimum output value (when not disarmed).
The output range can be reversed by setting Min > Max.
'''
maximum_description = \
'''Maxmimum output value (when not disarmed).
The output range can be reversed by setting Min > Max.
'''
failsafe_description = \
'''This is the output value that is set when in failsafe mode.
When set to -1 (default), the value depends on the function (see {:}).
'''.format(param_prefix+'_FUNC${i}')
standard_params_array = [
( 'disarmed', 'Disarmed', 'DIS', disarmed_description ),
( 'min', 'Minimum', 'MIN', minimum_description ),
( 'max', 'Maximum', 'MAX', maximum_description ),
( 'failsafe', 'Failsafe', 'FAIL', failsafe_description ),
]
for key, label, param_suffix, description in standard_params_array:
if key in standard_params:
# values must be in range of an uint16_t
if standard_params[key]['min'] < 0:
raise Exception('minimum value for {:} expected >= 0 (got {:})'.format(key, standard_params[key]['min']))
if standard_params[key]['max'] >= 1<<16:
raise Exception('maximum value for {:} expected <= {:} (got {:})'.format(key, 1<<16, standard_params[key]['max']))
if key == 'failsafe':
standard_params[key]['default'] = -1
standard_params[key]['min'] = -1
param = {
'description': {
'short': channel_label+' ${i} '+label+' Value',
'long': description
},
'type': 'int32',
'instance_start': instance_start,
'instance_start_label': instance_start_label,
'num_instances': num_channels,
'min': standard_params[key]['min'],
'max': standard_params[key]['max'],
'default': standard_params[key]['default'],
}
add_local_param(param_prefix+'_'+param_suffix+'${i}', param)
if verbose: print('adding actuator params: {:}'.format(all_params))
return all_params
def load_yaml_file(file_name):
with open(file_name, 'r') as stream:
try:
return yaml.safe_load(stream)
except yaml.YAMLError as exc:
print(exc)
raise
output_functions_yaml = load_yaml_file(output_functions_file)
output_functions = output_functions_yaml['functions']
all_params = ""
for yaml_file in args.config_files:
yaml_config = load_yaml_file(yaml_file)
# convert 'output_groups' section into additional params
try:
actuator_output_params = get_actuator_output_params(yaml_config,
output_functions, timer_config_file, verbose)
except Exception as e:
print('Exception while parsing {:}:'.format(yaml_file))
raise e
# now add them to the yaml config
if not 'parameters' in yaml_config:
yaml_config['parameters'] = []
group_name = 'Actuator Outputs'
yaml_config['parameters'].append({'group': group_name, 'definitions': actuator_output_params})
all_params += parse_yaml_parameters_config(yaml_config, ethernet_supported)
if verbose: print("Generating {:}".format(params_output_file))
with open(params_output_file, 'w') as fid:
fid.write(all_params)
@@ -1,228 +0,0 @@
#!/usr/bin/env python3
""" Script to parse board-specific timer_config.cpp and print the output groups
and timer config params to stdout
"""
import argparse
import os
import sys
import re
from itertools import groupby
from copy import deepcopy
def find_matching_brackets(brackets, s, verbose):
idx = 0
opening = 0
first_open = -1
while idx < len(s):
if s[idx] == brackets[0]:
opening += 1
if first_open == -1:
first_open = idx
if s[idx] == brackets[1]:
opening -= 1
if opening == 0:
if verbose: print(first_open, idx, s[first_open:idx+1])
return first_open+1, idx
idx += 1
raise Exception('Failed to find opening/closing brackets in {:}'.format(s))
def extract_timer(line):
# Try format: initIOTimer(Timer::Timer5, DMA{DMA::Index1, DMA::Stream0, DMA::Channel6}),
search = re.search('Timer::([0-9a-zA-Z_]+)[,\)]', line, re.IGNORECASE)
if search:
return search.group(1)
# nxp rt1062 format: initIOPWM(PWM::FlexPWM2),
search = re.search('PWM::Flex([0-9a-zA-Z_]+)[,\)]', line, re.IGNORECASE)
if search:
return search.group(1)
return None
def extract_timer_from_channel(line):
# Try format: initIOTimerChannel(io_timers, {Timer::Timer5, Timer::Channel1}, {GPIO::PortA, GPIO::Pin0}),
search = re.search('Timer::([0-9a-zA-Z_]+), ', line, re.IGNORECASE)
if search:
return search.group(1)
# nxp rt1062 format: initIOTimerChannel(io_timers, {PWM::PWM2_PWM_A, PWM::Submodule0}, IOMUX::Pad::GPIO_B0_06),
search = re.search('PWM::(PWM[0-9]+)[_,\)]', line, re.IGNORECASE)
if search:
return search.group(1)
return None
def get_timer_groups(timer_config_file, verbose=False):
with open(timer_config_file, 'r') as f:
timer_config = f.read()
# timers
dshot_support = {} # key: timer
timers_start_marker = 'io_timers_t io_timers'
timers_start = timer_config.find(timers_start_marker)
if timers_start == -1:
raise Exception('"{:}" not found in {:}'.format(timers_start_marker, timer_config_file))
timer_config = timer_config[timers_start:]
open_idx, close_idx = find_matching_brackets(('{', '}'), timer_config, verbose)
timers_str = timer_config[open_idx:close_idx]
timers = []
for line in timers_str.splitlines():
line = line.strip()
if len(line) == 0 or line.startswith('//'):
continue
timer = extract_timer(line)
if timer:
if verbose: print('found timer def: {:}'.format(timer))
dshot_support[timer] = 'DMA' in line
timers.append(timer)
else:
# Make sure we don't miss anything (e.g. for different syntax) or misparse (e.g. multi-line comments)
raise Exception('Unparsed timer in line: {:}'.format(line))
# channels
channels_start_marker = 'timer_io_channels_t timer_io_channels'
channels_start = timer_config.find(channels_start_marker)
if channels_start == -1:
raise Exception('"{:}" not found in {:}'.format(channels_start_marker, timer_config_file))
timer_config = timer_config[channels_start:]
open_idx, close_idx = find_matching_brackets(('{', '}'), timer_config, verbose)
channels = timer_config[open_idx:close_idx]
channel_timers = []
channel_types = []
for line in channels.splitlines():
line = line.strip()
if len(line) == 0 or line.startswith('//'):
continue
if verbose: print('--'+line+'--')
timer = extract_timer_from_channel(line)
if timer:
if verbose: print('Found timer: {:} in channel line {:}'.format(timer, line))
channel_types.append('cap' if 'capture' in line.lower() else 'pwm')
channel_timers.append(timer)
else:
# Make sure we don't miss anything (e.g. for different syntax) or misparse (e.g. multi-line comments)
raise Exception('Unparsed channel in line: {:}'.format(line))
if len(channel_timers) == 0:
raise Exception('No channels found in "{:}"'.format(channels))
groups = [(timers.index(k), len(list(g)), dshot_support[k]) for k, g in groupby(channel_timers)]
outputs = {
'types': channel_types,
'groups': groups
}
return outputs
def get_output_groups(timer_groups, param_prefix="PWM_MAIN",
channel_labels=["PWM Main", "PWM Capture"],
standard_params=[],
extra_function_groups=[], pwm_timer_param=None,
verbose=False):
""" convert the timer groups into an output_groups section of module.yaml
and extra timer params
"""
instance_start = 1
output_groups = []
timer_params = {}
instance_start_label = [ 1, 1 ]
for timer_index, group_count, dshot_support in timer_groups['groups']:
# check for capture vs normal pins for the label
types = timer_groups['types'][instance_start-1:instance_start+group_count-1]
if not all(types[0] == t for t in types):
# Should this ever be needed, we can extend this script to handle that
raise Exception('Implementation requires all channel types for a timer to be equal (types: {:})'.format(types))
if types[0] == 'pwm':
channel_type_idx = 0
elif types[0] == 'cap':
channel_type_idx = 1
else:
raise Exception('unsupported channel type: {:}'.format(types[0]))
channel_label = channel_labels[channel_type_idx]
channel_type_instance = instance_start_label[channel_type_idx]
group_label = channel_label + ' ' + str(channel_type_instance)
if group_count > 1:
group_label += '-' + str(channel_type_instance+group_count-1)
group = {
'param_prefix': param_prefix,
'channel_label': channel_label,
'instance_start': instance_start,
'instance_start_label': channel_type_instance,
'extra_function_groups': deepcopy(extra_function_groups),
'num_channels': group_count,
'standard_params': deepcopy(standard_params),
'group_label': group_label,
'channel_label_module_name_prefix': False,
}
if pwm_timer_param is not None:
pwm_timer_param_cp = deepcopy(pwm_timer_param)
timer_param_name = param_prefix+'_TIM'+str(timer_index)
group['config_parameters'] = [
{
'param': timer_param_name,
'function': 'primary',
}
]
if dshot_support:
# don't show pwm limit params when dshot enabled
for standard_param in group['standard_params']:
group['standard_params'][standard_param]['show_if'] = timer_param_name + '>=-1'
# indicate support for changing motor spin direction
group['supported_actions'] = {
'set_spin_direction1': {
'supported_if': timer_param_name + '<-1',
'actuator_types': ['motor']
},
'set_spin_direction2': {
'supported_if': timer_param_name + '<-1',
'actuator_types': ['motor']
},
}
else:
# remove dshot entries if no dshot support
values = pwm_timer_param_cp['values']
for key in list(values.keys()):
if 'dshot' in values[key].lower():
del values[key]
for descr_type in ['short', 'long']:
descr = pwm_timer_param_cp['description'][descr_type]
pwm_timer_param_cp['description'][descr_type] = \
descr.replace('${label}', group_label)
timer_params[timer_param_name] = pwm_timer_param_cp
output_groups.append(group)
instance_start += group_count
instance_start_label[channel_type_idx] += group_count
return (output_groups, timer_params)
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='Extract output groups from timer_config.cpp')
parser.add_argument('--timer-config', type=str, action='store',
help='timer_config.cpp file', required=True)
parser.add_argument('-v', '--verbose', dest='verbose', action='store_true',
help='Verbose Output')
args = parser.parse_args()
verbose = args.verbose
timer_groups = get_timer_groups(args.timer_config, verbose)
print('timer groups: {:}'.format(timer_groups))
output_groups, timer_params = get_output_groups(timer_groups, verbose=verbose)
print('output groups: {:}'.format(output_groups))
print('timer params: {:}'.format(timer_params))
+1 -1
View File
@@ -25,7 +25,7 @@ div.frame_common table, div.frame_common table {
}
div.frame_common table {
float: right;
float: right;
width: 70%;
}
-1
View File
@@ -74,7 +74,6 @@ class RCOutput():
result += "\n"
result += "if [ ${AIRFRAME} != none ]\n"
result += "then\n"
result += "\techo \"Loading airframe: /etc/init.d/airframes/${AIRFRAME}\"\n"
result += "\t. /etc/init.d/airframes/${AIRFRAME}\n"
if not post_start:
result += "else\n"
+1
View File
@@ -55,3 +55,4 @@ class JsonOutput():
if need_to_write:
with codecs.open(filename, 'w', 'utf-8') as f:
f.write(json.dumps(self.json,indent=2))
+2 -2
View File
@@ -137,8 +137,8 @@ class ModuleDocumentation(object):
"\"board-specific bus (default=all) (external SPI: n-th bus (default=1))\"", 'true'])
if self._is_bool_true(args[1]):
self._handle_usage_param_int(['\'c\'', '-1', '0', '31',
"\"chip-select pin (for internal SPI) or index (for external SPI)\"", 'true'])
self._handle_usage_param_int(['\'c\'', '1', '1', '10',
"\"chip-select index (for external SPI)\"", 'true'])
self._handle_usage_param_int(['\'m\'', '-1', '0', '3', "\"SPI mode\"", 'true'])
self._handle_usage_param_int(['\'f\'', '-1', '0', '1000000', "\"bus frequency in kHz\"", 'true'])
+81 -1
View File
@@ -1,6 +1,8 @@
#!/usr/bin/env python3
""" Script to generate Serial (UART) parameters and the ROMFS startup script """
from __future__ import print_function
import argparse
import os
import sys
@@ -193,6 +195,7 @@ if rc_serial_output_dir is None and serial_params_output_file is None:
# parse the YAML files
serial_commands = []
ethernet_configuration = []
additional_params = ""
if ethernet_supported:
ethernet_configuration.append({
@@ -213,12 +216,88 @@ def parse_yaml_serial_config(yaml_config):
ret.append(serial_config)
return ret
def parse_yaml_parameters_config(yaml_config, ethernet_supported):
""" parse the parameters section from the yaml config file """
if 'parameters' not in yaml_config:
return ''
parameters_section_list = yaml_config['parameters']
for parameters_section in parameters_section_list:
if 'definitions' not in parameters_section:
return ''
definitions = parameters_section['definitions']
ret = ''
param_group = parameters_section.get('group', None)
for param_name in definitions:
param = definitions[param_name]
if param.get('requires_ethernet', False) and not ethernet_supported:
continue
num_instances = param.get('num_instances', 1)
instance_start = param.get('instance_start', 0) # offset
# get the type and extract all tags
tags = '@group {:}'.format(param_group)
if param['type'] == 'enum':
param_type = 'INT32'
for key in param['values']:
tags += '\n * @value {:} {:}'.format(key, param['values'][key])
elif param['type'] == 'boolean':
param_type = 'INT32'
tags += '\n * @boolean'
elif param['type'] == 'int32':
param_type = 'INT32'
elif param['type'] == 'float':
param_type = 'FLOAT'
else:
raise Exception("unknown param type {:}".format(param['type']))
for tag in ['decimal', 'increment', 'category', 'volatile', 'bit',
'min', 'max', 'unit', 'reboot_required']:
if tag in param:
tags += '\n * @{:} {:}'.format(tag, param[tag])
for i in range(num_instances):
# default value
default_value = 0
if 'default' in param:
# default can be a list of num_instances or a single value
if type(param['default']) == list:
assert len(param['default']) == num_instances
default_value = param['default'][i]
else:
default_value = param['default']
if type(default_value) == bool:
default_value = int(default_value)
# output the existing C-style format
ret += '''
/**
* {short_descr}
*
* {long_descr}
*
* {tags}
*/
PARAM_DEFINE_{param_type}({name}, {default_value});
'''.format(short_descr=param['description']['short'].replace("\n", "\n * "),
long_descr=param['description']['long'].replace("\n", "\n * "),
tags=tags,
param_type=param_type,
name=param_name,
default_value=default_value,
).replace('${i}', str(i+instance_start))
return ret
for yaml_file in args.config_files:
with open(yaml_file, 'r') as stream:
try:
yaml_config = yaml.load(stream, Loader=yaml.Loader)
serial_commands.extend(parse_yaml_serial_config(yaml_config))
# TODO: additional params should be parsed in a separate script
additional_params += parse_yaml_parameters_config(
yaml_config, ethernet_supported)
except yaml.YAMLError as exc:
print(exc)
raise
@@ -325,5 +404,6 @@ if serial_params_output_file is not None:
with open(serial_params_output_file, 'w') as fid:
fid.write(template.render(serial_devices=serial_devices,
ethernet_configuration=ethernet_configuration,
commands=commands, serial_ports=serial_ports))
commands=commands, serial_ports=serial_ports,
additional_definitions=additional_params))
+2
View File
@@ -71,3 +71,5 @@ PARAM_DEFINE_INT32({{ command.port_param_name }}, {{ command.default_port }});
{% endfor -%}
{% endif %}
{{ additional_definitions }}
-2
View File
@@ -3,11 +3,9 @@ argparse>=1.2
cerberus
coverage
empy>=3.3
future
jinja2>=2.8
jsonschema
kconfiglib
lxml
matplotlib>=3.0.*
numpy>=1.13
nunavut>=1.1.0
+1 -9
View File
@@ -86,8 +86,6 @@ sudo DEBIAN_FRONTEND=noninteractive apt-get -y --quiet --no-install-recommends i
gdb \
git \
lcov \
libxml2-dev \
libxml2-utils \
make \
ninja-build \
python3 \
@@ -136,13 +134,13 @@ if [[ $INSTALL_NUTTX == "true" ]]; then
genromfs \
gettext \
gperf \
kconfig-frontends \
libelf-dev \
libexpat-dev \
libgmp-dev \
libisl-dev \
libmpc-dev \
libmpfr-dev \
libncurses5 \
libncurses5-dev \
libncursesw5-dev \
libtool \
@@ -153,12 +151,6 @@ if [[ $INSTALL_NUTTX == "true" ]]; then
util-linux \
vim-common \
;
if [[ "${UBUNTU_RELEASE}" == "20.04" ]]; then
sudo DEBIAN_FRONTEND=noninteractive apt-get -y --quiet --no-install-recommends install \
kconfig-frontends \
;
fi
if [ -n "$USER" ]; then
# add user to dialout group (serial port access)
+4 -4
View File
@@ -1,5 +1,5 @@
//Public key to verify signed binaries
0x4d, 0xb0, 0xc2, 0x1, 0x5, 0x55, 0x2a, 0x3c,
0xd7, 0xfb, 0xaf, 0x5c, 0xba, 0x7a, 0xb0, 0x81,
0x1b, 0x36, 0x63, 0xdb, 0x28, 0x52, 0x5e, 0xdb,
0x14, 0x36, 0xf2, 0x57, 0x8d, 0x2, 0xb7, 0xfd,
0x4d, 0xb0, 0xc2, 0x1, 0x5, 0x55, 0x2a, 0x3c,
0xd7, 0xfb, 0xaf, 0x5c, 0xba, 0x7a, 0xb0, 0x81,
0x1b, 0x36, 0x63, 0xdb, 0x28, 0x52, 0x5e, 0xdb,
0x14, 0x36, 0xf2, 0x57, 0x8d, 0x2, 0xb7, 0xfd,
+37 -37
View File
@@ -1,38 +1,38 @@
0x30, 0x82, 0x1, 0x22, 0x30, 0xd, 0x6, 0x9,
0x2a, 0x86, 0x48, 0x86, 0xf7, 0xd, 0x1, 0x1,
0x1, 0x5, 0x0, 0x3, 0x82, 0x1, 0xf, 0x0,
0x30, 0x82, 0x1, 0xa, 0x2, 0x82, 0x1, 0x1,
0x0, 0xcf, 0xa3, 0xb8, 0xec, 0x4f, 0xac, 0x37,
0xe6, 0x1b, 0xfa, 0x1e, 0xb3, 0x92, 0xe9, 0x1a,
0x83, 0x36, 0x2d, 0x27, 0xa6, 0x4a, 0xab, 0x7e,
0x38, 0x6f, 0x93, 0x7a, 0x1f, 0x60, 0x83, 0x83,
0xac, 0xfd, 0x2e, 0x61, 0xbf, 0x19, 0x10, 0x1f,
0x39, 0xe3, 0x6c, 0xb6, 0xcc, 0xf5, 0x85, 0x7c,
0xb2, 0x38, 0x27, 0x14, 0x43, 0xd7, 0xfe, 0xbc,
0xa1, 0xe8, 0x7d, 0x33, 0x74, 0x93, 0xe7, 0xd6,
0x2b, 0x2f, 0x79, 0x87, 0x59, 0xb0, 0x63, 0x95,
0x5c, 0xe7, 0x4f, 0x60, 0x46, 0xc9, 0xa9, 0xf,
0xde, 0xa9, 0x36, 0x9e, 0x3e, 0x34, 0xba, 0x77,
0x18, 0x50, 0xe3, 0x6b, 0x3, 0x93, 0xaa, 0xc7,
0xf2, 0x2d, 0xe, 0xf3, 0x2b, 0x5, 0x34, 0x60,
0xa4, 0xf7, 0xa9, 0xe2, 0x37, 0xa3, 0x6d, 0x27,
0xd8, 0xa3, 0x71, 0x9c, 0x6b, 0xb2, 0x5e, 0xdd,
0x12, 0x2b, 0x73, 0xe1, 0xdb, 0x9d, 0xf4, 0xc3,
0xc, 0xd6, 0x5, 0x1d, 0xac, 0xa4, 0xdc, 0x69,
0x2a, 0xf5, 0x7c, 0x30, 0x24, 0x7b, 0x2b, 0x80,
0x1b, 0x7a, 0xec, 0x68, 0x77, 0x12, 0x97, 0x2a,
0xb2, 0xe5, 0xd2, 0xff, 0x41, 0x1d, 0xf5, 0x6,
0xa4, 0xb6, 0x47, 0xa5, 0xfa, 0x5, 0x7e, 0xf0,
0xa1, 0xb8, 0xad, 0xde, 0x5c, 0xae, 0x2c, 0x8b,
0x4e, 0xad, 0xaf, 0xac, 0x6d, 0x46, 0x62, 0xe1,
0xe9, 0xfe, 0xa1, 0xc5, 0xc9, 0xf4, 0x48, 0xd2,
0x80, 0x2b, 0xe5, 0xa9, 0x3e, 0xc1, 0xfc, 0x98,
0xde, 0x3, 0xa9, 0xac, 0x86, 0xb7, 0xb5, 0x19,
0xe5, 0x75, 0x6a, 0x63, 0x83, 0x3f, 0x27, 0x7a,
0x5e, 0xf8, 0xf1, 0x6d, 0xb2, 0xd2, 0x36, 0xa1,
0xc0, 0xd2, 0x5f, 0x93, 0x9c, 0x90, 0xe8, 0x3e,
0xca, 0x89, 0xd7, 0xca, 0xd0, 0xc7, 0xe8, 0x8f,
0x4b, 0xb7, 0x60, 0x92, 0x5e, 0x36, 0x43, 0x70,
0x23, 0x36, 0xfb, 0xb5, 0xa5, 0x6, 0x9a, 0xc0,
0xcb, 0x2, 0x3, 0x1, 0x0, 0x1,
0x30, 0x82, 0x1, 0x22, 0x30, 0xd, 0x6, 0x9,
0x2a, 0x86, 0x48, 0x86, 0xf7, 0xd, 0x1, 0x1,
0x1, 0x5, 0x0, 0x3, 0x82, 0x1, 0xf, 0x0,
0x30, 0x82, 0x1, 0xa, 0x2, 0x82, 0x1, 0x1,
0x0, 0xcf, 0xa3, 0xb8, 0xec, 0x4f, 0xac, 0x37,
0xe6, 0x1b, 0xfa, 0x1e, 0xb3, 0x92, 0xe9, 0x1a,
0x83, 0x36, 0x2d, 0x27, 0xa6, 0x4a, 0xab, 0x7e,
0x38, 0x6f, 0x93, 0x7a, 0x1f, 0x60, 0x83, 0x83,
0xac, 0xfd, 0x2e, 0x61, 0xbf, 0x19, 0x10, 0x1f,
0x39, 0xe3, 0x6c, 0xb6, 0xcc, 0xf5, 0x85, 0x7c,
0xb2, 0x38, 0x27, 0x14, 0x43, 0xd7, 0xfe, 0xbc,
0xa1, 0xe8, 0x7d, 0x33, 0x74, 0x93, 0xe7, 0xd6,
0x2b, 0x2f, 0x79, 0x87, 0x59, 0xb0, 0x63, 0x95,
0x5c, 0xe7, 0x4f, 0x60, 0x46, 0xc9, 0xa9, 0xf,
0xde, 0xa9, 0x36, 0x9e, 0x3e, 0x34, 0xba, 0x77,
0x18, 0x50, 0xe3, 0x6b, 0x3, 0x93, 0xaa, 0xc7,
0xf2, 0x2d, 0xe, 0xf3, 0x2b, 0x5, 0x34, 0x60,
0xa4, 0xf7, 0xa9, 0xe2, 0x37, 0xa3, 0x6d, 0x27,
0xd8, 0xa3, 0x71, 0x9c, 0x6b, 0xb2, 0x5e, 0xdd,
0x12, 0x2b, 0x73, 0xe1, 0xdb, 0x9d, 0xf4, 0xc3,
0xc, 0xd6, 0x5, 0x1d, 0xac, 0xa4, 0xdc, 0x69,
0x2a, 0xf5, 0x7c, 0x30, 0x24, 0x7b, 0x2b, 0x80,
0x1b, 0x7a, 0xec, 0x68, 0x77, 0x12, 0x97, 0x2a,
0xb2, 0xe5, 0xd2, 0xff, 0x41, 0x1d, 0xf5, 0x6,
0xa4, 0xb6, 0x47, 0xa5, 0xfa, 0x5, 0x7e, 0xf0,
0xa1, 0xb8, 0xad, 0xde, 0x5c, 0xae, 0x2c, 0x8b,
0x4e, 0xad, 0xaf, 0xac, 0x6d, 0x46, 0x62, 0xe1,
0xe9, 0xfe, 0xa1, 0xc5, 0xc9, 0xf4, 0x48, 0xd2,
0x80, 0x2b, 0xe5, 0xa9, 0x3e, 0xc1, 0xfc, 0x98,
0xde, 0x3, 0xa9, 0xac, 0x86, 0xb7, 0xb5, 0x19,
0xe5, 0x75, 0x6a, 0x63, 0x83, 0x3f, 0x27, 0x7a,
0x5e, 0xf8, 0xf1, 0x6d, 0xb2, 0xd2, 0x36, 0xa1,
0xc0, 0xd2, 0x5f, 0x93, 0x9c, 0x90, 0xe8, 0x3e,
0xca, 0x89, 0xd7, 0xca, 0xd0, 0xc7, 0xe8, 0x8f,
0x4b, 0xb7, 0x60, 0x92, 0x5e, 0x36, 0x43, 0x70,
0x23, 0x36, 0xfb, 0xb5, 0xa5, 0x6, 0x9a, 0xc0,
0xcb, 0x2, 0x3, 0x1, 0x0, 0x1,
-6
View File
@@ -5,7 +5,6 @@ https://json-schema.org/"""
import argparse
import sys
import json
import os
try:
from jsonschema import validate
@@ -22,8 +21,6 @@ parser = argparse.ArgumentParser(description='Validate JSON file(s) against a sc
parser.add_argument('json_file', nargs='+', help='JSON config file(s)')
parser.add_argument('--schema-file', type=str, action='store',
help='JSON schema file', required=True)
parser.add_argument('--skip-if-no-schema', dest='skip_if_no_schema', action='store_true',
help='Skip test if schema file does not exist')
parser.add_argument('-v', '--verbose', dest='verbose', action='store_true',
help='Verbose Output')
@@ -32,9 +29,6 @@ schema_file = args.schema_file
json_files = args.json_file
verbose = args.verbose
if args.skip_if_no_schema and not os.path.isfile(schema_file):
sys.exit(0)
# load the schema
with open(schema_file, 'r') as stream:
schema = json.load(stream)
@@ -48,7 +48,6 @@ CONFIG_MODULES_ESC_BATTERY=y
CONFIG_MODULES_EVENTS=y
CONFIG_MODULES_FLIGHT_MODE_MANAGER=y
CONFIG_MODULES_FW_ATT_CONTROL=y
CONFIG_MODULES_FW_AUTOTUNE_ATTITUDE_CONTROL=y
CONFIG_MODULES_FW_POS_CONTROL_L1=y
CONFIG_MODULES_GYRO_CALIBRATION=y
CONFIG_MODULES_GYRO_FFT=y
@@ -58,14 +57,12 @@ CONFIG_MODULES_LOAD_MON=y
CONFIG_MODULES_LOCAL_POSITION_ESTIMATOR=y
CONFIG_MODULES_LOGGER=y
CONFIG_MODULES_MAG_BIAS_ESTIMATOR=y
CONFIG_MODULES_MANUAL_CONTROL=y
CONFIG_MODULES_MAVLINK=y
CONFIG_MODULES_MC_ATT_CONTROL=y
CONFIG_MODULES_MC_AUTOTUNE_ATTITUDE_CONTROL=y
CONFIG_MODULES_MC_HOVER_THRUST_ESTIMATOR=y
CONFIG_MODULES_MC_POS_CONTROL=y
CONFIG_MODULES_MC_RATE_CONTROL=y
CONFIG_MODULES_CONTROL_ALLOCATOR=y
CONFIG_MODULES_NAVIGATOR=y
CONFIG_MODULES_RC_UPDATE=y
CONFIG_MODULES_ROVER_POS_CONTROL=y
@@ -77,7 +74,6 @@ CONFIG_MODULES_UUV_POS_CONTROL=y
CONFIG_MODULES_VMOUNT=y
CONFIG_MODULES_VTOL_ATT_CONTROL=y
CONFIG_SYSTEMCMDS_BL_UPDATE=y
CONFIG_SYSTEMCMDS_ACTUATOR_TEST=y
CONFIG_SYSTEMCMDS_DUMPFILE=y
CONFIG_SYSTEMCMDS_ESC_CALIB=y
CONFIG_SYSTEMCMDS_GPIO=y
@@ -25,7 +25,7 @@
# CONFIG_STM32_CCMEXCLUDE is not set
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD_CUSTOM=y
CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/airmind/mindpx-v2/nuttx-config"
CONFIG_ARCH_BOARD_CUSTOM_DIR="../nuttx-config"
CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
CONFIG_ARCH_BOARD_CUSTOM_NAME="px4"
CONFIG_ARCH_CHIP="stm32"
@@ -42,7 +42,6 @@ CONFIG_BOARD_RESET_ON_ASSERT=2
CONFIG_BUILTIN=y
CONFIG_C99_BOOL8=y
CONFIG_CDCACM=y
CONFIG_CDCACM_IFLOWCONTROL=y
CONFIG_CDCACM_PRODUCTID=0x0030
CONFIG_CDCACM_PRODUCTSTR="MindPX FMU v2.x"
CONFIG_CDCACM_RXBUFSIZE=600
@@ -93,6 +92,7 @@ CONFIG_MTD_PARTITION=y
CONFIG_MTD_RAMTRON=y
CONFIG_NAME_MAX=40
CONFIG_NSH_ARCHINIT=y
CONFIG_NSH_ARCHROMFS=y
CONFIG_NSH_ARGCAT=y
CONFIG_NSH_BUILTIN_APPS=y
CONFIG_NSH_CMDPARMS=y
@@ -114,6 +114,7 @@ CONFIG_PRIORITY_INHERITANCE=y
CONFIG_PTHREAD_MUTEX_ROBUST=y
CONFIG_PTHREAD_STACK_MIN=512
CONFIG_RAMTRON_SETSPEED=y
CONFIG_RAMTRON_WRITEWAIT=y
CONFIG_RAM_SIZE=262144
CONFIG_RAM_START=0x20000000
CONFIG_RAW_BINARY=y
+6 -1
View File
@@ -239,6 +239,7 @@ __EXPORT int board_app_initialize(uintptr_t arg)
if (!spi4) {
syslog(LOG_ERR, "[boot] FAILED to initialize SPI port 4\n");
board_autoled_on(LED_AMBER);
return -ENODEV;
}
/* Default SPI4 to 10MHz and de-assert the known chip selects. */
@@ -254,6 +255,7 @@ __EXPORT int board_app_initialize(uintptr_t arg)
if (!spi1) {
syslog(LOG_ERR, "[boot] FAILED to initialize SPI port 1\n");
board_autoled_on(LED_AMBER);
return -ENODEV;
}
/* Default SPI1 to 37.5 MHz (40 MHz rounded to nearest valid divider, F4 max)
@@ -277,7 +279,9 @@ __EXPORT int board_app_initialize(uintptr_t arg)
sdio = sdio_initialize(CONFIG_NSH_MMCSDSLOTNO);
if (!sdio) {
syslog(LOG_ERR, "[boot] Failed to initialize SDIO slot %d\n", CONFIG_NSH_MMCSDSLOTNO);
syslog(LOG_ERR, "[boot] Failed to initialize SDIO slot %d\n",
CONFIG_NSH_MMCSDSLOTNO);
return -ENODEV;
}
/* Now bind the SDIO interface to the MMC/SD driver */
@@ -285,6 +289,7 @@ __EXPORT int board_app_initialize(uintptr_t arg)
if (ret != OK) {
syslog(LOG_ERR, "[boot] Failed to bind SDIO to the MMC/SD driver: %d\n", ret);
return ret;
}
/* Then let's guess and say that there is a card in the slot. There is no card detect GPIO. */
-1
View File
@@ -13,4 +13,3 @@ CONFIG_DRIVERS_UAVCANNODE=y
CONFIG_SYSTEMCMDS_PARAM=y
CONFIG_SYSTEMCMDS_PERF=y
CONFIG_SYSTEMCMDS_TOP=y
CONFIG_SYSTEMCMDS_TOPIC_LISTENER=y
@@ -7,7 +7,7 @@
#
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD_CUSTOM=y
CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/ark/can-flow/nuttx-config"
CONFIG_ARCH_BOARD_CUSTOM_DIR="../nuttx-config"
CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
CONFIG_ARCH_BOARD_CUSTOM_NAME="px4"
CONFIG_ARCH_CHIP="stm32"
@@ -40,6 +40,13 @@ CONFIG_FS_PROCFS_MAX_TASKS=0
CONFIG_MM_REGIONS=2
CONFIG_NAME_MAX=0
CONFIG_NUNGET_CHARS=0
CONFIG_NXFONTS_DISABLE_16BPP=y
CONFIG_NXFONTS_DISABLE_1BPP=y
CONFIG_NXFONTS_DISABLE_24BPP=y
CONFIG_NXFONTS_DISABLE_2BPP=y
CONFIG_NXFONTS_DISABLE_32BPP=y
CONFIG_NXFONTS_DISABLE_4BPP=y
CONFIG_NXFONTS_DISABLE_8BPP=y
CONFIG_PREALLOC_TIMERS=0
CONFIG_PTHREAD_STACK_MIN=512
CONFIG_RAM_SIZE=262144
@@ -124,6 +124,10 @@
#define GPIO_CAN1_RX GPIO_CAN1_RX_2
#define GPIO_CAN1_TX GPIO_CAN1_TX_2
/* I2C */
#define GPIO_I2C1_SCL GPIO_I2C1_SCL_1
#define GPIO_I2C1_SDA GPIO_I2C1_SDA_1
/* SPI */
#define GPIO_SPI1_MISO GPIO_SPI1_MISO_1
#define GPIO_SPI1_MOSI GPIO_SPI1_MOSI_1
@@ -21,7 +21,7 @@
# CONFIG_STM32_DMACAPABLE is not set
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD_CUSTOM=y
CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/ark/can-flow/nuttx-config"
CONFIG_ARCH_BOARD_CUSTOM_DIR="../nuttx-config"
CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
CONFIG_ARCH_BOARD_CUSTOM_NAME="px4"
CONFIG_ARCH_CHIP="stm32"
@@ -57,6 +57,8 @@ CONFIG_GRAN=y
CONFIG_GRAN_INTR=y
CONFIG_HAVE_CXX=y
CONFIG_HAVE_CXXINITIALIZE=y
CONFIG_I2C=y
CONFIG_I2C_RESET=y
CONFIG_IDLETHREAD_STACKSIZE=750
CONFIG_LIBC_FLOATINGPOINT=y
CONFIG_LIBC_LONG_LONG=y
@@ -70,6 +72,7 @@ CONFIG_MTD_PARTITION=y
CONFIG_MTD_RAMTRON=y
CONFIG_NAME_MAX=40
CONFIG_NSH_ARCHINIT=y
CONFIG_NSH_ARCHROMFS=y
CONFIG_NSH_ARGCAT=y
CONFIG_NSH_BUILTIN_APPS=y
CONFIG_NSH_CMDPARMS=y
@@ -91,6 +94,7 @@ CONFIG_PRIORITY_INHERITANCE=y
CONFIG_PTHREAD_MUTEX_ROBUST=y
CONFIG_PTHREAD_STACK_MIN=512
CONFIG_RAMTRON_SETSPEED=y
CONFIG_RAMTRON_WRITEWAIT=y
CONFIG_RAM_SIZE=262144
CONFIG_RAM_START=0x20000000
CONFIG_RAW_BINARY=y
@@ -123,6 +127,7 @@ CONFIG_STM32_DMA1=y
CONFIG_STM32_DMA2=y
CONFIG_STM32_FLASH_PREFETCH=y
CONFIG_STM32_FLOWCONTROL_BROKEN=y
CONFIG_STM32_I2C1=y
CONFIG_STM32_JTAG_SW_ENABLE=y
CONFIG_STM32_PWR=y
CONFIG_STM32_RTC=y
+1
View File
@@ -49,6 +49,7 @@ if("${PX4_BOARD_LABEL}" STREQUAL "canbootloader")
else()
add_library(drivers_board
can.c
i2c.cpp
init.c
led.c
spi.cpp
@@ -35,5 +35,4 @@
constexpr px4_i2c_bus_t px4_i2c_buses[I2C_BUS_MAX_BUS_ITEMS] = {
initI2CBusExternal(1),
initI2CBusInternal(2),
};
+1
View File
@@ -146,6 +146,7 @@ __EXPORT int board_app_initialize(uintptr_t arg)
if (result != OK) {
syslog(LOG_ERR, "[boot] FAILED to init params in FLASH %d\n", result);
return -ENODEV;
}
#endif // FLASH_BASED_PARAMS
-1
View File
@@ -15,4 +15,3 @@ CONFIG_DRIVERS_TONE_ALARM=y
CONFIG_BOARD_UAVCAN_INTERFACES=1
CONFIG_DRIVERS_UAVCANNODE=y
CONFIG_SYSTEMCMDS_PARAM=y
CONFIG_SYSTEMCMDS_TOPIC_LISTENER=y

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