Skip to content

Conversation

@gemenerik
Copy link
Member

CF21BL uses DSHOT for brushless motors, which requires DMA1_Stream6. UART2 TX also needs DMA1_Stream6, creating a conflict, becoming apparent when trying to flash the ESP32 on the AI-deck.

Changes:

  • Guard uart2DmaInit() with #ifndef CONFIG_MOTORS_ESC_PROTOCOL_DSHOT
  • Guard initialDMACount variable (only used with DMA)
  • Add fallback in uart2SendDataDmaBlocking() to use interrupt-based uart2SendData() instead when DSHOT is enabled

This allows UART2 (and thus ESP32 flashing) to work on CF21BL by avoiding the DMA conflict entirely - UART2 uses interrupts instead of DMA when motors need the stream.

Fixes bitcraze/crazyflie-lib-python#550

@gemenerik gemenerik requested a review from tobbeanton October 6, 2025 14:42
@gemenerik gemenerik self-assigned this Oct 6, 2025
CF21BL uses DSHOT for brushless motors, which requires DMA1_Stream6.
UART2 TX also needs DMA1_Stream6, creating a conflict during ESP32 flashing.

Changes:
- Guard uart2DmaInit() with #ifndef CONFIG_MOTORS_ESC_PROTOCOL_DSHOT
- Guard initialDMACount variable (only used with DMA)
- Add fallback in uart2SendDataDmaBlocking() to use interrupt-based
  uart2SendData() instead when DSHOT is enabled

This allows UART2 (and thus ESP32 flashing) to work on CF21BL by avoiding the DMA conflict
entirely - UART2 uses interrupts instead of DMA when motors need the stream.
@gemenerik gemenerik force-pushed the rik/cf21bl-uart2-dma-stream6-conflict-fix branch from 82940b9 to 01b08b2 Compare October 6, 2025 14:49
@tobbeanton tobbeanton merged commit 189fa18 into master Oct 8, 2025
25 checks passed
@tobbeanton tobbeanton deleted the rik/cf21bl-uart2-dma-stream6-conflict-fix branch October 8, 2025 12:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ESP32 OTA flashing issue with AI‑deck on Brushless platform

3 participants