Vscode pio esp32 compilation error

PACKAGES:

  • framework-arduinoespressif32 @ 3.20011.230801 (2.0.11)
  • tool-esptoolpy @ 1.40501.0 (4.5.1)
  • toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch5
    Converting MultiRowRefreshMapping.ino
    LDF: Library Dependency Finder → Library Dependency Finder (LDF) — PlatformIO latest documentation
    LDF Modes: Finder ~ chain, Compatibility ~ soft
    Found 40 compatible libraries
    Scanning dependencies…
    Dependency Graph
    |-- SmartMatrix @ 4.0.3
    Building in release mode
    Compiling .pio\build\nodemcu-32s\src\MultiRowRefreshMapping.ino.cpp.o

the err msg is :/arduino_lib/SmartMatrix/src/esp32_i2s_parallel.c:129:21: error: 'GPIO_PIN_MUX_REG' undeclared (first use in this function) PIN_FUNC_SELECT(GPIO_PIN_MUX_REG[gpio], PIN_FUNC_GPIO);

arduino_lib/SmartMatrix/src/esp32_i2s_parallel.c:384:69: error: 'ESP_INTR_FLAG_LEVEL1' undeclared (first use in this function); did you mean 'ESP_ERR_FLASH_BASE'?
     esp_intr_alloc(ETS_I2S1_INTR_SOURCE, (int)(ESP_INTR_FLAG_IRAM | ESP_INTR_FLAG_LEVEL1), i2s_isr, NULL, NULL);
                                                                     ^~~~~~~~~~~~~~~~~~~~
                                                                     ESP_ERR_FLASH_BASE

@Louis is aware, smartmatrix is incompatible with the more recent ESP32 hardware definitions. I had to go back in time for things to work, I guess as of now, you’d have to get back 2 years in time for things to be compatible.
It may not be super hard to fix, I just haven’t used my ESP32 setup for over 2 years now.

1 Like

In esp32_i2s_parallel.h file, to add the following header files

#include <sys/types.h>
#include <freertos/FreeRTOS.h>
#include <driver/i2s.h>
#include <rom/lldesc.h>
#include <rom/gpio.h>

Borrowing from ESP32 HUB75 LED MATRIX library.

1 Like

Thanks @xuniuer99
@Louis looks like an easy fix for you add this problem from the last 2 years?