Commit Graph

143 Commits

Author SHA1 Message Date
Daniel Agar 15332a7e56 boards: reduce CONFIG_NFILE_DESCRIPTORS 20 -> 15 2020-04-01 16:17:14 -04:00
Daniel Agar ca81175b07 rename drivers/px4fmu -> drivers/pwm_out
- split out header
2020-03-31 19:12:31 -04:00
Daniel Agar 44bec269b0 boards: update all NuttX configs CONFIG_NSH_MAXARGUMENTS 12 -> 15 2020-03-25 17:59:22 -04:00
Daniel Agar f5fe50f839 invensense/icm20608g driver minor improvements
- interupt pin set active low and latch
 - relax retry timeout if configure failed
 - improve configured empty rate (sample rate) rounding
 - fix RegisterCheck
 - check FIFO count as part of full transfer and reset or adjust timing if necessary
 - rename DRV_IMU_DEVTYPE_ICM20608 -> DRV_IMU_DEVTYPE_ICM20608G
2020-03-25 01:05:38 -04:00
Beat Küng b156fe5787 boards: remove deprecated SPI + I2C defines from board_config.h
chip-selects are deselected in stm32_spiinitialize()
2020-03-24 09:46:20 -04:00
Beat Küng 924f46ee28 refactor icm20608g: use driver base class 2020-03-24 09:46:20 -04:00
Beat Küng 00280d55c2 refactor rm3100: use driver base class 2020-03-24 09:46:20 -04:00
Beat Küng 4d511868e6 refactor lis3mdl: use driver base class 2020-03-24 09:46:20 -04:00
Beat Küng 7626be0485 refactor mpu9250: use driver base class 2020-03-24 09:46:20 -04:00
Beat Küng 2f3174abb0 refactor icm20602: use driver base class 2020-03-24 09:46:20 -04:00
Daniel Agar 8738c26426
boards: enable NuttX SPI DMA buffers
- update to NuttX with stm32f4 and stm32f7 SPI DMA internal buffers
 - remove explicit DMA buffer allocations from new IMU drivers
 - restore original BOARD_DMA_ALLOC_POOL_SIZE
 - decrease SPI DMA thresholds based on fmu-v2/v3/v4/v5 bench testing
2020-03-22 19:24:26 -04:00
Beat Küng 8ebde51648 refactor hmc5883: use driver base class
Removes the calibration on startup, as these values were overwritten by
the system calibration values anyway.
So the only difference is that if all calibration scales were equal to 1,
the driver startup would have failed.
2020-03-17 23:31:17 -04:00
Beat Küng ec2de33547 lights: use driver base class 2020-03-17 23:31:17 -04:00
Daniel Agar 0ce9e113ff boards: stm32f4/f7 enable SPI_DMATHRESHOLD=32 2020-03-11 22:08:37 -04:00
Beat Küng 179c89b6bd board configs: extend board_dma_map.h with a table 2020-03-11 22:08:37 -04:00
Daniel Agar 6834f089cc px4_fmu-v4pro: cleanup board_dma_map.h 2020-03-11 22:08:37 -04:00
Daniel Agar f9794e99f8
move hover_thrust_estimator to new module (mc_hover_thrust_estimator)
* MC_HTE: unitialize with hover_thrust parameter
* MC_HTE: constrain hover thrust setter between 0.1 and 0.9
* MC_HTE: integrate with land detector and velocity controller
* MCHoverThrustEstimator: Always publish an estimate even when not fusing measurements. This is required as the land detector and the position controller need to receive a hover thrust value.

* MC_HTE: use altitude agl threshold to start the estimator
local_position.z is relative to the origin of the EKF while dist_bottom
is above ground

Co-authored-by: bresch <brescianimathieu@gmail.com>
2020-03-11 21:20:54 -04:00
Daniel Agar 505afc6063 boards: increase LPWORKSTACKSIZE 1536 -> 1600 2020-03-10 12:53:01 -04:00
Beat Küng 335623e11d SPI config: use enum to specify bus 2020-03-10 10:11:43 -04:00
Beat Küng 1851665fab boards: add new spi+i2c config
Chip-select and SPI initialization uses the new config, whereas the drivers
still use the existing defines.

The configuration in board_config.h can be removed after all drivers are
updated.
2020-03-10 10:11:43 -04:00
Daniel Agar 4698a09b98 delete unmaintained outback challenge (OBC) bottle drop example 2020-03-05 14:09:31 -05:00
Daniel Agar 779ba0fda5
px4_fmu-v4/v4pro: switch to new InvenSense icm20602/icm20608g IMU drivers
* 8 kHz gyro, 4 kHz accel
 * DLPF disabled
 * scheduled using data ready interrupts
 * FIFO is emptied at 1 kHz by default, but can adjusted via IMU_GYRO_RATEMAX from 250 Hz - 2000 kHz.
 * On both px4_fmu-v4 and px4_fmu-v4pro the secondary IMU is an mpu9250 with the same driver
2020-02-26 01:19:12 +01:00
Daniel Agar 1d226ad2ca invensense icm20608g improvements
- checked register mechanism and simple watchdog
  - driver checks for errors gradually and can reconfigure itself
 - respect IMU_GYRO_RATEMAX at the driver level
 - fixed sensor INT16_MIN and INT16_MAX handling (y & z axis are flipped before publishing)
2020-02-18 22:48:32 -05:00
Beat Küng d74d094940 nuttx configs: disable nuttx timers which are used for PWM output
These are not required, and to be consistent we enforce disabling them now.
2020-02-13 03:49:16 -08:00
Beat Küng a0bfb7ad8e px4/fmu-v4pro: use hw description methods for timer configuration 2020-02-13 03:49:16 -08:00
Beat Küng 62b4f3487a io timer: remove some fields from io_timers_t and split out channel indexes
- reduces amount of board configuration required
- removes the cyclic dependency between io_timers_t and timer_io_channels_t

Fixes a bug in the fmuk66-v3 config: the 2. timer has 3 channels associated
not 2.
Fixes a bug in the modelai config: the 2. timer has 4 channels associated.
2020-02-13 03:49:16 -08:00
David Sidrane 514e1a3744 px4_fmu-v4pro:Fix USART6 RX DMA Assignment 2020-01-30 16:20:49 -05:00
Daniel Agar dc05ceaad2
create temperature_compensation module
- this is a new module for temperature compensation that consolidates the functionality previously handled in the sensors module (calculating runtime thermal corrections) and the events module (online thermal calibration)
 - by collecting this functionality into a single module we can optionally disable it on systems where it's not used and save some flash (if disabled at build time) or memory (disabled at run time)
2020-01-20 21:42:42 -05:00
Daniel Agar 709961ec8c
InvenSense ICM20602 and ICM20608-G: new standalone optimized drivers
- uses the FIFO and SPI DMA to transfer full raw data (8 kHz gyro, 4 kHz accel)
 - new sensor messages for better visibility
   - sensor_{accel, gyro}_fifo: full raw data for optional logging and analysis
   - sensor_{accel, gyro}_status: metadata, clipping, etc
 - currently not enabled by default
