Main Content

Get Started with IO Device Builder

This section helps you understand and get started with the IO Device Builder app. To get more information on the workflow, see Create Real-Time Clock Block to Display Time Using IO Device Builder App.

System Requirements

To use the IO Device Builder, you need the following MathWorks® software:

Open IO Device Builder

To open the IO Device Builder app, follow these steps.

  1. Start MATLAB® and then open / create a Simulink® model.

  2. On the Hardware tab of the Simulink toolstrip, in the Prepare section, under Design, choose IO Device Builder.

    open IO device builder

    open IO device builder

  3. Click Next.

Select Working Directory and Add Third-party Source Files

Once the Source files location page loads, click Select to select the working directory.

The specified directory is where you can find the generated System object, along with the corresponding cpp and h files, as well as the model.

open IO device builder

Click Add folder to add the required third-party source files you downloaded.

Note

There is no need to add third-party source files. CubeMX IDE is used to generate all the required driver files.

Click Next.

Add Block Name, Block Description, and Add Block Parameters

In the Block parameters page, specify a name, add description, and add the required parameters for the block.

block parameters

  1. Specify a name for the block in Block Name textbox.

  2. Enter a description for the block in Block description textbox.

  3. Add the required parameters for the block using Add and Remove buttons. Use Move up and Move down buttons to move the selected parameters up / down in the list.

  4. Click Next to move to the next page.

Add Outputs for the Block

In the Outputs page, add the required output ports for the block.

select outputs for block

After adding the required output ports, click Next to move to the next page.

Add Inputs for the Block

In the Inputs page, add the required input ports for the block.

select inputs for block

After adding the required input ports, click Next to move to the next page.

Preview Block Image

In the Preview page, a preview image of the block is shown along with the outputs and inputs your added.

model diagram with output

Click Next to move to the next page.

Generate System Object Files

In the Generate page, click Generate to generate the system object files for the block.

Note

STMicroelectronics STM32 Processors supports both C and C++. Select or clear the Select to generate a C++ driver option according to your requirement.

Generate system object files

Next Steps

In the Next steps page, information to update the setup and step methods are mentioned. Click Finish to complete the process.

  • The generated cpp file opens automatically.

  • Modify the generated cpp files step and setup function as required.

  • Then open the generated model and navigate to Modeling > Model Settings and in the Configuration Parameters dialog box, click Hardware Implementation and then select an STMicroelectronics® Processor-Based board and do the necessary modifications.

model diagram with output