Driving WS2812 and WS2812B LEDs from an STM32 does not require carefully timed bit-banging. SPI can generate the waveform for you, as long as each LED bit is expanded into a short SPI bit pattern. This post explains the timing math and the full reasoning, but builds toward the practical result: use an 8-bit encoding, send the data in GRB order, and run SPI somewhere around 3 to 6 Mb/s.