Can’t say I’ve used raw code to set the cycle counter!
I use this…
void sl_cycle_counter_enable(void)
{
CoreDebug->DEMCR |= CoreDebug_DEMCR_TRCENA_Msk;
ITM->LAR = 0xc5acce55;
DWT->CTRL |= DWT_CTRL_CYCCNTENA_Msk;
}
I shall leave the intricacies of ezWS2812 up to you
I just use SPI for WS2812 on MG2x - seems OK - though haven’t tried using with Arduino code.