2 ws2812b LED Matrix + arduino uno + HT-05

512 LEDs will need to allocate 1536 bytes of ram for buffers at runtime. Your code only has 1485 bytes available.