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

esp32: canio: custom timings #10067

Open
kaseiiro opened this issue Feb 14, 2025 · 0 comments
Open

esp32: canio: custom timings #10067

kaseiiro opened this issue Feb 14, 2025 · 0 comments
Labels
canio enhancement espressif applies to multiple Espressif chips
Milestone

Comments

@kaseiiro
Copy link

CircuitPython version
Adafruit CircuitPython 9.2.4 on 2025-01-29

Code
can = canio.CAN(rx = board.D15, tx = board.D33, baudrate = some_custom_value)

When the some_custom_value is not in the list of a few predefined values (250000, 125000, etc.), it fails to configure. The same behaviour confirmed with ESP32-S2, ESP32-S3.

Sometimes an experienced user may want a baudrate value outside the list. And unfortunatelly there's no option to pass raw timings there. Even memorymap.AddressRange doesn't help either: the TWAI reg range seems to be protected.

Please consider something like the following dirty piece.
can = canio.CAN(rx = board.D15, tx = board.D33, timings = {"brp": x, "tseg_1": xxx, "tseg_2": x])

Sorry, I'm a bit too lazy to recompile it all just to have more baudrate options. Thanks! 🙂

@jepler jepler added this to the Long term milestone Feb 14, 2025
@tannewt tannewt added espressif applies to multiple Espressif chips canio labels Feb 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
canio enhancement espressif applies to multiple Espressif chips
Projects
None yet
Development

No branches or pull requests

3 participants