From 8e2da5a519c3c68f0e9a04613e9d3e2a48ec44bb Mon Sep 17 00:00:00 2001 From: Angus Gratton Date: Wed, 9 Oct 2024 14:53:37 +1100 Subject: [PATCH] stm32/boards: Support 'FDCAN' in board pin CSVs. Previously micros with the 'FDCAN' peripheral (as opposed to the older 'CAN' peripheral) needed to rename these pins in the CSVs for the CAN driver to work. The following CSVs in MicroPython still had FDCAN in them: $ rg -t csv -l FDCAN boards boards/stm32h7b3_af.csv boards/stm32h743_af.csv boards/stm32h573_af.csv boards/stm32h723_af.csv boards/stm32g0b1_af.csv Confirmed that this allows CAN to work on NUCLEO_H723ZG board, and that at least one board based on each of the other chips can still compile. Some of these boards could possibly have MICROPY_HW_ENABLE_CAN set and work, now. Signed-off-by: Angus Gratton --- ports/stm32/boards/make-pins.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ports/stm32/boards/make-pins.py b/ports/stm32/boards/make-pins.py index 8fb442153..1b89fd641 100755 --- a/ports/stm32/boards/make-pins.py +++ b/ports/stm32/boards/make-pins.py @@ -122,6 +122,9 @@ class Stm32Pin(boardgen.Pin): if af_ext: af_pin = "EXT" + af_pin + # Special case: FDCAN peripheral is named CAN in MicroPython, same as bxCAN + af_fn = af_fn.replace("FDCAN", "CAN") + af_supported = af_fn in SUPPORTED_AF and af_pin in SUPPORTED_AF[af_fn] self._afs.append(PinAf(af_idx, af_fn, af_unit, af_pin, af_supported, af_name))