pierremolinaro / acan-esp32

An ESP32 CAN 2.0B library
MIT License
40 stars 16 forks source link

Auto reinitialize can bus speed on the fly #4

Open Gcopper22 opened 1 year ago

Gcopper22 commented 1 year ago

I have a standalone automotive ecu with obd2 can bus protocol and i can change the baud rate speeds on the fly.In the other hand i use an esp32 with built in can bus controller to read the PID (RPM,VSS...)When i change the can bus speed on the ecu , i have an option to reinitialize the can bus speed on eps32 so it can reconnect. I just cycle in every 1sec the acan.begin with the additional can bus speeds (128,250,500,1000) and pid request transmit. The problem is that it cannot reconnect to the bus although i get message "Configuration ESP32 OK!" . I think its stops transmitting the buffer. If i use acan 2515 with external controller (MCP 2515) the problem disappear and succeffully connected to the bus.The mc2515 was without interrupts using 2515.poll();

Maybe the transmit buffer is over the limit? Please can you help me?

pierremolinaro commented 1 year ago

Hello,

Unfortunatly, I was unable to reproduce the bug. What is your code ? The code I used is the following:

//------------------------------- Board Check ----------------------------------

ifndef ARDUINO_ARCH_ESP32

error "Select an ESP32 board"

endif

//------------------------------- Include files --------------------------------

include

include // For ARDUINO_ESP32_RELEASE

//—————————————————————————————————————————————————————————————————————————————— // SETUP //——————————————————————————————————————————————————————————————————————————————

