Create simulink model file and configuration for RTW (STM32F0 Target)

<< Click to Display Table of Contents >>

Navigation:  STM32F0 Target > Demos >

Create simulink model file and configuration for RTW (STM32F0 Target)

Previous pageReturn to chapter overviewNext page

Instruction for creating the Simulink model file used in this demo.

1. Create new and save file

Open Simulink Browser
At shortcut icon bar, click "New model" icon as below picture.


Select sub library node under "STM32F0 Target", drag "Target Setup" block and drop into the new model we've just created.
Base sample time. The sample time of "Target Setup" blocks will be use as base sample time(normally in Red color). It is recommended to use 0.001 to 0.1 second as base sample time of STM32F0 Target.
Update diagram, by press Ctrl+D keys (2 times). The block will be now in Red color.


Save model to file to the disk drive location (not recommended to save to removable drive).

Note, requirement for file name and directory path:

Non-Unicode (English only)
Not containing space or special character

2. Blocks supported for STM32F0 Target

Basic Simulink blocks library can be used in this model.
Waijung blocks
Blocks under "STM32F0 Target:" node (Device Configuration and On-chip Peripherals)
Soft I2C Master
Custom code
Character LCD
aMG Sense Light (Soft I2C)
aMG Sense Pressure (Soft I2C)
aMG Sense Temp Humid (Soft I2C)
Data Storage
Soft CRC
String Manipulation
Note: More blocks support will be add to later version release

3. Ready for design model function

This step is model design.

4. Verify blocks sample

Press Ctrl+J to display blocks color and its sample time. Below picture showing an example:


The model has two difference sample time, 0.1 and 0.5 second which represented in difference color.

5. Build model with Auto Compile and Download

Connect Hardware (FiO MOTE-ST + aMG_USBConnect)
Press Ctrl+B key to start build process.
Wait until auto code generation, compile and download to finish.