176 Commits

Author SHA1 Message Date
Daniel Agar
65b1a9648d Tools/HIL/run_nsh_cmd.py: fail if ERROR printed in output 2021-09-01 15:16:00 -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
Jukka Laitinen
523578d2ce Increase stack size of wq:manager and worker threads for 64 bit targets
Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2021-08-24 10:16:27 -04: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
Beat Küng
f88f224fe6 logger: avoid data bursts by distributing slow subscription updates over time
There's an increasing amount of slow logged topics at 1-2Hz, which were all
updated in the same logger iteration, leading to data bursts. For log
streaming this started to exceed uart buffer sizes. By distributing updates
more equal over time those bursts are removed, reducing buffer size
requirements.

Tests showed during steady state a reduction of maximum topic updates per
iteration from 40 down to 17.
Also the SD log buffer fill level is more constant.
2021-08-12 10:09:11 -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
David Sidrane
ced366b74e Add Option NO_HELP for CONSTRAINED_FLASH system 2021-07-30 22:35:02 -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
David Sidrane
f5e5794930 platforms/common:SPI - fix hang on bords supporting BOARD_HAS_BUS_MANIFEST 2021-07-10 11:37:29 +02:00
TSC21
e39e3b3418 events interface: chance uORB 'sequence' to 'event_sequence'
The reason is that sequence is an IDL reserved keyword, which results on failure when parsing with FastRTPSGen.
2021-07-09 13:24:13 +02: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
0d4f481035 Add simple SW implementations for crypto_backend and keystore_backend
Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2021-06-25 08:35:58 +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
Daniel Agar
500c45e798 uORB: Subscription check if uORB::Manager instance is valid
- this is necessary if uORB::Subscription is used with static storage
duration
2021-06-17 08:07:24 +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
echoG
6bc09138c1
Adding BatMon smart battery as a module and refactoring SMBUS based SBS 1.1 spec to a library 2021-06-09 12:17:45 -04:00
Daniel Agar
47b9016f5e I2CSPIDriverBase: print rotation and i2c address if set 2021-06-08 09:27:21 +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
Beat Küng
0a98c5a7f4 Subscription: fix ChangeInstance 2021-04-27 10:29:09 -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
Daniel Agar
385512aead uORB: test multi timestamp requirement only applies per topic instance 2021-03-17 12:35:53 -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
f1f396e338 uORB: PublicationMulti get_instance() advertise if not already advertised
- fixes UAVCANv0 sensor bridge uORB usage, but also a reason thing to do in general
2021-02-26 17:55:30 -05: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
ab0d0fd0be
uORB move to PX4 platform layer 2021-02-17 11:25:56 -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