phycore-st10hs/e with st10f269 - phytec 2015 · phycore-st10hs/e with st10f269 ... new projects and...

74
A product of a PHYTEC Technology Holding company phyCORE-ST10HS/E with ST10F269 QuickStart Instructions Using ST Microelectronics’ ST10 Flasher and the Keil μVision2 Software Evaluation Development Tool Chain Note: The PHYTEC Spectrum CD includes the electronic version of the phyCORE-ST10HS/E English Hardware Manual Edition: March 2003

Upload: dinhnhi

Post on 26-Aug-2018

220 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: phyCORE-ST10HS/E with ST10F269 - Phytec 2015 · phyCORE-ST10HS/E with ST10F269 ... new projects and generate and download output files to the phyCORE-ST10HS/E using the Keil tools

A product of a PHYTEC Technology Holding company

phyCORE-ST10HS/Ewith ST10F269QuickStart Instructions

Using ST Microelectronics’ ST10 Flasher and the Keil µVision2Software Evaluation Development Tool Chain

Note: The PHYTEC Spectrum CD includes the electronic version ofthe phyCORE-ST10HS/E English Hardware Manual

Edition: March 2003

Page 2: phyCORE-ST10HS/E with ST10F269 - Phytec 2015 · phyCORE-ST10HS/E with ST10F269 ... new projects and generate and download output files to the phyCORE-ST10HS/E using the Keil tools

phyCORE-ST10HSE with ST10F269 QuickStart Instructions

© PHYTEC Meßtechnik GmbH 2003 L-633e_1

In this manual are descriptions for copyrighted products that are not explicitlyindicated as such. The absence of the trademark () and copyright () symbolsdoes not imply that a product is not protected. Additionally, registered patents andtrademarks are similarly not expressly indicated in this manual.

The information in this document has been carefully checked and is believed to beentirely reliable. However, PHYTEC Meßtechnik GmbH assumes noresponsibility for any inaccuracies. PHYTEC Meßtechnik GmbH neither givesany guarantee nor accepts any liability whatsoever for consequential damagesresulting from the use of this manual or its associated product. PHYTECMeßtechnik GmbH reserves the right to alter the information contained hereinwithout prior notification and accepts no responsibility for any damages whichmight result.

Additionally, PHYTEC Meßtechnik GmbH offers no guarantee nor accepts anyliability for damages arising from the improper usage or improper installation ofthe hardware or software. PHYTEC Meßtechnik GmbH further reserves the rightto alter the layout and/or design of the hardware without prior notification andaccepts no liability for doing so.

Copyright 2003 PHYTEC Meßtechnik GmbH, D-55129 Mainz.Rights - including those of translation, reprint, broadcast, photomechanical orsimilar reproduction and storage or processing in computer systems, in whole orin part - are reserved. No reproduction may occur without the express writtenconsent from PHYTEC Meßtechnik GmbH.

EUROPE NORTH AMERICA

Address: PHYTEC Technologie Holding AGRobert-Koch-Str. 39D-55129 MainzGERMANY

PHYTEC America LLC203 Parfitt Way SW, Suite G100Bainbridge Island, WA 98110USA

OrderingInformation:

+49 (800) [email protected]

1 (800) [email protected]

TechnicalSupport:

+49 (6131) [email protected]

1 (800) [email protected]

Fax: +49 (6131) 9221-33 1 (206) 780-9135

Web Site: http://www.phytec.de http://www.phytec.com

1st Edition: March 2003

Page 3: phyCORE-ST10HS/E with ST10F269 - Phytec 2015 · phyCORE-ST10HS/E with ST10F269 ... new projects and generate and download output files to the phyCORE-ST10HS/E using the Keil tools

Contents

© PHYTEC Meßtechnik GmbH 2003 L-633e_1 3

1 Introduction to the Rapid Development Kit .....................................5

1.2 Rapid Development Kit Documentation ......................................5

1.3 Overview of this QuickStart Instruction.......................................6

1.4 System Requirements ...................................................................7

1.5 The PHYTEC phyCORE-ST10HS/E ...........................................8

1.6 The Keil µVision2 Software Development Tool Chain.............11

2 Getting Started ..................................................................................15

2.1 Installing Rapid Development Kit Software ..............................15

2.2 Installing ST Microelectronics ST10 Flasher.............................21

2.3 Interfacing the phyCORE-ST10HS/E to a Host-PC...................22

2.4 Starting ST Microelectronics' ST10 Flasher...............................24

2.5 Downloading Example Code with ST10 Flasher .......................25

2.5.1 "Blinky" .........................................................................27

2.5.2 "Hello" ...........................................................................30

3 Getting More Involved......................................................................35

3.1 Starting the µVision2 Tool Chain...............................................35

3.2 Creating a New Project and Adding an Existing Source File ....36

3.3 Modifying the Source Code........................................................43

3.4 Saving the Modifications............................................................44

3.5 Setting Options for Target ..........................................................44

3.6 Building the Project ....................................................................47

3.7 Downloading the Output File .....................................................48

3.8 "Hello2" ......................................................................................49

3.8.1 Creating a New Project..................................................49

3.8.2 Modifying the Example Source.....................................50

3.8.3 Setting Target Options...................................................50

3.8.4 Building the New Project ..............................................50

3.8.5 Downloading the Output File ........................................51

3.8.6 Starting the Terminal Emulation Program ....................52

Page 4: phyCORE-ST10HS/E with ST10F269 - Phytec 2015 · phyCORE-ST10HS/E with ST10F269 ... new projects and generate and download output files to the phyCORE-ST10HS/E using the Keil tools

phyCORE-ST10HSE with ST10F269 QuickStart Instructions

© PHYTEC Meßtechnik GmbH 2003 L-633e_1

4 Debugging ..........................................................................................53

4.1 Creating a Debug Project and Preparing the Debugger .............54

4.2 Preparing the Debugger..............................................................55

4.3 Preparing the Target Hardware to Communicate with the

Debugger ....................................................................................56

4.4 Starting the Debugger.................................................................57

4.5 Using the Keil µVision2 Debug Features ..................................59

4.5.1 Breakpoints....................................................................59

4.5.2 In Line Assembler .........................................................60

4.6 Single Stepping...........................................................................61

4.6.1 Memory Window ..........................................................62

4.6.2 Watch Window..............................................................62

4.7 Resetting Simulator and the phyCORE-ST10HSE ....................64

5 Advanced User Information.............................................................65

5.1 Start-pcST10HSE.a66 ................................................................65

5.2 Linking and Locating .................................................................66

5.3 Debugging Using Monitor Kernel..............................................68

5.4 Demo for the Optional Ethernet Controller CS8900A-CQ........70

Index of Figures

Figure 1: phyCORE Development Board HD200 Overview.....................22

Figure 2: Default Setting for the phyCORE DevelopmentBoard HD200 .............................................................................23

Figure 3: Power Connector ........................................................................23

Page 5: phyCORE-ST10HS/E with ST10F269 - Phytec 2015 · phyCORE-ST10HS/E with ST10F269 ... new projects and generate and download output files to the phyCORE-ST10HS/E using the Keil tools

Introduction

© PHYTEC Meßtechnik GmbH 2003 L-633e_1 5

1 Introduction to the Rapid Development Kit

This QuickStart provides:

• general information on the PHYTEC phyCORE-ST10HS/E SingleBoard Computer (SBC),

• an overview of Keil’s µVision2 software development tool chainevaluation version, and

• instructions on how to run example programs on thephyCORE-ST10HS/E, mounted on the PHYTEC phyCOREDevelopment Board HD200, in conjunction with Keil softwaretools

Please refer to the phyCORE-ST10HS/E Hardware Manual forspecific information on such board-level features as jumperconfiguration, memory mapping and pin layout. Selecting the links onthe electronic version of this document links to the applicable sectionof the phyCORE-ST10HS/E Hardware Manual.

1.2 Rapid Development Kit Documentation

This "Rapid Development Kit" (RDK) includes the followingelectronic documentation on the enclosed "PHYTEC SpectrumCD-ROM":

• the PHYTEC phyCORE-ST10HS/E Hardware Manual• controller User's Manuals and Data Sheets• this QuickStart Instruction with general "Rapid Development Kit"

description, software installation hints and three example programsenabling quick out-of-the box start-up of the phyCORE-ST10HS/Ein conjunction with the Keil µVision2 software development toolchain evaluation version

Page 6: phyCORE-ST10HS/E with ST10F269 - Phytec 2015 · phyCORE-ST10HS/E with ST10F269 ... new projects and generate and download output files to the phyCORE-ST10HS/E using the Keil tools

phyCORE-ST10HSE with ST10F269 QuickStart Instructions

© PHYTEC Meßtechnik GmbH 2003 L-633e_1

1.3 Overview of this QuickStart Instruction

This QuickStart Instruction gives a general "Rapid Development Kit"description, as well as software installation hints and three exampleprograms enabling quick out-of-the box start-up of thephyCORE-ST10HS/E in conjunction with Keil µVision2. It isstructured as follows:

1) The "Getting Started" section uses two example programs:Blinky and Hello to demonstrate the download of user code to theFlash device using ST Microelectronics ST10 Flasher.

2) The „Getting More Involved“ section provides step-by-stepinstructions on how to modify both examples, create and buildnew projects and generate and download output files to thephyCORE-ST10HS/E using the Keil tools and ST10 Flasher.

3) The “Debugging" section provides a third exampleprogram - "Debug" - to demonstrate simple debug functionsusing the Keil µVision2 debug environment.

In addition to dedicated data for this Rapid Development Kit, thePHYTEC Spectrum CD-ROM contains supplemental information onembedded microcontroller design and development.

Page 7: phyCORE-ST10HS/E with ST10F269 - Phytec 2015 · phyCORE-ST10HS/E with ST10F269 ... new projects and generate and download output files to the phyCORE-ST10HS/E using the Keil tools

Introduction

© PHYTEC Meßtechnik GmbH 2003 L-633e_1 7

1.4 System Requirements

Use of this "Rapid Development Kit" requires:

• the PHYTEC phyCORE-ST10HS/E• the phyCORE Development Board HD200 with the included DB-9

serial cable and AC adapter supplying 5 VDC /min. 500 mA• the PHYTEC Spectrum CD• an IBM-compatible host-PC (486 or higher running at least

Windows95/NT)

For more information and example updates, please refer to thefollowing sources:

http://www.phytec.com - or - http://[email protected] - or - [email protected]

http://[email protected]

Page 8: phyCORE-ST10HS/E with ST10F269 - Phytec 2015 · phyCORE-ST10HS/E with ST10F269 ... new projects and generate and download output files to the phyCORE-ST10HS/E using the Keil tools

phyCORE-ST10HSE with ST10F269 QuickStart Instructions

© PHYTEC Meßtechnik GmbH 2003 L-633e_1

1.5 The PHYTEC phyCORE-ST10HS/E

The phyCORE-ST10HS/E represents an affordable yet highlyfunctional Single Board Computer (SBC) solution in sub-miniaturedimensions (60 x 53 mm). It is intended for use in memory-intensiveapplications running within a CAN bus system. The standard board ispopulated with an ST Microelectronics ST10F269 controller as wellas a Real-Time Clock which, like the SRAM, can be buffered by anexternal battery.

All applicable data/address lines and signals extend from theunderlying logic devices to two high-density Molex SMT pin headerconnectors (pin width is 0.635 mm/25 mil) lining the circuit boardedges. This enables the phyCORE-ST10HS/E to be plugged like a"big chip" into target hardware.

The standard module runs at a 40 MHz internal clock speed(delivering 50 ns instruction cycle) and offers 512 kByte (up to1 MByte) SRAM, 256 kByte on-chip Flash as well as up to 2 Mbyteon-board Flash for DATA and CODE storage.

The module communicates by means of an RS-232 transceiver and2 CAN bus interfaces. An optional external UART with an RS-232transceiver provides the second asynchronous serial interface. Theoptional CS8900A 10Base-T Ethernet controller enableimplementation of the module in embedded Internet devices. ThephyCORE-ST10HS/E operates within a standard industrial range of0 to +70°C and requires only a 220 mA power source.

ST Microelectronics’ ST10 Flasher enables easy in-systemprogramming of the on-chip Flash memory.

Page 9: phyCORE-ST10HS/E with ST10F269 - Phytec 2015 · phyCORE-ST10HS/E with ST10F269 ... new projects and generate and download output files to the phyCORE-ST10HS/E using the Keil tools

Introduction

© PHYTEC Meßtechnik GmbH 2003 L-633e_1 9

phyCORE-ST10HS/E (ST10F269) Technical Highlights

• SBC in subminiature dimensions (60 x 53 mm) achieved throughmodern SMD technology

• populated with an ST Microelectronics ST10F269 controllerfeaturing two Full 2.0B on-chip CAN and operating in 16-bit, non-multiplexed bus mode at 40 MHz CPU speed (50 ns/instructioncycle)

• 512 kByte (up to 1 MByte) external SRAM (up to 1 MByte )1

• 256 kByte on-chip Flash memory supporting on-board downloadof user code from a host-PC in conjunction with STMicroelectronics’ ST10 Flasher1

• no dedicated programming voltage required• battery-buffered Real-Time Clock• one serial interface via RS-232• external UART as a second asynchronous serial interface• optional Ethernet controller• 16-channel A/D converter with 10-bit resolution• two 2.0B Full-CAN interfaces• requires a single power supply of 5 VDC/ <220 mA

1 : Please contact PHYTEC for more information about additional module configurations.

Page 10: phyCORE-ST10HS/E with ST10F269 - Phytec 2015 · phyCORE-ST10HS/E with ST10F269 ... new projects and generate and download output files to the phyCORE-ST10HS/E using the Keil tools

phyCORE-ST10HSE with ST10F269 QuickStart Instructions

© PHYTEC Meßtechnik GmbH 2003 L-633e_1

The phyCORE Development Board HD200, in EURO-carddimensions (160 x 100 mm) is fully equipped with all mechanical andelectrical components necessary for the speedy and secure insertionand subsequent programming of most PHYTEC phyCORE high-density series Single Board Computers. Simple jumper configurationreadies the Development Board’s connection to thephyCORE-ST10HS/E, which plugs into the receptacle contact stripsmounted on the Development Board HD200.

phyCORE Development Board HD200 Technical Highlights

• Reset signal controlled by push button or RS-232 control lineCTS0

• Boot signal controlled by push button or RS-232 control line DSR0

• low voltage socket for supply with regulated input voltage 5 VDC

• additional supply voltage 3.3 VDC

• two DB-9 sockets (P1A, P1B) configurable as RS-232 interfaces

• two additional DB-9 plugs (P2A, P2B) configurable asCAN interfaces

• simple jumper configuration allowing use of thephyCORE Development Board HD 200 with various PHYTECphyCORE high-density SBC’s

• RJ45 Ethernet transformer module

• one control LED D3 for quick testing of user software

• 2 x 160-pin Molex connector (X2) enabling easy connectivity toexpansion boards (e.g. PHYTEC GPIO Expansion Board)

Page 11: phyCORE-ST10HS/E with ST10F269 - Phytec 2015 · phyCORE-ST10HS/E with ST10F269 ... new projects and generate and download output files to the phyCORE-ST10HS/E using the Keil tools

Introduction

© PHYTEC Meßtechnik GmbH 2003 L-633e_1 11

1.6 The Keil µVision2 Software Development Tool Chain

Keil µVision2 fully supports the entire ST Microelectronics C166microcontroller family. This includes a C compiler, macroassembler,Linker/Locator and the Simulator and Target Monitor within theµVision2 IDE. Specific chips supported are the ST10F168, ST10F269and more. Future derivatives are easily accommodated due to theflexible Keil C compiler design.

µVision2 supports all in-circuit emulators that adhere to the InfineonOMF166 debugging specification. The Keil OH166 Object-to-Hexconverter converts an absolute object file into an Intel hexfile that issuitable for programming into an EPROM device or downloading intointernal/external Flash on the PHYTEC phyCORE-ST10HS/E targetboard.

µVision2 consists of the following executables:

• C Compiler c166. exe• Assembler a166. exe• Linker l166. exe• Converter oh166. exe• µVision2 Uv2. exe (a Windows-based application)

Once installed, the default destination location for the DOS based filesis the C:\Keil\C166\bin directory while µVision2 is in C:\Keil\Uv2.Access to these programs from Windows is accomplished withµVision2. The entire tool set can be run from µVision2 or directlyfrom DOS with batch files. The evaluation version is limited in codesize to 8 kByte. Other than these restrictions, all features operatenormally.

Page 12: phyCORE-ST10HS/E with ST10F269 - Phytec 2015 · phyCORE-ST10HS/E with ST10F269 ... new projects and generate and download output files to the phyCORE-ST10HS/E using the Keil tools

phyCORE-ST10HSE with ST10F269 QuickStart Instructions

© PHYTEC Meßtechnik GmbH 2003 L-633e_1

µVision2 IDE

µVision2 is a Windows-based Graphical User Interface for theC compiler and assembler. All compiler, assembler and linker optionsare set with simple mouse clicks. µVision runs under Windows95/98/Me, NT, 2000 and XP. This Integrated DevelopmentEnvironment (IDE) has been expressly designed with the user in mindand includes a fully functional editor.

All IDE commands and functions are accessible via intuitive pull-down menus with prompted selections. An extensive Help utility isincluded. External executables can be run from within µVision2, in-cluding emulator software.

C166 C Compiler for the Entire ST Microelectronics ST10 Family

The C166 ANSI compiler and A166 assembler are designedspecifically for the ST Microelectronics ST10F168, ST10F269, andfuture derivatives. The C166 compiler easily integrates into the KeilRTOS and interfaces and passes debug information to the µVision2Simulator and all in-circuit emulators. Extensions provide access toon-chip peripherals.

The Keil C166 compiler provides the fastest and smallest code usingindustry benchmarks.

A166 Macroassembler

The Professional Kit (PK) macroassembler is included with thePK Compiler package or is available separately. It is DOS-based orcan be run from µVision2 and includes all utilities needed to completeyour project.

Page 13: phyCORE-ST10HS/E with ST10F269 - Phytec 2015 · phyCORE-ST10HS/E with ST10F269 ... new projects and generate and download output files to the phyCORE-ST10HS/E using the Keil tools

Introduction

© PHYTEC Meßtechnik GmbH 2003 L-633e_1 13

Debug Environment

µVision2 contains a software simulator supporting debugging eithervia software on a host-PC or in target hardware. When operated inconjunction with the Keil Monitor resident in target hardwareµVision2 enable the following debugging functions:

• run/halt,• set breakpoints,• examine/change memory,• view the stack,• view/set peripheral information• apply virtual external signals.

µVision2 has a performance analysis feature to ensure your code runsefficiently. In addition, µVision2 has a disassembler/assembler thatallows the modification of user code without recompiling. Theevaluation version of µVision2 is restricted to a 8 kByte inmanipulable code. Other than this restriction the evaluation tool chain(EK) functions exactly as does the full (PK) version. The evaluationversion does not have a starting address restriction and producesuseful object code. This allows you to fully evaluate the features andpower of Keil products on the PHYTEC target board. The PK fullversion has no restrictions and is fully ANSI compliant.

FR166 Full-Function RTOS for the Infineon C166 Family

The FR166 is a multi-tasking real-time operating system for theInfineon 166 family. You can manage multiple tasks on a single CPUmaking your programs much easier to develop. The RTX166 Fullincludes CAN libraries. The RTX166 Tiny is a subset of the RTX166Full and is included with all C166 C Compiler Kits. The EK versionof the tool chain does not include an RTOS.

Page 14: phyCORE-ST10HS/E with ST10F269 - Phytec 2015 · phyCORE-ST10HS/E with ST10F269 ... new projects and generate and download output files to the phyCORE-ST10HS/E using the Keil tools

phyCORE-ST10HSE with ST10F269 QuickStart Instructions

© PHYTEC Meßtechnik GmbH 2003 L-633e_1

CAN (Controller Area Network) Library

