Commit Graph

1059 Commits

Author SHA1 Message Date
Daniel Agar 1d66f2cf83 posix: HRT hrt_lock() sem_wait try again if error returned 2022-04-12 12:46:29 -04:00
CUAVmengxiao f540335998 spi: get the correct version revision 2022-03-29 17:09:34 -04:00
Jacob Schloss 5ae4cae073
orb_advertise_multi: might return nullptr (#19387) 2022-03-24 07:47:48 +01:00
David Sidrane 1a17e9df4d board_hw_rev_ve:Use 97.50% for ADC ref for "High" detection 2022-03-22 21:15:03 -04:00
David Sidrane ebc8ecdee6 board_hw_rev_ve:ADC returns 32 bits 2022-03-22 21:15:03 -04:00
David Sidrane 1c224be8f6 stm32h7:ADC fix CCr Access 2022-03-22 21:15:03 -04:00
Thomas Debrunner 5b0fc8f507 print_load: Removed unused variable to fix compilation on macos 2022-03-18 10:42:19 +01:00
Jukka Laitinen 4658a627d7 Separate i2c and spi board bus configuration into and own library for protected build target
This info is needed on both kernel and user sides, and is just data.

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2022-03-17 08:01:51 +01:00
Jukka Laitinen 56c6120e83 Use IOCTL for board_read_VBUS_state in NuttX protected builds
Direct gpio read is not possible from user side applications, so use boardctl
interface instead.

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2022-03-17 08:01:51 +01:00
Jukka Laitinen 005095d199 Add gran allocator also to user side in protected build
This is needed for DMA capable memory for fat also in the user side;
the file system doesn't seem to work reliably without.

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2022-03-17 08:01:51 +01:00
Jukka Laitinen c43c71f4af platforms/nuttx/src/px4/common/board_ctrl: Add handlers for vbus & shutdown lockout
Add kernel side ioctls and handlers for vbus state and managing shutdown lockout

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2022-03-17 08:01:51 +01:00
Jukka Laitinen 4a74d266be Initialize cxx static variables also in kernel side
For protected/kernel builds the cxx static initializations
needs to be done also in kernel side, since px4 creates
c++ objects in kernel

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2022-03-17 08:01:51 +01:00
Jukka Laitinen c1a7b8df1d Add a px4 userspace initialization in protected build
The px4_userspace_init function is called from userspace
entrypoint before starting NSH

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2022-03-17 08:01:51 +01:00
wangwwno1 746c16400a Typo Fix: ChangeWorkQeue
Fix the typo of 'WorkItem::ChangeWorkQeue' to 'WorkItem::ChangeWorkQueue'
2022-03-15 13:31:52 -04: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
Daniel Agar 52221b0bb7
vscode: add stlink debug config (#19269)
Co-authored-by: Jacob Crabill <jacob.crabill@gmail.com>
2022-03-01 09:47:22 -05:00
Jukka Laitinen aae0876d82 platforms/rpi: Clean away the removed hrt_elapsed_time_atomic
Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2022-02-25 13:35:14 +01:00
Jukka Laitinen 77f71e61d2 Add a generic hrt driver userspace interface
This adds a nuttx userspace interface for hrt driver, communicating with
the actual px4 hrt driver via BOARDCTL IOCTLs

This is be used when running PX4 in NuttX protected or kernel builds

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2022-02-25 13:35:14 +01:00
Jukka Laitinen 9f049b4dca Inline ts_to_abstime and abstime_to_ts
Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2022-02-25 13:35:14 +01:00
Jukka Laitinen caaa13ddc0 uORB performance updates
Move some logic from Subscriber into uORBManager. This reduces calls from the
modules to the uORB manager, improving performance in protected build.

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2022-02-24 11:50:05 -05:00
Charles Cross f31f3370ef
Add support for Timer15 on H743 boards (#19228)
* Adds Timer15 to stm32_common, if the timer base is defined
* Adds Timer15 logic for DMA and AltFunc config on stm32h7 boards
* Adds TIM15 BDTR->MOE support in stm32_common timer init
* Adds support for TIM15 pwm channels on Matek H743 Slim
2022-02-21 16:52:38 -05:00
David Sidrane c0facec889 cdc_acm_check:Prevent USB disconect on param save
If the hardware support RESET lockout that has nArmed ANDed with VBUS
   vbus_sense may drop during a param save which uses
   BOARD_INDICATE_EXTERNAL_LOCKOUT_STATE to prevent external resets
   while writing the params.  If we are not armed and nARMRED is low
   we are in such a lock out so ignore changes on VBUS_SENSE during this
   time.
2022-02-21 10:56:41 +01:00
Jukka Laitinen dab7b007de Auto-generate a list of kernel-side built-in modules(drivers)
Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2022-02-18 07:58:58 +01:00
Jukka Laitinen 6071b87afc platforms/common/uORB: Separate IOCTLs going through boardctl interface from the original ones
It was a mistake to mix these two together, it is simpler to implement the boardctl interface
for the protected build, if the boardctl ioctls are different

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2022-02-18 07:53:13 +01:00
Jukka Laitinen f0d9f44f45 Add an ioctl handler to launch built-in modules in kernel side
Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2022-02-18 07:53:13 +01:00
Jukka Laitinen db3baf6c26 Add an ioctl interface for userspace to kernel calls
This adds an ioctl interface for NuttX protected build, allowing
system calls from user space to kernel for uORB, HRT and crypto

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2022-02-18 07:53:13 +01:00
David Sidrane 3593cf795d NuttX With DMA/FLASH Backports 2022-02-16 10:09:02 -05:00
David Sidrane d05d7f4154 bl:Clean up formatting 2022-02-16 10:09:02 -05:00
David Sidrane 92590155fc px4_fmu-v6x:Bootloader move to TELEM1 with DMA 2022-02-16 10:09:02 -05:00
Jukka Laitinen 36d440f895 Add IOCTL interface to uORBManager for nuttx protected/kernel build split
When building uORB for NuttX flat build, or for some other target, everything
works as before.

When building uORB for NuttX protected or kernel build, this does the following:
- The kernel side uORB library reigsters a boardctl handler for calls from userspace
  and services the boardctl_ioctls by calling the actual uORB functions
- For user mode binaries, the uORBManager acts as a proxy, making boardctl_ioctl calls to the
  kernel side

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2022-02-14 09:10:49 +01:00
Beat Küng b6607a7b78 battery_status: do not publish if no voltage channel is defined
This is the case for boards with digital readout, like v5x, but still
enable the battery_status module for external analog driver options.

An alternative would be to not run battery_status depending on config.
2022-02-09 16:54:45 -05:00
David Sidrane 0c936e4fd2 serial_passthru:Move CONFIG_xxx to serial_passthru 2022-02-09 13:11:52 -05:00
Daniel Agar be3da5089c uORB: uORBDeviceNode use px4_cache_aligned_alloc 2022-02-08 10:20:50 -05:00
Peter van der Perk 9f97793491 Generate C/C++ header to expose px4board kconfig symbols to the preprocessor 2022-02-02 13:23:21 -05:00
David Sidrane 3fecf8a23c Added ability to launch passthru on u-center traffic 2022-02-01 21:49:29 -05:00
David Sidrane 2761112466 NuttX with CDCACM/OTGID backports
disable otg id
   cdcacm:support c_cflag in the termios structure
   and speed
2022-02-01 21:49:29 -05:00
David Sidrane cb06f82f0f gnss-m9n-f4:Board support clean up
SD is on SPI3 - correct pin mapping
   Fix DMA Mapping for all SPI and RX DMA on U[S]ART RX
   Fix Memory MAP SRAM size
   Removed unused GPIO
   Used proper I2C definitions
   Ensure Watchdog is configured for debugging
   Fixed FLASH param definitions
   Removed unedded SPI init

matek_gnss-m9n-f4:Correct Board ID and Size

Build order SJF

Added Support for F40x
2022-02-01 21:49:29 -05:00
Jukka Laitinen 70872d94c8 Split px4_layer into kernel and userspace parts for nuttx protected build
Split the px4_layer into user and kernel space libraries. Add some stubs for
user-space (e.g. version) where an interface to the kernel needs to be added

Use posix-versions for cpuload.cpp and print_load.cpp for userspace; these link to nuttx internals. This functinality could be built on top of posix (e.g. procfs) interfaces

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2022-01-31 20:26:08 -05:00
Jukka Laitinen 3a6ebe5fc1 NuttX Cmake changes to build combined kernel+userspace image in nuttx protected build
Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2022-01-31 20:26:08 -05:00
Jukka Laitinen 70704ff9d6 platforms/nuttx/src/px4/common/CMakeLists.txt: Link px4_layer to nuttx_mm for gran allocators
Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2022-01-27 12:42:40 -05:00
Jukka Laitinen 4c75f1d505 platforms/nuttx/CMakeLists.txt: fixes to accommodate other linker changes
Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2022-01-27 12:42:40 -05:00
Jukka Laitinen 705171eb53 Fix linking for posix targets
Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2022-01-27 12:42:40 -05:00
Jukka Laitinen e959fcf9d1 bootloader: link stm bootloaders to nuttx_arch for flash functions
Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2022-01-27 12:42:40 -05:00
Jukka Laitinen fe5059b0e8 s32k1xx/led_pwm: link to arch_io_pins
Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2022-01-27 12:42:40 -05:00
Jukka Laitinen 68729e8ec0 nuttx/rpi io_pins: link to drivers_board for timer_io_channels dependency
Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2022-01-27 12:42:40 -05:00
Jukka Laitinen d181fe0cee nuttx/stm io_pins: link to drivers_board for timer_io_channels dependency
Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2022-01-27 12:42:40 -05:00
Jukka Laitinen 76d4b6c7d0 arch_board_reset: link to nuttx_arch / nuttx_karch for up_systemreset dependency
Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2022-01-27 12:42:40 -05:00
Jukka Laitinen 7bb33e65ae Remove px4_work_queue linking to px4_platform
Remove linking to px4_plaform in here; this breaks linking for nuttx protected build

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2022-01-27 12:42:40 -05:00
Jukka Laitinen 98906c224b Don't link px4_platform directly to uORB
Since uORB is split into kernel and userspace parts, it is no longer possible to just
link uORB into px4_platform, which is used in both kernel and user side.

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2022-01-27 12:42:40 -05:00
Jukka Laitinen 54f1e12684 Link arch_spi with drivers_board
Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2022-01-27 12:42:40 -05:00