Skip to content

Commit

Permalink
fmu-v5: add dshot support
Browse files Browse the repository at this point in the history
But only on the first 4 FMU outputs, as the next ones conflict with px4io
serial dma (UART8_RX)

RX DMA is disabled on the GPS port as well (conflicts with TIM1).
  • Loading branch information
bkueng committed Sep 24, 2019
1 parent da63c2f commit 4ffbe0c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions boards/px4/fmu-v5/default.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ px4_add_board(
camera_trigger
differential_pressure # all available differential pressure drivers
distance_sensor # all available distance sensor drivers
dshot
gps
#heater
imu/adis16448
Expand Down
1 change: 0 additions & 1 deletion boards/px4/fmu-v5/nuttx-config/nsh/defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,6 @@ CONFIG_UART8_RXDMA=y
CONFIG_UART8_TXBUFSIZE=1500
CONFIG_USART1_BAUD=57600
CONFIG_USART1_RXBUFSIZE=600
CONFIG_USART1_RXDMA=y
CONFIG_USART1_TXBUFSIZE=1500
CONFIG_USART2_BAUD=57600
CONFIG_USART2_IFLOWCONTROL=y
Expand Down
2 changes: 2 additions & 0 deletions boards/px4/fmu-v5/src/board_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -671,6 +671,8 @@

#define BOARD_ENABLE_CONSOLE_BUFFER

#define BOARD_DSHOT_MOTOR_ASSIGNMENT {3, 2, 1, 0, 4, 5, 6, 7};

__BEGIN_DECLS

/****************************************************************************************************
Expand Down
8 changes: 7 additions & 1 deletion boards/px4/fmu-v5/src/timer_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,13 @@ __EXPORT const io_timers_t io_timers[MAX_IO_TIMERS] = {
.last_channel_index = 3,
.handler = io_timer_handler0,
.vectorno = STM32_IRQ_TIM1CC,

.dshot = {
.dma_base = DSHOT_DMA2_BASE,
.channel = DShot_Channel6,
.stream = DShot_Stream5,
.start_ccr_register = TIM_DMABASE_CCR1,
.channels_number = 4u /* CCR1, CCR2, CCR3 and CCR4 */
}
},
{
.base = STM32_TIM4_BASE,
Expand Down

0 comments on commit 4ffbe0c

Please sign in to comment.