The RTX166 Full RTOS supports CAN controllers with the includedlibraries. The CAN libraries are sold with the RTOS and support11- and 29-bit message identifiers. Keil C166/ST10 and 8051 Ccompilers interface with the RTOS and CAN libraries. Keil supportsvarious CAN microcontrollers including the ST10F168 and ST10F269among others. Future CAN products based on these 8051 orC16x/ST10 families are easily supported due to the flexible KeilCompiler design.

Page 15: phyCORE-ST10HS/E with ST10F269 - Phytec 2015 · phyCORE-ST10HS/E with ST10F269 ... new projects and generate and download output files to the phyCORE-ST10HS/E using the Keil tools

Getting Started

© PHYTEC Meßtechnik GmbH 2003 L-633e_1 15

2 Getting Started

What you will learn with this Getting Started example:

• installing Rapid Development Kit software• starting ST10 Microelectronics’ ST10 Flasher download utility• interfacing the phyCORE-ST10HS/E, mounted on the

Development Board, to a host-PC• downloading example user code in hexfile format from a host-PC

to the on-chip Flash memory using the ST10 Flasher

2.1 Installing Rapid Development Kit Software

When you insert the PHYTEC Spectrum CD into the CD-ROM driveof your host-PC, the PHYTEC Spectrum CD should automaticallylaunch a setup program that installs the software required for theRapid Development Kit as specified by the user. Otherwise the setupprogram start.exe can be manually executed from the root directory ofthe PHYTEC Spectrum CD.

Page 16: phyCORE-ST10HS/E with ST10F269 - Phytec 2015 · phyCORE-ST10HS/E with ST10F269 ... new projects and generate and download output files to the phyCORE-ST10HS/E using the Keil tools

phyCORE-ST10HSE with ST10F269 QuickStart Instructions

© PHYTEC Meßtechnik GmbH 2003 L-633e_1

The following window appears:

• Choose Install Basic Product Files Button.• After accepting the Welcome window and license agreement select

the destination location for installation of Rapid Development Kitsoftware and documentation.

The default destination location is C:\PHYBasic. All path and filestatements within this QuickStart Instruction are based on theassumption that you accept the default install paths and drives. If youdecide to individually choose different paths and/or drives you mustconsider this for all further file and path statements.

We recommend that you accept the default destination location.

Page 17: phyCORE-ST10HS/E with ST10F269 - Phytec 2015 · phyCORE-ST10HS/E with ST10F269 ... new projects and generate and download output files to the phyCORE-ST10HS/E using the Keil tools

Getting Started

© PHYTEC Meßtechnik GmbH 2003 L-633e_1 17

• In the next window select your Rapid Development Kit of choicefrom the list of available products. By using the Change button,advanced users can select in detail which options should beinstalled for a specific product.

All Kit-specific content will be installed to a Kit-specific subdirectoryof the Rapid Development Kit root directory that you have specified atthe beginning of the installation process.

Page 18: phyCORE-ST10HS/E with ST10F269 - Phytec 2015 · phyCORE-ST10HS/E with ST10F269 ... new projects and generate and download output files to the phyCORE-ST10HS/E using the Keil tools

phyCORE-ST10HSE with ST10F269 QuickStart Instructions

© PHYTEC Meßtechnik GmbH 2003 L-633e_1

All software and tools for this phyCORE-ST10HS/E RDK will beinstalled to the \PHYBasic directory on your hard-drive.

• In the next dialog you must choose whether to copy the selecteddocumentation as *.pdf files to your hard drive or to install a linkto the file on the Spectrum CD.

If you decide not to copy the documentation to your hard-drive youwill need the PHYTEC Spectrum CD-ROM each time you want toaccess these documents. The installed links will refer to yourCD-ROM drive in this case.

If you decide to copy the electronic documentation to your hard-drive,the documentation for this phyCORE-ST10HSE Kit will also beinstalled to the Kit-specific subdirectory.

Page 19: phyCORE-ST10HS/E with ST10F269 - Phytec 2015 · phyCORE-ST10HS/E with ST10F269 ... new projects and generate and download output files to the phyCORE-ST10HS/E using the Keil tools

Getting Started

© PHYTEC Meßtechnik GmbH 2003 L-633e_1 19

• Setup will now add program icons to the program folder, namedPHYTEC.

• In the next window, choose the Keil EK166 Software DevelopmentTool Chain.

The applicable Keil tool chain must be installed to ensure successfulcompletion of this QuickStart Instruction. Failure to install the propersoftware could lead to possible version conflicts, resulting infunctional problems.

We recommend that you install the Keil EK166 resp. µVision2 fromthe Spectrum CD-ROM even if other versions of µVision2 are alreadyinstalled on your system. These QuickStart Instructions and the demosoftware included on the CD-ROM have been specifically tailored foruse with one another.

• After accepting the Welcome window and license agreement selectthe destination location for installation of the Development ToolChain.

Page 20: phyCORE-ST10HS/E with ST10F269 - Phytec 2015 · phyCORE-ST10HS/E with ST10F269 ... new projects and generate and download output files to the phyCORE-ST10HS/E using the Keil tools

phyCORE-ST10HSE with ST10F269 QuickStart Instructions

© PHYTEC Meßtechnik GmbH 2003 L-633e_1

The applicable Keil µVision2 evaluation development tool chain willbe installed to your hard-drive. Additional software, such as AdobeAcrobat Reader, will also be offered for installation.

• If a version of Acrobat Reader is already installed on your systemyou can skip the next step by clicking on No.

• Decide if you want to begin the QuickStart Instruction immediatelyby selecting the appropriate checkbox and click on Finish tocomplete the installation.

Page 21: phyCORE-ST10HS/E with ST10F269 - Phytec 2015 · phyCORE-ST10HS/E with ST10F269 ... new projects and generate and download output files to the phyCORE-ST10HS/E using the Keil tools

Getting Started

© PHYTEC Meßtechnik GmbH 2003 L-633e_1 21

2.2 Installing ST Microelectronics ST10 Flasher

The applicable ST10 Flasher software must be installed to ensuresuccesful completion of this QuickStart Instruction.

Install ST Microelectronics ST10 Flasher by executing Setup.exefrom within the \Software\ST-Flasher\Disk1 directory of yourPHYTEC Spectrum CD and follow the installation instructions.

• In the ST10 Flasher Setup window, click on Next and complete theST10 Flasher setup program.

Page 22: phyCORE-ST10HS/E with ST10F269 - Phytec 2015 · phyCORE-ST10HS/E with ST10F269 ... new projects and generate and download output files to the phyCORE-ST10HS/E using the Keil tools

phyCORE-ST10HSE with ST10F269 QuickStart Instructions

© PHYTEC Meßtechnik GmbH 2003 L-633e_1

2.3 Interfacing the phyCORE-ST10HS/E to a Host-PC

Connecting the phyCORE-ST10HS/E, mounted on the phyCOREDevelopment Board HD200, to your computer is simple.

• As shown in the figure below, if the phyCORE module is notalready pre-installed, mount it connector side down onto theDevelopment Board’s receptacle footprint (X6).

Ensure that pin 1 of the phyCORE-connector (denoted by the hashstencil mark on the PCB) matches pin 1 of the receptacle on thephyCORE Development Board HD200.Ensure that there is a solid connection between the Molex connectoron the module and the Development Board receptacle.

Figure 1: phyCORE Development Board HD200 Overview

Page 23: phyCORE-ST10HS/E with ST10F269 - Phytec 2015 · phyCORE-ST10HS/E with ST10F269 ... new projects and generate and download output files to the phyCORE-ST10HS/E using the Keil tools

Getting Started

© PHYTEC Meßtechnik GmbH 2003 L-633e_1 23

• Configure the jumpers on the Development Board as indicated inFigure 2. This correctly routes the RS-232 signals to the DB-9socket (P1A = bottom) and connects the Development Board’speripheral devices to the phyCORE module.

Figure 2: Default Setting for the phyCORE Development Board HD200

• Connect the RS-232 interface of your computer to the DB-9RS-232 interface on the phyCORE Development Board HD200(P1A = bottom) using the included serial cable.

• Using the included power adapter, connect the power socket on theboard (X1) to a power supply (refer to Figure 3 for the correctpolarity).

Figure 3: Power Connector

+5 VDC

GND

1500 mA

Center Hole1.3 mm 3.5 mm

-- +Polarity:

Page 24: phyCORE-ST10HS/E with ST10F269 - Phytec 2015 · phyCORE-ST10HS/E with ST10F269 ... new projects and generate and download output files to the phyCORE-ST10HS/E using the Keil tools

phyCORE-ST10HSE with ST10F269 QuickStart Instructions

© PHYTEC Meßtechnik GmbH 2003 L-633e_1

• Simultaneously press the Reset (S2) and Boot (S1) buttons on thephyCORE Development Board HD200, first releasing the Resetand then, two or three seconds later, release the Boot button.

This sequence of pressing and releasing the Reset (S2) and Boot (S1)buttons renders the phyCORE-ST10HS/E into the Bootstrap mode.Use of ST10 Flasher always requires the phyCORE-ST10HS/E to bein Bootstrap mode.

The phyCORE module should now be properly connected via thephyCORE Development Board HD200 to a host-PC and powersupply. After executing a Reset and rendering the board in Flashprogramming mode, you are now ready to program thephyCORE-ST10HS/E. This phyCORE module/phyCOREDevelopment Board HD200 combination is also referred to as "targethardware".

2.4 Starting ST Microelectronics’ ST10 Flasher

ST10 Flasher for Windows is a utility program that allows downloadof user code in Intel *.hex file format from a host-PC to thecontroller’s on-chip Flash on a PHYTEC SBC via an RS-232connection.

Proper connection of a PHYTEC SBC to a host-PC enables thesoftware portion of ST10 Flasher to recognize and communicate to theBootstrap loader on the phyCORE-ST10HS/E.

Note:Always ensure that the phyCORE-ST10HS/E is in Bootstrap modebefore starting ST10 Flasher (see section 2.2).

• You can start ST10 Flasher by selecting it from the Programsmenu using the Windows Start button.

• ST10 Flasher tries to establish connection to the target hardware.

Page 25: phyCORE-ST10HS/E with ST10F269 - Phytec 2015 · phyCORE-ST10HS/E with ST10F269 ... new projects and generate and download output files to the phyCORE-ST10HS/E using the Keil tools

