Commit Graph

493 Commits

Author SHA1 Message Date
Daniel Agar 8ce2f30aa6
NuttX cmake improve dependencies between configure and runtime
- attempting to make the build slightly more robust to incomplete configures or other bad states.
2019-11-16 18:30:52 -05:00
Daniel Agar df73a6667d NuttX cmake improvements
- fix temporary Make.defs copy
 - implement custom macros for COMPILE, COMPILEXX, ASSEMBLE, ARCHIVE to enable ccache properly (if available and enabled)
 - fix NuttX mkdeps
 - fix libapps race condition with context
2019-11-16 15:42:19 -05:00
David Sidrane 850821f47f [REVISIT] Support upstream DSHOT Revist!
The Addition of PX4_ARCH_DCACHE_LINESIZE is fundamentally wrong.
   It asserst that an STM32F4 has a cache and it does not.
   This should be #if defined() on CONFIG_ARMV7M_DCACHE
2019-11-16 11:43:42 +01:00
Daniel Agar 2af262ed1d NuttX cmake build wrapper thorough dependencies 2019-11-16 11:43:42 +01:00
Daniel Agar 99aae8b891 NuttX use toolchain math.h and avoid empty drivers/Kconfig 2019-11-16 11:43:42 +01:00
David Sidrane b2f28c977d durandal-v1 Nuttx Based PX4 bootloader
durandal bootloader:Run at 480 Mhz

durandal-v1:bootloader use VBUS detection

Add Durandal bootloader to build
2019-11-16 11:43:42 +01:00
David Sidrane 65a26ec060 nxp_fmuk66-v1:Port to NuttX 8.1+ 2019-11-16 11:43:42 +01:00
David Sidrane e847698c9f PX4 System changes Supporting STM32H7
stm32:ToneAlarmInterfacePWM TIM15-TIM17 have a BDTR Register

common:board_crashdump Add H7 support

stm32/board_mcu_version:Support H7

PX4 ADC:Use 32 interface and resoution abstraction

Added PX4 stm32h7 ADC driver

stm32h7:adc fix ADC ready check

fmu: handle BOARD_HAS_PWM==5

cmake: improve error handling for NuttX olddefconfig failures

WorkQueueManager:Quiet loadmon stack warning

camera_trigger:GPIO support < 6 GPIO

Adjust stack sizes (under hw stack check)

PX4 System changes Supporting STM32H7 PX4IO Driver

aerotenna_ocpoc:ADC add px4_arch_adc_dn_fullcount

init.cmake:Track Upstream change needing Make.def at config time

PX4 System changes Supporting STM32H7

NuttX CMakeLists.txt Track upstream changes

Common board_crashdump add header and px4 config

NuttX simplify callinb make libapps

Use UINT32_MAX for error return

drivers:uavcannode NuttX chip is now hardware

drivers:uavcanesc NuttX chip is now hardware

px4io:Avoid Race on AP to PX4 IO upgrade
2019-11-16 11:43:42 +01:00
David Sidrane 36a75b79a4 uavcan:Changes to support Nuttx 7.31+
libuavcan:Update with Kinetis NuttX 8.1+ support

Traking master uavcan changes
2019-11-16 11:43:42 +01:00
David Sidrane 522ed2d99b NuttX based PX4 bootloader
stm32h7 booloader:Obey VBUS input

stm32h7 booloader:Fully deinit systic
2019-11-16 11:43:42 +01:00
Beat Küng 78944a70c3 Upgrade NuttX to 8.2
Nuttx with PX4 contrib of bbsram fix

Nuttx 8.31+ with BBSRAM disable dcache

Nuttx 8.2-
2019-11-16 11:43:42 +01:00
TSC21 d4ddabdf52 SITL: adds 'iris_rtps' target 2019-11-13 18:24:11 +00:00
Daniel Agar c5520cbaca mpu9250: start building "NuttX" driver for Linux and QuRT 2019-11-13 09:21:02 -05:00
Daniel Agar 1c4e854f93 cmake don't build param "c" files and remove param defines
- these aren't actual source code
2019-11-11 10:25:42 -05:00
Beat Küng 5dff065ec5 uavcan: move to work queue and use MixingOutput
Main UAVCAN protocol handling and ESC updates run on the same thread/wq as
before. There are 2 WorkItems for separate scheduling of the 2, so that
ESC updates run in sync with actuator_control updates. UAVCAN is scheduled
at a fixed rate of 3ms (previously the poll timeout) and on each UAVCAN
bus event.
This leads to roughly the same behavior as before. CPU & RAM usage are
pretty much the same (tested on Pixhawk 4).

