Skip to content

Commit 8e2da5a

Browse files
projectgusdpgeorge
authored andcommitted
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 <[email protected]>
1 parent f2cd1a3 commit 8e2da5a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

ports/stm32/boards/make-pins.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,9 @@ def add_af(self, af_idx, af_name, af):
122122
if af_ext:
123123
af_pin = "EXT" + af_pin
124124

125+
# Special case: FDCAN peripheral is named CAN in MicroPython, same as bxCAN
126+
af_fn = af_fn.replace("FDCAN", "CAN")
127+
125128
af_supported = af_fn in SUPPORTED_AF and af_pin in SUPPORTED_AF[af_fn]
126129

127130
self._afs.append(PinAf(af_idx, af_fn, af_unit, af_pin, af_supported, af_name))

0 commit comments

Comments
 (0)