cancel
Showing results for 
Search instead for 
Did you mean: 

Unexpected WS2812B data burst on TIM3 after power-up (before Init)

PP1
Associate II

Hi everyone,

I’m using the WS28XX library by NimaLTD from GitHub:
:backhand_index_pointing_right: https://github.com/nimaltd/ws28xx

Setup:

  • STM32F103

  • TIM3 Channel 4 as PWM output

  • Data pin on PB1

  • 8×8 WS2812B LED matrix

Initialization and pixel updates work perfectly:

WS28XX_Init(&ws, &htim3, 72, TIM_CHANNEL_4, 64);
WS28XX_SetPixel_RGB(&ws, 0, 100, 0, 0);
WS28XX_Update(&ws);

Issue:
Immediately after power-up, some LEDs (LED 41 an 10-12 following) light up before WS28XX_Init() is even called.
On the logic analyzer, I can see a valid WS2812B data burst right after startup,
covering up to LED 40 with "0", followed by a ~100 ms gap,
and only then my actual data frames appear.

 

Once WS28XX_Update() runs, everything looks correct and stable.

Questions:

  • What generates this initial data burst on the PWM pin?

  • Could TIM3 or DMA be triggered automatically during startup?

  • Does CubeMX initialize the PWM channel before main() executes?

  • Has anyone seen similar behaviour with WS2812B + DMA on STM32?

Thanks for any insight!
Paul

2 REPLIES 2
PP1
Associate II

The picture upload failed...
LA.png

AScha.3
Super User

Hi,

> What generates this initial data burst on the PWM pin?

You, or your program.

> Could TIM3 or DMA be triggered automatically during startup?

If there is a command to do this - yes; maybe HAL_xxx_Transmit_DMA , HAL_TIMxxx_Start...

Does CubeMX initialize the PWM channel before main() executes?

init - yes :  MX_TIMxx_Init(); but not start it.

Has anyone seen similar behaviour with WS2812B + DMA on STM32?

Just debug the start/init, check output with scope; then you know, where the unexpected "send" coming from.

>I can see a valid WS2812B data burst right after startup

So its coming from using the WS28xx lib , as TIM or DMA have no native mode to send valid WS pattern.

If you feel a post has answered your question, please click "Accept as Solution".