Testing done: Motors still work (with feedback), param changes and a
UAVCAN optical flow sensor.
2019-11-07 10:40:03 +01:00
Beat Küng a203475489 BlockingList: fix unsafe getLockGuard() API
getLockGuard relies on copy elision to work correctly, which the compiler
is not required to do (only with C++17).
If no copy elision happens, the mutex ends up being unlocked twice, and the
CS is executed with the mutex unlocked.

The patch also ensures that the same pattern cannot be used again.
2019-11-05 12:14:20 +01:00
Daniel Agar 7f930f875e Jenkins store SITL unit test results 2019-11-04 14:04:40 -05:00
Daniel Agar 69bec3ee62
defines.h delete obsolete PRIu64, PRId64, and offsetof 2019-11-03 11:50:15 -05:00
Daniel Agar 7bf9700426
NuttX: math.h drop extra math defines carried in PX4 defines.h 2019-11-03 10:30:00 -05:00
FlavioTonelli 7984c0c910 px4_work_queue: stack size rounded to page size on posix 2019-11-03 09:04:04 -05:00
Matthias Grob 933ff8d480 Remove duplicate EOF trailing newlines
because they can screw up git when merging branches.
2019-11-02 09:49:46 -04:00
David Sidrane a3e2777208 NuttX/nuttx with SDIO fixes (#13311)
* NuttX/nuttx with SDIO fixes
2019-10-31 16:55:16 +01:00
Beat Küng 1dd6b6a505 stm32f3: add libs and stubs for F3 build (thiemar_s2740vc-v1) 2019-10-30 11:48:47 +01:00
Beat Küng 3b7c1b4ff1 src/drivers/boards: move to platforms/nuttx/src/px4/common 2019-10-30 11:48:47 +01:00
Beat Küng be7ed5e388 src/drivers/boards/common/{stm32,kinetis}: move under platforms/nuttx/src/px4 2019-10-30 11:48:47 +01:00
Beat Küng 58e161347b board_mcu_version: move to platforms/nuttx/src/px4 2019-10-30 11:48:47 +01:00
Beat Küng e7519c9fa0 board_identity: move to platforms/nuttx/src
And fix a potential alignment issue in board_get_mfguid and
board_get_px4_guid.
2019-10-30 11:48:47 +01:00
Beat Küng b30171ba8d board_common.h: move under platforms/common
Also move board_determine_hw_info and board_gpio_init under platforms/nuttx
2019-10-30 11:48:47 +01:00
Beat Küng 3198610f85 src/platforms: move all headers to platforms/common/include/px4_platform_common
and remove the px4_ prefix, except for px4_config.h.

command to update includes:
for k in app.h atomic.h cli.h console_buffer.h defines.h getopt.h i2c.h init.h log.h micro_hal.h module.h module_params.h param.h param_macros.h posix.h sem.h sem.hpp shmem.h shutdown.h tasks.h time.h workqueue.h; do for i in $(grep -rl 'include <px4_'$k src platforms boards); do sed -i 's/#include <px4_'$k'/#include <px4_platform_common\/'$k/ $i; done; done
for in $(grep -rl 'include <px4_config.h' src platforms boards); do sed -i 's/#include <px4_config.h/#include <px4_platform_common\/px4_config.h'/ $i; done

Transitional headers for submodules are added (px4_{defines,log,time}.h)
2019-10-30 11:48:47 +01:00
Daniel Agar 6f1f5e0325 clang-tidy: partially fix readability-redundant-declaration 2019-10-28 10:50:31 -04:00
Daniel Agar a7f330075a clang-tidy: enable hicpp-braces-around-statements and fix 2019-10-28 10:50:31 -04:00
Daniel Agar 4192414576 clang-tidy: partially fix cppcoreguidelines-pro-type-reinterpret-cast 2019-10-28 10:50:31 -04:00
Daniel Agar 967446af4c clang-tidy: enable readability-simplify-boolean-expr and fix 2019-10-27 19:19:07 -04:00
Daniel Agar 279df3b1b8 clang-tidy: partially fix hicpp-use-equals-delete 2019-10-27 19:19:07 -04:00
Daniel Agar ae27dd60a6
Jenkins re-enable clang-tidy and update .clang-tidy
- device/Device: fix explicit constructor and uninitialized fields
 - systemcmds/motor_test: update NULL to nullptr
2019-10-27 17:19:11 -04:00
Igor Mišić f4ee9141cb DShot: updated driver to use NuttX DMA functions (#13233) 2019-10-25 09:49:03 +02:00
Matthias Grob d60e1e2774 ControlMath: switch to gtest for unit tessting 2019-10-23 17:33:47 +02:00
Julian Oes 8e625285fc platforms: initialize strings
This might fix a warning about argv being a TAINTED_SCALAR further down.
2019-10-17 08:44:53 -04:00
Beat Küng 25aded36ec WorkQueue: avoid potential semaphore counter overflow
This could happen in the following cases:
- IRQ/publisher rate is faster than the processing rate, and therefore
  WorkQueue::Add is called at a higher rate
- a long-running or stuck task that blocks the work queue a long time

Both cases are not expected to happen under 'normal' circumstances (if the
system runs as expected).
2019-10-16 18:29:26 +02:00
Beat Küng 17551a99f8 io_timer: fix potential invalid memory access 2019-10-16 13:13:17 +02:00
Matthias Grob e843090383 Replace a lot of memset with {} initializers 2019-10-15 10:01:03 -04:00
Beat Küng 8a9744d05a dshot: allow boards to enable dshot only on a subset of the timers 2019-10-11 08:14:17 +02:00
Beat Küng d0a7490222 dshot: update timer generation before DMA request
This reloads the timer configuration before triggering DMA. Without that,
in rare cases, there were 17 bits sent instead of 16.
The 1. bit (1. pulse) was always wrong (too much), the rest of the bits
were the correct DShot packet that was meant to be sent.
2019-10-11 08:14:17 +02:00
Beat Küng 7445c25fcc dshot: check if DMA still in progress
No other functional change, just restructuring.
2019-10-11 08:14:17 +02:00
Beat Küng 182efaa757 dshot: reduce static buffer size
And handle failures of up_dshot_init().

On Omnibus: reduces memory usage if dshot is enabled by ~1.0KB.
The buffer is roughly 1KB in size.
2019-10-11 08:14:17 +02:00
Beat Küng 69c10dcaac dshot: move implementation to a separate directory & library
So that the static memory overhead is not added to targets w/o dshot
2019-10-11 08:14:17 +02:00
Beat Küng 23dbd9426a dshot: handle dcache, flush cache before DMA transfer 2019-10-11 08:14:17 +02:00
Beat Küng 3234aca53b px4_micro_hal: add PX4_ARCH_DCACHE_LINESIZE definition 2019-10-11 08:14:17 +02:00
Igor Mišić 5bd9659301 stm32 timers: add dshot implementation 2019-10-11 08:14:17 +02:00
Daniel Agar 3c623af903 ekf2: move to WQ with uORB callback scheduling 2019-10-02 19:44:46 -04:00
Daniel Agar 26364d44c9
px4_work_queue: command line status output and shutdown empty queues
* adds a work_queue systemcmd that will bring a tree view of all active work queues and work items
 * WorkQueues now track attached WorkItems and will shutdown when the last WorkItem is detached
2019-10-02 12:23:17 -04:00
Daniel Agar 3687677095 cmake: show sitl_gazebo build output and improve rebuild 2019-10-01 14:22:30 -04:00
Kjkinney 3f9b3fb4da px4_log: publish all PX4_INFO messages as well (#12954) 2019-09-27 14:04:30 -04:00
Daniel Agar 86dc4c5a00 cmake generate vscode launch.json 2019-09-21 13:06:49 -04:00
Daniel Agar fb7521eb5e cmake px4_base -> px4_parse_function_args 2019-09-15 14:36:38 -04:00
Daniel Agar d27dfcd921 NuttX CMakeLists.txt extract helpers (jlink, upload, etc) 2019-09-15 14:36:38 -04:00
Julian Oes 78d3986013 platforms: fix main function signature 2019-09-03 11:52:54 -05:00
Beat Küng d3fb610fde mixer_module: create MixingOutput library and use in fmu
This should be a pure refactoring, no functional change.
2019-08-31 10:05:00 -04:00
Beat Küng 43fdcd7876 px4_middleware: remove that header and move px4::init to px4_init.h
delete include:
for i in $(grep -rl 'px4_middleware.h' src platforms); do sed -i '/#include <px4_middleware.h/d' $i; done
2019-08-30 07:59:44 +02:00
Beat Küng f32abe8534 src/platforms: move remaining source files to platforms/common 2019-08-30 07:59:44 +02:00
Beat Küng f8e0441e7b src/platforms/common: move to platforms/common
Script to update include paths:
for i in $(grep -rl 'include <px4_work_queue' src platforms); do sed -i 's/#include <px4_work_queue/#include <px4_platform_common\/px4_work_queue/' $i; done
2019-08-30 07:59:44 +02:00
Beat Küng 5d0e72040c src/platforms/posix: move to platforms/posix/src/px4/common and src/drivers/driver_framework_wrapper 2019-08-30 07:59:44 +02:00
Beat Küng fa8165a1c3 platforms/posix/src: move to platforms/posix/src/px4/common 2019-08-30 07:59:44 +02:00
Beat Küng 3bdfd8ce8d ToneAlarmInterface: move to drivers/drv_tone_alarm
It belongs there since it's not a library providing the implementation, but
just declaring the interface.
2019-08-30 07:59:44 +02:00
Beat Küng f3fccf53f6 src/drivers/{kinetis,stm32}: move to arch-specific directories 2019-08-30 07:59:44 +02:00
Beat Küng 3003e7d0fc drv_led_pwm: move to arch-specific directory 2019-08-30 07:59:44 +02:00
Beat Küng bd1b267baa NuttX hrt: move into arch-specific directory 2019-08-30 07:59:44 +02:00
Beat Küng 1cb6c36a00 adc: refactor into arch-specific directories 2019-08-30 07:59:44 +02:00
Beat Küng ab43a83bed platform: restructure (NuttX) architecture-specific code
updated: tone_alarm, px4io_serial, px4_micro_hal
2019-08-30 07:59:44 +02:00
Daniel Agar e8dcd8c2fc cmake nuttx ignore linking target warning 2019-08-28 22:50:23 -04:00
roangel e50dd7c364 replay: close replay log file after replay is finished, then exit (#11264) 2019-08-28 08:13:50 +02:00
Hyon Lim 0262a699c1 UVify Core board support and airframes (Draco, Draco-R, IFO) (#12337)
* also includes minor changes to make it easy to keep in sync with px4_fmu-v4
2019-08-23 17:02:25 -04:00
Julian Oes dd2d5c029f platforms: match usb-Hex_ProfiCNC device (#12772)
This means that we are able to detect and flash the Pixhawk Cube Black.
2019-08-22 01:32:39 -07:00
Julian Kent d70b024ec7
GTest functional tests that include parameters and uORB messaging (#12521)
* Add kdevelop to gitignore

* Add test stubs

* Rename px4_add_gtest to px4_add_unit_gtest

* Add infrastructure to run functional tests

* Add example tests with parameters and uorb messages

* Fix memory issues in destructors in uORB manager and CDev

* Add a more real-world test of the collision prevention
2019-08-09 15:10:09 +02:00
David Sidrane 21782603b3 px4_fmu-v5x: add networking
* fixed dropped CONFIG_LIBC_FLOATINGPOINT=y
* fix RMII TX pinning
* update platforms/nuttx/NuttX/nuttx w/ f7 eth
2019-08-08 20:38:56 -04:00
Daniel Agar 64f105b530 Update submodule nuttx to latest Mon Aug 5 20:30:34 UTC 2019 (#12636)
- nuttx in PX4/Firmware (be76f909beadfe80415b733c020695efb042adef): b4013dcd4a
    - nuttx current upstream: 14f4dc735a
    - Changes: b4013dcd4a...14f4dc735a

    14f4dc7 2019-08-05 David Sidrane - [BACKPORT] kinetis:i2c transfer ensure correct result returned
2019-08-05 13:32:46 -07:00
Daniel Agar 030508a71d cmake make bloaty available everywhere and improve output 2019-08-05 00:19:18 -04:00
Daniel Agar f7c9acbdab Update submodule nuttx to latest Thu Aug 1 18:09:20 EDT 2019 (#12603)
- nuttx in PX4/Firmware (210dbb5b8365eb003453695aa4711044bb6d49be): 257e1730dc
    - nuttx current upstream: b4013dcd4a
    - Changes: 257e1730dc...b4013dcd4a

    b4013dc 2019-08-01 David Sidrane - [BACKPORT] stm32l4:serial add HW HS on UART 4 & 5
4380c12 2019-08-01 David Sidrane - [BACKPORT] stm32h7:serial add HW HS on UART 4 & 5
0ff3e6c 2019-08-01 David Sidrane - [BACKPORT] stm32:serial add HW HS on UART 4 & 5
316126f 2019-07-31 David Sidrane - [BACKPORT] stm32f7:serial add HW HS on UART 4 & 5
2019-08-01 16:14:45 -07:00
Anthony Lamping 5d986f2030 posix: add argument to change the CWD (#12482) 2019-08-01 12:25:35 -04:00
PX4 Build Bot ca74b3fef1 Update submodule nuttx to latest Mon Jul 29 12:38:24 UTC 2019
- nuttx in PX4/Firmware (0654fdcf0ec7e45cc1e1ca5cc38de6c5e36417bc): feb5b6f174
    - nuttx current upstream: 257e1730dc
    - Changes: feb5b6f174...257e1730dc

    257e173 2019-07-26 David Sidrane - [BACKPORT] stm32f7:If only one SDMMC it is slot 0
2019-07-29 10:59:28 -04:00
David Sidrane df0599913e Firmwarte master with nuttx printf backport 2019-07-25 05:28:46 -07:00
Beat Küng d95aae4619 Generic-arm-none-eabi-gcc-cortex-m7: use SP float depending on NuttX config
Not all m7 boards support double, as for example the STM32F745.
2019-07-16 08:09:22 +02:00
Daniel Agar d4cd1d0d2e
NuttX stm32f7 fully re-enable dcache with write back (#12435)
- fixes https://github.com/PX4/Firmware/issues/12216
 - includes latest PX4/NuttX and apps update 7.29+
2019-07-10 19:08:12 -04:00
Daniel Agar dc10a68539 NuttX and apps update 7.29 2019-07-10 12:58:35 -04:00
Julian Oes 35074aaffd posix: remove segfault handler
I could not get a core dump without removing the segfault handler, hence
this change.
2019-06-05 08:16:19 +02:00
Julian Oes f3620f7018 Remove all leftover PX4_BACKTRACE calls 2019-06-05 08:16:19 +02:00
Beat Küng 0d71eeccbf console buffer: write to log as 'boot_console_output' message 2019-06-04 11:57:54 +02:00
Beat Küng d947818654 console: add simple dmesg functionality (enable only on v5) 2019-06-04 11:57:54 +02:00
Beat Küng 6e2b70cbcd posix: restore original SEGV signal handler upon first entry of our handler
The current SEGV handling on posix is not useful: as soon as our handler
is left, it's triggered again, infinitely.
This patch changes to restore the original handler, so the OS can create
a core dump, etc.
2019-05-29 08:30:52 +02:00
Julian Oes 7b9562e3b1 hysteresis: move out of systemlib, move to gtest
This moves the hysteresis test out of the systemlib and makes it its own
small library. Since it still depends on hrt_absolute_time this does not
link yet. My attempt to get all link dependencies together failed.
2019-05-27 09:57:50 +02:00
Daniel Agar e9ca5d5aba PX4 general work queue 2019-05-24 12:58:55 -04:00
Beat Küng f58079bc5d pxh.cpp: fix invalid reference if words is empty
This can happen for example if 'line' is a space.
2019-05-24 11:06:41 -04:00
Julian Oes 7a768dbab3 lockstep_scheduler: always use the same code
This define was not set anyway, and in my opinion we should
not use different code for tests anyway.
2019-05-20 12:39:02 -04:00
Julian Oes 52099f5792 cmake: include lockstep_scheduler test
This makes sure we add the lockstep_scheduler_test even if the
ENABLE_LOCKSTEP_SCHEDULER is not set to yes. This means the
lockstep_scheduler is not used for SITL but the CMakeLists.txt file
still used and the test added.
2019-05-20 12:39:02 -04:00
Julian Oes 8d8799097d lockstep_scheduler: convert test to gtest 2019-05-20 12:39:02 -04:00
Daniel Agar 162405479b
device drivers lib add linux spi support 2019-05-20 12:18:56 -04:00
Matthias Grob cbd230e34e Testing: Clean up unit_test target because test_results does all tests now 2019-05-09 09:42:46 +02:00
Matthias Grob 542f61f04b testing build: add possibility to filter tests with ctest regex 2019-05-09 09:42:46 +02:00
Matthias Grob 5a90382cb8 sitl_tests: add prefix "sitl-" for regex test filtering 2019-05-09 09:42:46 +02:00
Matthias Grob 5020dfdc3d Testing: switch unit tests to BUILD_TESTING 2019-05-09 09:42:46 +02:00