141 Commits

Author SHA1 Message Date
Beat Küng
810d2e9497 ModuleParams: remove parent in destructor
This allows for dynamic deletion of children objects (in most cases this
is not used).

Uses ~100B memory.
2021-09-11 15:07:49 -04:00
Beat Küng
c5c80e31b6 boards: remove DIRECT_INPUT_TIMER_CHANNELS from board_config.h 2021-09-08 16:10:24 -04:00
Jukka Laitinen
c3c30e5d4f Fix memory corruption when work queue is being deleted
When the last WorkItem is deleted, it is removed from a work queue and the
queue is being stopped. But, the queue itself might get deleted in the middle,
in a higher priority thread than where the WorkItem deletion was performed from

If the WorkQueue::Detach accesses the member variables after this, there is memory
corruption

This happens in particular when launching i2c or spi devices in
I2CSPIDriverBase::module_start:

- The "initializer" is deleted when the instance is not found and the iterator
  while loop continues.
- The workqueue is deleted in the middle of "initializer" deletion when the
  WorkQueueRunner returns.

This prevents deletion of the WorkQueue before the Detach has been finished,
in the specific case that the ::Detach triggers the deletion

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2021-08-27 10:43:45 +02:00
David Sidrane
78b76cb636 i2c_spi_buses:Support devices that may change address 2021-08-20 10:15:57 -04:00
David Sidrane
bb913ae11a system_load:Track Dynamic PID hash 2021-08-13 14:22:00 -04:00
Daniel Agar
e900f2ea54 boards: Advanced Technology Labs (ATL) Mantis EDU support and airfarme (SYS_AUTOSTART 4061)
Co-authored-by: Julian Oes <julian@oes.ch>
Co-authored-by: Daniel Agar <daniel@agar.ca>
2021-08-04 17:15:24 -04:00
Daniel Agar
65745a3676 purge broken qurt support and atlflight boards 2021-07-16 08:53:36 -04:00
Daniel Agar
d8704cee67 platforms: px4 log build string then print (fputs) 2021-07-10 13:14:49 -04:00
Beat Küng
c5aef9d512 i2c_spi_buses: add support for multiple instances of the same device on a bus
This also simplifies the API a bit, since we anyway have to change the
drivers to pass additional information (the bus device index).

The orientation flag is merged with the rotation.
2021-07-08 12:59:35 -04:00
Daniel Agar
e4983ab88c
px4_platform_common: atomic support larger types with critical sections (on NuttX) 2021-07-08 10:56:25 -04:00
Beat Küng
38f3b8d356 mavlink & system: add events interface
- sending protocol
- uorb event message & template methods for argument packing
- libevents submodule to send common events and handle json files
- cmake maintains a list of all (PX4) source files for the current build
  (PX4 modules + libs), which is used to extract event metadata and
  generate a json file
2021-07-07 21:38:09 -04:00
Beat Küng
9b7170551c ModuleBase: allow configurable timeout for wait_until_running() 2021-07-02 12:45:18 +02:00
Jukka Laitinen
d068ae48d6 Add header file for arhitecture/implementation specific px4 crypto and
configuration for cmake

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2021-06-25 08:35:58 +02:00
David Sidrane
84dd8839a2 i2c_spi_buses:Track NuttX change to getopts avoid name collision
NuttX #defined optarg and getopt to move to TLS. This fixes the
  name collision.
2021-06-16 17:07:47 +02:00
Daniel Agar
806b462935 px4_work_queue: increase UART stack 2021-05-31 14:49:40 -04:00
David Sidrane
69e0c2fc10 px4:platform support SPI configuration selection on HW REV 2021-05-10 09:11:50 +02:00
Daniel Agar
3b7ce61901 px4_work_queue: increase wq:rate_ctrl stack slightly 2021-05-04 17:40:56 -04:00
Daniel Agar
f9d8c613b0 px4_work_queue: increase nav_and_controllers stack 2021-04-21 07:34:13 +02:00
Daniel Agar
5f6832e101 px4_work_queue: increasae UART stack 2021-03-22 22:48:58 -04:00
David Sidrane
ccee36bb68 sd_bench and logger use aligned buffers 2021-03-17 05:27:53 +01:00
Daniel Agar
2257c3767e simple gyro auto calibration module 2021-03-15 09:46:47 +01:00
Daniel Agar
c356181f90 px4_work_queue: increase wq:rate_ctrl stack 2021-03-11 22:35:25 -05:00
Peter van der Perk
18a8d89fa4 PNP fixed allocation scheme
Fixed register scheme
Incrased wq:uavcan stack since it overflowed when sending register response
2021-03-07 21:49:05 +01:00
Daniel Agar
4d9e88141e px4_work_queue: increase wq:nav_and_controllers stack 2021-03-02 00:03:17 +01:00
Daniel Agar
7393d5d761 delete aerotenna ocpoc 2021-02-26 08:38:45 +01:00
Daniel Agar
6482120d9a
sensors/vehicle_angular_velocity: use full raw FIFO data (sensor_gyro_fifo) if available 2021-02-25 10:06:17 -05:00
David Sidrane
dd3c3098f2 nxp_ucans32k146:Add Can Bootloader build
nxp_ucans32k146:Relocation for Bootloader

nxp_ucans32k146:can_boot enable CAN

nxp_ucans32k146:Save Space use Non Optimize memcpy

nxp_ucans32k146:Increase to 24K

nxp/ucans32k146:Canbootloader LED Driver

nxp_ucans32k146:Can bootloader shut down CAN

nxp_ucans32k146:Use NVMEEPROM for Paramaters

nxp_ucans32k146:Use bootloader AppDescriptor

px4 mtd:Support onchip emulated eeprom
2021-02-24 19:20:15 +01:00
Beat Küng
2a0a82fd90 param: add commit_no_notification(T val) API 2021-02-24 17:27:31 +01:00
Daniel Agar
382e0cbaec
px4_work_queue: increase wq:nav_and_controllers stack 1760->1824 2021-02-22 11:15:01 -05:00
David Sidrane
5ea56af5f0 canbootloder:Make support for ALT Bootloader an Option 2021-02-17 22:47:35 -05:00
David Sidrane
8943644566 board_common:Add board_configure_reset and board_booted_by_px4 API 2021-02-17 22:47:35 -05:00
David Sidrane
8747b343d9 Non-compliant nodes support
WorkQueueManager:Increase UAVCAN stack size
2021-02-17 22:47:35 -05:00
Daniel Agar
da1a38b44e parameters: merge generated files ito single static constexpr header
- store parameter type and if volatile separately (saves kilobytes of flash)
 - use Bitset for tracking active and changed parameters
 - use atomic for autosave_enabled flag
 - compile at ${MAX_CUSTOM_OPT_LEVEL} (-O2 on non flash constrained boards)
2021-02-12 08:27:47 -05:00
Lorenz Meier
cd148cda88 Revert "platforms: px4 log build string then print (fputs)"
This reverts commit 9e112dd48bd9f5a2df559263bd1b8e5c636d68a9.
2021-02-02 00:53:32 +01:00
Daniel Agar
9e112dd48b platforms: px4 log build string then print (fputs) 2021-01-31 11:43:47 +01:00
Daniel Agar
0c58d12216 mavlink: receiver estimate total lost messages 2021-01-31 11:41:56 +01:00
Daniel Agar
cf43d07f70
uavcannode: refactor into separate publishers and subscribers 2021-01-27 20:57:23 -05:00
Daniel Agar
15cbe8c09a px4_work_queue: wq:nav_and_controllers increase stack 1730 -> 1760 bytes 2021-01-26 16:03:37 -05:00
Daniel Agar
e656c9c13f
drivers/uavcannode: Add a simple parameter server (simpler version for merging) (#16649)
* drivers/uavcannode: Add a simple parameter server

Added a simple parameter server using the libuavcan ParamServer class.
The parameter server exposes a selection of PX4 parameters via UAVCAN.
Also, Increased the stack size of the uavcan work queue in order to
prevent a stack overflow.

* uavcannode: fetch all active PX4 parameters

Co-authored-by: Kenneth Thompson <ken@flyvoly.com>
2021-01-26 10:19:20 -08:00
Julien Lecoeur
343cf5603e initial control allocation support
- control allocation module with multirotor, VTOL standard, and tiltrotor support
 - angular_velocity_controller
 - See https://github.com/PX4/PX4-Autopilot/pull/13351 for details

Co-authored-by: Silvan Fuhrer <silvan@auterion.com>
Co-authored-by: Roman Bapst <bapstroman@gmail.com>
2021-01-18 11:25:37 -05:00
Daniel Agar
3abe2e82d1 mpu9250: create dedicated i2c version and delete legacy driver
- update crazyflie and bbblue usage
 - eventually this should be merged with the SPI version after interface
changes are made
2021-01-17 16:11:19 -05:00
Beat Küng
ade3871bee adc: add support for multiple sensor voltage channels 2021-01-15 10:57:20 -05:00
Daniel Agar
98cff94702 px4_work_queue: directly support SITL lockstep
- the purpose is to ensure that every WorkItem (and WorkItems scheduled
by WorkItems) is allowed to run to completion every step
 - per workqueue register a lockstep component whenever a work item is
added (if not already registered)
 - once the work queue is empty unregister component
2021-01-04 09:38:05 +01:00
Julian Oes
862fd1d450 module: remove NuttX only quirk
The behaviour on NuttX and Posix should now be the same anyway.
2020-12-14 09:26:18 +01:00
David Sidrane
8d8a31c56d WorkQueueManager:Increase stack size 2020-12-04 12:59:09 -05:00
David Sidrane
e83a00c604 px4_manifest:Add Queries 2020-12-02 20:40:23 -05:00
David Sidrane
68ab736b16 Refactor mtd to make available to board startup 2020-12-02 20:40:23 -05:00
Daniel Agar
1659447abb px4_work_queue: reduce INS (ekf2) stack by 1200 bytes 2020-11-11 20:17:52 -05:00
David Sidrane
8797823333 px4_init:Split out console init to create null device to be used in non PX4 platform bsp (bootloadres) 2020-10-28 14:25:25 -04:00
Daniel Agar
0f411d6820
Multi-EKF support (ekf2)
- ekf2 can now run in multi-instance mode (currently up to 9 instances)
    - in multi mode all estimates are published to alternate topics (eg estimator_attitude instead of vehicle_attitude)
 - new ekf2 selector runs in multi-instance mode to monitor and compare all instances, selecting a primary (eg N x estimator_attitude => vehicle_attitude)
 - sensors module accel & gyro inconsistency checks are now relative to the mean of all instances, rather than the current primary (when active ekf2 selector is responsible for choosing primary accel & gyro)
 - existing consumers of estimator_status must check estimator_selector_status to select current primary instance status
 - ekf2 single instance mode is still fully supported and the default

Co-authored-by: Paul Riseborough <gncsolns@gmail.com>
2020-10-27 10:56:11 -04:00