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

Allow for WS2812 PWM to work on DMAMUX-capable devices #9471

Merged
merged 1 commit into from
Jul 16, 2020

Conversation

tzarc
Copy link
Member

@tzarc tzarc commented Jun 19, 2020

Description

Newer STM32 MCUs have a DMAMUX peripheral, which allows mapping of DMAs to different DMA streams, rather than hard-defining the target streams in silicon.

Affects STM32L4+ devices, as well as the soon-to-be-supported-by-QMK STM32G4/H7 families.

Tested on F303/Proton-C (ChibiOS v19, non-DMAMUX), G474 (ChibiOS v20, with DMAMUX).

Types of Changes

  • Core
  • Bugfix
  • New feature
  • Enhancement/optimization
  • Keyboard (addition or update)
  • Keymap/layout/userspace (addition or update)
  • Documentation

Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • I have tested the changes and verified that they work and don't break anything (as well as I can manage).

@tzarc tzarc requested a review from a team June 19, 2020 04:12
@tzarc tzarc changed the base branch from master to develop June 19, 2020 04:14
@tzarc tzarc force-pushed the ws2812_no_dma_stream_def branch 4 times, most recently from 74e4557 to 19e0fd1 Compare June 19, 2020 09:37
@zvecr
Copy link
Member

zvecr commented Jun 19, 2020

Wont the removal of WS2812_DMA_STREAM stop configuration of TIM1_UP on stm32f4 (dma2, steam 5, channel 6)?

@tzarc
Copy link
Member Author

tzarc commented Jun 20, 2020

Wont the removal of WS2812_DMA_STREAM stop configuration of TIM1_UP on stm32f4 (dma2, steam 5, channel 6)?

Internally, ChibiOS would make it index 14, i.e. you'd need #define WS2812_DMA_CHANNEL 14.
The fun part here is that it's 0-indexed, but for the F3 it's 1-indexed.
As for channel 6 -- in the stm32_registry.h it defines:

#define STM32_DMA2_CH6_NUMBER               69

....which really only maps to the interrupt vector.

Either way, it's clear as mud... so I'm inclined to rollback that portion of this PR.

@tzarc tzarc force-pushed the ws2812_no_dma_stream_def branch 2 times, most recently from a2bb5a7 to 15d74ad Compare June 20, 2020 03:30
@tzarc tzarc force-pushed the ws2812_no_dma_stream_def branch 2 times, most recently from aa62b50 to 53b2897 Compare June 20, 2020 04:42
Copy link
Member

@drashna drashna left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

__attribute__((weak))

nicocesar pushed a commit to nicocesar/qmk_firmware that referenced this pull request Sep 6, 2020
@tzarc tzarc deleted the ws2812_no_dma_stream_def branch September 10, 2020 02:28
drashna pushed a commit to zsa/qmk_firmware that referenced this pull request Sep 30, 2020
kjganz pushed a commit to kjganz/qmk_firmware that referenced this pull request Oct 28, 2020
BorisTestov pushed a commit to BorisTestov/qmk_firmware that referenced this pull request May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants