Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

ELEC2720 Introduction to Embedded Computing

Software Development Tools

1    Introduction

The software development tools or Integrated Development Environment (IDE) used for the assign- ments have already been installed on the computers in the laboratory. The tools allow software to be developed for the STM32 hardware available in the laboratory as well as targeting Windows.

The IDE used for course is available from OpenSTM32 Community [1] and is called System Work- bench for STM32 [2]. It is based on the Eclipse [3] IDE with a GNU [4] tool chain back end which can target the STM32 hardware. To allow Windows to be targeted, MinGW [5] is used. The tools are also available to run under Linux and MAC OSX. Under Linux and MAC OSX, the GNU C compiler is used instead of MinGW.

All of these software tools are freely available to download so that software development can be done away from the laboratory. In fact GNU, which stands for GNU’s not Unix! [6], is a collection of free software which is Unix like and even includes an operating system kernel called HURD. However, the most popular free Unix like kernel used today is Linux [7]

This document provides a brief overview of the STM32 hardware and the installation of the software development tools under Windows.

It is not a requirement of this course that you install the development tools on your own computer as the software is already installed on the computers in the laboratory. However, it would be convenient if you could run the development tools on your own computer as this would allow you to practice coding and work on the assignments without needing to access the laboratory.

2    Hardware Platform

The basis for the hardware is the WavesShare Open407V-D Package B[8]. This particular package includes the STM32F4DISCOVERY [9] board which uses the STM32F407 [10] microcontroller. This processor will be the target for software written during the trimester.

The package comes with a number of peripheral devices, although only a handful will be used for this course. The peripherals that will be used are:

PL2303 USB UART Board (TxD/RxD) Micro SD Storage Board (SDIO/SPI)   Analogue Input/Output (ADC/DAC)   UDA1380 Audio Board (I2 S/I2 C)

3.2 320x240 LCD Touch Screen (RAM/SPI)


Some of these peripherals are implemented using devices that are included with the microcontroller, such as the UART. Some peripherals connect to the microcontroller using a bus interface.  Details about the hardware will be provided with the assignments.

There are so many devices on the STM32F4 microcontroller that a software tool has been developed by the manufacturer to help configure these devices.  It is called STM32CubeMX [11]. A graphical user interface allows the selection and configuration of devices for a certain hardware platform which is then used to generate the complete code framework to be included in System Workbench. It can be installed as a separate program or as a plug in for System Workbench.

The code framework makes use of the STM32F4xx Hardware Abstraction Layer (HAL) library. These provide high level functions for accessing peripherals on the microcontroller.  This HAL library will be used for the three assignments, with template System Workbench projects provided as a starting point.   It  is  not critical to  have  STM32CubeMX  installed on your own computer for software development as all the required libraries will be provided.

To access the UART from the computer, the PuTTY [12] program will be used. This provides serial communications over USB using the Prolific USB-to-Serial COM Port.  Details to install PuTTY are provided later in this document.

3    Installing System Workbench

To be able to download System Workbench, you will need to create an account with the OpenSTM32 Community. There is no cost to create an account and it then gives you access to all resources.

Instructions for installing System Workbench can found at:


 

There are two options for installing the tools.  If you don’t already have Eclipse installed on your computer, then select the following option:

●  Installing System Workbench for STM32 with installer

This will present a page with instructions for installing the tools on Windows, Linux and MAC OSX.

The installation for Windows starts by downloading the System  Workbench for STM32  installer. The link for the installer goes to another page where the installer suitable for your computer can be selected. The executable install file is the most convenient.

The appropriate version of JavaRE is required, with the installer checking that an appropriate version is installed.   If not, the installer will direct you to install it.   The  remainder of the installation instructions on the website should be followed to complete installing the tools.

Once installation is complete, you have just about everything that is required to write software to target the STM32 hardware. The only other items that may be required are libraries specific to the hardware and device drivers for programming the STM32 from your computer.

 

4    Installing MinGW

The  MinGW software provides a  Minimalist GNU for Windows, which is where the contraction comes from. While it is not provide a POSIX runtime environment, such as Cygwin [13], it will be suitable for this course.


Instructions for installing MinGW can found at:

 

Getting Started:  MinGW Installation Notes

http://www.mingw.org/wiki/Getting Started


First the  Graphical User Interface Installer needs to be downloaded and installed using the link provided.  Using the basic set up, install the mingw-developer-toolkit, ming32-base, mingw32-gcc- g++ and msys-base.

Note  that  there  is actually a  newer version  which supports  64-bit platforms.   See http:// mingw-w64.org/doku.php and http://win-builds.org/doku.php.

The MinGW installation provides an IDE for code development. However once installed, the MinGW compiler appears as a compile and target option within System Workbench. It is recommended just to use the System  Workbench IDE. MSYS is a collection of GNU utilities that are required for building projects.

 

5    Installing PuTTY

The terminal program PuTTY is used to access the serial port.  It can transmit and receive serial data from the computer to the target hardware.

The installation file for PuTTY can found at:



 

Once installed, it provides an executable for the application in the installation folder.

To  use  PuTTY with the  hardware,  select the  Serial connection type and enter the  Serial line COM Port and Speed. The COM Port depends on the next available COM Port number when the USB cable is plugged into the computer from the PL2303 USB UART Board.  The speed setting needs to match the serial line settings on the hardware. In general, 115,200 Baud will be used. The other serial line settings can be left at default.

The only other setting is to set Implicit CR in every LF under Terminal. This is required send the end of line character sent by the GCC library only sends a LF character in true Unix style.