Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Solved: Fatal Error: esp_intr.h: No such file or directory #146

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
onlyvinod56 opened this issue Aug 23, 2024 · 8 comments
Open

Solved: Fatal Error: esp_intr.h: No such file or directory #146

onlyvinod56 opened this issue Aug 23, 2024 · 8 comments

Comments

@onlyvinod56
Copy link

Use ESP32 board ver 2.0.11 in board manager.
(Espressif Systems)

espressif

@bluecraank
Copy link

Same, help pls

@Merange
Copy link

Merange commented Sep 25, 2024

It seems to be a bug in V3
I came back to the latest V2 V2.0.17 and it works fine

@avlasic
Copy link

avlasic commented Sep 27, 2024

#150 pull request should fix this problem in v3

@JayMcAnser
Copy link

@drnet-at
Copy link

drnet-at commented Nov 10, 2024

Replace

#include "esp_intr.h"

with

#include "rom/gpio.h"

In src/ESP32SJA1000.cpp to get it running

@BWV999-MTL
Copy link

Hi all, i tried the CANSender.ino sketch. my setup is esp32-S3 dev module. the fix mentionned above compiles for a DOIT ESP32 DEVKIT V1, but i get the following errors for esp32-S3 dev module :

In file included from C:\Users\Public\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.3-cfea4f7c-v1\esp32s3/include/soc/esp32s3/include/soc/dport_reg.h:21,
from C:\Users\Public\Arduino15\libraries\CAN\src\ESP32SJA1000.cpp:8:
C:\Users\Public\Arduino15\libraries\CAN\src\ESP32SJA1000.cpp: In member function 'virtual int ESP32SJA1000Class::begin(long int)':
C:\Users\Public\Arduino15\libraries\CAN\src\ESP32SJA1000.cpp:57:29: error: 'DPORT_PERIP_RST_EN_REG' was not declared in this scope; did you mean 'SYSTEM_PERIP_RST_EN1_REG'?
57 | DPORT_CLEAR_PERI_REG_MASK(DPORT_PERIP_RST_EN_REG, DPORT_CAN_RST);
| ^~~~~~~~~~~~~~~~~~~~~~
C:\Users\Public\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.3-cfea4f7c-v1\esp32s3/include/soc/esp32s3/include/soc/dport_access.h:77:67: note: in definition of macro '_DPORT_WRITE_PERI_REG'
77 | #define _DPORT_WRITE_PERI_REG(addr, val) (*((volatile uint32_t )(addr))) = (uint32_t)(val)
| ^~~~
C:\Users\Public\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.3-cfea4f7c-v1\esp32s3/include/soc/esp32s3/include/soc/dport_access.h:87:46: note: in expansion of macro 'DPORT_WRITE_PERI_REG'
87 | #define DPORT_CLEAR_PERI_REG_MASK(reg, mask) DPORT_WRITE_PERI_REG((reg), (DPORT_READ_PERI_REG(reg)&(~(mask))))
| ^~~~~~~~~~~~~~~~~~~~
C:\Users\Public\Arduino15\libraries\CAN\src\ESP32SJA1000.cpp:57:3: note: in expansion of macro 'DPORT_CLEAR_PERI_REG_MASK'
57 | DPORT_CLEAR_PERI_REG_MASK(DPORT_PERIP_RST_EN_REG, DPORT_CAN_RST);
| ^~~~~~~~~~~~~~~~~~~~~~~~~
C:\Users\Public\Arduino15\libraries\CAN\src\ESP32SJA1000.cpp:57:53: error: 'DPORT_CAN_RST' was not declared in this scope
57 | DPORT_CLEAR_PERI_REG_MASK(DPORT_PERIP_RST_EN_REG, DPORT_CAN_RST);
| ^~~~~~~~~~~~~
C:\Users\Public\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.3-cfea4f7c-v1\esp32s3/include/soc/esp32s3/include/soc/dport_access.h:77:88: note: in definition of macro '_DPORT_WRITE_PERI_REG'
77 | #define _DPORT_WRITE_PERI_REG(addr, val) (
((volatile uint32_t )(addr))) = (uint32_t)(val)
| ^~~
C:\Users\Public\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.3-cfea4f7c-v1\esp32s3/include/soc/esp32s3/include/soc/dport_access.h:87:46: note: in expansion of macro 'DPORT_WRITE_PERI_REG'
87 | #define DPORT_CLEAR_PERI_REG_MASK(reg, mask) DPORT_WRITE_PERI_REG((reg), (DPORT_READ_PERI_REG(reg)&(~(mask))))
| ^~~~~~~~~~~~~~~~~~~~
C:\Users\Public\Arduino15\libraries\CAN\src\ESP32SJA1000.cpp:57:3: note: in expansion of macro 'DPORT_CLEAR_PERI_REG_MASK'
57 | DPORT_CLEAR_PERI_REG_MASK(DPORT_PERIP_RST_EN_REG, DPORT_CAN_RST);
| ^~~~~~~~~~~~~~~~~~~~~~~~~
C:\Users\Public\Arduino15\libraries\CAN\src\ESP32SJA1000.cpp:58:27: error: 'DPORT_PERIP_CLK_EN_REG' was not declared in this scope; did you mean 'SYSTEM_PERIP_CLK_EN1_REG'?
58 | DPORT_SET_PERI_REG_MASK(DPORT_PERIP_CLK_EN_REG, DPORT_CAN_CLK_EN);
| ^~~~~~~~~~~~~~~~~~~~~~
C:\Users\Public\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.3-cfea4f7c-v1\esp32s3/include/soc/esp32s3/include/soc/dport_access.h:77:67: note: in definition of macro '_DPORT_WRITE_PERI_REG'
77 | #define _DPORT_WRITE_PERI_REG(addr, val) (
((volatile uint32_t )(addr))) = (uint32_t)(val)
| ^~~~
C:\Users\Public\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.3-cfea4f7c-v1\esp32s3/include/soc/esp32s3/include/soc/dport_access.h:90:46: note: in expansion of macro 'DPORT_WRITE_PERI_REG'
90 | #define DPORT_SET_PERI_REG_MASK(reg, mask) DPORT_WRITE_PERI_REG((reg), (DPORT_READ_PERI_REG(reg)|(mask)))
| ^~~~~~~~~~~~~~~~~~~~
C:\Users\Public\Arduino15\libraries\CAN\src\ESP32SJA1000.cpp:58:3: note: in expansion of macro 'DPORT_SET_PERI_REG_MASK'
58 | DPORT_SET_PERI_REG_MASK(DPORT_PERIP_CLK_EN_REG, DPORT_CAN_CLK_EN);
| ^~~~~~~~~~~~~~~~~~~~~~~
C:\Users\Public\Arduino15\libraries\CAN\src\ESP32SJA1000.cpp:58:51: error: 'DPORT_CAN_CLK_EN' was not declared in this scope
58 | DPORT_SET_PERI_REG_MASK(DPORT_PERIP_CLK_EN_REG, DPORT_CAN_CLK_EN);
| ^~~~~~~~~~~~~~~~
C:\Users\Public\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.3-cfea4f7c-v1\esp32s3/include/soc/esp32s3/include/soc/dport_access.h:77:88: note: in definition of macro '_DPORT_WRITE_PERI_REG'
77 | #define _DPORT_WRITE_PERI_REG(addr, val) (
((volatile uint32_t )(addr))) = (uint32_t)(val)
| ^~~
C:\Users\Public\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.3-cfea4f7c-v1\esp32s3/include/soc/esp32s3/include/soc/dport_access.h:90:46: note: in expansion of macro 'DPORT_WRITE_PERI_REG'
90 | #define DPORT_SET_PERI_REG_MASK(reg, mask) DPORT_WRITE_PERI_REG((reg), (DPORT_READ_PERI_REG(reg)|(mask)))
| ^~~~~~~~~~~~~~~~~~~~
C:\Users\Public\Arduino15\libraries\CAN\src\ESP32SJA1000.cpp:58:3: note: in expansion of macro 'DPORT_SET_PERI_REG_MASK'
58 | DPORT_SET_PERI_REG_MASK(DPORT_PERIP_CLK_EN_REG, DPORT_CAN_CLK_EN);
| ^~~~~~~~~~~~~~~~~~~~~~~
C:\Users\Public\Arduino15\libraries\CAN\src\ESP32SJA1000.cpp:62:26: error: 'CAN_RX_IDX' was not declared in this scope; did you mean 'TWAI_RX_IDX'?
62 | gpio_matrix_in(_rxPin, CAN_RX_IDX, 0);
| ^~~~~~~~~~
| TWAI_RX_IDX
C:\Users\Public\Arduino15\libraries\CAN\src\ESP32SJA1000.cpp:67:27: error: 'CAN_TX_IDX' was not declared in this scope; did you mean 'TWAI_TX_IDX'?
67 | gpio_matrix_out(_txPin, CAN_TX_IDX, 0, 0);
| ^~~~~~~~~~
| TWAI_TX_IDX
C:\Users\Public\Arduino15\libraries\CAN\src\ESP32SJA1000.cpp: In member function 'virtual void ESP32SJA1000Class::end()':
C:\Users\Public\Arduino15\libraries\CAN\src\ESP32SJA1000.cpp:172:27: error: 'DPORT_PERIP_RST_EN_REG' was not declared in this scope; did you mean 'SYSTEM_PERIP_RST_EN1_REG'?
172 | DPORT_SET_PERI_REG_MASK(DPORT_PERIP_RST_EN_REG, DPORT_CAN_RST);
| ^~~~~~~~~~~~~~~~~~~~~~
C:\Users\Public\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.3-cfea4f7c-v1\esp32s3/include/soc/esp32s3/include/soc/dport_access.h:77:67: note: in definition of macro '_DPORT_WRITE_PERI_REG'
77 | #define _DPORT_WRITE_PERI_REG(addr, val) (
((volatile uint32_t )(addr))) = (uint32_t)(val)
| ^~~~
C:\Users\Public\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.3-cfea4f7c-v1\esp32s3/include/soc/esp32s3/include/soc/dport_access.h:90:46: note: in expansion of macro 'DPORT_WRITE_PERI_REG'
90 | #define DPORT_SET_PERI_REG_MASK(reg, mask) DPORT_WRITE_PERI_REG((reg), (DPORT_READ_PERI_REG(reg)|(mask)))
| ^~~~~~~~~~~~~~~~~~~~
C:\Users\Public\Arduino15\libraries\CAN\src\ESP32SJA1000.cpp:172:3: note: in expansion of macro 'DPORT_SET_PERI_REG_MASK'
172 | DPORT_SET_PERI_REG_MASK(DPORT_PERIP_RST_EN_REG, DPORT_CAN_RST);
| ^~~~~~~~~~~~~~~~~~~~~~~
C:\Users\Public\Arduino15\libraries\CAN\src\ESP32SJA1000.cpp:172:51: error: 'DPORT_CAN_RST' was not declared in this scope
172 | DPORT_SET_PERI_REG_MASK(DPORT_PERIP_RST_EN_REG, DPORT_CAN_RST);
| ^~~~~~~~~~~~~
C:\Users\Public\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.3-cfea4f7c-v1\esp32s3/include/soc/esp32s3/include/soc/dport_access.h:77:88: note: in definition of macro '_DPORT_WRITE_PERI_REG'
77 | #define _DPORT_WRITE_PERI_REG(addr, val) (
((volatile uint32_t )(addr))) = (uint32_t)(val)
| ^~~
C:\Users\Public\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.3-cfea4f7c-v1\esp32s3/include/soc/esp32s3/include/soc/dport_access.h:90:46: note: in expansion of macro 'DPORT_WRITE_PERI_REG'
90 | #define DPORT_SET_PERI_REG_MASK(reg, mask) DPORT_WRITE_PERI_REG((reg), (DPORT_READ_PERI_REG(reg)|(mask)))
| ^~~~~~~~~~~~~~~~~~~~
C:\Users\Public\Arduino15\libraries\CAN\src\ESP32SJA1000.cpp:172:3: note: in expansion of macro 'DPORT_SET_PERI_REG_MASK'
172 | DPORT_SET_PERI_REG_MASK(DPORT_PERIP_RST_EN_REG, DPORT_CAN_RST);
| ^~~~~~~~~~~~~~~~~~~~~~~
C:\Users\Public\Arduino15\libraries\CAN\src\ESP32SJA1000.cpp:173:29: error: 'DPORT_PERIP_CLK_EN_REG' was not declared in this scope; did you mean 'SYSTEM_PERIP_CLK_EN1_REG'?
173 | DPORT_CLEAR_PERI_REG_MASK(DPORT_PERIP_CLK_EN_REG, DPORT_CAN_CLK_EN);
| ^~~~~~~~~~~~~~~~~~~~~~
C:\Users\Public\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.3-cfea4f7c-v1\esp32s3/include/soc/esp32s3/include/soc/dport_access.h:77:67: note: in definition of macro '_DPORT_WRITE_PERI_REG'
77 | #define _DPORT_WRITE_PERI_REG(addr, val) (
((volatile uint32_t )(addr))) = (uint32_t)(val)
| ^~~~
C:\Users\Public\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.3-cfea4f7c-v1\esp32s3/include/soc/esp32s3/include/soc/dport_access.h:87:46: note: in expansion of macro 'DPORT_WRITE_PERI_REG'
87 | #define DPORT_CLEAR_PERI_REG_MASK(reg, mask) DPORT_WRITE_PERI_REG((reg), (DPORT_READ_PERI_REG(reg)&(~(mask))))
| ^~~~~~~~~~~~~~~~~~~~
C:\Users\Public\Arduino15\libraries\CAN\src\ESP32SJA1000.cpp:173:3: note: in expansion of macro 'DPORT_CLEAR_PERI_REG_MASK'
173 | DPORT_CLEAR_PERI_REG_MASK(DPORT_PERIP_CLK_EN_REG, DPORT_CAN_CLK_EN);
| ^~~~~~~~~~~~~~~~~~~~~~~~~
C:\Users\Public\Arduino15\libraries\CAN\src\ESP32SJA1000.cpp:173:53: error: 'DPORT_CAN_CLK_EN' was not declared in this scope
173 | DPORT_CLEAR_PERI_REG_MASK(DPORT_PERIP_CLK_EN_REG, DPORT_CAN_CLK_EN);
| ^~~~~~~~~~~~~~~~
C:\Users\Public\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.3-cfea4f7c-v1\esp32s3/include/soc/esp32s3/include/soc/dport_access.h:77:88: note: in definition of macro '_DPORT_WRITE_PERI_REG'
77 | #define _DPORT_WRITE_PERI_REG(addr, val) (
((volatile uint32_t )(addr))) = (uint32_t)(val)
| ^~~
C:\Users\Public\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.3-cfea4f7c-v1\esp32s3/include/soc/esp32s3/include/soc/dport_access.h:87:46: note: in expansion of macro 'DPORT_WRITE_PERI_REG'
87 | #define DPORT_CLEAR_PERI_REG_MASK(reg, mask) DPORT_WRITE_PERI_REG((reg), (DPORT_READ_PERI_REG(reg)&(~(mask))))
| ^~~~~~~~~~~~~~~~~~~~
C:\Users\Public\Arduino15\libraries\CAN\src\ESP32SJA1000.cpp:173:3: note: in expansion of macro 'DPORT_CLEAR_PERI_REG_MASK'
173 | DPORT_CLEAR_PERI_REG_MASK(DPORT_PERIP_CLK_EN_REG, DPORT_CAN_CLK_EN);
| ^~~~~~~~~~~~~~~~~~~~~~~~~
C:\Users\Public\Arduino15\libraries\CAN\src\ESP32SJA1000.cpp: In member function 'virtual void ESP32SJA1000Class::onReceive(void (
)(int))':
C:\Users\Public\Arduino15\libraries\CAN\src\ESP32SJA1000.cpp:284:20: error: 'ETS_CAN_INTR_SOURCE' was not declared in this scope
284 | esp_intr_alloc(ETS_CAN_INTR_SOURCE, 0, ESP32SJA1000Class::onInterrupt, this, &_intrHandle);
| ^~~~~~~~~~~~~~~~~~~