Getting Started

© PHYTEC Meßtechnik GmbH 2003 L-633e_1 25

It is recommended that you drag the ST10 Flasher icon onto thedesktop of your PC. This enables easy start of ST10 Flasher bydouble-clicking on the icon.

The microcontroller tries to automatically adjust to the baud rate usedby ST10 Flasher (default 57,600 baud). See the ST10 Flasher manualfor details on how to change the default setting. However, it mayoccur that the selected baud rate can not be attained. This results in aconnection error. In this case, try other baud rates to establish a con-nection. Before attempting each connection, be sure to reset the targethardware and render it into Bootstrap mode as described insection 2.2.

2.5 Downloading Example Code with ST10 Flasher

• Ensure that the target hardware is properly connected to the host-PC and a power supply.

• Reset the target hardware and force it into Bootstrap mode bysimultaneously pressing the Reset (S2) and Boot (S1) buttons onthe phyCORE Development Board HD200 and then releasing firstthe Reset and, two or three seconds later, the Boot button.

• Start ST10 Flasher for Windows by double-clicking on theST10 Flasher icon or by selecting ST10 Flasher from within thePrograms program group.

• ST10 Flasher tries to establish connection to the target hardware.

The default settings for the ST10 Flasher configure COM1 with57,600 baud as communication parameters. If you want to changethese default settings follow the instructions given in theST10 Flasher User’s Manual located in the installation folder\Program Files\STMicoelectronics\ST10-Flasher-2.02\Doc.

Page 26: phyCORE-ST10HS/E with ST10F269 - Phytec 2015 · phyCORE-ST10HS/E with ST10F269 ... new projects and generate and download output files to the phyCORE-ST10HS/E using the Keil tools

phyCORE-ST10HSE with ST10F269 QuickStart Instructions

© PHYTEC Meßtechnik GmbH 2003 L-633e_1

• The ST10 Flasher startup window will now appear.

Page 27: phyCORE-ST10HS/E with ST10F269 - Phytec 2015 · phyCORE-ST10HS/E with ST10F269 ... new projects and generate and download output files to the phyCORE-ST10HS/E using the Keil tools

Getting Started

© PHYTEC Meßtechnik GmbH 2003 L-633e_1 27

2.5.1 "Blinky"

The "Blinky" example downloads a program to the Flash that, whenexecuted, manipulates the LED D3 on the phyCORE DevelopmentBoard HD200 that is located above the jumper field(refer to Figure 1).

• Choose Open Hex File from the File menu.

• Select (*.*) in the List file of type: pull-down menu.

The hexfile has already been installed to your hard drive during theinstallation procedure.

Page 28: phyCORE-ST10HS/E with ST10F269 - Phytec 2015 · phyCORE-ST10HS/E with ST10F269 ... new projects and generate and download output files to the phyCORE-ST10HS/E using the Keil tools

phyCORE-ST10HSE with ST10F269 QuickStart Instructions

© PHYTEC Meßtechnik GmbH 2003 L-633e_1

• Browse to the correct drive and path for the phyCORE-ST10HS/EDemo folder (default location

C:\PHYBasic\pC-ST10HSE\Demos\Keil\Blinky\Blinky.h86),select the file Blinky.h86 and click OK.

• The ST10 Flasher main window will re-appear.

Page 29: phyCORE-ST10HS/E with ST10F269 - Phytec 2015 · phyCORE-ST10HS/E with ST10F269 ... new projects and generate and download output files to the phyCORE-ST10HS/E using the Keil tools

Getting Started

© PHYTEC Meßtechnik GmbH 2003 L-633e_1 29

• Click on the Program & Verify button in the upper right corner.• Wait until programming is done. Once you see the OK message in

the Message Window, the downloaded code can be executed.

• Exit ST10 Flasher.• Press the Reset button (S2) on the phyCORE Development

Board HD200 to reset the target hardware and to start execution ofthe downloaded software.

• Successful execution of the program will flash the LED D3 withequal on and off duration.

Page 30: phyCORE-ST10HS/E with ST10F269 - Phytec 2015 · phyCORE-ST10HS/E with ST10F269 ... new projects and generate and download output files to the phyCORE-ST10HS/E using the Keil tools

phyCORE-ST10HSE with ST10F269 QuickStart Instructions

© PHYTEC Meßtechnik GmbH 2003 L-633e_1

2.5.2 "Hello"

The "Hello" example downloads a program to the on-chip Flash that,when executed, sends a character string from the target hardware backto the host-PC. The character string can be viewed with a terminalemulation program. This example program provides a review of theST10 Flasher download procedure. For detailed commentary on eachstep, described below in concise form, refer back to sections 2.2through .

• Ensure that the target hardware is properly connected to thehost-PC and a power supply.

• Reset the target hardware and force it into Bootstrap mode bysimultaneously pressing the Reset (S2) and Boot (S1) buttons onthe phyCORE Development Board HD200 and then releasing firstthe Reset and, two or three seconds later, the Boot button.

• Start ST10 Flasher.• Choose Open Hex File from the File menu.

The demo hexfile has already been installed to your hard drive duringthe installation procedure.

• Browse to the correct drive and path for the phyCORE-ST10HS/EDemo folder (default locationC:\PHYBasic\pC-ST10HSE\Demos\Keil\Hello\Hello.h86)and click OK.

• The ST10 Flasher main window will re-appear.• Click on the Program & Verify button in the upper right corner.• Wait until the Flash programming is done. Once you see the OK

message in the Message window, the downloaded code can beexecuted.

• Exit ST10 Flasher.

Page 31: phyCORE-ST10HS/E with ST10F269 - Phytec 2015 · phyCORE-ST10HS/E with ST10F269 ... new projects and generate and download output files to the phyCORE-ST10HS/E using the Keil tools

Getting Started

© PHYTEC Meßtechnik GmbH 2003 L-633e_1 31

Monitoring the execution of the Hello demo requires use of a terminalprogram, such as the HyperTerminal program included withinWindows.

• Start the HyperTerminal program within the Programs|Accessoriesbar.

• The HyperTerminal main window will now appear2:• Double-click on the HyperTerminal icon “Hypertrm” to create a

new HyperTerminal session.

• The Connection Description window will now appear. Enter“COM Direct” in the Name text field.

• Next click on OK. This creates a new HyperTerminal sessionnamed “COM Direct” and advances you to the nextHyperTerminal window.

2 : The HyperTerminal Window has a different appearance for different versions of Windows.

Page 32: phyCORE-ST10HS/E with ST10F269 - Phytec 2015 · phyCORE-ST10HS/E with ST10F269 ... new projects and generate and download output files to the phyCORE-ST10HS/E using the Keil tools

phyCORE-ST10HSE with ST10F269 QuickStart Instructions

© PHYTEC Meßtechnik GmbH 2003 L-633e_1

• The COM Direct Properties window will now appear. SpecifyDirect to COM1/COM2 under the Connect Using pull-down menu(be sure to indicate the correct COM setting for your system).

• Click the Configure button in the COM Direct Properties windowto advance to the next window (COM1/COM2 Properties).

• Then set the following COM parameters: Bits per second = 9,600;Data bits = 8; Parity = None; Stop Bits = 1; Flow Control = None.

Page 33: phyCORE-ST10HS/E with ST10F269 - Phytec 2015 · phyCORE-ST10HS/E with ST10F269 ... new projects and generate and download output files to the phyCORE-ST10HS/E using the Keil tools

Getting Started

© PHYTEC Meßtechnik GmbH 2003 L-633e_1 33

• Selecting OK advances you to the COM Direct–HyperTerminalmonitoring window. Notice the connection status report in thelower left corner of the window.

• Resetting the phyCORE Development Board HD200 (at S2) willexecute the Hello.hex file loaded into the Flash.

• Successful execution will send the character string "Hello World"from the target hardware to the HyperTerminal window.

• Click the disconnect icon in HyperTerminal toolbar and exitHyperTerminal.

• If no output appears in the HyperTerminal window check thepower supply, the COM parameters and the RS-232 connection.

The demo application within the file hello.h86 initializes the serialport of your phyCORE-ST10HS/E to 9600 baud. The initializationvalues are based on the assumption that the microcontroller runs at a40 MHz internal clock frequency. Please note that an oscillator with afrequency of 10 MHz populates the phyCORE-ST10HS/E. Using theinternal PLL (Phase Locked Loop) device results in an internal40 MHz CPU frequency. If your phyCORE-ST10HS/E is equippedwith a different speed oscillator, the demo application might transmitusing another baud rate.

You have now successfully downloaded and executed two pre-existing example programs in Intel *.h86 file format.

Page 34: phyCORE-ST10HS/E with ST10F269 - Phytec 2015 · phyCORE-ST10HS/E with ST10F269 ... new projects and generate and download output files to the phyCORE-ST10HS/E using the Keil tools

phyCORE-ST10HSE with ST10F269 QuickStart Instructions

© PHYTEC Meßtechnik GmbH 2003 L-633e_1

Page 35: phyCORE-ST10HS/E with ST10F269 - Phytec 2015 · phyCORE-ST10HS/E with ST10F269 ... new projects and generate and download output files to the phyCORE-ST10HS/E using the Keil tools

Getting More Involved

© PHYTEC Meßtechnik GmbH 2003 L-633e_1 35

3 Getting More Involved

What you will learn with this example:

• how to start the µVision2 tool chain• how to configure the µVision2 IDE (Integrated Development

Environment)• how to modify the source code from our examples, create a new

project and build and download an output *.h86 file to the targethardware

3.1 Starting the µVision2 Tool Chain

The µVision2 evaluation software development tool chain shouldhave been installed during the install procedure, as described insection 2.1.

You can also manually install µVision2 by executing ek166v424A.exefrom within the \Software\Keil\µVision2.30 directory of yourPHYTEC Spectrum CD.

Caution:It is necessary to use the Keil tool chain provided on theaccompanying Spectrum CD in order to complete this QuickStartInstruction successfully. Use of a different version could lead topossible version conflicts, resulting in functional problems.

Start the tool chain by selecting Keil µVision2 from within theprograms group.

