SPI2 on STM32WB55 pin error
Trying to use pin D3 as SPI2_MISO alternate function does not work, the pin D3 switches to the previous alternate funtion (SPI2_SCK).
This can be fixed by removing the AF3 declaration out of the stm32wb55_af.csv list:
PortD,PD3,,,,SPI2_SCK,,SPI2_MISO,,,,,QUADSPI_BK1_NCS,,,,,EVENTOUT, (Original)
PortD,PD3,,,,,,SPI2_MISO,,,,,QUADSPI_BK1_NCS,,,,,EVENTOUT, (fix)
But this causes the Pin D3 incapable of switching to SCK mode.
This is caused by the definition of a pin list in spi.c (line 294), not a function list. In the pin list, the actual output pin is defined, but the information what the pin should be doing is not remembered.
A sollution could be the sequnce of the list, it can be defined to hold the function. The function mp_hal_pin_config_alt then should be told what the pin function should be.
Pin.af_list() method is mis-classified
http://docs.micropython.org/en/latest/library/pyb.Pin.html#Pin.af_list is includes in "Class methods" section, but says "Returns an array of alternate functions available for this pin." It doesn't take any argument based on the signature, so unclear what "this pin" refers to (if it's class method). And http://docs.micropython.org/en/latest/library/pyb.Pin.html#class-pinaf-pin-alternate-functions gives example which contradicts the method being class one.