Hello @VPerr.1 ,
There is no need to modify in hardware.
You have to check the peripherals you need, whether supported or not
You can use STM32CubeMX, which offers the feature to compare the characteristics of two or more MCUs through the "Cross Selector" tab.
In addition, STM32CubeMX allows easily migrate from one device to another, this allows you to optimize the time needed:
click Pinout & Configuration tab > Pinout dropdown > List Pinout compatible MCUs
For more details, refer to the UM1718, "Tutorial 5: Exporting current project configuration to a compatible MCU" which shows how to display the list of compatible MCUs and export your current project configuration to a compatible MCU.
Please mark my answer as best by clicking on the "Select as Best" button if it fully solved your issue. This will help other users find this solution more quickly.
Imen
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. Thanks