After you start µVision2, the window shown below appears. From thiswindow you can create projects, edit files, configure tools, assemble,link and start the debugger. Other 3rd party tools such as emulators canalso be started from here.

Page 36: phyCORE-ST10HS/E with ST10F269 - Phytec 2015 · phyCORE-ST10HS/E with ST10F269 ... new projects and generate and download output files to the phyCORE-ST10HS/E using the Keil tools

phyCORE-ST10HSE with ST10F269 QuickStart Instructions

© PHYTEC Meßtechnik GmbH 2003 L-633e_1

3.2 Creating a New Project and Adding an Existing SourceFile

To create a new project file select from the µVision2 menuProject|New Project…. This opens a standard Windows dialog thatasks you for the new project file name.• Change to the project directory created by the installation

procedure (default locationC:\PHYBasic\pC-ST10HSE\Demos\Keil\Blinky2).

Page 37: phyCORE-ST10HS/E with ST10F269 - Phytec 2015 · phyCORE-ST10HS/E with ST10F269 ... new projects and generate and download output files to the phyCORE-ST10HS/E using the Keil tools

Getting More Involved

© PHYTEC Meßtechnik GmbH 2003 L-633e_1 37

• In the text field ’File name’, enter the file name of the project youare creating. For this tutorial, enter the name Blinky2.uv2 and clickon Save.

• The Select Device for Target ’Target1’ will automatically appear.Double click on ST Microelectronics as manufacturer for the CPUwithin the next window which opens automatically3. ThephyCORE-ST10HS/E is equipped with a ST10F269 CPU. Choosethis controller type from the list as shown below. This selectionsets necessary tool options for the ST10F269 device and simplifiesin this way the tool configuration.

3 : The same window opens by choosing Select Device for Target from the Project menu.

Page 38: phyCORE-ST10HS/E with ST10F269 - Phytec 2015 · phyCORE-ST10HS/E with ST10F269 ... new projects and generate and download output files to the phyCORE-ST10HS/E using the Keil tools

phyCORE-ST10HSE with ST10F269 QuickStart Instructions

© PHYTEC Meßtechnik GmbH 2003 L-633e_1

• Click on OK to save this setting.

Page 39: phyCORE-ST10HS/E with ST10F269 - Phytec 2015 · phyCORE-ST10HS/E with ST10F269 ... new projects and generate and download output files to the phyCORE-ST10HS/E using the Keil tools

Getting More Involved

© PHYTEC Meßtechnik GmbH 2003 L-633e_1 39

• Now click on Target1 within the Project Window - Files tab.Target1 is now highlighted. Click on Target1 again to enable theedit mode. Change the default name of the target tophyCORE-ST10HSE.

• Select the file group Source Group 1 in the Project Window –Files tab and click on it to change the name into User.

• Right-click in the Project Window – Files to open a new window.Choose the option Targets, Groups, Files....

Page 40: phyCORE-ST10HS/E with ST10F269 - Phytec 2015 · phyCORE-ST10HS/E with ST10F269 ... new projects and generate and download output files to the phyCORE-ST10HS/E using the Keil tools

phyCORE-ST10HSE with ST10F269 QuickStart Instructions

© PHYTEC Meßtechnik GmbH 2003 L-633e_1

• Select the Groups / Add Files tabsheet and type the new groupname System Files in the Group to Add: section.

• Click on Add and then on OK.• Your project file structure should now look like this:

Page 41: phyCORE-ST10HS/E with ST10F269 - Phytec 2015 · phyCORE-ST10HS/E with ST10F269 ... new projects and generate and download output files to the phyCORE-ST10HS/E using the Keil tools

Getting More Involved

© PHYTEC Meßtechnik GmbH 2003 L-633e_1 41

• Now it’s time to add some source code to our project. To do so,click with the right mouse key on the User group to open a localmenu. The option Add Files to Group ‘User’ opens the standardfiles dialog.

• Select the file Blinky2.c.

• Click on the Add button to add the Blinky2.c file to your currentproject window.

• Close the window.

Page 42: phyCORE-ST10HS/E with ST10F269 - Phytec 2015 · phyCORE-ST10HS/E with ST10F269 ... new projects and generate and download output files to the phyCORE-ST10HS/E using the Keil tools

phyCORE-ST10HSE with ST10F269 QuickStart Instructions

© PHYTEC Meßtechnik GmbH 2003 L-633e_1

• Now right-click on group System Files and add the fileStart-pcST10HSE.a66. You have to change the file type to "AsmSource file (*.a, *.src)" in the File of types pull-down menu to seethis file.

• Your project window should now look like this:

At this point you have created a project called Blinky2.uv2 and addedan existing C source file called Blinky2.c and an existing Assemblerfile called Start-pcST10HSE.a66. The next step is to modify the Csource before building your project. This includes compiling, linking,locating and creating the hexfile.

Page 43: phyCORE-ST10HS/E with ST10F269 - Phytec 2015 · phyCORE-ST10HS/E with ST10F269 ... new projects and generate and download output files to the phyCORE-ST10HS/E using the Keil tools

Getting More Involved

© PHYTEC Meßtechnik GmbH 2003 L-633e_1 43

3.3 Modifying the Source Code

Double click on Blinky2.c to open it in the source code editor.

• Locate the following code section. Modify the section shownbelow (the values shown in bold and italic) from the original(150,000) counts to the indicated values:

while (1) { /* loop forever */

P2_0 = 0; /* output to LED port */ for (i=0; i<225000; i++) { /* delay for 225000 counts */ wait (); /* call wait function */ }

P2_0 = 1; /* output to LED port */ for (i=0; i<75000; i++) { /* delay for 75000 counts */ wait (); /* call wait function */ } }

Page 44: phyCORE-ST10HS/E with ST10F269 - Phytec 2015 · phyCORE-ST10HS/E with ST10F269 ... new projects and generate and download output files to the phyCORE-ST10HS/E using the Keil tools

phyCORE-ST10HSE with ST10F269 QuickStart Instructions

© PHYTEC Meßtechnik GmbH 2003 L-633e_1

3.4 Saving the Modifications

Save the modified file by choosing File|Save or by clicking the floppydisk icon .

3.5 Setting Options for Target

Keil includes a Make utility that can control compiling and linkingsource files in several programming languages. Before using the Makeutility, macroassembler, C compiler or linker you must configure thecorresponding options. Most of the options are set when specifyingthe target device for the project. Only the external memory and outputoptions must be set.

Enter the changes as indicated below and leave all other options set totheir default values. µVision2 allows you to set various options withmouse clicks and these are all saved in your project file.

• Click with the right mouse key in the Project window to open alocal menu. Choose the option Options for Target‘phyCORE-ST10HSE’.

Page 45: phyCORE-ST10HS/E with ST10F269 - Phytec 2015 · phyCORE-ST10HS/E with ST10F269 ... new projects and generate and download output files to the phyCORE-ST10HS/E using the Keil tools

Getting More Involved

© PHYTEC Meßtechnik GmbH 2003 L-633e_1 45

To configure the Target:

• Type the settings for the External Memory as shown below.Make sure that #1 is set to RAM.

Page 46: phyCORE-ST10HS/E with ST10F269 - Phytec 2015 · phyCORE-ST10HS/E with ST10F269 ... new projects and generate and download output files to the phyCORE-ST10HS/E using the Keil tools

phyCORE-ST10HSE with ST10F269 QuickStart Instructions

© PHYTEC Meßtechnik GmbH 2003 L-633e_1

To configure the Output options:

• Select the Output tab and activate the Create HEX-File option.With this option a downloadable Intel *.h86 file will be created.

• No other configurations are necessary for this example.• Click OK to save these settings

Page 47: phyCORE-ST10HS/E with ST10F269 - Phytec 2015 · phyCORE-ST10HS/E with ST10F269 ... new projects and generate and download output files to the phyCORE-ST10HS/E using the Keil tools

Getting More Involved

© PHYTEC Meßtechnik GmbH 2003 L-633e_1 47

3.6 Building the Project

You are now ready to run the compiler and linker using the Makeutility.

• Click on the Build Target icon from the µVision2 tool baror press <F7>.

• If the program specified (Blinky2.c) contains any errors, they willbe shown in an error dialog box on the screen.

• If there are no errors, the code is assembled and linked and the ex-ecutable code is ready to be downloaded to the board. This is shownin the Output Window, which indicates "Blinky2" – 0 Errors, 0Warnings. The code to be downloaded to the board will be thename of the project with .h86 as filename extension (in this caseBlinky2.h86).

• If a list of errors appears, use the editor to correct the error(s) in thesource code and save the file and repeat this section.

Page 48: phyCORE-ST10HS/E with ST10F269 - Phytec 2015 · phyCORE-ST10HS/E with ST10F269 ... new projects and generate and download output files to the phyCORE-ST10HS/E using the Keil tools

phyCORE-ST10HSE with ST10F269 QuickStart Instructions

© PHYTEC Meßtechnik GmbH 2003 L-633e_1

3.7 Downloading the Output File

Ensure that the target hardware is properly connected to thehost-PC and a power supply.• Reset the target hardware and force it into Bootstrap mode by

simultaneously pressing the Reset (S2) and Boot (S1) buttons onthe phyCORE Development Board HD200 and then releasing firstthe Reset and, two or three seconds later, the Boot button.

• Start ST10 Flasher.• Choose Open Hex File from the File menu.• Browse to the correct drive and path for the phyCORE-ST10HS/E

Demo folder (default locationC:\PHYBasic\pC-ST10HSE\Demos\Keil\Blinky2\Blinky2.h86)and click OK.

• The ST10 Flasher main window will re-appear.• Click on the Program & Verify button in the upper right corner.• Wait until the Flash programming is done. Once you see the OK

message in the Message window, the downloaded code can beexecuted.

• Exit ST10 Flasher.• Press the Reset (S2) button on the Development Board.

If the modified hexfile properly executes, the LED should now flashin a different mode with different on and off durations.

You have now modified source code, recompiled the code, created amodified downloadable hexfile, and successfully executed thismodified code.

