arduino-CAN icon indicating copy to clipboard operation
arduino-CAN copied to clipboard

Error compiling with Adafruit Feather v2: `esp_intr.h: No such file or directory`

Open midgarth opened this issue 1 year ago • 2 comments

When trying to use Examples on an Adafruit ESP32 Feather V2 with tag 0.3.1 getting following error:

/Arduino/libraries/CAN/src/ESP32SJA1000.cpp:6:10: fatal error: esp_intr.h: No such file or directory
    6 | #include "esp_intr.h"
      |          ^~~~~~~~~~~~
compilation terminated.
exit status 1

Attempted to update the ESP32SJA1000.cpp to use esp_intr_alloc.h. as mentioned this issue : https://github.com/sandeepmistry/arduino-CAN/issues/138

When doing so get the following errors:

/Arduino/libraries/CAN/src/ESP32SJA1000.cpp: In member function 'virtual int ESP32SJA1000Class::begin(long int)':
/Arduino/libraries/CAN/src/ESP32SJA1000.cpp:61:3: error: 'gpio_matrix_in' was not declared in this scope
   61 |   gpio_matrix_in(_rxPin, CAN_RX_IDX, 0);
      |   ^~~~~~~~~~~~~~
/Arduino/libraries/CAN/src/ESP32SJA1000.cpp:62:3: error: 'gpio_pad_select_gpio' was not declared in this scope; did you mean 'esp_rom_gpio_pad_select_gpio'?
   62 |   gpio_pad_select_gpio(_rxPin);
      |   ^~~~~~~~~~~~~~~~~~~~
      |   esp_rom_gpio_pad_select_gpio
/Arduino/libraries/CAN/src/ESP32SJA1000.cpp:66:3: error: 'gpio_matrix_out' was not declared in this scope; did you mean 'gpio_iomux_out'?
   66 |   gpio_matrix_out(_txPin, CAN_TX_IDX, 0, 0);
      |   ^~~~~~~~~~~~~~~
      |   gpio_iomux_out

Board Manager URLs included:

  • https://dl.espressif.com/dl/package_esp32_index.json
  • https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_dev_index.json

I apologize if this is a very basic error/question.

midgarth avatar Jul 22 '24 22:07 midgarth

Go to boards manager and search for ESP32, then go back to an older version, 3.0.3 gave the same problems you've mentioned. Going back to for example 2.0.11 will solve this.

nickskethisnikske avatar Jul 25 '24 18:07 nickskethisnikske

Hello, Kindly try with these changes: #155 These changes might fix the issue.

ZillKhan avatar Mar 21 '25 06:03 ZillKhan