qmk/qmk_firmware

[Bug] WS2812 PWM Does Not Work On STM32F042X

Open

#14,129 opened on 2021年8月23日

GitHub で見る
 (0 comments) (0 reactions) (0 assignees)C (43,867 forks)batch import
bughelp wanted

Repository metrics

Stars
 (20,368 stars)
PR merge metrics
 (平均マージ 20d 9h) (30d で 27 merged PRs)

説明

Describe the Bug

When using the PWM driver for the WS2812 LED's does not function (they do not light).

The normal bitbang driver functions as expected

Specific chip : STM32F042F6P7 / TSSOP20

System Information

  • Keyboard: Development breakout board
  • Operating system: Linux
  • ARM GCC version: 11.2.0
  • QMK Firmware version: master
  • Any keyboard related software installed? : NA

Additional Context

I have tested CH2 and 4 on TIM3, below is the configuration when using CH2 (A7)

config.h

#define RGBLIGHT_ANIMATIONS
#define RGB_DI_PIN A7

#define WS2812_PWM_DRIVER PWMD3 
#define WS2812_PWM_CHANNEL 2
#define WS2812_PWM_PAL_MODE 1
#define WS2812_DMA_STREAM STM32_DMA1_STREAM3
#define WS2812_DMA_CHANNEL 3

mcuconf.h

#pragma once

#include_next <mcuconf.h>

#undef STM32_PWM_USE_TIM3
#define STM32_PWM_USE_TIM3 TRUE

#define HAL_USE_PWM TRUE is enabled on halconfig and WS2812_DRIVER is set to pwm in rules.mk

コントリビューターガイド