ARM Cortex-M1 Embedded Processor Software Development ...
44 pages
English

ARM Cortex-M1 Embedded Processor Software Development ...

Le téléchargement nécessite un accès à la bibliothèque YouScribe
Tout savoir sur nos offres
44 pages
English
Le téléchargement nécessite un accès à la bibliothèque YouScribe
Tout savoir sur nos offres

Description

®ARM Cortex™-M1 Embedded Processor
Software Development Tutorial
for Fusion Mixed-Signal FPGAs © 2009 Actel Corporation. All rights reserved.
Printed in the United States of America
Part Number: 50200162-1
Release: November 2009
No part of this document may be copied or reproduced in any form or by any means without prior written
consent of Actel.
Actel makes no warranties with respect to this documentation and disclaims any implied warranties of
merchantability or fitness for a particular purpose. Information in this document is subject to change without
notice. Actel assumes no responsibility for any errors that may appear in this document.
This document contains confidential proprietary information that is not to be disclosed to any unauthorized
person without prior written consent of Actel Corporation.
Trademarks
Actel, IGLOO, Actel Fusion, ProASIC, Libero, Pigeon Point and the associated logos are trademarks or registered
trademarks of Actel Corporation. All other trademarks and service marks are the property of their respective
owners. ®ARM Cortex™-M1 Embedded Processor Software Development Tutorial
Table of Contents
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Requirements for the Tutorial . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Tutorial Files . . . . . . . . . ...

Sujets

Informations

Publié par
Nombre de lectures 89
Langue English
Poids de l'ouvrage 1 Mo

Extrait

ARM
®
Cortex™-M1 Embedded Processor Software Development Tutorial
for Fusion Mixed-Signal FPGAs
© 2009 Actel Corporation. All rights reserved. Printed in the United States of America Part Number: 50200162-1 Release: November 2009 No part of this document may be copied or reproduc ed in any form or by any means without prior written consent of Actel. Actel makes no warranties with respect to this docu mentation and disclaims any implied warranties of merchantability or fitness for a particu lar purpose. Information in this document is su bject to change without notice. Actel assumes no respon sibility for any errors that may appear in this document. This document contains confidential proprietary information that is not to be disclosed to any unauthorized person without prior written consent of Actel Corporation.
Trademarks Actel, IGLOO, Actel Fusion, ProASIC, Libero, Pigeon Poin t and the associated logos ar e trademarks or registered trademarks of Actel Corporation. Al l other trademarks and service marks ar e the property of their respective owners.
Table of Contents
ARM®Cortex™-M1 Embedded Processo r Software Development Tutorial
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 Requirements for the Tutorial . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 Tutorial Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 1 Before You Get Started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 Set Up the USB-to-UART Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 Set Up HyperTerminal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 Install Firmware Catalog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 Setup Firmware Catalog to Run in SoftConsole . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 2 Tutorial – Create and Build Software Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 Open SoftConsole . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 Create and Build the Software Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 3 Tutorial – Programming and Debug . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 Program the FPGA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 Create the Cortex-M1 Debug Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 Launch Debug Session . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 Continue Debug Session for Fusion-Based Kits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 A Appendix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 Debugging Features in SoftConsole . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 Updating Contents of NVM in PDB file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 B List of Document Changes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 A Product Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 Customer Service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 Actel Customer Technical Support Center . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 Actel Technical Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 Website . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 Contacting the Customer Technical Support Center . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
3
Introduction
This tutorial shows you how use the Actel to ols to develop a software application for a Cortex™-M1–based embedded processor system. After completing this tutorial you will be familiar with the software design process which includes the following steps:  Creating the SoftConsole project  Configuring the SoftConsol e complier/linker settings  Compiling your code  Creating and launching a debug session  Debugging your code using SoftConsole This design is suitable as a starting point for developing an embedded system. Requirements for the Tutorial This tutorial requires SoftConsole v2.2 (or newer) and FlashPro v8.6 (or newer) installed on your computer. FlashPro is often installed as part of the Actel Libero® Integrated Design Environment (IDE) installation and can be launched from within Libero IDE or standalone. You will also need the following hardware:  One of the following Actel development boards: – Fusion Embedded Development Kit (M1AFS-EMBEDDED-KIT) – Fusion Advanced Development Kit (M1AFS -ADV-DEV-KIT) along with power supply  Programming hardware (low-cost programming stick or FlashPro3)  2 USB cables (program ming and communication) Programming of the application code to the ta rget board requires a FlashPro3 programmer (or low-cost programming stic k). Development kits contain a low- cost programming stick (LCPS) or FlashPro3 programmer. You will also need two USB cables; one for connecting the programmer to your PC and the other to connect the UA RT interface on the board to your PC. Tutorial Files Before starting the tutorial, you need to download the tutorial fi les from the website for the board you are targeting. Go to Actel's Design Hardware web page: (http://www.actel.com/produ cts/hardware/default.aspx) Click the link for the board you ar e targeting. On the web page of the target board, click the zip file under theARM Cortex-M1 Embedded Processo Software Development Tutorial r document. Download and unzip the file to your hard dr ive. The files are placed in a folder called CortexM1 Fusion SW Tutorial. _ _ _ If you browse the contents of the zip file, you wi ll see a subdirectory for every board this tutorial supports. The directory structure is si milar for each board. As an example,Figure 1shows a picture of the directory structure for the M1AFS-EMBE DDED-KIT board. The WORKSPACE is the software
 