Page 49: phyCORE-ST10HS/E with ST10F269 - Phytec 2015 · phyCORE-ST10HS/E with ST10F269 ... new projects and generate and download output files to the phyCORE-ST10HS/E using the Keil tools

Getting More Involved

© PHYTEC Meßtechnik GmbH 2003 L-633e_1 49

3.8 "Hello2"

A return to the "Hello" program allows a review of how to modifysource code, create and build a new project, and download theresulting output file from the host-PC to the target hardware. Fordetailed commentary on each step, described below in concise form,refer back to the "Blinky2" example starting at section 1.3.

3.8.1 Creating a New Project

Open the Project menu and create a new project called Hello2.uv2within the existing project folder

C:\PHYBasic\pC-ST10HSE\Demos\Keil\Hello2(default location) on your hard-drive. Select the STMicroelectronics ST10F269 in the CPU vendor database list.

• Add Hello2.c and Start-pcST10HSE.a66 from within the projectdirectory to the project Hello2.uv2.

• Your project should now look like this:

• Save the project.

At this point you have created a project called Hello2.uv2 consistingof a C source file called Hello2.c and an assembler file calledStart-pcST10HSE.a66.

Page 50: phyCORE-ST10HS/E with ST10F269 - Phytec 2015 · phyCORE-ST10HS/E with ST10F269 ... new projects and generate and download output files to the phyCORE-ST10HS/E using the Keil tools

phyCORE-ST10HSE with ST10F269 QuickStart Instructions

© PHYTEC Meßtechnik GmbH 2003 L-633e_1

3.8.2 Modifying the Example Source

Double click the file Hello2.c from within the project window.• Use the editor to modify the printf command:

printf ("\x1AHello World\n")

to

printf ("\x1APHYTEC... Stick It In!\n")

• Save the modified file under the same name Hello2.c.

3.8.3 Setting Target Options

Open the Project|Options for Target... menu and change the defaultsettings to the correct values as shown in section 1.6.• Type the settings for the External Memory as shown below. Make

sure that the option “Use On Chip Rom (256KB)” is selected.

RAM: Start: 0x200000 Size: 0x7FFFF

• Modify the default options for the output file by selecting theCreate HEX File checkbox in the Project|Options forTarget....|Output tab. This will automatically create a hexfile fordownload to the phyCORE-ST10HS/E after compiling.

3.8.4 Building the New Project

Build the project.• If any source file of the project contains any errors, they will be

shown in an error dialog box on the screen. Use the editor tocorrect the error(s) in the source code and save the file and repeatthis section.

• If there are no errors, the code is assembled and linked and theexecutable code is ready to be downloaded to the board.

Page 51: phyCORE-ST10HS/E with ST10F269 - Phytec 2015 · phyCORE-ST10HS/E with ST10F269 ... new projects and generate and download output files to the phyCORE-ST10HS/E using the Keil tools

Getting More Involved

© PHYTEC Meßtechnik GmbH 2003 L-633e_1 51

3.8.5 Downloading the Output File

Ensure that the target hardware is properly connected to thehost-PC and a power supply.• Reset the target hardware and force it into Bootstrap mode by

simultaneously pressing the Reset (S2) and Boot (S1) buttons onthe phyCORE Development Board HD200 and then releasing firstthe Reset and, two or three seconds later, the Boot button.

• Start ST10 Flasher.• Choose Open Hex File from the File menu.• Browse to the correct drive and path for the phyCORE-ST10HS/E

Demo folder (default locationC:\PHYBasic\pC-ST10HSE\Demos\Keil\Hello2\Hello2.h86)and click OK.

• The ST10 Flasher main window will re-appear.• Click on the Program & Verify button in the upper right corner.• Wait until the Flash programming is done. Once you see the OK

message in the Message window, the downloaded code can beexecuted.

• Exit ST10 Flasher.

Page 52: phyCORE-ST10HS/E with ST10F269 - Phytec 2015 · phyCORE-ST10HS/E with ST10F269 ... new projects and generate and download output files to the phyCORE-ST10HS/E using the Keil tools

phyCORE-ST10HSE with ST10F269 QuickStart Instructions

© PHYTEC Meßtechnik GmbH 2003 L-633e_1

3.8.6 Starting the Terminal Emulation Program

Start the HyperTerminal and connect to the target hardware using thefollowing COM parameters: Bits per second = 9600; Databits = 8; Parity = None; Stop Bits = 1; Flow Control = None• Resetting the Development Board (at S2) will execute the

Hello2.h86 file loaded into the internal Flash.• Successful execution will send the modified character string

"PHYTEC... Stick It In!" to the HyperTerminal window.• Click the Disconnect icon .• Close the HyperTerminal program

You have now modified source code, recompiled the code, created amodified download hexfile, and successfully executed this modifiedcode.

Page 53: phyCORE-ST10HS/E with ST10F269 - Phytec 2015 · phyCORE-ST10HS/E with ST10F269 ... new projects and generate and download output files to the phyCORE-ST10HS/E using the Keil tools

Debugging

© PHYTEC Meßtechnik GmbH 2003 L-633e_1 53

4 Debugging

This Debugging section provides a basic introduction to the debugfunctions included in the Keil µVision2 evaluation tool chain. Usingan existing example, the more important features are described. For amore detailed description of the debugging features, please refer tothe appropriate manuals provided by Keil.

The µVision2 Debugger offers two operating modes that can beselected in the Project|Options for Target phyCORE-ST10HSEdialog:

• The Simulator allows PC-based microcontroller simulation ofmost features of the 166/ST10 microcontroller family withoutactually having target hardware. You can test and debug yourembedded application before the hardware is ready. µVision2simulates a wide variety of peripherals, including the serial port,external I/O, and timers. The peripheral set is selected when youselect a CPU from the device database for your target.

• Advance GDI drivers, like the Keil Monitor 166 interface, allowtarget-based debugging. With the Advanced GDI interface youmay connect directly to the target hardware. Debugging on thetarget hardware also enables testing peripheral components of theapplication.

The following examples utilize the Keil Monitor 166 environment.

Page 54: phyCORE-ST10HS/E with ST10F269 - Phytec 2015 · phyCORE-ST10HS/E with ST10F269 ... new projects and generate and download output files to the phyCORE-ST10HS/E using the Keil tools

phyCORE-ST10HSE with ST10F269 QuickStart Instructions

© PHYTEC Meßtechnik GmbH 2003 L-633e_1

4.1 Creating a Debug Project and Preparing the Debugger

Within the default locationC:\PHYBasic\pC-ST10HSE\Demos\Keil\Debug you will find analready build project called Debug.

• Close all possible open projects and open the project Debug.uv2with the option Project|Open Project.

Page 55: phyCORE-ST10HS/E with ST10F269 - Phytec 2015 · phyCORE-ST10HS/E with ST10F269 ... new projects and generate and download output files to the phyCORE-ST10HS/E using the Keil tools

Debugging

© PHYTEC Meßtechnik GmbH 2003 L-633e_1 55

4.2 Preparing the Debugger

This example utilizes the Monitor interface, which automaticallydownloads a special Monitor kernel to the target hardware using theBootstrap mode. Depending on the Project|Options for Target’pCST10HSE’|Debug configuration, µVision2 will load the applicationprogram and run the startup code.

• Open the Project|Options for Target ’pCST10HSE’ menu andselect the Debug tabsheet.

• Enable the checkboxes Use: Keil Monitor –166 Driver and LoadApplication at Startup.

• Click on the Settings button in the upper right-hand corner of theDebug tabsheet.

Page 56: phyCORE-ST10HS/E with ST10F269 - Phytec 2015 · phyCORE-ST10HS/E with ST10F269 ... new projects and generate and download output files to the phyCORE-ST10HS/E using the Keil tools

phyCORE-ST10HSE with ST10F269 QuickStart Instructions

© PHYTEC Meßtechnik GmbH 2003 L-633e_1

• Select Phytec phyCORE-ST10HSE from the Monitor Configurationpull-down menu. A short description for the selected module isshown in the Description section on the right.

• Select the correct COM Port and Baudrate in the PC Port Settings.

• Click OK to save these settings and exit the Monitor DriverSettings window.

• The Options for Target ’pCST10HSE’ menu will appear.• Click on the OK button again.

4.3 Preparing the Target Hardware to Communicate withthe Debugger

Ensure that the target hardware is properly connected to the host-PCand a power supply• Reset the target hardware and force it into Bootstrap mode by

simultaneously pressing the Reset (S2) and Boot (S1) buttons onthe phyCORE Development Board HD200 and then releasing firstthe Reset and, two or three seconds later, the Boot button.

Page 57: phyCORE-ST10HS/E with ST10F269 - Phytec 2015 · phyCORE-ST10HS/E with ST10F269 ... new projects and generate and download output files to the phyCORE-ST10HS/E using the Keil tools

Debugging

© PHYTEC Meßtechnik GmbH 2003 L-633e_1 57

Since the required microcontroller portion to communicate with theKeil Monitor 166 will be automatically downloaded using theBootstrap mode there is no further preparation of the target system.

4.4 Starting the Debugger

To start the µVision2 debug environment, click on the debugger icon on the µVision2 toolbar. A pop-up window will appear indicating

that this is an evaluation version. Click on OK.

• You will see a blue status bar from left to right at the bottom ofyour screen indicating the download process of the debug program.

If a problem occurs during data transfer, the following window willappear:

• Click on Settings and verify the COM port and the baud rate (9600baud). Reset the target hardware, force it into Bootstrap mode(refer to section 1.4) and click on Try Again.

Page 58: phyCORE-ST10HS/E with ST10F269 - Phytec 2015 · phyCORE-ST10HS/E with ST10F269 ... new projects and generate and download output files to the phyCORE-ST10HS/E using the Keil tools

phyCORE-ST10HSE with ST10F269 QuickStart Instructions

© PHYTEC Meßtechnik GmbH 2003 L-633e_1

• If the data transfer was successful choose View|DissassemblyWindow and you will get a screen similar to this shown below. Theproject window changed to the register value view and the debugtoolbar is shown. The lower right screen shows the Watch & CallStack Window. (If you can’t see one of these enable it in the Viewmenu).

