stm32: Adding pins and peripherals to the board files
Just while upgrading my collection of STM32 boards I was looking through the pin definitions and one can debate if they are complete. Other boards also suffer from incompleteness. So now the question pops up to support only the bare micropython or add the peripherals too.
For the STM32F4DISC board the following 'needs' to be added. Also like with the OTG_FS_POWER_SWITCH it seems reasonable to add a disable at startup time (like what is done with the NUCLEO_H743ZI board implementation.
There is however a driver for the LIS302DL in python. It would be nice to include a driver for the MP45DT02 microphone and CS43L22 24-bit audio DAC.
So for starters this needs to be added to the pins.csv:
SW,PA0
LED_GREEN,PD12
LED_ORANGE,PD13
LED_RED,PD14
LED_BLUE,PD15
VBUS_FS,PA9
OTG_FS_ID,PA10
OTG_FS_DM,PA11
OTG_FS_DP,PA12
OTG_FS_POWERSWITCH,PC0
OTG_FS_OVERCURRENT,PD5
LIS302DL_CE,PE3
LIS302DL_INT2,PE1
LIS302DL_SCK,PA5
LIS302DL_SDO,PA6
LIS302DL_SDI,PA7
MP45DT02_CLK,PB10
MP45DT02_DOUT,PC3
CS43L22_MCLK,PC7
CS43L22_LRCK,PA4
CS43L22_SCLK,PC10
CS43L22_SDIN,PC12
CS43L22_RESET,PD4
CS43L22_SCL,PB8
CS43L22_SDA,PB9
BOOT1,PB2
SWDIO,PA13
SWCLK,PA14
SWO,PB3
First would be to add these peripheral definitions for all the DISCO and NUCLEO boards. Do we like this approach?
stm32: Support 'FDCAN' in board pin CSVs.
Summary
This PR has been split out from #15989.
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.
Testing
- Tested CAN peripheral 1 now works on the NUCLEO_H723ZG board. Additional testing was also done as part of #15989.
Trade-offs and Alternatives
- Could manually rename FDCAN in the mentioned CSV files, but given it's been missed in the past it seems safer for future SoCs if we apply the fix during processing.