Project

General

Profile

Frequently Asked Questions

View table of content.

1 How can I get started?

This tutorial aims at teaching beginners how to use RapidSTM32 Blockset in ONE DAY (approximately 6 hours). After completing the tutorials, you will have enough basic knowledge to use the Blockset to implement a variety of basic but useful applications such as:

  • Real-time data acquisition into Matlab/Simulink
  • Add your own signal processing algorithm in Matlab (m-script) language
  • Control external hardware from Simulink
  • Use digital input/output ports
  • Generate PWM signals
  • Simulate and actually display some data on a character LCD
  • Send data to a PC via USB as a (Virtual) COM port
  • Understand the basic architecture of the generated code
  • Create an arbitrary function generator with Digital to Analog Module
  • Create a data logger to micro SD card

Yes!! all those within 6 hours, no kidding. We are truly taking about Rapid Prototyping. That's Why our duck can peel banana skin? :)

2 What is RapidSTM32?

RapidSTM32 LogoRapidSTM32 is a Simulink device driver blockset and tool suite for STM32 microcontroller family.

Ultimately, the blockset is expected to enable users to transfer their designs from Simulink, with just one click, to a working embedded system (based on STM32 microcontrollers) without the need to write a single line of C or Assembly code.

The blockset works by taking advantage of the Mathworks Inc.'s products, i.e. Real-Time Workshop and Real-Time Workshop Embedded Coder, code generation capability.

The blockset is not intended to be a comprehensive embedded target, allowing users to adjust every single bit in every single register.

Rather, its focus is on helping users (especially beginners in embedded systems) implement such complex systems or algorithms as event-driven real-time applications or Kalman filtering as Fast-Easy-Fun as possible without the need to understand RTOS or perform low-level device configuration or debugging.

Rapid STM32 bridges the gap between the high-performance graphical programing language, real-world applications, and the users with low-cost moderate-performance hardware.

3 Why RapidSTM32? Who needs it?

Ideally, RapidSTM32 is for anyone who needs to make use of an embedded system, a kind of a miniature computer on a single piece of Printed Circuit Board (PCB), but don't know how to or do not want to write a low-level program for it.

Basically, if you already know Matlab and want to do one of the following tasks:

  1. Bring in real world data from any kind of sensors into a PC.
  2. Control external hardware from a PC.
  3. Create an intelligent embedded system for any kind of stand alone applications such as.
    • A data logger system
    • Automatic/Intelligent/Automation control system
    • Signal processing system

Then RapidSTM32 is definitely for you.

RapidSTM32 can convert your Matlab program to a working system in just a few mouse clicks. All you need is standard Matlab tool suite, RapidSTM32 Blockset and FiO evaluation board. You do not need to write a single line of code.

Additionally, for students and lecturers in automatic control or DSP courses, RapidSTM32 Blockset will definitely help students:

  • learn about Rapid Prototyping and Model-based design using affordable hardware.
  • be able to focus their learning about such topics as Automatic Control Systems or Digital Signal Processing applications, while avoiding a steep learning curve in low-level C programming / debugging.
  • to be able to make use of microcontrollers in senior projects very Fast-Easy-Fun, directly from Matlab & Simulink.

Additionally, for students and lecturers in automatic control or DSP courses, RapidSTM32 Blockset will definitely help students:

  • learn about Rapid Prototyping and Model-based design using affordable hardware.
  • be able to focus their learning about such topics as Automatic Control Systems or Digital Signal Processing applications, while avoiding a steep learning curve in low-level C programming / debugging.
  • to be able to make use of microcontrollers in senior projects very Fast-Easy-Fun, directly from Matlab & Simulink.

Pictures are worth a thousand words.


The conventional Way of developing embedded systems.


The RapidSTM32 Way.

4 Why banana in RapidSTM32 Logo?

In Thailand, there is a saying "as easy as peeling a banana skin".

Our goal for RapidSTM32 is to make using microcontrollers as easy as peeling banana skin.

Thank you Viree for the Design.

Download our logo

Small Medium Large

5 What is STM32?

STM32 is a family of 32-bits ARM Cortex-M3 microcontrollers developed and marketed by STMicroelectronics.

ARM Cortec-M3 is based on ARMv7-M architecture which is not the same as ARM7. ARM7 microcontrollers are based on ARMv4 architecture.

Basically, ARM Cortex-M3 has been designed to improve upon and overcome several limitations of ARM7.

Read a Cortex - M3 white paper (An Introduction to the ARM Cortex-M3 Processor) from ARM Inc

This article reports a simple speed test between STM32 and other MCU.

6 RapidSTM32 Features

RapidSTM32 Blockset is offered with two sets of features:

  1. Limited-feature (Demo)
  2. Full-feature

