Main Content

Migrate External Interrupt Block Usage to STM32 Processor Based Library Block

When you migrate External Interrupt block usage in STMicroelectronics hardware board models from using Simulink Coder support package blocks to using Embedded Coder support package blocks, there is a workflow you should use. This table lists the blocks that should be migrated with this workflow.

Migrate Block Usage

Migrate from Blocks in Simulink Coder Support Package for STMicroelectronics Nucleo Boards Library

Migrate to Blocks in Embedded Coder Support Package for STMicroelectronics STM32 Processor Library

External Interrupt

External Interrupt

To migrate your model from using these blocks to using the corresponding blocks in an STM32Fxx Based Board block library, follow these steps. These example steps show the process for migrating usage from the Nucleo library External Interrupt block to the STM32 processor library External Interrupt block:

  1. Open the Simulink model in which you are migrating block usage.

  2. From Configuration Parameters > Hardware Implementation, note that the Hardware board selection is STM32 Nucleo F767ZI. Note the pin selections for the external interrupt (D5 corresponds to external pin PE_11).

    Model configuration parameters for selecting the external interrup resource on Nucleo board

  3. Change Hardware board selection to STM32F7xx Based. After the dialog box updates to match this selection, From Target hardware resources > Build options, use the Browse or Create buttons to select an STM32CubMX project file.

    Model configuration parameters for selecting external interrupt resource on STM32F7xx Based processor board

  4. To open the STM32 CubeMX configuration software and configure pin selections, click the Launch button from the Build options group.

  5. In the Simulink model, replace the External Interrupt block from the Nucleo library with a External Interrupt block from the STM32F7xx Based Boards library.

  6. View the block configuration parameters. Confirm that the Hardware Interrupt selection is configured as shown.

    Block configuration parameters for external interrupt block in STM32 library

  7. In the STM32 CubeMX configuration software, configure the TIM1 resource for PWM operation on pins PE9 (TIM1_CH1) and PE11 (TIM1_CH2).

    Pin map configuration for external interrupt resource in STM32 CubeMX configuration software

    Also, in the CubeMX configuration software, configure the settings for the external interrupt resource.

    Configuration options for external interrupt resource in STM32 CubeMX configuration software

See Also

Topics