Migrate Analog Output Block Usage to STM32 Processor Based Library Block
When you migrate Analog Output 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 |
---|---|
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 Analog Output block to the STM32 processor library Digital to Analog Converter block:
Open the Simulink model in which you are migrating block usage.
From Configuration Parameters > Hardware Implementation, note that the Hardware board selection is
STM32 Nucleo F767ZI
.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 anSTM32CubMX project file
.In the Simulink model, replace the Analog Output block from the Nucleo library with a Digital to Analog Converter block from the STM32F7xx Based Boards library.
Before replacing the block, note the
PA_5
processor pin assignment from the View pin map link in the block parameters dialog box.To open the STM32 CubeMX configuration software and configure pin selections, click the Launch button from the Build options group.
In the STM32 CubeMX configuration software, configure the
DAC_OUT2
resource for Analog Output operation on pinPA5
.Also, in the CubeMX configuration software, configure the settings for the Analog Output interface.