795 Commits

Author SHA1 Message Date
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
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
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
Jacob Dahl
b891961a0c make upload: fix usb path wildcard 2024-11-19 23:02:12 -05: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
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
David Sidrane
c60b1d1a5f board_hw_rev_ver: Support EEPROM-only HW IDs 2024-08-19 11:05:50 -04:00
Niklas Hauser
07734c243f mtd: Initialized the RAMTRON speed with 30MHz 2024-08-19 11:05:50 -04:00
Alexis Guijarro
0481c04b2b Nuttx with backport (stm32h7x3x): Add External Power Supply option 2024-08-19 09:22:17 -04:00
Julian Oes
2d99ae18ad
stm32h7: Reset USART clock selection (#23498)
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-07 11:41:50 -04:00
Thomas Frans
3157a4e171
gnss: update supported baud rates (#23415)
* gnss: update supported baud rates

The Septentrio GNSS driver requires certain baud rates to test all the
supported baud rates of the receiver. Without these changes, certain
"non-standard" ones would print an error to the MAVLink console when the
driver was started through the console.

* platforms: add missing baudrate defines

---------

Co-authored-by: Thomas Frans <franske2000@gmail.com>
Co-authored-by: Julian Oes <julian@oes.ch>
2024-08-07 10:46:18 +12:00
Matthias Grob
f2bca92221 Fix duplicate newlines at the end of files 2024-07-19 14:33:36 +02:00
Matthias Grob
7f14110bb1 Fix missing newlines at the end of files 2024-07-19 14:33:36 +02:00
Peter van der Perk
6bd81f38a6
imxrt dshot timing fix (#23365)
* imxrt: Change PLL settings for more accurate dshot timing
* Update NuttX submodule
2024-07-08 12:57:15 -04:00
Peter van der Perk
58f7c3e9c9
NuttX with imxrt1170 soc vdd backport (#23333) 2024-06-27 16:21:45 -04:00
David Sidrane
e8e8a60ca8 NuttX with backport of stm32h7 No phy 2024-06-24 06:12:12 -04:00
Eric Katzfey
c334e488e4 Changed Serial readAtLeast timeout from microseconds to milliseconds 2024-06-18 18:48:56 -04:00
David Sidrane
636cb57f27 NuttX with Backport Adding stm32h755II 2024-06-17 15:21:30 -04:00
Jacob Dahl
fcb479cd3d
platforms: nuttx: SerialImpl: fix poll timeout and integer underflow (#23248)
* platforms: nuttx: SerialImpl: fix poll timeout

* platforms: posix: SerialImpl: fix poll timeout
2024-06-14 17:43:15 -08:00
Jacob Dahl
2882e5c4e1
platforms: nuttx: SerialImpl: fix hang if baudrate is 0 (#23238) 2024-06-07 22:08:21 -06:00
Peter van der Perk
ff6966da57 imxrt: dshot fix erpm calculation by implementing 3-bit exponent and 9-bit period 2024-05-30 04:56:42 -04:00
Peter van der Perk
5d2fda6172 dshot: bdshot fix esc offline/online checks 2024-05-30 04:56:42 -04:00
Peter van der Perk
0e41f9730f imxrt: dshot improve state machine reduce's no response count 2024-05-30 04:56:42 -04:00
Peter van der Perk
f3ef0d6610 dshot: fix clearing out esc status 2024-05-30 04:56:42 -04:00
Peter van der Perk
b0cb697f71 imxrt: dshot add 1060 support and use channels instead of timers 2024-05-30 04:56:42 -04:00
Peter van der Perk
e2969952d3 drivers: dshot: prepare to extend for bidrectional dshot 2024-05-30 04:56:42 -04:00
Peter van der Perk
2de0af52e8 px4_fmuv6xrt: bidirectional dshot driver 2024-05-30 04:56:42 -04:00
David Sidrane
3beb57aae1 px4_fmu-v6xrt & bootloader:Bootloader enusres that ITCM memory is writable before jump to APP 2024-05-29 11:08:49 -04:00
David Sidrane
d79c5f170b bootloader/common/bl.c:Fixed Wrong vec_base caculation - only effects imxrt 2024-05-29 11:08:49 -04:00
David Sidrane
04e0d3475f nxp/imxrt_common/main:Fix Breakage from a9962dc 2024-05-29 11:08:49 -04:00
Julian Oes
e4fd80b6ef bootloader: remove unused/duplicate defines 2024-05-22 18:18:55 +12:00
Julian Oes
6ebb2b33df bootloader: track ArduPilot protocol
Just so we don't conflict on these commands in the future.
2024-05-22 18:18:55 +12:00
Julian Oes
7c4507b6d6 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-05-22 18:18:55 +12:00
Julian Oes
21e550fdba 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-05-22 18:18:55 +12:00
Jacob Dahl
70304fe715
[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-20 12:35:29 -06:00