void setup() { //--- Switch on builtin led pinMode (LED_BUILTIN, OUTPUT) ; digitalWrite (LED_BUILTIN, HIGH) ; //--- Start serial Serial.begin (115200) ; delay (100) ; //--- Display ESP32 Chip Info esp_chip_info_t chip_info ; esp_chip_info (&chip_info) ; Serial.print ("ESP32 Arduino Release: ") ; Serial.println (ARDUINO_ESP32_RELEASE) ; Serial.print ("ESP32 Chip Revision: ") ; Serial.println (chip_info.revision) ; Serial.print ("ESP32 SDK: ") ; Serial.println (ESP.getSdkVersion ()) ; Serial.print ("ESP32 Flash: ") ; Serial.print (spi_flash_get_chip_size () / (1024 * 1024)) ; Serial.print (" MB ") ; Serial.println (((chip_info.features & CHIP_FEATURE_EMB_FLASH) != 0) ? "(embeded)" : "(external)") ; Serial.print ("APB CLOCK: ") ; Serial.print (APB_CLK_FREQ) ; Serial.println (" Hz") ; }

//——————————————————————————————————————————————————————————————————————————————

static uint32_t gBlinkLedDate = 0 ; static const uint32_t bitRateArray [4] = { 125000, 250000, 500000, 1000000 } ; static uint32_t gBitRateIndex = 0 ; static const uint32_t MESSAGE_COUNT = 10 ;

//—————————————————————————————————————————————————————————————————————————————— // LOOP //——————————————————————————————————————————————————————————————————————————————

void loop () { if (gBlinkLedDate < millis ()) { gBlinkLedDate += 1000 ; digitalWrite (LED_BUILTIN, !digitalRead (LED_BUILTIN)) ; //--- Configure ESP32 CAN Serial.print ("Configure ESP32 CAN at ") ; Serial.print (bitRateArray [gBitRateIndex]) ; Serial.println (" bit/s") ; ACAN_ESP32_Settings settings (bitRateArray [gBitRateIndex]) ; gBitRateIndex = (gBitRateIndex + 1) % 4 ; settings.mRequestedCANMode = ACAN_ESP32_Settings::LoopBackMode ; // settings.mRxPin = GPIO_NUM_4 ; // Optional, default Tx pin is GPIO_NUM_4 // settings.mTxPin = GPIO_NUM_5 ; // Optional, default Rx pin is GPIO_NUM_5 const uint32_t errorCode = ACAN_ESP32::can.begin (settings) ; if (errorCode == 0) { Serial.print ("Bit Rate prescaler: ") ; Serial.println (settings.mBitRatePrescaler) ; Serial.print ("Time Segment 1: ") ; Serial.println (settings.mTimeSegment1) ; Serial.print ("Time Segment 2: ") ; Serial.println (settings.mTimeSegment2) ; Serial.print ("RJW: ") ; Serial.println (settings.mRJW) ; Serial.print ("Triple Sampling: ") ; Serial.println (settings.mTripleSampling ? "yes" : "no") ; Serial.print ("Actual bit rate: ") ; Serial.print (settings.actualBitRate ()) ; Serial.println (" bit/s") ; Serial.print ("Exact bit rate ? ") ; Serial.println (settings.exactBitRate () ? "yes" : "no") ; Serial.print ("Distance ") ; Serial.print (settings.ppmFromDesiredBitRate ()) ; Serial.println (" ppm") ; Serial.print ("Sample point: ") ; Serial.print (settings.samplePointFromBitStart ()) ; Serial.println ("%") ; Serial.println ("Configuration OK!"); }else { Serial.print ("Configuration error 0x") ; Serial.println (errorCode, HEX) ; } //--- Loop for sending and receiving MESSAGE_COUNT messages uint32_t sentCount = 0 ; uint32_t receiveCount = 0 ; while ((sentCount < MESSAGE_COUNT) || (receiveCount < MESSAGE_COUNT)) { if (sentCount < MESSAGE_COUNT) { CANMessage frame ; const bool ok = ACAN_ESP32::can.tryToSend (frame) ; if (ok) { sentCount += 1 ; Serial.print (" Sent ") ; Serial.println (sentCount) ; } } CANMessage frame ; while (ACAN_ESP32::can.receive (frame)) { receiveCount += 1 ; Serial.print (" Received ") ; Serial.println (receiveCount) ; } } Serial.print (" STATUS 0x") ; Serial.print (CAN_STATUS, HEX) ; Serial.print (", RXERR ") ; Serial.print (CAN_RX_ECR) ; Serial.print (", TXERR ") ; Serial.println (CAN_TX_ECR) ; } }

Le 20 juil. 2022 à 01:37, hulktech @.***> a écrit :

I have a stand alone automotive ecu with obd2 can bus protocol and i can change the baud rate speeds on the fly.In the other hand i use an esp32 with built in can bus controller to read the PID (RPM,VSS...)When i change the can bus speed on the ecu , i have an option to reinitialize the can bus speed on eps32 so it can reconnect.I just cycle in every 1sec the acan.begin with the aditional can bus speeds (128,250,500,1000) and pid request transmit. The problem is that it cannot reconnect to the bus althout i get the message "Configuration ESP32 OK!" . I think its stops transmiting the buffer. If i use acan 2515 with external controller (MCP 2515) the proble disapear and succeffully connected to the bus.The mc2515 was without interupts using 2515.poll();

Maybe the transmit buffer is over the limit? Please can you help me?

— Reply to this email directly, view it on GitHub https://github.com/pierremolinaro/acan-esp32/issues/4, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEWKZVFM2MDZIIQ3SHPPRBTVU432RANCNFSM54BU6MVQ. You are receiving this because you are subscribed to this thread.

Gcopper22 commented 1 year ago

Your sketch is not working when i change the can bus speed from ecu.

To be more specific : i start the ECU BUS speed 125kbs as EPS32 CAN bus initialize (gBitRateIndex = 0=125000) it run succefully :
00:29:06.850 -> Configure ESP32 CAN at 125000 bit/s 00:29:06.850 -> Bit Rate prescaler: 16 00:29:06.850 -> Time Segment 1: 13 00:29:06.850 -> Time Segment 2: 6 00:29:06.850 -> RJW: 4 00:29:06.850 -> Triple Sampling: yes 00:29:06.850 -> Actual bit rate: 125000 bit/s 00:29:06.850 -> Exact bit rate ? yes 00:29:06.850 -> Distance 0 ppm 00:29:06.850 -> Sample point: 65% 00:29:06.850 -> Configuration OK! 00:29:06.850 -> Sent 1 00:29:06.850 -> Received 1 00:29:06.850 -> Received 2 00:29:06.850 -> Received 3 00:29:06.850 -> Received 4 00:29:06.850 -> Received 5 00:29:06.850 -> Received 6 00:29:06.897 -> Received 7 ........

When i change the ECU BUS speed @250kbs Its stops and i get :

00:29:10.764 -> STATUS 0x60, RXERR 56, TXERR 128 00:29:10.764 -> Configure ESP32 CAN at 250000 bit/s 00:29:10.764 -> Bit Rate prescaler: 8 00:29:10.764 -> Time Segment 1: 13 00:29:10.764 -> Time Segment 2: 6 00:29:10.764 -> RJW: 4 00:29:10.764 -> Triple Sampling: no 00:29:10.764 -> Actual bit rate: 250000 bit/s 00:29:10.764 -> Exact bit rate ? yes 00:29:10.764 -> Distance 0 ppm 00:29:10.764 -> Sample point: 70% 00:29:10.764 -> Configuration OK! 00:29:10.764 -> Sent 1 00:29:10.764 -> Sent 2 00:29:10.764 -> Sent 3 00:29:10.764 -> Sent 4 00:29:10.764 -> Sent 5 00:29:10.764 -> Sent 6 00:29:10.764 -> Sent 7 00:29:10.764 -> Sent 8 00:29:10.764 -> Sent 9 00:29:10.764 -> Sent 10

AND STOPS..

Also after a lot of search i get CAN BUS STATUS 0x4 in my sketch ,what is this error? Is it possible to restart the Can bus? Or recover?

Thank you in andvace

pierremolinaro commented 1 year ago

Strange, I have ran it without any problem during 30 minutes.

I have noticed you have this output:

00:29:10.764 -> STATUS 0x60, RXERR 56, TXERR 128

It means there are received errors (RXERR) and transmit errors (TXERR).

Questions :

Pierre

Le 20 juil. 2022 à 23:39, Gcopper @.***> a écrit :

Your sketch is not working when i change the can bus speed from ecu.

To be more specific : i start the ECU BUS speed 125kbs as EPS32 CAN bus initialize (gBitRateIndex = 0=125000) it run succefully : 00:29:06.850 -> Configure ESP32 CAN at 125000 bit/s 00:29:06.850 -> Bit Rate prescaler: 16 00:29:06.850 -> Time Segment 1: 13 00:29:06.850 -> Time Segment 2: 6 00:29:06.850 -> RJW: 4 00:29:06.850 -> Triple Sampling: yes 00:29:06.850 -> Actual bit rate: 125000 bit/s 00:29:06.850 -> Exact bit rate ? yes 00:29:06.850 -> Distance 0 ppm 00:29:06.850 -> Sample point: 65% 00:29:06.850 -> Configuration OK! 00:29:06.850 -> Sent 1 00:29:06.850 -> Received 1 00:29:06.850 -> Received 2 00:29:06.850 -> Received 3 00:29:06.850 -> Received 4 00:29:06.850 -> Received 5 00:29:06.850 -> Received 6 00:29:06.897 -> Received 7 ........

When i change the ECU BUS speed @250kbs Its stops and i get :

00:29:10.764 -> STATUS 0x60, RXERR 56, TXERR 128 00:29:10.764 -> Configure ESP32 CAN at 250000 bit/s 00:29:10.764 -> Bit Rate prescaler: 8 00:29:10.764 -> Time Segment 1: 13 00:29:10.764 -> Time Segment 2: 6 00:29:10.764 -> RJW: 4 00:29:10.764 -> Triple Sampling: no 00:29:10.764 -> Actual bit rate: 250000 bit/s 00:29:10.764 -> Exact bit rate ? yes 00:29:10.764 -> Distance 0 ppm 00:29:10.764 -> Sample point: 70% 00:29:10.764 -> Configuration OK! 00:29:10.764 -> Sent 1 00:29:10.764 -> Sent 2 00:29:10.764 -> Sent 3 00:29:10.764 -> Sent 4 00:29:10.764 -> Sent 5 00:29:10.764 -> Sent 6 00:29:10.764 -> Sent 7 00:29:10.764 -> Sent 8 00:29:10.764 -> Sent 9 00:29:10.764 -> Sent 10

AND STOPS..

Also after a lot of search i get CAN BUS STATUS 0x4 in my sketch ,what is this error? Is it possible to restart the Can bus? Or recover?

Thank you in andvace

— Reply to this email directly, view it on GitHub https://github.com/pierremolinaro/acan-esp32/issues/4#issuecomment-1190783319, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEWKZVGR6TK34ZFBHCZQU5LVVBWYJANCNFSM54BU6MVQ. You are receiving this because you commented.

Gcopper22 commented 1 year ago

yes the LoopBackMode is removed, The Esp32 is not alone on the Bus.Is connected with standalone Engine ECU that I have the option to change the can bus speed as i told you. Questions : Is there any function to Stop the Driver? Is there any function to Reset-Recover the Driver? How can i decode the CAN BUS Status messages (the meanings) ? I have CAN_STATUS 0x4 ,and in this situation i cant send or recieve any can bus message even if i start again the can bus (begin) thats why i'm asking for a recovery option

In IDF there is option to Recovering CAN BUS from Bus-off State (https://docs.espressif.com/projects/esp-idf/en/release-v3.3/api-reference/peripherals/can.html) :

esp_err_t can_initiate_recovery() Start the bus recovery process.

Also there is option to Stop the CAN driver : esp_err_tcan_stop()

Can you add this functions to your library?

matt6626 commented 1 year ago

Just wanted to add that I have run into the same issue with the tx buffer not being sent.

I haven't had time to create a min working example but the easiest trigger in my hardware setup (esp32 alone on canbus and esp32 with a single can logging device on canbus - loopback mode in both cases just sending out a random can packet onto the bus) has been to power cycle the 5V CAN for the can transceiver.

The ACAN_ESP32 driver is never able to recover after 5V CAN is re-enabled despite re-calling the can.begin() routine.

Only thing I noted was that attaching the CAN ISR in can.begin() fails when re-calling begin(). I briefly experimented with trying to de-initialize the can peripherals and free the can ISR without success despite getting rid of the failed isr attach call.

Calling esp_restart() is not sufficient to recover from the issue either. Calling a deepsleep of 0 duration does allow recovering from the issue.

If I get more time, I will investigate further.

Edit: The CAN interrupt handler stops being triggered entirely in the fault state. void IRAM_ATTR ACAN_ESP32::isr(void *inUserArgument)

The primary registers appear to recover after cycling 5V CAN, however interrupt does not trigger anymore:

Initially Working: mDriverisSending: 0 CAN_CMD (internalSendMessage): 10 internalSendMessageSentNow: 1 CAN Diagnostics: CAN Driver Debug, TX_INTR_COUNT: 8 CAN MODE: 4 CAN_CMD: 0 CAN_STATUS: C CAN_INTERRUPT: 0 CAN IER: 3 Sent: 8 Received: 8 CAN: STATUS 0X00C RXERR 0 TXERR 0

After 5V CAN power off: mDriverisSending: 1 CAN_CMD (internalSendMessage): NO LONGER PRINTING internalSendMessageSentNow: 0 CAN Diagnostics: CAN Driver Debug, TX_INTR_COUNT: 35 CAN MODE: 5 CAN_CMD: 0 CAN_STATUS: D4 CAN_INTERRUPT: 0 CAN IER: 3 Sent: 43 Received: 35 CAN: STATUS 0X0D4 RXERR 0 TXERR 128

After 5V CAN power back on accompanied with can.begin(): mDriverisSending: 1 CAN_CMD (internalSendMessage): NO LONGER PRINTING internalSendMessageSentNow: 0 CAN Diagnostics: CAN Driver Debug, TX_INTR_COUNT: 35 CAN MODE: 4 CAN_CMD: 0 CAN_STATUS: C CAN_INTERRUPT: 0 CAN IER: 3 Sent: 78 Received: 35 CAN: STATUS 0X00C RXERR 0 TXERR 0

All is pointing towards my earlier conclusion that the CAN ISR stops running, however, I'm not sure why.

pierremolinaro commented 1 year ago

Hello,

I have reproduced the bug, and commenting out one line from the begin method enables again frame sending :

In ACAN_ESP32.cpp, comment out line #195 (CAN_TX_ECR = 0):

//--------------------------------- Set the Acceptance Filter setAcceptanceFilter (inFilterSettings) ; //--------------------------------- Set and clear the error counters to default value CAN_EWLR = 96 ; CAN_RX_ECR = 0 ; // CAN_TX_ECR = 0 ; //--------------------------------- Clear the Interrupt Registers const uint8_t unusedVariable attribute((unused)) = CAN_INTERRUPT ;

You are right, the ISR should be freed before attaching a new one.

I have pushed a commit (f70bc99) on the https://github.com/pierremolinaro/acan-esp32 repository where I have a added a clean ISR free before performing a new alloc.

If it solves the bug, I will make a new release.

Best Regards,

Pierre

Le 9 août 2022 à 05:39, matt6626 @.***> a écrit :

Just wanted to add that I have run into the same issue with the tx buffer not being sent.

I haven't had time to create a min working example but the easiest trigger in my hardware setup (esp32 alone on canbus and esp32 with a single can logging device on canbus - loopback mode in both cases just sending out a random can packet onto the bus) has been to power cycle the 5V CAN for the can transceiver.

The ACAN_ESP32 driver is never able to recover after 5V CAN is re-enabled despite re-calling the can.begin() routine.

Only thing I noted was that attaching the CAN ISR in can.begin() fails when re-calling begin(). I briefly experimented with trying to de-initialize the can peripherals and free the can ISR without success despite getting rid of the failed isr attach call.

Calling esp_restart() is not sufficient to recover from the issue either. Calling a deepsleep of 0 duration does allow recovering from the issue.

If I get more time, I will investigate further.

— Reply to this email directly, view it on GitHub https://github.com/pierremolinaro/acan-esp32/issues/4#issuecomment-1208873970, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEWKZVFTXAE4FHALNJMDGMTVYHHIHANCNFSM54BU6MVQ. You are receiving this because you commented.

matt6626 commented 1 year ago

I’ll give this a go in a day or two to confirm if this fixes the issue. Thanks for the fast turnaround.

matt6626 commented 1 year ago

Unfortunately the CAN ISR still doesn't trigger on latest commit after the can 5V is re-enabled and begin() is called. Uncommenting following made no difference:

if (mInterruptHandler != nullptr) { esp_intr_disable (mInterruptHandler) ; esp_intr_free (mInterruptHandler) ; mInterruptHandler = nullptr ; }

Only additional comment I can add is that no can packet is ever sent (ie. tx buffer never decreases) if any attempt to send a can packet is performed before 5VCAN is enabled (regardless of how many times begin() is called after this).

Update: As long as there is no attempt being made to send can packets while 5V can is off, power cycling 5V can (with associated call to can.begin()) does not cause any issues and the can isr is called and sends can packets fine.

It is only when 5V can is turned off while still trying to send can packets that the issue occurs.

Update 2: Just as a sanity check, I tried a different drop in replacement can transceiver to rule out any weird power off behaviour but this made no difference (to be expected).

I dug through the idf twai driver to see if they do much different, only difference I found so far was calling periph_module_reset before periph_module_enable but that didn't help.

Update 3: I ported to the esp-idf TWAI/CAN driver and it recovers from the 5V can turning off and continues sending can packets.

Gcopper22 commented 1 year ago

@matt6626 can you please post an example with ported twai can driver that can recover and send packets as you said?

matt6626 commented 1 year ago

I've stripped out everything except hopefully the relevant min working can example (haven't checked whether it compiles). The main difference in the way I incorporated the idf-can was using no_ack mode instead of the loopback but I imagine principles are similar.

acan_esp32_example.zip

matthew-mower commented 1 year ago

I seem to be having this same issue. My setup has rare failures where receiving CAN just stops working on my board so I'm forced to reset the CAN peripheral, but if I try begin() and end()ing it fails to ever send more CAN messages. (The rare failures are definitely not simply being in CAN Bus Off mode as I've verified that I'm handling that. My best guess is I'm hitting some errata condition but I haven't looked into it very far)

As a workaround I'm currently resetting the device by putting it into deep sleep and reinitializing everything, which works but is pretty tricky to get glitch free.

AndreaInverardi commented 1 year ago

The ACAN library works successfully with a CANbed board v1 (AT328U4 + MCP2515) and it can recover from BUS-OFF state. This one (acan-esp32), i confirm it can't recover from BUS-OFF state, and the receive ISR is not recover. Hope it can be fixed.

matthew-mower commented 1 year ago

The ACAN library works successfully with a CANbed board v1 (AT328U4 + MCP2515) and it can recover from BUS-OFF state. This one (acan-esp32), i confirm it can't recover from BUS-OFF state, and the receive ISR is not recover. Hope it can be fixed.

I was able to get my board to recover from BUS-OFF by occasionally running the code below:

bool CAN_check()
{
    if (MODULE_CAN->SR.B.BS == 1 && MODULE_CAN->MOD.B.RM == 1)
    {
        MODULE_CAN->MOD.B.RM = 0;// leave reset
        return true;
    }
    return false;
}

Note it uses the register definitions in the file here: https://github.com/ThomasBarth/ESP32-CAN-Driver/blob/master/components/can/include/can_regdef.h

I'm sure it can be ported easily over to not require that but I haven't bothered and just copied the file into my lib.

pierremolinaro commented 1 year ago

I have published the 1.1.0 release that includes the recoveryFromBusOff method.

Pierre

Le 21 sept. 2022 à 23:53, Andrea Inverardi @.***> a écrit :

The ACAN library works successfully with a CANbed board v1 (AT328U4 + MCP2515) and it can recover from BUS-OFF state. This one (acan-esp32), i confirm it can't recover from BUS-OFF state, and the receive ISR is not recover. Hope it can be fixed.

— Reply to this email directly, view it on GitHub https://github.com/pierremolinaro/acan-esp32/issues/4#issuecomment-1254265343, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEWKZVDKJD6MKOCG65PAOKDV7N7UDANCNFSM54BU6MVQ. You are receiving this because you commented.

pierremolinaro commented 1 year ago

Thank you for your contribution, I have published the 1.1.0 release that includes the recoveryFromBusOff method, based on the code you sent.

Pierre

Le 23 sept. 2022 à 17:04, matthew-mower @.***> a écrit :

The ACAN library works successfully with a CANbed board v1 (AT328U4 + MCP2515) and it can recover from BUS-OFF state. This one (acan-esp32), i confirm it can't recover from BUS-OFF state, and the receive ISR is not recover. Hope it can be fixed.

I was able to get my board to recover from BUS-OFF by occasionally running the code below:

bool CAN_check() { if (MODULE_CAN->SR.B.BS == 1 && MODULE_CAN->MOD.B.RM == 1) { MODULE_CAN->MOD.B.RM = 0;// leave reset return true; } return false; }

Note it uses the register definitions in the file here: https://github.com/ThomasBarth/ESP32-CAN-Driver/blob/master/components/can/include/can_regdef.h https://github.com/ThomasBarth/ESP32-CAN-Driver/blob/master/components/can/include/can_regdef.h I'm sure it can be ported easily over to not require that but I haven't bothered and just copied the file into my lib.

— Reply to this email directly, view it on GitHub https://github.com/pierremolinaro/acan-esp32/issues/4#issuecomment-1256333268, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEWKZVEXKH4GZXHBX5DFFF3V7XBHTANCNFSM54BU6MVQ. You are receiving this because you commented.

Gcopper22 commented 1 year ago

I'm trying compile examples using version 1.1.0 and unfortunately the didn't complete.I use 1.0.6 core and i dont know how i can include twai driver.Also when i update to core version 2.0.4 i have error "freertos/FreeRTOS.h: No such file or directory.

Please is it possible to use your library with core 1.0.6 and how it will be done? Can someone help me.I want to use the recoveryFromBusOff method in 1.0.6 arduino core.

Thank you advance

pierremolinaro commented 1 year ago

Hello,

My library is designed for working with 2.0.5 esp32 platform version. It compiles without any error when I select the "MH ET LIVE ESP32MiniKit" board.

But I realize that selecting an other board, as the ESP32C3 Dev Module raises the error "soc/dport_reg.h: No such file or directory". The include path availabity depends from the selected board !

So, what is your board selection ?

My configuration is :

I realize also that my "ESP32RecoveringFromBusOff.ino" sample code is just of copy of "ESP32ChangingBitRateOnTheFly.ino".

I will write an actual "ESP32RecoveringFromBusOff.ino" sample code, updating the include path, and make a new release.

Best regards,

Pierre

Le 26 oct. 2022 à 01:30, Gcopper @.***> a écrit :

I'm trying compile examples using version 1.1.0 and unfortunately the didn't complete.I use 1.0.6 core and i dont know how i can include twai driver.Also when i update to core version 2.0.4 i have error "freertos/FreeRTOS.h: No such file or directory.

Please is it possible to use your library with core 1.0.6 and how it will be done? Can someone help me.I want to use the recoveryFromBusOff method in 1.0.6 arduino core.

Thank you advance

— Reply to this email directly, view it on GitHub https://github.com/pierremolinaro/acan-esp32/issues/4#issuecomment-1291246518, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEWKZVCIUEKIQZPF4ZZUXL3WFBUR3ANCNFSM54BU6MVQ. You are receiving this because you commented.

Gcopper22 commented 1 year ago

Ok, i successfully run busrecover, so i have another problem : Its stop receiving messages when i have a heavy load in the can bus network and trying to saving to EEPROM. So is there any example to use CAN driver’s ISR (Interrupt Service Routine) for the receiving and maybe also for the transmitting messages?

ronzelver commented 1 year ago

So is there any example to use CAN driver’s ISR (Interrupt Service Routine) for the receiving and maybe also for the transmitting messages?

I would also like to see an interrupt driven / callback handler for receiving CAN messages.