Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Sponsored by ARK] Bidirectional DShot #23863

Open
wants to merge 23 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
6d1c183
Bidirectional DShot
dakejahl Oct 29, 2024
e7f9e58
f4/f1 support, not supported
dakejahl Oct 29, 2024
1aa216e
fix f1 build target
dakejahl Oct 29, 2024
87d6851
sanity check timer_channel value, fix CCxNP ifdef, debug stuff
dakejahl Nov 15, 2024
ff6430b
removed debug code, added define for H7 HAVE_GTIM_CCXNP
dakejahl Nov 17, 2024
07b7dc8
round robin sampling for less than 4 DMA
dakejahl Nov 18, 2024
6cde017
unlimited esc_status logging
dakejahl Nov 18, 2024
e628db8
dshot: fix formatting
julianoes Nov 18, 2024
3457391
dshot: add define for number of DMA channels to use
julianoes Nov 18, 2024
c3d1c91
ARK: enable 4 DMA channels for DShot on 6X
julianoes Nov 18, 2024
4cf2f24
dshot: publish when all channels are updated
julianoes Nov 18, 2024
fdb94f9
dshot: avoid duplicate publications for bidir and telem
julianoes Nov 19, 2024
ee3f724
boards: add ark fpv and pi6x BOARD_DMA_NUM_DSHOT_CHANNELS
AlexKlimaj Nov 26, 2024
03528b3
dshot: turn off debug build
AlexKlimaj Nov 27, 2024
1009c6e
Merge branch 'main' into dev/bidirectional_dshot_single_timer
AlexKlimaj Dec 18, 2024
334f6ba
Merge branch 'main' into dev/bidirectional_dshot_single_timer
AlexKlimaj Jan 8, 2025
a96549c
Merge branch 'main' into dev/bidirectional_dshot_single_timer
AlexKlimaj Jan 13, 2025
a9468fd
Merge branch 'main' into dev/bidirectional_dshot_single_timer
AlexKlimaj Feb 19, 2025
d4fb2ee
Merge branch 'main' into dev/bidirectional_dshot_single_timer
mrpollo Feb 21, 2025
aa8ed8e
Merge branch 'main' into dev/bidirectional_dshot_single_timer
dakejahl Feb 25, 2025
cd6769b
update imxrt/dshot
dakejahl Feb 25, 2025
40e9190
Merge branch 'main' into dev/bidirectional_dshot_single_timer
AlexKlimaj Feb 26, 2025
9689c2f
Merge branch 'main' into dev/bidirectional_dshot_single_timer
AlexKlimaj Feb 27, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions boards/ark/fmu-v6x/src/board_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,9 @@
/* This board provides a DMA pool and APIs */
#define BOARD_DMA_ALLOC_POOL_SIZE 5120

/* This board has 4 DMA channels available for bidirectional dshot */
#define BOARD_DMA_NUM_DSHOT_CHANNELS 4

/* This board provides the board_on_reset interface */

#define BOARD_HAS_ON_RESET 1
Expand Down
3 changes: 3 additions & 0 deletions boards/ark/fpv/src/board_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,9 @@
/* This board provides a DMA pool and APIs */
#define BOARD_DMA_ALLOC_POOL_SIZE 5120

/* This board has 3 DMA channels available for bidirectional dshot */
#define BOARD_DMA_NUM_DSHOT_CHANNELS 3

/* This board provides the board_on_reset interface */

#define BOARD_HAS_ON_RESET 1
Expand Down
2 changes: 1 addition & 1 deletion boards/ark/fpv/src/timer_config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
constexpr io_timers_t io_timers[MAX_IO_TIMERS] = {
initIOTimer(Timer::Timer5, DMA{DMA::Index1}),
initIOTimer(Timer::Timer8, DMA{DMA::Index1}),
initIOTimer(Timer::Timer4, DMA{DMA::Index1}),
initIOTimer(Timer::Timer4),
};

constexpr timer_io_channels_t timer_io_channels[MAX_TIMER_IO_CHANNELS] = {
Expand Down
3 changes: 3 additions & 0 deletions boards/ark/pi6x/src/board_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,9 @@
/* This board provides a DMA pool and APIs */
#define BOARD_DMA_ALLOC_POOL_SIZE 5120

/* This board has 4 DMA channels available for bidirectional dshot */
#define BOARD_DMA_NUM_DSHOT_CHANNELS 4

/* This board provides the board_on_reset interface */

#define BOARD_HAS_ON_RESET 1
Expand Down
15 changes: 15 additions & 0 deletions platforms/nuttx/src/px4/nxp/imxrt/dshot/dshot.c
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,21 @@ void up_bdshot_erpm(void)
}


int up_bdshot_num_erpm_ready(void)
{
int num_ready = 0;

for (unsigned i = 0; i < DSHOT_TIMERS; ++i) {
// We only check that data has been received, rather than if it's valid.
// This ensures data is published even if one channel has bit errors.
if (bdshot_recv_mask & (1 << i)) {
++num_ready;
}
}

return num_ready;
}


int up_bdshot_get_erpm(uint8_t channel, int *erpm)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,6 @@ __EXPORT int io_timer_free_channel(unsigned channel);
__EXPORT int io_timer_get_channel_mode(unsigned channel);
__EXPORT int io_timer_get_mode_channels(io_timer_channel_mode_t mode);
__EXPORT extern void io_timer_trigger(void);
__EXPORT void io_timer_update_dma_req(uint8_t timer, bool enable);

__EXPORT extern int io_timer_set_dshot_mode(uint8_t timer, unsigned dshot_pwm_rate, uint8_t dma_burst_length);

/**
* Returns the pin configuration for a specific channel, to be used as GPIO output.
Expand Down
Loading
Loading