Full-feature set is available only when FiO family of Evaluation Board (EVB) is physically connected to the host PC. FiO is a family of EVB that has been specifically designed to work seamlessly with RapidSTM32 Blockset and is offered at an affordable cost. In this respect, in addition to being an evaluation board, FiO is also a hardware key that enables the full features of RapidSTM32 Blockset.

Nevertheless, the generated source code is available for both full and limited features. "Therefore, in theory, even with limited-feature set you can modify the source code in anyway you like to suit your needs."

The following table lists and compares the features of RapidSTM32 Blockset.

Limited-feature Full-feature
Clock speed max. 24 MHz Unlimited
Digital IO Unlimited Unlimited
ADC 2 channels max. Unlimited
DAC 1 channel max. Unlimited
PWM 2 channels max. Unlimited
RTC Unlimited Unlimited
USART 2 element max. Unlimited
USB Virtual COM No Yes
USB HID No Yes
Character LCD Yes Yes
SD card No Yes
GPS NMEA Parser No Yes
GPS Simulation Blockset Yes Yes
Auto Compile No Yes
Auto Download No Yes
USB In Application Programming No Yes
USART In Application Programming No Yes

7 How does STM32 compare with other DSP microcontrollers?

Our choice to adopt STM32 is based on trade offs between price, performance, and ease-of-use.

We classify microcontrollers roughly in 3 groups.

  • High-end DSP with hardware floating point unit such as Texas Instrument C2000 family.
  • 32-bits hardware fixed-point unit such as ARM Cortex-M3.
  • 8-bits of 16-bits microcontrollers such as 8051 or dsPIC.

In terms of performance TI C2000 is very powerful with 300MIPS (Delfino) and hardware floating point unit. However, it is neither cheap to get started (eZdsp kits start from $500+) nor easy to use in custom board with high pin counts (176+) LQFP or BGA package.

8-bits or 16-bits microcontrollers are cheap (starter kits may start from about $40) and they are easy to use in custom board. However, the performance is limited, e.g. 16-bits and 40MIPS max. for dsPIC33.

In our opinion, ARM Cortex-M3 offers the best compromise. It is comparable to 16-bits microcontrollers in terms of price (ARM Cortex-M3 development kits start from about $20) and ease-of-use in custom board. Additionally, with 32-bits and 90MIPS, it offers superior performance to 8/16-bits systems.

We did a simple test. We declare two variable a = 1.1 and b = 2.2. We time how fast the program execute this single line c = a*b; using built-in stop watches in MPLAB IDE and Keil RealView MDK. The results are as follows.

Time taken in micro sec (10^-6) to execute a single line of code "c = a*b"; where a = 1.1; and b = 2.2;

IDE MPLAB Keil RVMDK
Settings Optimization Level 3 Optimization Level 3 use MicroLIB Optimization Level 3 do not use MicroLIB
CPU (Running Speed) dsPIC33 (40MIPS) STM32F103RE (90MIPS) STM32F103RE (90MIPS)
a,b,c data type IEEE float (32 bits) 3 2.58 2.13
a,b,c data type IEEE double (64 bits) 8.125 5.88 2.54

Remark

  1. dsPIC float and double is the same (IEEE 32 bits) to declare IEEE 64 bits use long double.
  2. RVMDK - ARM 4.10

8 Minimum requirements

  1. Matlab 2009a (version 7.8)
  2. Simulink 2009 (version 7.3)
  3. Real-Time Workshop 2009 (version 7.3)
  4. Real-Time Workshop Embedded Coder 2009 (version 5.3)
  5. RealView MDK for ARM version 4.0
  6. Microsoft Windows XP SP2
  7. .Net Framework version 3.5

9 How much does RapidSTM32 Blockset cost?

RapidSTM32 Blockset itself is free and is released under BSD license.

At present, however, RapidSTM32 is NOT opensource.

RapidSTM32 Blockset is offered with two sets of features:

  1. Limited-feature
  2. Full-feature

Full-feature set is available only when FiO family of Evaluation Board (EVB) is physically connected to the host PC. FiO is a family of EVB that has been specifically designed to work seamlessly with RapidSTM32 Blockset and is offered at an affordable cost. In this respect, FiO EVB may be viewed as a hardware key that enables the full features of RapidSTM32 Blockset.

Nevertheless, the generated source code is available for both full and limited features. "Therefore, in theory, even with limited-feature set you can modify the source code in anyway you like to suit your needs."

For a comprehensive list of feature comparison please see RapidSTM32 Features.

10 Can the Blockset be used with non FiO boards?

Yes. But with some limitations.

See this demonstration on How to.

Basically, just select "Generic" target board and then select your MCU.


Configuring RapidSTM32 for uses with Non FiO

11 Where does the name FiO come from?

When we started works on the Blockset and the evaluation board, we noticed that it can perform the following FOUR functions:

  1. Data acquisition
  2. Signal generation
  3. Data logger
  4. Custom stand-alone applications

So, we called it Four in One (FiO).