pierremolinaro / acan-esp32

An ESP32 CAN 2.0B library
MIT License
47 stars 17 forks source link

Problems with the library ACAN-ESP32.cpp for ESP32-S3 #13

Open Kether180 opened 8 months ago

Kether180 commented 8 months ago

I' having some issues trying to use the CAN library with my ESP32-S3. When I run the ino file it gives me these errors .

new bugs : C:\Users\gag_a\Documents\Arduino\libraries\ACAN_ESP32\src\ACAN_ESP32.cpp: In member function 'uint32_t ACAN_ESP32::begin(const ACAN_ESP32_Settings&, const ACAN_ESP32_Filter&)': C:\Users\gag_a\Documents\Arduino\libraries\ACAN_ESP32\src\ACAN_ESP32.cpp:149:25: error: 'PERIPH_TWAI_MODULE' was not declared in this scope periph_module_enable (PERIPH_TWAI_MODULE) ; ^~~~~~ C:\Users\gag_a\Documents\Arduino\libraries\ACAN_ESP32\src\ACAN_ESP32.cpp:149:3: error: 'periph_module_enable' was not declared in this scope periph_module_enable (PERIPH_TWAI_MODULE) ; ^~~~~~~~ C:\Users\gag_a\Documents\Arduino\libraries\ACAN_ESP32\src\ACAN_ESP32.cpp:149:3: note: suggested alternative: 'dhcps_router_enabled' periph_module_enable (PERIPH_TWAI_MODULE) ; ^~~~~~~~ dhcps_router_enabled C:\Users\gag_a\Documents\Arduino\libraries\ACAN_ESP32\src\ACAN_ESP32.cpp:205:19: error: 'ETS_TWAI_INTR_SOURCE' was not declared in this scope esp_intr_alloc (ETS_TWAI_INTR_SOURCE, 0, isr, this, & mInterruptHandler) ; ^~~~~~~~ C:\Users\gag_a\Documents\Arduino\libraries\ACAN_ESP32\src\ACAN_ESP32.cpp:205:19: note: suggested alternative: 'ETS_INTERNAL_SW0_INTR_SOURCE' esp_intr_alloc (ETS_TWAI_INTR_SOURCE, 0, isr, this, & mInterruptHandler) ; ^~~~~~~~ ETS_INTERNAL_SW0_INTR_SOURCE exit status 1 Compilation error: exit status 1

I tried to edit the downloaded library as a momentary fix but I was wondering if you have a long term fix solution . These are the lines I had to commented so that the library could work ACAN-ESP32.cpp .

**// periph_module_enable(PERIPH_TWAI_MODULE);

// esp_intr_alloc(ETS_TWAI_INTR_SOURCE, 0, isr, this, &mInterruptHandler);**

Let me know if you have an updated solution that I can use.

Thanks

Kether180 commented 8 months ago

I can't run it with these 3 and I already checked your last updated and it is the one which Iam having troubles with, it seems they are not compatible with ESP32-S3

**periph_module_enable(PERIPH_TWAI_MODULE);

esp_intr_alloc(ETS_TWAI_INTR_SOURCE, 0, isr, this, &mInterruptHandler);**

include <esp_private/periph_ctrl.h> .****