-
Notifications
You must be signed in to change notification settings - Fork 112
Fix wrong API usage in disable() and beginAutoSpeed() #83
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
base: master
Are you sure you want to change the base?
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:
|
Hi @sans-ltd, Edit: I now see @jeroenveer already mentioned the issue ;) |
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 . |
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.