• You will see the source code on your screen in the DisassemblyWindow. Note that you will not see your C source code becausethe program starts at 00000H – which is the reset vector - withsome assembler instructions. There is an assembler jump to asection of initialization code which then branches to your C mainprogram. In this example you will see the JMPS instruction at00000H and some parts of the C code.

• Click once on StepInto! . You will see the assembly code ofthe initialization routine. DISWDT (disable watchdog) is the firstinstruction. EINIT (E8H) signals the end of the initializationroutine of the CPU.

• To view the Output window, if not already visible, selectView|Output window.

Page 59: phyCORE-ST10HS/E with ST10F269 - Phytec 2015 · phyCORE-ST10HS/E with ST10F269 ... new projects and generate and download output files to the phyCORE-ST10HS/E using the Keil tools

Debugging

© PHYTEC Meßtechnik GmbH 2003 L-633e_1 59

• At the Output window prompt, type in g,main and press<Enter> (notice the comma!) to run the CPU to the start of the‘main’ function. The program counter will advance to ‘main’. Noteyou can press the up arrow key to get the history of keys typed inthe Output Window.

• You can single step using the StepInto icon . You are nowready to use the debugger window to step through code, set break-points, and issue the Go command to start program execution. Youcan examine special function registers, memory locations, andregister values, etc.

4.5 Using the Keil µVision2 Debug Features

4.5.1 Breakpoints

Click on a memory location such as line number 42 first.x++. Acolored bar appears marking this position.• You can click on Run to Cursor line to reach this point or

you can double-click and set a breakpoint. Set a breakpoint herewith the double-click. The red mark on the left-hand of theselected line indicates the breakpoint.

• Click on RUN and the program will run and stop at thebreakpoint.

• Double click on the breakpoint to remove it.

Page 60: phyCORE-ST10HS/E with ST10F269 - Phytec 2015 · phyCORE-ST10HS/E with ST10F269 ... new projects and generate and download output files to the phyCORE-ST10HS/E using the Keil tools

phyCORE-ST10HSE with ST10F269 QuickStart Instructions

© PHYTEC Meßtechnik GmbH 2003 L-633e_1

4.5.2 In Line Assembler

Open the Watch & Call Stack Windows with a click on thisicon .• You could see the actual values of the variable bigcount in the

Watch window.• Double click in line 48 to set a breakpoint.• Click on RUN a few times. This will continue the endless loop

until program execution stops at the breakpoint. See how the valueof bigcount changes with each RUN.

• Open the Inline Assembler window by selecting Debug|InlineAssembly.

• Move the Window with your mouse to your upper left hand so youcan see your source code and the Watch Window.

• Type the address 0x64 in the Current Assembly Address field andpress <Enter> on your keyboard. The assembly code at this addressappears in the Current Instruction field. It is the addition of thevariable bigcount with 2.

• Type the assembler instruction ADD R10,#3 in the Enter NewInstruction field and press <Enter>. You could see the change ofyour source code at address 0x64H.

• Close the Inline Assembler window.• Click on RUN a few times and see that the value of bigcount now

is added with 3 at each run.• Remove the breakpoint at line 48 with a double mouse click.

Page 61: phyCORE-ST10HS/E with ST10F269 - Phytec 2015 · phyCORE-ST10HS/E with ST10F269 ... new projects and generate and download output files to the phyCORE-ST10HS/E using the Keil tools

Debugging

© PHYTEC Meßtechnik GmbH 2003 L-633e_1 61

4.6 Single Stepping

The debugger uses “Step Into” to single step one instruction at a time.“Step Into” is also used to enter a function in the same fashion.• “Step Over” means to skip over a function that you are not

interested in.• “Step Out” is used to exit a function you are currently in.

“Step Out” is very useful if you find yourself in a function you arenot interested in and need to return quickly to your intendedfunction.

• If the debugger gets stuck, execute a Reset using the Reset iconlocated next to the RUN icon. To isolate any problems fromthe target hardware board you could use the software simulatorinstead of the Monitor. You can also use the hardware Reset buttonon the board.

• With the cursor on line 42 click on StepInto until you enter thefunction stepout(). Note that you must click on StepInto 10 timesto exit the for loop within the function stepout().

• Repeat the process using StepOver and you will not enter thefunction although it will be executed. Use the command $=\42within the Output Window to reposition the program counter toline 42 prior to further code execution. This command takes a linenumber preceded by a backslash to set the program counter. TheStepOver feature is useful to skip function calls you are notinterested in debugging.

Note:The StepOut button is grayed out and not available in Monitor mode.StepOut is available in the simulator and provides a quick escape froma function by executing the next return instruction.

• As you step through the program - the appropriate values in theRegs window will change color as their values are updated. Most ofthe variables have been allocated to fast internal CPU registers bythe µVision2 compiler.

Page 62: phyCORE-ST10HS/E with ST10F269 - Phytec 2015 · phyCORE-ST10HS/E with ST10F269 ... new projects and generate and download output files to the phyCORE-ST10HS/E using the Keil tools

phyCORE-ST10HSE with ST10F269 QuickStart Instructions

© PHYTEC Meßtechnik GmbH 2003 L-633e_1

4.6.1 Memory Window

If the Memory Window is not already visible, activate it by selectingView|Memory window from the µVision2 tool bar.• Type 0x5000 at the Address: field and press <Enter>. The

addresses displayed in the Memory Window should change startingat this address. This is the memory area for the variables of theproject.

• Set a breakpoint at line 47 (count++). Note that as you press Run,the contents of the memory changes as the structure values areincremented at lines 42 through 45 (e.g. bigcount at 0x5000, first at0x500A). Remove the breakpoint at line 47 with a double mouseclick.

• Close the Memory Window

4.6.2 Watch Window

If not already visible view the Watch Window by selectingView|Watch & Call Stack window at the µVision2 menu.• The Watch Window displays memory contents as specified by

name. Structures can also be displayed.• Click on the Files tab in the Project window and double click on

the Debug.c filename to open it. Scroll down till you could see theyellow program counter arrow.

Page 63: phyCORE-ST10HS/E with ST10F269 - Phytec 2015 · phyCORE-ST10HS/E with ST10F269 ... new projects and generate and download output files to the phyCORE-ST10HS/E using the Keil tools

Debugging

© PHYTEC Meßtechnik GmbH 2003 L-633e_1 63

• Click on the Watch #1 tab at the bottom of the Watch Window• To add variable symbols just click with the right mouse button on

the symbol name in you source code and choose Add “...” toWatch Window. Add the variables bigcount and first to WatchWindow #1. Till first is a structure with the members x and y theWatch Window shows a + symbol left from first. Click on + to seethe structure members x and y.

• Open the Disassembly Window with a click on this icon ..• Double click in line 42 of the C source code (the line-counter is

displayed at the bottom of the µVision2 window) to set abreakpoint and choose Run to Cursor line from the Debug Toolbar.

• Now choose Step into few times and look how the variable valuesare changing in the Watch Window.

Page 64: phyCORE-ST10HS/E with ST10F269 - Phytec 2015 · phyCORE-ST10HS/E with ST10F269 ... new projects and generate and download output files to the phyCORE-ST10HS/E using the Keil tools

phyCORE-ST10HSE with ST10F269 QuickStart Instructions

© PHYTEC Meßtechnik GmbH 2003 L-633e_1

4.7 Resetting Simulator and the phyCORE-ST10HSE

Debugger in Simulator mode: When you are using the simulator (i.e.no connection to target hardware), pressing theReset CPU icon does not cause a running simulation to stopat the current point of execution. Reset CPU starts the applicationfrom the beginning address (0) again. Press the Halt buttonto halt a program under normal conditions.• Debugger in Monitor mode: The Monitor runs in the target

hardware. A Debugger reset sets the IPC to zero and performsother initialization routines if no user application was started. It isnot as complete as a hardware-reset (pressing S2 on theDevelopment Board). The best method of stopping a runningapplication is to press the Halt button rather than the Reset CPU inMonitor mode. Halt tries to stop a running application when the’Serial interrupt or NMI’ option is enabled. If this option is notenabled, a dialog box is displayed in which you can select the nextstep. This has the advantage of detecting any ‘infinite loop‘ inwhich your program might be stuck. With Reset, you start again ataddress 0.

• The PHYTEC Development Board does not have a hardware NMIbutton. A NMI is the most reliable way to stop a running program.This is even more important when you are using the Bootstrapversion of the Monitor because it is difficult to re-synchronize theDebugger and the kernel. For example, it is not possible for theDebugger to re-synchronize automatically by pressing thehardware Reset button (S2) if the monitor has been downloadedwith the Bootstrap Loader. It must be restarted manually byrestarting the Debugger.

Page 65: phyCORE-ST10HS/E with ST10F269 - Phytec 2015 · phyCORE-ST10HS/E with ST10F269 ... new projects and generate and download output files to the phyCORE-ST10HS/E using the Keil tools

Advanced User Information

© PHYTEC Meßtechnik GmbH 2003 L-633e_1 65

5 Advanced User Information

This section provides advanced information for successful operationof the phyCORE-ST10HS/E with the µVision2 software tool chain.

5.1 Start-pcST10HSE.a66

The code within the assembly file start-pcST10HSE.a66 isresponsible for the initial controller configuration and the startupinitialization of your C project. This includes adjusting the propertiesof the external bus signals and Chip Select signals, setting of thesystem stack, initialization of variables and clearing of memory areas.

It is very important that this code will execute prior to the execution ofuser code. To ensure this, it is recommended that the startup codeoccupies the reset vector of the application, which is the locationwhere the microcontroller starts execution after reset (0x0000). Afterperforming the initialization steps your individual main() function iscalled by the startup code.

Since some of the settings are hardware-dependent, we recommenduse of the prepared start-ST10HSE.a66 from within the defaultlocation C:\PHYBasic\pC-ST10HSE\Tools\Startup\Keil. Theproperties of the external bus interface are already configured for thephyCORE-ST10HS/E. You may want to change the values for theChip Select Unit.

To accommodate the startup code to the needs of your applicationcopy it from the directory described above to your project directory.You can then edit, modify and compile it using the Keil macro-assembler.

