1391 Commits

Author SHA1 Message Date
Sindre Meyer Hegre
3be0cb077c
Neural Control Mode (#24366)
* Add tflm to px4 with module

 - Add TensorFlow Lite Micro(TFLM) as a library in px4
 - Make a module that uses neural network inference for control, which uses TFLM for inference
 - Make board config files for PX4 with neural module

* Added neural flight mode

* Add posibility to read of inference times

* Fix comments from review:

- Switch ssh link to https link in submodule
- Remove mc_nn_control from startup

* Add tflm to px4 with module

 - Add TensorFlow Lite Micro(TFLM) as a library in px4
 - Make a module that uses neural network inference for control, which uses TFLM for inference
 - Make board config files for PX4 with neural module

* Added neural flight mode

* Add posibility to read of inference times

* Remove auto start

* Add logging from neural control module

* Fix automatic startup to only be when module is included

* Switch to flight mode registration

* Add docs

* Change min/max/coeff to actual parameters

* add figures to neural network docs

* Switch to e2e network

* Remove toolchain changes and replace with instructions in docs

* Get ready for merge after toolchain upgrade

* switch back to submodule

* Try to figure out cmake

* Get CI working with new toolchain

* Remove fork dependency

* Finalize PR

* fix toolchain inclusion

* Fix ctype_base.h include

* Cleanup includes for TFLM

* Remove redundant std

* Update FW module names in board files

* Fix docs

* Remove cstdlib copy

* Copy header from nuttx

* Prettier, markup, layout

* NeuralControl.msg - update uorb comments to current standard

* Add description to neural topic

* Fix typo

* Typo

* TFLM and Module utitlities

* Neural networks top level

* Update docs

* Add manual control

* Update docs

* Revert the manual control attempt

* Update docs/en/advanced/nn_module_utilities.md

* Add posibility to set trajectory setpoint with manual control

---------

Co-authored-by: Pedro Roque <padr@kth.se>
Co-authored-by: Hamish Willee <hamishwillee@gmail.com>
Co-authored-by: Ramon Roche <mrpollo@gmail.com>
2025-07-25 09:42:12 -08:00
Pedro Roque
6474e5d7c1
feat: configurable board pwm freq from Kconfig (#24787)
* feat: configurable board pwm freq from Kconfig

* feat: add board_pwm_config to submenu

* fix: define sequence correction

* fix: revert Tools/simulation/gz

* fix: track upstream gz

* fix: track upstream mavlink

* feat: adjustable pwm for multiple board types

* feat: add conditional check for CONFIG_ for correct fallback

* add: spacecraft board with correct BOARD_PWM_FREQ supporting 10Hz actuation rate

* fix: set dependencies for submenu arch chips

* fix: keep only upper arch level

* fix: proper checking - still not showing up for board config

* feat: add hidden kconfig for platforms

* Merge Nuttx config into px4board

Allows to expose nuttx into PX4 if needed

* Kconfig: Include nuttx symbols in updateconfig

Only if applicable i.e. defined in the kconfig

* fix: merged config with previously generated boardconfig

* doc: updated code comment

---------

Co-authored-by: Daniel Agar <daniel@agar.ca>
Co-authored-by: Peter van der Perk <peter.vanderperk@nxp.com>
2025-07-23 08:23:13 -07:00
dusan19
8dd14d9aaa
platforms/stm32_common: hrt.c: define timer 1 IRQ properly for H7 platform (#25260) 2025-07-21 09:53:38 -08:00
Jacob Dahl
09ebd21e55 mixer: remove used flag stop_outputs
dshot: fix motor test on CANnode

Also includes fixes for the DShot driver since stop_outputs is removed. The esc info command has been removed because it doesn't work with AM32, can only be used via command line, and complicates the driver
2025-07-11 08:53:52 -06:00
Beat Küng
7594a270f7 tests: remove previous fuzz testing
We now use https://github.com/google/fuzztest (see previous commits).
And the test was also failing to build
(https://github.com/PX4/PX4-Autopilot/actions/workflows/cflite_batch.yml)

This reverts these commits:
- 9eda5b373c1f16ffec585a0e27d55682d5726c0e
- 2cbc99397681ad9b67f69703c5dd65eaea26c154
- be0a5b4b3272fac13716436c06ff435d157965b4
2025-07-11 10:39:28 +02:00
Beat Küng
d31f227f15 tests: add mavlink fuzz test
Based on the previous fuzz tests in main_fuzztesting.cpp
2025-07-11 10:39:28 +02:00
Beat Küng
fd2ded08e4 pxh: do not use variable sized array on the stack
This is a compiler-specific extension
2025-07-11 10:39:28 +02:00
Beat Küng
3d1cace7b7 test: add google fuzztest to unit test build
From https://github.com/google/fuzztest.
This will now also add gtest (via cmake FetchContent)

And requires newer cmake (container updates):
CMake 3.19 or higher is required.  You are running version 3.16.3
2025-07-11 10:39:28 +02:00
Jacob Dahl
bb423bc007
dshot: fix bidirectional dshot stream sharing (#24996)
Freeing the DMA stream in the hrt callback causes other peripherals on that DMA controller to lock up (namely GPS). Moving the free back into thread context, right before allocation, solves the problem
2025-06-10 00:36:45 -08:00
Jacob Dahl
6e7638c14b
dshot: fix scaling (#25001) 2025-06-10 00:26:17 -08:00
Jacob Dahl
64989c3b8d
dshot: add perf counter for hrt callback (15us avg) (#24976) 2025-06-05 14:45:28 -08:00
Peter van der Perk
b8fa208bb5 Update NuttX
Fixes RT117X OCRAM M7 memory freeze
2025-06-05 06:03:59 -07:00
lgf
b7f07a1ff7 manifest: Add AmovLab ICF6
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2025-05-29 13:06:19 -07:00
Peter van der Perk
1656278b5e Update NuttX 2025-05-29 05:15:18 -04:00
Julian Oes
3c39095271
[Sponsored by Holybro] Support for Kakute H743-Wing (#24669)
* hrt: Fix PPM input on channel 2

The CCMR1_PPM define for PPM input on channel 2 was incorrectly set to 2,
which was setting bits for channel 1 instead of channel 2. This prevented
PPM input from functioning properly on channel 2.

Changed CCMR1_PPM for channel 2 from 2 to (1 << 8), which correctly
configures the CC2S bits for input capture mode on TI2.

This fixes an issue noted in the existing code comment:
"FIXME! There is an interaction in the CCMR registers that prevents
using Chan 1 as the timer and chan 2 as the PPM"

Tested on STM32H743 with PPM input on PC7 (TIM8_CH2).

* rc_input: enable sharing serial and PPM pin

By setting RC_SERIAL_PORT_SHARED_PPM_PIN_GPIO_RX it is now possible to
use the same pin on the STM32 for PPM input as well as serial input.

* boards: Add support for Holybro KakuteH7-Wing
2025-05-04 14:44:11 -08:00
Daniel Agar
45bdf20481 lockstep_scheduler: bump cmake minimum to 3.5 2025-04-30 18:12:33 -04:00
Alexander Lerach
905b6ac0ba Use ITCM on v5x 2025-04-17 04:48:37 -04:00
Niklas Hauser
154623500e
boards: Add Auterion FMUv6s target 2025-04-15 22:31:37 -04:00
Julian Oes
43f5a713db
stm32_common: add timer 12 (#24680) 2025-04-15 16:10:11 +12:00
Beat Küng
2d899c624e platforms: update nuttx submodule 2025-04-10 04:30:41 -04:00
Jacob Dahl
7cb7977263
dshot: only use 1 DMA, round robin the channels. Fix esc telemetry. (#24610) 2025-03-27 11:41:38 -06:00
Jacob Dahl
543851db50
[Sponsored by ARK] Bidirectional DShot (#23863)
* Bidirectional DShot

Co-authored-by: Julian Oes <julian@oes.ch>

* f4/f1 support, not supported

* fix f1 build target

* sanity check timer_channel value, fix CCxNP ifdef, debug stuff

* removed debug code, added define for H7 HAVE_GTIM_CCXNP

* round robin sampling for less than 4 DMA

* unlimited esc_status logging

* dshot: fix formatting

* dshot: add define for number of DMA channels to use

This allows individual boards to override the number of DShot channels
and hence avoid round robin capture of the RPM feedback.

* ARK: enable 4 DMA channels for DShot on 6X

* dshot: publish when all channels are updated

This slows down the ESC_STATUS publication in the case of round robin
capture. E.g. for 800 Hz output with one DMA channel, the ESC_STATUS is
now published at 200 Hz.

* dshot: avoid duplicate publications for bidir and telem

Instead of publishing both bidirectional dshot updates as well as
telemetry updates, we now combine the data from both streams, and
publish whenever we get RPM updates, as the latter arrives with higher
rate, e.g. 200 Hz with round robin, or faster otherwise.

When combining the data, we take RPM from bidirectional dshot, and the
rest from telemetry.

When we have only one of the two, either telemetry or bidirectional
dshot, we just publish that one.

* boards: add ark fpv and pi6x BOARD_DMA_NUM_DSHOT_CHANNELS

* dshot: turn off debug build

---------

Co-authored-by: Julian Oes <julian@oes.ch>
Co-authored-by: alexklimaj <alex@arkelectron.com>
2025-03-12 12:55:15 -06:00
Eric Katzfey
5a05444bad
QuRT logging improvements (#24462)
- Made general improvements to the QURT platform message logging so that module name is printed both in mini-dm and on apps side terminal
2025-03-10 18:59:52 -04:00
PavloZMN
5be867da1c
Duplicate empty _node check removed from Subscription.hpp (#23316) (#23317)
* Duplicate empty `_node` check removed from Subscription.hpp (#23316)

* newline

* move uORB gtests to uORB/test

---------

Co-authored-by: Jacob Dahl <dahl.jakejacob@gmail.com>
Co-authored-by: Jacob Dahl <37091262+dakejahl@users.noreply.github.com>
2025-03-07 01:53:30 -09:00
Eric Katzfey
0cb7b8b525
voxl2: Changed from old CONFIG_BOARD_ROOTFSDIR to new CONFIG_BOARD_ROOT_PATH in Posix builds (#24392) 2025-02-25 21:54:43 -05:00
Jacob Dahl
73b51242c8 nuttx: h7: eth: add checks for PHYID in stm32_phyinit
arch: stm32h7: Add support for dual bank flash memory
2025-02-22 08:46:12 -05:00
Silvan
b7b6d45e18 lib: remove bezier
Signed-off-by: Silvan <silvan@auterion.com>
2025-02-18 14:33:16 +01:00
Peter van der Perk
64d8f9a3c6 cmake: for vscode launch fallback to gdb-multiarch
Newer toolchains don't ship with arm-none-eabi-gdb hence we should use gdb-multiarch instead
2025-02-03 23:12:30 -05:00
Matthias Grob
50092a7f67 NuttX: update submodule to branch px4_firmware_nuttx-10.3.0+ with "FlexSPI allow RWW" merged 2025-01-14 10:32:00 +01:00
Peter van der Perk
e9536cb30b
Tropic-community use flash as storage using LittleFS (#24158)
* Update NuttX
2025-01-08 21:35:08 -05:00
Matthias Grob
077ade4f8f Add IO timer channel mode for RPM and also sync up rpi configuration to work with all these drivers 2024-12-19 07:30:25 +01:00
Matthias Grob
b8c2805263 spi: Suppress null pointer warning
Depending on defines px4_spi_buses can be NULL
but often it's not and in those cases the
compiler correctly warns about it.
2024-11-20 22:36:23 -05:00
Daniel Agar
ada2bb4c42 uORB_tests: relax latency threshold on non-realtime SITL 2024-11-20 14:10:39 -05:00
Jacob Dahl
b891961a0c make upload: fix usb path wildcard 2024-11-19 23:02:12 -05:00
Niklas Hauser
0879f67cc3 manifest: Add Skynode S baseboard 2024-11-12 13:32:33 +01:00
Peter van der Perk
5d29c7811b imxrt: tone_alarm: Add FlexPWM based Tone alarm driver 2024-11-06 17:28:35 -05:00
Peter van der Perk
a7e4000861 rgbled_pwm: Change linker so we can make board specific override for led functionality 2024-11-06 17:28:35 -05:00
Peter van der Perk
c6e86fdea0 Add Tropic teensy loader upload support 2024-11-06 17:28:35 -05:00
Jacob Dahl
87b52ae6ee Update platforms/nuttx/src/bootloader/stm/stm32_common/main.c 2024-11-05 06:59:47 -05:00
alexklimaj
7768dfda35 stm32 bootloader: use STM32_CPUCLK_FREQUENCY for systick_mhz 2024-11-05 06:59:47 -05:00
Alex Klimaj
4d1c65d722
boards: new ARK FPV FC (#23830)
* add new payload power switch (RC_MAP_PAY_SW)
2024-10-30 11:35:35 -04:00
Alexander Lerach
3b1d7e20da
Updated NuttX ref to include littlefs fix (#23828) 2024-10-18 17:07:02 +02:00
Julian Oes
e3dd050c91 bootloader: robustify uploader detection
The bootloader can often get stuck parsing random MAVLink traffic,
thinking it had seen a GET_SYNC.

Therefore, this commits adds a two step check which requires a GET_SYNC
followed by a GET_DEVICE to make sure it's really an uploader script
talking to it, and not just random data.
2024-10-14 06:35:55 -04:00
Jacob Dahl
ba75b9c35e
platforms/nuttx: Serial change fsync to tcdrain
Calling serial::write() in quick succession was blowing away the previous buffer, fsync does not guarantee that data is transmitted on serial lines. On the other hand tcdrain waits until the output buffer is empty.
2024-09-25 12:18:05 -04:00
caijie
11d370823b NuttX with mtd:ramtron MB85RS256B address length is 2 backport 2024-09-20 06:16:34 -04:00
BazookaJoe1900
4d83badba1
fix files tags on the header comments (#23564) 2024-09-19 09:25:18 +03:00
Silvan Fuhrer
8bfd3b0f62
platforms/nuttx/init/stm32f7: rc.board_arch_defaults reduce LOGGER_BUF to 40
To get some breathing space on setups with memory-intensive components (e.g. UAVCAN).

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2024-08-26 13:13:11 -04:00
David Sidrane
cf941b18df Nuttx with stm32h7: STM32H7X5XX selects hardware files backport 2024-08-23 05:12:28 -04:00
jfbblue0922
13c413622b Nuttx with stm32h7: STM32H7X5XX selects hardware files backport 2024-08-23 04:48:20 -04:00
ZeroOne-Aero
02ed1162ed
Update pab_manifest.c (#23594)
* Update pab_manifest.c

I have rebased on main and squash my commits into 1.

* Update pab_manifest.c

I have updated pab_manifest.c:
// BASE ID 0x150 ZeroOne Pixhawk Baseboard Alaised to ID 0
{HW_BASE_ID(0x150), base_configuration_0, arraySize(base_configuration_0)}, // ZeroOne Pixhawk Baseboard ver 0x150
2024-08-22 04:02:02 -04:00