Hello @Joe.H ,
Thanks for your feedback,
It is not always possible to change the default pin, this depends on the availability of the signal in the package of the MCU.
If you already used the default pins, CubeMX will automatically set for you the other options (ONLY IF AVAILABLE) otherwise it will make the whole peripheral RED and will not take your inputs (simply because your input don't support the peripherals signal).
Here's how you can check the availability of the signal.
1) you need to check pin/ball definition table in the MCU datasheet. In this table you will find the alternate functions that could be provided by each pin.
2) you have to check the availability of the signal in your package and the number of pins (available) that supports this signal. If there are more than 1 pin that can support this signal, you can change the default pin in CubeMX. otherwise you can't.
Here's a small example that may help you understand.
MCU: STM32H745ZITx(package LQFP144)
Default pins chosen by CubeMX for SPI2 (Full-duplex Master, NSS disabled) are : PC1 -> MOSI, PC2_C-> MISO and SCK -> PB10
In the datasheet of this MCU (DS12923) table8 we can find another pins that can support our signals which are : PB15 -> MOSI, PB14 -> MISO and PB13 -> SCK,
In this case, default pins can be changed. (if the default are used than CubeMX will do the work for you, else you can do a right click on the other pin e.g PB15 and you select SPI2_MOSI you will see that PC2_C turns gray ( not used))
For SAI4 A mode Master you will find that SAI4_FS_A and SAI4_SCK_A signals are only available in PE4 and PE5 so they cannot be changed, however SAI4_SD_A is available in PE6, PC1, PB2 and PD6, so the default pin (PE6) can be changed to one of the mentioned.
If you issue is solved, please close this post by clicking the "Select as Best" button. This will help other members of the community find this response more quickly :)
Regards,
Sara.
In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question.