Since the startup code will usually be implicitly taken intoconsideration from the default runtime libraries, you must nowexplicitly tell your linker to instead consider your individual startupobject file. To do this we recommend adding your modifiedstart-pcST10HSE.a66 file to your project. Be sure that it is alwaysincluded in the Link/Lib process of your project (see options withinthe Project window of the Keil tool chain).

Page 66: phyCORE-ST10HS/E with ST10F269 - Phytec 2015 · phyCORE-ST10HS/E with ST10F269 ... new projects and generate and download output files to the phyCORE-ST10HS/E using the Keil tools

phyCORE-ST10HSE with ST10F269 QuickStart Instructions

© PHYTEC Meßtechnik GmbH 2003 L-633e_1

5.2 Linking and Locating

The Linker has to combine several re-locatable object modulescontained in object files and/or libraries to generate a single absoluteobject.

In addition the Linker must locate several segments of code type,constants and data to fixed address locations within the address rangeof the microcontroller: This ensures the natural or explicitly declaredproperties of these segments.

Data segments must always be located in Random Access Memory(e.g. RAM), code and constant segments should be located in any kindof non-volatile memory (e.g. Flash). The C166 family has aVon-Neumann architecture which uses the same read signal to fetchdata and also code or constants. To distinguish between non-volatileand modifiable memory, physically different memory devices must beaddressable within different address ranges.

To enable easy accommodation of the linking process the Linkercollects segments of equal type to classes.

The Keil tool chain distinguishes the following classes:

xCODE: code for several addressing modes(x = N, I, F, H or X)

xDATA: not initialized data for several addressing modes(x = N, I, F, H or X)

xDATA0: pre-initialized data for several addressing modes(x = N, I, F, H or X)

xCONST: constant for several addressing modes(x = N, I, F, H or X)

It is required that all xDATA and xDATA0 classes segments arelocated to any internal RAM of the ST10F269 or to any external RAMon the phyCORE-ST10HS/E.

All xCODE and xCONST classes must also be located to any internalnon-volatile memory (e.g. Flash) of the ST10F269.

Page 67: phyCORE-ST10HS/E with ST10F269 - Phytec 2015 · phyCORE-ST10HS/E with ST10F269 ... new projects and generate and download output files to the phyCORE-ST10HS/E using the Keil tools

Advanced User Information

© PHYTEC Meßtechnik GmbH 2003 L-633e_1 67

A near address data area (NDATA, NDATA0) must reside in one datapage (16 kByte). A near address code area (NCODE, NCONST) mustreside in one code segment (64 kByte).

To ensure proper execution of your application you must take theruntime memory model into account when linking and locating. Thismeans that you must instruct the Linker where to assume externalRAM for locating data classes and internal Flash for locating code andconstant classes.

The recommended operating mode of the phyCORE-ST10HS/Eallows the use of the Chip Select Unit of the ST10F269 to define thephysical memory layout. By modifying the file start-pcST10HSE.a66as part of your project you can adapt the memory layout to your needs.

The external use of the Chip Select signals is predefined by thehardware in the following way:

• Flash Bank uses /CS0 (up to 2 MByte Flash) (not populated atstandard version of the phyCORE-ST10HS/E)

• RAM Bank uses /CS1 (up to 1 MByte RAM)

The default configuration of the phyCORE-ST10HS/E has 256 kByteon-chip Flash and 512 kByte RAM (/CS1).

Caution:You will see multiple mirrors of a memory device that has a physicalsmaller address range than the associated address range of the ChipSelect signal.For instance if you adjust Chip Select signal /CS1 to be active withinan address range of 1 MByte and the actual memory size populatingthe phyCORE is just 512 kByte, you will get one mirrored image ofyour RAM.

We recommend that you generate a *.m66 map file for your projectand inspect the memory map information within this file. Comparethis information with the physical memory model resulting from yoursettings selected within the start-pcST10HSE.a66 file.

Page 68: phyCORE-ST10HS/E with ST10F269 - Phytec 2015 · phyCORE-ST10HS/E with ST10F269 ... new projects and generate and download output files to the phyCORE-ST10HS/E using the Keil tools

phyCORE-ST10HSE with ST10F269 QuickStart Instructions

© PHYTEC Meßtechnik GmbH 2003 L-633e_1

5.3 Debugging Using Monitor Kernel

Whenever you decide to use the µVision2 target debugger or Mon166target Monitor to debug your application, some special precautionsmust be taken into consideration to ensure proper code execution ofyour application.

Your application and the Keil Monitor kernel contained in the filesboot and monitor must share some memory locations within the targetsystem. If you do not consider the physical memory model alreadyclaimed by the kernel and the memory requirements of the kernel, youmay get conflicts in memory use. This typically leads to variablescontaining not their assigned value, functions returning bad results andmodified code.

We recommend the use of the start-pcST10HSE_debug.a66 withinthe default destination C:\PHYBasic\pCST10HSE\Tools\Mon\Keil ifyou want to debug your application using the Monitor kernel. This filewill adjust the external bus properties and the Chip Select Unit inexactly the same manner as did the Monitor kernel.

To obtain information about the memory requirements of the Monitor,the corresponding memory map file monitor.m66 is made availabletogether with the monitor executable file. This file contains a detailedmemory map of the Monitor and is also located in the defaultdestination mentioned above.

You must link your application to prevent any overlapping memoryranges. Since the Monitor also uses some special interrupts forcommunication with the host-PC at runtime, you should add aReserve: statement for 0x008 – 0x011, 0x0AC – 0x0AF to theL166Misc tab of your Options for Target option to reserve at leastthese ranges.

Page 69: phyCORE-ST10HS/E with ST10F269 - Phytec 2015 · phyCORE-ST10HS/E with ST10F269 ... new projects and generate and download output files to the phyCORE-ST10HS/E using the Keil tools

Advanced User Information

© PHYTEC Meßtechnik GmbH 2003 L-633e_1 69

You should always ensure that segments of your application do notreach or overlap the segments of the Monitor. The Monitor segmentswill usually be linked to the top of the memory, leaving you the mostpossible memory space for the application code.

The Monitor is linked under the assumption of maximum memoryupgrading for Flash bank and RAM bank. Remember that you willhave multiple additional mirrors of the physical devices actuallymounted on the phyCORE-ST10HS/E if their capacity is less than themaximum value of 1 MByte.

For instance if you have 512 kByte of RAM mounted on thephyCORE-ST10HS/E you will have one additional mirror image ofthe RAM within the reserved 1 MByte range. Note that in this case allassociated address ranges of 0x80000 – 0xFFFFF will actually addressthe same physical device address range of0x00000 – 0x7FFFF. This means that exactly the same physicalmemory location can be addressed using two different internaladdresses. This must be taken into consideration when verifying yourmemory mappings.

Page 70: phyCORE-ST10HS/E with ST10F269 - Phytec 2015 · phyCORE-ST10HS/E with ST10F269 ... new projects and generate and download output files to the phyCORE-ST10HS/E using the Keil tools

phyCORE-ST10HSE with ST10F269 QuickStart Instructions

© PHYTEC Meßtechnik GmbH 2003 L-633e_1

5.4 Demo for the Optional Ethernet Controller CS8900A-CQ

As an option, the Crystal LAN CS8900A-Q Ethernet Controller canpopulate the phyCORE-ST10HS/E at position U23. The PHYTECSpectrum-CD, included in the phyCORE-ST10HS/E RapidDevelopment Kit, contains an example program that demonstrates athe use of a tiny webserver. This example program can be found in thefolder:

C:\PHYBasic\pC-ST10HSE\Demos\Keil\easy-WEB\)

This tiny web server was taken from the magazine ’Design &Elektronik’, special issue ’Embedded Internet’. It can be downloadedfrom the following web site: www.elektroniknet.de/extraheft. Thissoftware has been modified to work with a PHYTECphyCORE-ST10HS/E board and the Keil C166 C-Compiler.

All modifications in the source code are marked with ’// Keil:’ and‘//Phytec: .́

The web page shows the values of two analog inputs (AN0 and AN1).This tiny webserver needs very less resources and therefore has somerestrictions:

� only one active TCP session at a given time� no support for fragmented IP datagrams� no buffer for TCP datagrams received in wrong order� only one web page, mo GIF/JPG graphics possible

The IP address can be modified in the module tcpip.h to fit into yourexisting LAN (see MYIP_x).

Page 71: phyCORE-ST10HS/E with ST10F269 - Phytec 2015 · phyCORE-ST10HS/E with ST10F269 ... new projects and generate and download output files to the phyCORE-ST10HS/E using the Keil tools

Advanced User Information

© PHYTEC Meßtechnik GmbH 2003 L-633e_1 71

The easyWEB project is set up for two different targets:

• pC-ST10HSE: Settings for PHYTEC phyCORE-ST10HS/Emodule

• Simulation: Settings for Simulation.

Note:The Ethernet controller cannot be simulated.

Page 72: phyCORE-ST10HS/E with ST10F269 - Phytec 2015 · phyCORE-ST10HS/E with ST10F269 ... new projects and generate and download output files to the phyCORE-ST10HS/E using the Keil tools

phyCORE-ST10HSE with ST10F269 QuickStart Instructions

© PHYTEC Meßtechnik GmbH 2003 L-633e_1

Page 73: phyCORE-ST10HS/E with ST10F269 - Phytec 2015 · phyCORE-ST10HS/E with ST10F269 ... new projects and generate and download output files to the phyCORE-ST10HS/E using the Keil tools

Suggestions for Improvement

© PHYTEC Meßtechnik GmbH 2003 L-633e_1

Document: phyCORE-ST10HSE QuickStart InstructionsDocument number: L-633e_1, March 2003 How would you improve this manual?

Did you find any mistakes in this manual? page

Submitted by:Customer number:

Name:

Company:

Address:

Return to:PHYTEC Technologie Holding AGPostfach 100403D-55135 Mainz, GermanyFax : +49 (6131) 9221-33

Page 74: phyCORE-ST10HS/E with ST10F269 - Phytec 2015 · phyCORE-ST10HS/E with ST10F269 ... new projects and generate and download output files to the phyCORE-ST10HS/E using the Keil tools

Published by

PHYTEC Meßtechnik GmbH 2003 Ordering No. L-633e_1Printed in Germany