exit status 1

Compilation error: exit status 1

I replicated the issue on several computers and fresh installs of Arduino IDE 2.3.2. Any ideas?

@drnet-at
Copy link

drnet-at commented Jan 23, 2025

The line

C:\Users\Public\Arduino15\libraries\CAN\src\ESP32SJA1000.cpp:57:29: error: 'DPORT_PERIP_RST_EN_REG' was not declared in this scope; did you mean 'SYSTEM_PERIP_RST_EN1_REG'?

Tells you everything you need to know: The macro DPORT_PERIP_RST_EN_REG is obviously not resolved in your version of the ESP32 for Arduino SDK. You need to either track it down (if it is now in another header file) and include it, or replace it by the macro which is valid for your SDK (if it was renamed).

Just a hail-mary-try: Replace all instances of macros with CAN in them by macros with TWAI replacing it. Or even better redefine the CAN versions from the TWAI versions - the complier will warn you, if you start breaking things.

@BWV999-MTL
Copy link

I had a look a at the technical reference manual for both esp32 and esp32 s3. I might be able to track down registers and migrate them in the library, but i could not find confirmation that the twai controller in the s3 version is still compatible with the SJA1000 as it was in esp 32. I might be in over my head with this. My end goal is to use the Odrive arduino library with an S3 and builtin TWAI (https://github.com/odriverobotics/ODriveArduino). instead of trying to migrate sandeepmistry's arduino-CAN library to esp32 S3, i might have a better chance of succes in implementing a IS_ESP32-S3_BUILTIN Board-specific includes that uses TWAI in Odrives library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants