Skip to content
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

beginAutoSpeed Crashes ESP32 #56

Open
bl1tz3n4 opened this issue Sep 30, 2023 · 2 comments
Open

beginAutoSpeed Crashes ESP32 #56

bl1tz3n4 opened this issue Sep 30, 2023 · 2 comments

Comments

@bl1tz3n4
Copy link

bl1tz3n4 commented Sep 30, 2023

Been having a difficult time getting auto speed to work.. When I run it and it encounters the speed of the data, it crashes citing a core 1 panic. Below is the feed from my serial terminal:

Trying Speed 1000000 FAILED.
Trying Speed 500000Guru Meditation Error: Core  1 panic'ed (LoadProhibited). Exception was unhandled.

Core  1 register dump:
PC      : 0x4008ac77  PS      : 0x00060033  A0      : 0x80089c25  A1      : 0x3ffbf2ac  
A2      : 0x0000001f  A3      : 0x3ffc2ecc  A4      : 0x00000004  A5      : 0x00060023  
A6      : 0x00060023  A7      : 0x00000001  A8      : 0x00000001  A9      : 0x00000001  
A10     : 0x00000005  A11     : 0x00000003  A12     : 0x00000000  A13     : 0x00000020  
A14     : 0x007bf378  A15     : 0x003fffff  SAR     : 0x00000018  EXCCAUSE: 0x0000001c  
EXCVADDR: 0x00000023  LBEG    : 0x40085d55  LEND    : 0x40085d77  LCOUNT  : 0xffffffff  

Backtrace: 0x4008ac74:0x3ffbf2ac |<-CORRUPTED

ELF file SHA256: efd7b5ffc96f16e9

I believe I am using the function correctly, but I did not see any examples to confirm or deny this.

Code is:

ESP32CAN CAN0(GPIO_NUM_4, GPIO_NUM_5);

void setup() {
  Serial.begin(115200);
  delay(1000);
  CAN0.begin(250000);
  CAN0.watchFor();
  CAN0.setListenOnlyMode(true);
  CAN0.beginAutoSpeed();
}

Is there something I am missing? I am using IDE v2.1.1 with the latest versions from here. Using the builtin with a vp230

@collin80
Copy link
Owner

collin80 commented Oct 2, 2023

Try not beginning CAN0 with a definite speed first. beginAutoSpeed() does the initialization process. It also should automatically be using listen only mode internally so start with beginAutoSpeed then do CAN0.watchFor() afterward and maybe CAN0.setListenOnlyMode(true) if you really don't want to touch the bus.

@kevinlieb
Copy link

kevinlieb commented Apr 2, 2024

@collin80 can you perhaps post an example of "beginAutoSpeed()" usage?
and how to retrieve what rate it discovered?
I tried this:
CAN0.begin();
auto result = CAN0.beginAutoSpeed();

an I get the same crash.

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

3 participants