2019-12-03 23:21:32 -05:00
Daniel Agar bc182e94e6
sensors split rc_update into new standalone module 2019-11-24 13:25:11 -05:00
Daniel Agar 5aaf1b100b delete unused md25 driver 2019-11-21 18:56:24 -05:00
Daniel Agar 8c38176d77 boards: alphabetize and sync common drivers and modules 2019-11-21 18:56:24 -05:00
Daniel Agar 84fe64b1c2
create new multicopter rate controller module (mc_rate_control) split out of mc_att_control 2019-11-19 17:03:11 -05:00
Daniel Agar 99aae8b891 NuttX use toolchain math.h and avoid empty drivers/Kconfig 2019-11-16 11:43:42 +01:00
David Sidrane 7ce4f06470 px4:fmu-v4pro BSP Updated to NuttX 8.1+ 2019-11-16 11:43:42 +01:00
Daniel Agar 52554f1efa px4_fmu-v4pro: cleanup SPI devs 2019-11-12 11:18:57 -05:00
Daniel Agar 668984b6b0 boards: start adc in rc.board_sensors 2019-11-11 17:08:24 -05:00
Daniel Agar 40850f58ee boards cleanup old nsh_archinitialize 2019-11-03 12:09:48 -05: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 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 6a0f5249f8
sensors: split out analog battery handling to new standalone battery_status module 2019-10-21 13:40:23 -04:00
Daniel Agar 315141873e NuttX boards reduce CONFIG_MAX_TASKS 64 -> 32 (default) 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
garfieldG bbb96cbd0c Mavlink startup script per board
-moved rc.mavlink to the boards optional rc additions (now it's called rc.board_mavlink) to handle board specific mavlink needs (mavlink over usb, ethernet, additional streams, etc.)
-mavlink module will be responsible to usb defaults, therefore less args are needed to be passed to mavlink module if one wants to use mavlink over usb.
-the way to check if connection is usb is by it's designated variable and not by config mode.
2019-09-29 10:46:08 -04:00
Daniel Agar 0486d69240 delete obsolete segway example 2019-09-28 15:05:50 -04:00
BazookaJoe1900 6ab5c2170e remove unused pca8574 and oreoled drivers 2019-09-04 08:05:08 -07:00
BazookaJoe1900 e3b60cd9e7 rc.sensors: moved common ms5611 start to rc.board_sensors per board 2019-09-01 12:55:50 -04: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 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
Silvan Fuhrer cedf14e2ba Airspeed Selector: repurpose wind estimator into an airspeed (selection, validation) module.
This new airspeed module does:
  -runns an airspeed validator for every airspeed sensor present, which checks measurement validity and estimates an airspeed scale
  -selects another airspeed sensor if for the current one a failure is detected
  -estimates airspeed with groundspeed-windspeed if no valid airspeed sensor is present
  -outputs airspeed_validated topic

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2019-08-09 10:55:05 +02:00
Daniel Agar 0955fd2d58
NuttX boards reduce CONFIG_NFILE_DESCRIPTORS 54 -> 20 2019-08-07 21:23:27 -04:00
Daniel Agar 5421ef5535 NuttX increase HPWORK and LPWORK stack by 256 bytes 2019-08-06 23:15:07 -04:00
Daniel Agar 9d701a077d
NuttX reduce stack for interrupts, HPWORK, LPWORK 2019-08-06 11:00:55 -04:00
Daniel Agar 77694183b2 delete position_estimator_inav 2019-08-02 17:38:28 -04:00
Beat Küng b7a0e1ef03 boards: simplify RC port configuration by using NuttX ioctl's
A board only needs to define:
 #define RC_SERIAL_PORT                     "/dev/ttyS4"

Then it can optionally define one or more of the following:
 #define RC_SERIAL_SWAP_RXTX
 #define RC_SERIAL_SINGLEWIRE
 #define RC_INVERT_INPUT(_invert_true) px4_arch_gpiowrite(GPIO_SBUS_INV, _invert_true)
2019-07-16 08:09:22 +02:00
Timothy Scott 2ed00c9cb6 Rover: Rewrote gnd_pos_control and removed gnd_att_control (#12239) 2019-07-11 09:39:13 -04:00
Daniel Agar dc10a68539 NuttX and apps update 7.29 2019-07-10 12:58:35 -04:00
Daniel Agar 321c2c0392 boards don't use px4_add_library for drivers_board
- this prevents low level board support from using PX4 logging, uORB, etc
2019-07-09 19:09:47 -04:00
Daniel Agar 15d1543f95 create systemcmds/i2cdetect tool to scan i2c bus 2019-07-06 10:28:16 -04:00
Daniel Agar bef7a9ba8e
NuttX boards increase task limit 32 -> 64 (#12230) 2019-06-10 09:42:36 -04:00
Daniel Agar f85c15e247 board common create generic dma allocator (from fat_dma_alloc) 2019-05-30 19:31:40 -04:00
Mohammed Kabir b334b75886 Move optical flow drivers to own subdirectory 2019-05-28 23:23:38 -04:00
Beat Küng 226f3c0999 rc.board_sensors: probe for external qmc5883 2019-04-15 10:37:06 +02:00
Beat Küng 914a9b78b6 new airframe for sih, HIL_STATE_QUATERION sent through MAVLink 2019-04-12 09:25:07 +02:00
Daniel Agar 5e6bfe1ad8
vscode updates
* working debugging (one click build and debug)
   * SITL jmavsim
   * SITL gazebo
   * jlink px4_fmu-v{2-5}
 * improved syntax highlighting
   * GNU linker files
   * ROS message files msg/*.msg
   * jinja2 template files
 * fixed intellisense support
2019-03-22 20:55:39 -04:00
Daniel Agar 7ccaf1068b px4_fmu-v4pro nsh compress defconfig 2019-03-21 08:41:01 -04:00
Hamish Willee 257b90958f Correct links to example docs 2019-03-15 08:05:54 +01:00
David Sidrane edd9f91a19 board:Set larger stack margin 2019-03-01 23:45:48 -05:00
Daniel Agar f1d17c9003
camera_capture add to all boards 2019-02-11 14:15:28 -05:00
mcsauder dc5f18bdcd ToneAlarm class refactoring to implement an interface for hardware specific methods and a single ToneAlarm class. 2019-01-28 18:58:04 -08:00
Daniel Agar 739a02022b position_estimator_inav: move to examples (start deprecation) 2019-01-27 22:15:39 +01:00
David Sidrane 7e863456c4 px4_fmu-v4pro: Inital commit NuttX 7.27+ 2019-01-25 06:32:37 -08:00
David Sidrane 8f308efa88 upstram NuttX CONFIG_EXAMPLES_NSH_CXXINITIALIZE->CONFIG_SYSTEM_NSH_CXXINITIALIZE 2019-01-25 06:32:37 -08:00
Daniel Agar 2ffb49b734 delete px4_includes.h header and update boards/ to use syslog 2019-01-23 18:25:18 -05:00
Daniel Agar 67e5986c9b delete obsolete examples/subscriber 2019-01-23 18:25:18 -05:00
Daniel Agar 693ee4808a delete obsolete examples/publisher 2019-01-23 18:25:18 -05:00
Daniel Agar 320d2e9383
create PX4 platform layer initialization helper (#11269)
- starts requirements for PX4 modules (hrt, param, etc)
2019-01-22 14:13:20 -05:00
Daniel Agar fef65bf5c8 ROMFS split rc.board into defaults, sensors, and extras 2019-01-15 23:52:46 -08:00
Daniel Agar 1b8c2c82d5
px4flow start in rc.sensors instead of per board (#11123)
- fixes #11009
2019-01-01 11:39:40 -05:00
Daniel Agar 8622fa4aac move pca8574 driver to lights 2018-12-04 01:06:54 -05:00
Daniel Agar 75b2053243 move uavcan from modules to drivers 2018-12-04 01:06:54 -05:00
Daniel Agar bbab66d974 move vmount to modules (it's not a driver) 2018-12-04 01:06:54 -05:00
Daniel Agar 9d42480f4e drivers create lights category (directory) 2018-12-04 01:06:54 -05:00
Daniel Agar d4e06e517a delete drv_gpio.h, modules/gpio_led, and fmu GPIO ioctls 2018-12-03 16:30:39 +01:00
Daniel Agar 6c2436c2ca move fmu-v4pro init to rc.board 2018-12-01 10:03:19 -05:00
Daniel Agar e45e7aa8a6 move posix/tests/hello to examples/hello and include everywhere 2018-11-26 14:40:14 -08:00
Daniel Agar 3e0a3559a9 cmake use standard mechanisms for settings flags 2018-11-26 14:40:14 -08:00
Daniel Agar c258534aa5 cmake px4_add_board document and cleanup 2018-11-26 14:40:14 -08:00
Daniel Agar fa0fe4cac6 cmake remove need for platform px4_add_board_os
- explicitly set TOOLCHAIN on all NuttX targets
2018-11-26 14:40:14 -08:00
Daniel Agar abb3817d31 boards new split VENDOR_MODEL naming convention 2018-11-26 14:40:14 -08:00
Daniel Agar f692ad04d0 boards organization 2018-11-26 14:40:14 -08:00