Commit Graph

20 Commits

Author SHA1 Message Date
Ville Juven 6cb2c176d5 events: Move implementation of events::send() to lib/events
Events have a global, system-wide sequence number, which must be handled
atomically, (fetching and incrementing the sequence AND sending the event
to uORB must be atomic). Currently in FLAT mode, only one instance of this
sequence number exists, so it is OK to have it in px4_platform.

However, in PROTECTED mode px4_platform is instantiated both in kernel-
and user spaces, which makes two instances of this sequence number, which
causes problems in the mavlink event handling logic.

When mavlink receives and handles events, it expects that:
- The sequence numbers arrive in order (seq n is followed by n+1 etc)
- It increments by 1
- There is only one instance of the sequence number

In PROTECTED mode this is violated, as the kernel and user sequence
numbers run freely on their own. This patch fixes the issue by moving
the event backend to the kernel and by providing user access to it via
ioctl.
2023-09-25 09:54:11 +02:00
Zachary Lowell 643eed51cb
Qurt lightweight parameter implementation (#20735) 2022-12-09 09:55:49 -08:00
Zachary Lowell a9989df36c
Qurt uORB SLPI Implementation (#20538)
- allow uORB to be compiled and run on the qurt architecture.
2022-11-08 12:30:36 -05:00
Jukka Laitinen c7aaf52fd4 Double the allocated stack size of 64-bit NuttX built-in modules
Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2022-08-09 08:08:54 +02:00
Jukka Laitinen 0d31aadcc3 src/lib/paramters: Add a new interface library for protected build user side
Implement an interface for protected build to access parameters.

The implementation only does IOCTL calls to the kernel, where the parameters
live.

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2022-03-15 07:52:26 +01:00
Jukka Laitinen 51ceb9a85e Add support for compiling modules into kernel side
Define __KERNEL__ macro during compilation and place the module in separate library

Remove default library linking to m or libc on NuttX. Add these in platform layer instead, since
they are different on kernel and user side

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2022-01-27 12:42:40 -05:00
Daniel Agar 24090b724c cmake: px4_add_module improve unity build dependencies to avoid unnecessary work 2021-11-19 09:13:07 -05:00
Jacob Crabill 5969508fa7
mavlink: cmake generate mavlink headers at build time
- mavlink/mavlink is now directly included as a submodule instead of the generated mavlink/c_library_v2
 - this also switches to mavlink development.xml by default
2021-11-05 23:01:38 -04:00
Daniel Agar be5c5856e7 cmake: px4_add_module always add module to PX4_MODULE_PATHS so that parameters aren't pruned 2021-10-27 23:00:40 -04:00
Daniel Agar 65745a3676 purge broken qurt support and atlflight boards 2021-07-16 08:53:36 -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
Daniel Agar de4f594937 DriverFramework purge
The bulk of this change was tightly coupled and needed to be deleted in one pass. Some of the smaller changes were things that broke as a result of the initial purge and subsequently fixed by further eradicating unnecessary platform differences. Finally, I deleted any dead code I came across in the related files I touched while going through everything.

 - DriverFramework (src/lib/DriverFramework submodule) completely removed
 - added dspal submodule in qurt platform (was brought in via DriverFramework)
 - all df wrapper drivers removed
 - all boards using df wrapper drivers updated to use in tree equivalents
 - unused empty arch/board.h on posix and qurt removed
 - unused IOCTLs removed (pub block, priv, etc)
 - Integrator delete methods only used from df wrapper drivers
 - commander: sensor calibration use "NuttX version" everywhere for now
 - sensors: update to px4_{open, read, close} instead of DevMgr wrapper (adc open for analog differential pressure)
 - battery_status: update to px4_{open, read, close} instead of DevMgr wrapper (adc open for analog differential pressure)
 - cdev cleanup conflicting typedefs and names with actual OS (pollevent_t, etc)
 - load_mon and top remove from linux boards (unused)
 - delete unused PX4_MAIN_FUNCTION
 - delete unused getreg32 macro
 - delete unused SIOCDEVPRIVATE define
 - named each platform tasks consistently
 - posix list_devices and list_topics removed (list_files now shows all virtual files)
2020-01-13 14:07:03 -05:00
Daniel Agar ed6c7cc806 cmake remove unused/broken _no_optimization_for_target 2019-09-15 17:16:38 -04:00
Daniel Agar dc46b6a749 cmake px4_add_module MAIN is always present (required) 2019-09-15 17:16:38 -04:00
Daniel Agar fb7521eb5e cmake px4_base -> px4_parse_function_args 2019-09-15 14:36:38 -04:00
Daniel Agar 78ef8aab2d STACK_MAIN increase default 1024 -> 2048 2019-08-30 19:11:51 -07:00
Daniel Agar b35d048566 cmake enable -Wcast-align and disable per module 2019-03-16 11:47:15 -04: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 3e0a3559a9 cmake use standard mechanisms for settings flags 2018-11-26 14:40:14 -08:00
Daniel Agar 11be2b8873 cmake split px4_base into px4_add_module, px4_add_library, px4_add_common_flags 2018-11-26 14:40:14 -08:00