SmartMatrix without HW drive

Hi Louis.
I am trying to implement FastLED_Functions example for an ESP32 on a homemade RGB-matrix 32x16.
The matrix is built out of WS2812 strips, that are driven by an Arduino accepting Glediator protocol.

So I am using the SmartMatrix3 for creating the matrix in RAM and my own ShowAsGlediator() that sends the pixels on Serial1 with baudrate 1000000.

The problem is, that as soon as I try to send the pixels with Serial1.write() the ESP32 reboots. So I suppose there is a collision with the SmartMatrix hardware (pins or DMA).
I am trying to use pins GPIO13, GPIO14 or GPIO33 for the Serial1 which I believed were available after studying the MatrixHardware_ESP32_V0.h

Is there a way to “disable” or remove the SmartMatrix hardware, so I do not crash with it?

I appreciate the time you are spending on answering all these questions and I hope you will find time for answering mine.

By the way - are you planning to write matrix rotation by degree-units (not only 90, 180, 270) ?

Thank you.

Where in RAM are you reading the pixels? From the Background Layer, or from what’s generated during refresh?

Why are you using SmartMatrix Library vs some other library, maybe just FastLED? Maybe trying FastLED::NeoMatrix?

Is there a way to “disable” or remove the SmartMatrix hardware, so I do not crash with it?

If you don’t need the matrix refreshing to be run, maybe just don’t call matrix.begin().

By the way - are you planning to write matrix rotation by degree-units (not only 90, 180, 270) ?

No, the rotation in multiples of 90 degrees is basically “free” in CPU cycles, arbitrary rotation would be very expensive in CPU and probably wouldn’t look very good.

Hi Louis, thank you so very much for answering.
These are lines of code I am using:

rgb24 *buffer = backgroundLayer.backBuffer();
static const int TX_BUF_SIZE = 1536;  // needed 512 * 3  (NUM_BYTES)

uint8_t *leds1_buffer;

leds1_buffer = (uint8_t*) buffer;   // remaping leds1 so that it is byte addresable
// UART init
const uart_config_t uart_config = {
    .baud_rate = 1000000,
    .data_bits = UART_DATA_8_BITS,
    .parity = UART_PARITY_DISABLE,
    .stop_bits = UART_STOP_BITS_1,
uart_param_config(UART_NUM_1, &uart_config);
// uart_driver_install(uart_port_t uart_num, int rx_buffer_size, int tx_buffer_size, int queue_size, QueueHandle_t* uart_queue, int intr_alloc_flags);
uart_driver_install(UART_NUM_1, RX_BUF_SIZE * 2, TX_BUF_SIZE * 2, 0, NULL, 0);

// writing to UART buffer
long txBytes = uart_write_bytes(UART_NUM_1, (const char *) leds1_buffer, TX_BUF_SIZE);

So the answer I guess is from the Background Layer.

I am using SmartMatrix Library only because I want to run some existing fancy examples, that I find on the net without modifying the code too much. Also I like the layer technik that is used in SmartMatrix and the text scrolling.

I am still investigating from where the crashes come that initiate the reboot.

For the arbitrary rotation:
I am trying to achieve something like text scroll rotation like the one implemented in Glediator application. My hope is that by using the simplified sin cos math in FastLED, I will be able to rotate the 32x16 matrix fast enough to make it with 30 frames per sec. I was asking if rotation was in your pipeline, because I hate the situation, when I am half way in something, that is solved already :slight_smile:

I recommend checking out @marcmerlin’s demos ported to his FastLED::NeoMatrix driver, which I think is more what you need without the complexity of SmartMatrix Library: