I found a S2 in my parts box (a small Adafruit QtPy ESP32-S2uFL) and that seems to work nicely.
Rather than modify the header you can just add the extra line to the source file where you do call twai_driver_install()…
#define TWAI_TIMING_CONFIG_16K6BITS() {.brp = 200, .tseg_1 = 15, .tseg_2 = 8, .sjw = 3, .triple_sampling = false}
So thanks v.much for the hints.
I can get the WROOM32 parts to work too as long as they are v2 or greater (my D1 Mini are v3.1). Its only the original 2016 WROOMs that have the old 1.0 chip version.
So I now have code running on Pi Pico, WROOM-32, ESP32-S2 and ESP32-S3, and STM32F103.
And have you seen Canable.io? All open source. It uses a newer STM part… STM32F042/F072, that is capable of running both USB and CAN at the same time (unlike the F103). There is a pretty cheap official ST Nucleo-F042K2 dev board but there are also adapters like this one…
It has no 16600 bd support out of the box but that is easily fixed.
I have a few very small CAN-AVR boards I might try out too.
Only thing I am missing now is the usual cheap MCP2515 boards on a.n.other MCU.
So lots of options to play with.
Still no idea what I will do with any of this yet but it’s interesting to play with.