153 Commits

Author SHA1 Message Date
Daniel Agar
8067207ea6 px4_work_queue: rename serial port WQs 2022-01-18 14:56:15 -05:00
Beat Küng
590239dedb work_queue: increase rate_ctrl stack size by 150 B
WARN  [load_mon] wq:rate_ctrl low on stack! (172 bytes left)
2021-12-24 20:06:13 -05:00
Daniel Agar
38731662c6 parameters use bitset for mark_unsaved 2021-12-24 14:32:40 -05:00
Beat Küng
bcba3dfe52 control_allocator,angular_velocity_controller: run on rate_ctrl wq 2021-11-23 12:40:22 -05:00
Jani Paalijarvi
02336acd61 Improve SPI bus implementation
Make possible to define chip-select pin for internal SPI.
By defining chip-select pin, it's possible to start specific SPI device only.
This allows to have several same type of sensors on the same bus with different orientation.
2021-11-19 07:47:18 +01:00
Daniel Agar
7b7b7acd36 i2c_spi_buses: respect CONFIG_I2C and CONFIG_SPI
- bmp280, dps310, and ms5611 barometers support boards without I2C
2021-11-15 15:57:33 -05:00
Beat Küng
15daded6b0 refactor output_limit: split output_limit_calc_single into separate function 2021-10-18 18:45:19 -04:00
Jukka Laitinen
3db76d88fe Add crypto key generation functions
Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2021-09-27 17:45:07 +02:00
Jukka Laitinen
4c6779812d Add keystore_put_key interface function for storing keys permanently
Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2021-09-27 17:45:07 +02:00
Jukka Laitinen
fc2668cba1 Add encryption function for the crypto_backend and px4_crypto
Take into use libtomcrypt library to add RSA and some other algorithms
for SW ecnryption use case

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2021-09-27 17:45:07 +02:00
Jukka Laitinen
d36a91ceaf Add generic px4 interface for crypto features
Add common functions, implemented for nuttx, and link to architecture specific libraries

Make a separate library to wrap nuttx random number generator as "os_random".

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2021-09-27 17:45:07 +02:00
Daniel Agar
089c962d92 px4io: moving mixing to FMU side
Using mixers on the IO side had a remote benefit of being able to
override all control surfaces with a radio remote on a fixed wing.
This ended up not being used that much and since the original design
10 years ago (2011) we have been able to convince ourselves that the
overall system stability is at a level where this marginal benefit,
which is not present on multicopters, is not worth the hazzle.

Co-authored-by: Beat Küng <beat-kueng@gmx.net>
Co-authored-by: Daniel Agar <daniel@agar.ca>
2021-09-25 19:15:05 -04:00
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