To configure your model for a STM32F4xx based board, open the Configuration Parameters.
Go to Hardware Implementation > Hardware board and select STM32F4xx Based board.There are two options to add support for your STM32 Processor-Based Board in Simulink: Use an existing STM32CubeMX project, or create a new one from Simulink. First Approach: In the "Build options", click Browse to select an existing STM32CubeMX project (.ioc file).
Second Approach: In the "Build options", click Create to create a custom STM32CubeMX project from Simulink:
Select Custom STM32F4xx Based on the hardware drop-down. Please note that the "Custom hardware part number" should exactly match with the MCUs xml file names found at <STM32CubeMX installation directory>\db\mcu.
For example, to create a STM32CubeMX project for STM32F405RG microcontroller, the customer should specify "STM32F405RGTx" for "Custom hardware part number" because STM32F405RG is defined in STM32CubeMX database with xml name "STM32F405RGTx.xml".