1316 Commits

Author SHA1 Message Date
Jacob Dahl
8017135965 Update platforms/nuttx/src/bootloader/stm/stm32_common/main.c 2024-11-19 12:19:19 -05:00
alexklimaj
eb76cc6001 stm32 bootloader: use STM32_CPUCLK_FREQUENCY for systick_mhz 2024-11-19 12:19:19 -05:00
Alex Klimaj
510d6a1f70 boards: new ARK FPV FC (#23830)
* add new payload power switch (RC_MAP_PAY_SW)
2024-11-19 12:19:19 -05:00
Julian Oes
fe26cdebc0
stm32h7: Reset USART clock selection (#23498) (#23516)
This resets the USARTs' clock source selection to the default, in case
it has been changed by the bootloader.

This is required if booting from the ArduPilot bootloader which happens
to reset the clock selection to PLL.

Without this fix, UARTs (including the console) is garbled, so
presumably at an invalid baudrate.
2024-08-09 10:25:19 +12:00
Matthias Grob
5216d5c569 SubscriptionInterval: move updated, update, copy function to a cpp file
Saves 17.3 kilobytes of flash 😮
2024-07-15 11:31:52 +02:00
Matthias Grob
920005a235 uORB: SubscriptionInterval fix timestamp wrapping when initializing less than the interval time after boot (#23384)
* SubscriptionInterval: ensure _last_update is never before timer start
2024-07-11 16:36:55 +02:00
Peter van der Perk
50dd011c5e Update NuttX
Backports:
stm32h755II backport
stm32h7: allow Ethernet MAC without PHY
imxrt: imxrt11xx set core clock to 1p15v regardless of ocotp
imxrt: Correctly update PLL, bit has to toggled instead of being set
2024-07-10 22:00:47 -04:00
Peter van der Perk
e00101b771 [BACKPORT] imxrt: Change PLL settings for more accurate dshot timing 2024-07-10 22:00:47 -04:00
David Sidrane
ec2c91fa90 nxp/imxrt_common/main:Fix Breakage from a9962dc 2024-06-07 09:24:40 +12:00
Julian Oes
9dc3f6ea12 bootloader: remove unused/duplicate defines 2024-06-07 09:24:40 +12:00
Julian Oes
0d957e9e87 bootloader: track ArduPilot protocol
Just so we don't conflict on these commands in the future.
2024-06-07 09:24:40 +12:00
Julian Oes
cc83186dcc bootloader: add bootloader version
This adds a new protocol extension which allows to get the bootloader
version.

The bootloader version is different from the bootloader protocol
revision which has stabilized at 5 and is not easy to update unless a
bootloader is actually breaking the protocol. The reason being that both
the Python script as well as the uploader used in QGC will not attempt
to load firmware if they don't know the bootloader version, so it could
basically be considered a "breaking" protocol revision.

Signed-off-by: Julian Oes <julian@oes.ch>
2024-06-07 09:24:40 +12:00
Julian Oes
eb9fd7ec76 tools/bootloader: add force-erase option
If the STM32H7 fails to program or erase a full chunk of 256 bytes, the
ECC check will trigger a busfault when trying to read from it.

To speed up erasing and optimize wear, we read before erasing to check
if it actually needs erasing. That's when a busfault happens and the
erase time outs.

The workaround is to add an option to do a full erase without check.

Credit goes to:
https://github.com/ArduPilot/ardupilot/pull/22090

And the protocol option added to the bootloader is the same as for
ArduPilot, so compatible.

Signed-off-by: Julian Oes <julian@oes.ch>
2024-06-07 09:24:40 +12:00
David Sidrane
f10650e114 [BACKPORT] px4_fmu-v6xrt & bootloader:Bootloader enusres that ITCM memory is writable before jump to APP 2024-06-05 11:15:45 -04:00
David Sidrane
82a259cebe [BACKPORT] bootloader/common/bl.c:Fixed Wrong vec_base caculation - only effects imxrt 2024-06-05 11:15:45 -04:00
David Sidrane
5903a815b7 NuttX with imxrt:lpuart & 1170 MPU Backports
[BACKPORT] imxrt: lpuart singlewire transfer support

   These correctly enables mpu_rest on MPU init if CONFIG_ARM_MPU_RESET
   is defined.
   [BACKPORT] imxrt: 1170 MPU config ensure no lockups can occur
   [BACKPORT] armv{7|8}-{m|r}:MPU fix CONFIG naming to include ARM
2024-06-05 11:15:45 -04:00
David Sidrane
0ca57a5547 NuttX with imxrt_sd-preflight backport 2024-06-05 11:15:45 -04:00
Jacob Dahl
b8e43e1649 [mavlink] Parameter to always start on USB (#22234)
* usb: Added parameter to enable always starting mavlink on USB.

    Refactored cdcacm_init into a module and added a paramter to allow always starting mavlink on
    USB, also added a paramter to choose the mode. The current default behavior is to wait and listen
    for data on USB and auto-detect the protocol (mavlink, nsh, ublox). This results in the mavlink
    stream not starting until something else on the mavlink network sends a packet first. The new
    default behavior is to always start mavlink.

    Added parameters
    MAV_USB_ENABLE -- default 1 (always start mavlink on USB)
    MAV_USE_MODE -- default 3 (onboard)

* added 3 retries for opening serial port in mavlink, removed sleep before sercon

* added DRIVERS_CDCACM_AUTOSTART to ark-v6x default.px4board

* added CONFIG_DRIVERS_CDCACM_AUTOSTART=y to default.px4board for boards with CONFIG_CDCACM in their nsh/defconfig

* format

* remove PGA460 from COMMON_DISTANCE_SENSOR to save flash

* remove LIS2MDL from COMMON_MAGNETOMETER to save flash

* disable CONFIG_DRIVERS_CDCACM_AUTOSTART for fmu-v5 protected.px4board

* moved and renamed parameters, removed mode logic in mavlink

* changed parameter names, added mode none

* remove parameters from mavlink
2024-05-29 11:23:16 -04:00
Eric Katzfey
2dccd6cacb
Voxl ESC driver update (#23022)
* Made Serial API open the UART in NON BLOCKING mode
* Updated voxl_esc driver to latest from ModalAI fork
* Ported voxl_esc driver over to new Serial UART API
* Removed voxl_esc serial abstraction since new Serial API is already a serial abstraction
2024-04-17 15:09:35 -04:00
alexklimaj
528ad1e87d boards: ARK Pi6X Initial Commit 2024-04-12 14:44:01 -04:00
Peter van der Perk
7bfad2502b Update NuttX 2024-04-10 11:04:07 -04:00
David Sidrane
a73df4752f px4_fmu-v6x:Add Holybro Pixhawk Jetson Baseboard ver 0x100 2024-04-09 11:27:29 -04:00
Eric Katzfey
0a867b5d1d
Serial: removed the validateBaudrate function from nuttx and posix platforms and just send out a warning it baudrate is non-standard (#22969)
- Fix some Qurt platform build issues uncovered when changing the posix version of SerialImpl
2024-04-04 12:07:46 -04:00
Eric Katzfey
8e61026511
Port CRSF RC driver to new Serial UART API (#22917)
* Added implementations of Rx Tx swap and single wire for new UART API needed by CRSF driver
* Added inverted mode to Serial interface API
2024-04-01 22:09:13 -04:00
Peter van der Perk
8817f59108 v6x-rt: Split ITCM static and auto-generated functions 2024-04-01 22:05:20 -04:00
Eric Katzfey
71b074b234
Qurt termios decoy (#22954)
* Added decoy termios support to Qurt so that ghst parser in RC library can be used. No termios is actually needed but has to be there for the parser to work
2024-04-01 18:33:37 -04:00
Eric Katzfey
ccdf060393
Additions to the Serial UART API (#22953)
- Added an empty constructor, setPort, and validatePort functions for Serial API
- Changed GPS to not allocate Serial object dynamically
- Moved access check on serial port name into the Serial API
- Improved the Qurt platform validatePort Serial function to implement a more rigorous check. Added safety check
to the setPort Serial function to make sure it isn't called after the port has been already opened.
2024-04-01 12:27:59 -04:00
David Sidrane
3099eac2ba NuttX with pr-h7-serial-logic-error backport 2024-03-27 14:43:08 -04:00
Eric Katzfey
4a553938fb
VOXL2: HRT updates for synchronization with Qurt time (#22881)
- Added offset to Posix hrt time to account for synchronization with Qurt hrt time
- Added new Kconfig to configure synchronization of HRT timestamps on VOXL2
- Moved voxl2 libfc sensor library submodule from muorb module to boards directory
- Added check to make sure hrt_elapsed_time can never be negative
2024-03-22 15:24:51 -04:00
Eric Katzfey
69028f37a9
New platform independent Serial interface (#21723) 2024-03-21 21:00:23 -04:00
Eric Katzfey
82a1aa37db
uORB: fix for uORB communicator, only send most recent data for new subscription (#22893) 2024-03-21 20:54:43 -04:00
Eric Katzfey
5f6dc1c5d0
uORB: SubscriptionBlocking purged the broken attempt to set the mutex protocol in constructor 2024-03-21 20:53:34 -04:00
Eric Katzfey
f4ebfa6130
parameters: support for an optional remote parameter database (#22836)
The voxl2 has a split architecture. PX4 runs on a posix platform and a Qurt platform. The two communicate uorb topics back and forth with the muorb module. But each has it's own parameters database and they need to stay in sync with each other. This PR adds support to keep the 2 parameter databases in sync. The main parameters database running on Linux has file system support while the Qurt one does not. The Linux side is considered the primary and the Qurt side is considered the remote.
2024-03-11 13:52:22 -04:00
Eric Katzfey
57df7e35b2
uORB: make queue size (ORB_QUEUE_LENGTH) completely static (#22815)
Previously uORB queue size was an awkward mix of runtime configurable (at advertise or IOCTL before allocate), but effectively static with all queue size settings (outside of test code) actually coming from the topic declaration (presently ORB_QUEUE_LENGTH in the .msg). This change finally resolves the inconsistency making the queue size fully static.

Additionally there were some corner cases that the muorb and orb communicator implementation were not correctly handling. This PR provides fixes for those issues. Also correctly sets remote queue lengths now based on the topic definitions.

* Made setting of uORB topic queue size in based on topic definition only
* Fixes to the ModalAI muorb implementation
* Removed libfc sensor from format checks
* msg/TransponderReport.msg ORB_QUEUE_LENGTH 8->16 (was set to higher in AdsbConflict.h

---------

Co-authored-by: Eric Katzfey <eric.katzfey@modalai.com>
Co-authored-by: Daniel Agar <daniel@agar.ca>
2024-03-08 16:28:24 -05:00
Niklas Hauser
0186d687b2 Add minimal Skynode RC13 config to the PAB manifest 2024-03-04 13:33:20 -05:00
Peter van der Perk
d28653b605 nuttx: update apps 2024-03-04 13:32:36 -05:00
Eric Katzfey
5ad0e68d8e Fix build error for Qurt platform in pab_manifest.c 2024-02-21 11:54:02 -05:00
Eric Katzfey
f07eeaa776 Added special muorb startup ordering in px4_init for posix platform 2024-02-21 11:52:24 -05:00
David Sidrane
76a2acb222 stm32h7:adc Dynamically set clock prescaler & BOOST
The ADC peripheral can only support up to
   50MHz on rev V silicon and 36MHz on Y silicon.
   The existing driver always used no prescaler
   and kept boost setting at 0.
2024-01-30 18:07:57 -05:00
David Sidrane
85bfba4497 NuttX with h7 adc clock Backports 2024-01-30 18:07:57 -05:00
David Sidrane
150a161efb nxp Support BOARD_HAS_HW_SPLIT_VERSIONING 2024-01-30 11:15:03 -05:00
David Sidrane
84d54c971f PX4:common add PAB manifest
PX4:common add PAB manifest with V5X bases
2024-01-30 11:15:03 -05:00
David Sidrane
46a8eb6335 PX4:Extend manifest types & add CLI query 2024-01-30 11:15:03 -05:00
David Sidrane
dc01c3a08e stm Support BOARD_HAS_HW_SPLIT_VERSIONING 2024-01-30 11:15:03 -05:00
David Sidrane
136e08652f PX4:comon Support BOARD_HAS_HW_SPLIT_VERSIONING 2024-01-30 11:15:03 -05:00
David Sidrane
0df611b115 NuttX with stm32h7:serial make TX DMA busy backport 2024-01-23 11:23:00 -05:00
Eric Katzfey
2b69a3d290
VOXL2 specific drivers, modules, and miscellaneous support files (#22588) 2024-01-18 12:14:17 -05:00
David Sidrane
b556d668f8 RCInput:Add Support for RX-TX SWAP using onewire
A board can optionaly define RC_SERIAL_SWAP_USING_SINGLEWIRE
   If the board is wired board with TX to the input (Swapped) and
   the SoC does not support U[S]ART level RX-TX swapping to allow
   useing onewire to do the swap if and only if:

     RC_SERIAL_SWAP_USING_SINGLEWIRE   is defined
     RC_SERIAL_SWAP_RXTX               is defined
     TIOCSSWAP                         is defined and retuns !OK
     TIOCSSINGLEWIRE                   is defined
2024-01-16 17:09:26 -05:00
David Sidrane
9849abcb63 rt1170:spi_hw_description:Support Validation and HW selection 2024-01-16 17:09:26 -05:00
David Sidrane
d33bb59225 NuttX with multi-PHY backports 2024-01-16 17:09:26 -05:00