Fix wrong API usage in disable() and beginAutoSpeed()#83
Fix wrong API usage in disable() and beginAutoSpeed()#83sans-ltd wants to merge 3 commits intocollin80:masterfrom
Conversation
|
I have had the same issues and this seems to have fixed the crashes i had. The issue i have now is that it somehow sees its own transmitted frames and then processes them as received frames. |
Yes it seems like I am doing the same thing as you. The trick is to remember the last forwarded frame and ignore it if it appears again. It seems to be a "feature" of the CAN transceiver. If you run |
|
I see the same issue on the older ESP32 boards with single CAN as well. I believe it appeared with the new IDF update so do not think it's a feature of the transceiver. |
|
Which part of the frame would u use to ignore it? you have a example code? |
|
I compare (==) id and length. And then memcmp the data |
|
A full example would be a bit difficult to extract from my code. |
|
I found out the core reason for this looping behavior: In the example, they set it to 0, for a good reason, since we have a C struct here, it is pure random how it is initialized: |
|
BTW: I do not use the synchronous loop code as seen here but a callback: |
|
@sans-ltd Awesome! That fixed it thank you! It runs perfectly with synchronous loop |
|
I can confirm that after applying the changes, I can forward thousands of messages back and forth to both buses without a hickup. |
|
This PR fixes issues with ESP32-C6 for me. Thanks @sans-ltd . |
|
Just wanted to ask if I could help with something to speed up the integration of this PR into the main branch. |
Hello,
we are using your CAN library in an automotive project on the ESP32-C6 where we have both CAN busses in use.
Thank you for restructuring your library, especially removing the static init of CAN busses and the MCP2517 stuff.
But we still have a crash when using your lib in our scenario.
This is the fix for it.
Feel free to contact us, maybe also for further collaboration.