5
Introduction
tutorial solution directory. If you change th e workspace in SoftConsol e to this location (File < Switch Workspace), you can use this software database directly.
Figure 1 Directory Structure for M1AFS-EMBEDDED-KIT Board TheCompleted_Design contains the complete Cortex-M1 subdirectory project for this tutorial design for your r_ you need toy les eference. TheTutorial Files contains th e source fi subdirector complete this tutorial.Table 1below has a description of these files. Table 1 Tutorial Files Descriptions File NameDescription _ _ prog ing fi le containing Cortex-M1 FPGA design M1<FPGA> TUT TOP.STP FPGA ramm tutorial (hardware design) tutorial.h Header file with memo ry map and interrupt assignments targeted for Cortex-M1 FPGA design tutorial main.c Top C source file boot-from-actel-coreahbnvm.ld Linker script mo dified to work with Fusion-based tutorial designs Thedriversall the peripherals in the system. Thesubfolder contains the driver code fo  rUSB Drivers subdirectory contains the driver for the USB-to-UART chip on the ta rget board. This driver allows you to communicate with the ta rget board over USB by treating the USB port as a COM port. Therefore, you can use HyperTermi nal to connect to a UART in th e design running on the board. Before debugging software for a Cortex-M1 system, you need the *.STP (p rogram database) file, which is used to program the FPGA with the ha rdware design. The *.STP file provided in this tutorial is from the design created in the Cortex-M1 <FPGA Family> FP GA Design Tutorial.
6
 
1 – Before You Get Started
Set Up the USB-to-UART Driver At the end of the tutori al, you program the Fusion FPGA and communicate with the target board. To complete the tutorial, you need to make sure that the USB-to-UART drivers are installed on your machine and that you know which COM port the US B port is associated with. Follow the steps below before starting th e tutorial to make sure your mach ine is properly configured and connected to the target board. 1. Install the drivers for th e USB to RS-232 Bridge by double clicking on thePreInstaller.exe executable located in theUSB_Driverssubfolder. Accept the default installation folder and press theInstall button. Press theContinue Anywaybutton if prompted. 2. Connect USB cables and power cables according toTable 1-1. Table 1-1 Board Connections Board Power and USB Connections M1AFS-EMBEDDED-KIT Make sure that you have J 40 set to use USB power (not V5IN). Connect a USB cable to J2, which provides power and the USB-to-UART communication. M1AFS-ADV-DEV-KIT Connect the 9 V power supply provided with the kit to J3 on the board. Connect a USB cable to J2. This provides the USB-to-UART communication and make sure SW7 is in the ON position to supply power to the board. 3. If Windows prompts you to conn ect to Windows Update, selectNo, not at this time and pressNext. Next, select tomatically (recommended)Install the software au and pressNext. Once installation has completed, pressFinish. Repeat the driver installation steps a second time (if prompted). Press theContinue Anywaybutton if prompted. 4. Open the Windows® Device Manager selecting byStart > Control Panel > System > Hardware > Device Manager. the ExpandPorts (COM & LPT) section and take note of the COM port assignment for the SFE USB to RS232 Controller.
 
7
Before You Get Started
The example shown inFigure 1-1is assigned to COM8.
Figure 1-1 Device Manager If you do not see SFE USB to RS232 Controller in the Device Manager, you may need to reboot your machine.
8
 
Set Up HyperTerminal
Set Up HyperTerminal 1. Open the HyperTerminal application (Start >Programs >Accessories >Communications > HyperTerminal). EnterCortexM1_Tutorial the Name field in th in Connection Description e dialog box and clickOK. 2. Select the COM po rt you identified in  1-7"Set Up the USB-to-UART Driver" on page and clickOK. 3. Enter the following valu es for the properties (Figure 1-2): – Bits per second: 57600 – Data bits: 8 – Parity: None – Stop bits: 1 – Flow control: None
Figure 1-2 COM Port Properties 4. ClickOK appropriate settings to communicate the. HyperTerminal is now connected with with the UART on the target design.
 
9
Before You Get Started
Install Firmware Catalog Firmware Catalog is a tool that allows you to create firmware for software development. Typically, you use the tool to select the firmware that you need and Firmware Catalog places the firmware into your software development pr oject (SoftConsole, IAR EWARM, or Keil). For this tutorial, you will use Firmware Catalog to add the drivers and HAL code to your SoftConsole project. Firmware Catalog is installe d by default when Libero IDE is inst alled (v8.6 or newer). If you do not want to install Libero IDE, you can download the Firmware Catalog install ation only from Actel’s Downloads web page: www.actel.com/download/default.aspx Regardless of which installation method you use, Firmware Catalog is a standalone tool with its own executable.
1 0
 
Setup Firmware Catalog to Run in SoftConsole
Setup Firmware Catalog to Run in SoftConsole Use the following steps to link Firmware Catalog to SoftConsole. 1. Invoke SoftConsole and de fine the directory calledWorkspace software project data for (Figure 1-3).
Figure 1-3 Workspace Launcher Note:Do not use folders that have spaces in the folder name.
 
11
  • Univers Univers
  • Ebooks Ebooks
  • Livres audio Livres audio
  • Presse Presse
  • Podcasts Podcasts
  • BD BD
  • Documents Documents