collin80 / esp32_can

Arduino ESP32 library supporting the on-chip CAN module
MIT License
264 stars 91 forks source link

HELLO, i tried esp32 with mcp2515 bun not working #40

Open lepromer opened 2 years ago

lepromer commented 2 years ago

HELLO, i tried esp32 with mcp2515 bun not working, did you tested with esp32, what i can i doing wrong, CS 5 INT 27 CLK 18 SI 19 SO 23

collin80 commented 2 years ago

I'm not sure. The MCP2515 code is very old at this point. Fairly quickly we moved to the CAN-FD hardware and the 2515 code was not touched since. You will probably have to do some debugging by dumping registers and/or putting debugging statements at various places to see what is going on.

AsmodeusX commented 2 years ago

I can confirm, it does initialize but won't work at all.

jeroenveer commented 2 years ago

Works fine on my ESP32 with MCP25625 did needed some minor changes.

NMSTEC commented 2 years ago

EDIT: Correction, seems MCPlibrary starts sending bullshit SPI register. Still working on it.

So receive works, as long as we are transmitting on the same bus. Go figure. Been checking every register state that could cause that, can't see why.

image

NMSTEC commented 2 years ago

Running while transmitting.txt

NMSTEC commented 2 years ago

Seems we are never clearing the interrupt flags. So it stops interrupting as per docs. image Thats issue 1,

Issue 2 is everytime the MCP2515 stops transmitting it, we for some reason request to read "mode_normal"... image

This has got to be a simple issue somwhere, and yet im still fighting it. half a mind to start rewriting library myself step by step. Currently on vacation so no JTAG debugging for me :(