Skip to content

esp32: canio: custom timings #10067

Open
Open
@kaseiiro

Description

@kaseiiro

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! 🙂

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions