Home
QuickStart Program Development User`s Guide
Contents
1. Name of target executable program or library NAME libea_startup_thumb Link program to RAM or ROM possible values for LD_RAMROM is RAM or ROM if not specified ROM LD RAMROM ROM Name if specific CPU used used by linker scripts to define correct memory map Valid CPUs are LPC2101 LPC2102 LPC2103 LPC2104 LPC2105 LPC2106 LPC2114 LPC2119 LPC2124 LPC2129 LPC2131 LPC2132 LPC2134 LPC2136 LPC2138 LPC2141 LPC2142 LPC2144 LPC2146 LPC2148 LPC2194 LPC2210 LPC2220 LPC2212 LPC2214 LPC2290 LPC2292 LPC2294 If you have a new version not specified above just select one of the old versions with the same memory map Copyright 2005 Embedded Artists AB QuickStart Program Development User s Guide CPU_VARIANT LPC2132 It is possible to override the automatic linker file selection with the variable below No not use this opion unless you have very specific needs LD_SCRIPT build_files myOwnLinkScript_rom 1d LD SCRIPT PATH ELF file contains debug information or not possible values for DEBUG are 0 or 1 Extra debug flags can be specified in DBFLAGS DEBUG 1 DBFLAGS Optimization setting Os for small code size 02 for speed OFLAGS Os Extra general flags For example compile for ARM THUMB interworking EFLAGS mthumb interwork EFLAGS mthumb interwork Program code run in ARM or THUMB mode Can be ARM THUMB CODE ARM
2. The files are compiled in ARM mode with THUMB interworking see EFLAGS List C source files here CSRCS consol c framework c List all included C files List assembler source files here ASRCS startup s List subdirectories to recursively invoke mar SUBDIRS List all included assembler files List additional libraries to link with LIBS Add include search path for startup files and other include directories NC I Select if an executable program or a library shall be created PROGRAM MK true LIBRARY MK true Select whether an executable program file or a library shall be created One of the lines is commented out Output format on hex file if making a program HEX FORMAT ihex C4 Program to download executable program file into mA DOWNLOAD lpc2lisp exe Configurations for download program Which com pot that is used which download speed and what crystal frequency on the board DL COMPORT coml DL _BAUDRATE 115200 Include the general makefile here DL CRYSTAL 14746 He EH FE HH HE EH AE HE HH HH HH HE EH HH HH HH HH HE E E E HH i Fa i at a E E a HH EE E E E a HE include build_files general mk HHH HH HHH EH FE HE HH EH FE FE HE EH FE FE HE EH HH HE EH HE EE EE EH EE EE EEE Figure 6 Example QuickStart Build Environment Makefile from Startup Library As seen in Figure 6 above the makefile ends with the command inclu
3. The installation is very simple and straightforward It s just following the default installation steps as illustrated in the pictures below joUSetipiGNUARM Welcome to the GNUARM Setup Wizard This will install GNUARM 3 4 3 on your computer It is recommended that you close all other applications before continuing Click Next to continue or Cancel to exit Setup IF Sariy GHUARM License Agreement Please read the following important information before continuing Please read the following License Agreement You must accept the terms of this agreement before continuing with the installation GNU GENERAL PUBLIC LICENSE Version 2 June 1991 Copyright C 1989 1991 Free Software Foundation Inc 9 Temple Place Suite 330 Boston MA 02111 1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document but changing it is not allowed Preamble The licenses for most software are designed to take away your oe co Copyright 2005 Embedded Artists AB QuickStart Program Development User s Guide isuSetup GNUARM Select Destination Location Where should GNUARM be installed C Program GNUARM i Setup will install GNUARM into the following folder ext If you would like to select a different folder click Browse At least 58 2 MB of free disk space is required elsetup GNUARM Select Components Use the default installatio
4. initialize the exception vector mapping ifndef RAM EXEC define MAM MAP 1 1 exception vectors are in FLASH at 0x0000 0000 2 exception vectors are in SRAM at 0x4000 0000 else define MAM MAP 2 When exec from RAM MAM MAP should always be 2 endif setup stack sizes define stackSize SYS 600 define stackSize_ SVC 64 define stackSize_ UND 64 define stackSize ABT 64 define stackSize IRQ 600 define stackSize FIQ 64 define consol settings define CONSOL_UART 0 define CONSOL BITRATE 115200 define CONSOL STARTUP_DELAY Short startup delay in order to remove risk for false startbit detection timer 1 will be used in polled mode define CONSOL STARTUP DELAY LENGTH 100 100 us is slightly more than one character at 115200 bps define USE NEWLIB 0 0 do not use newlib save about 22k FLASH 1 use newlib full implementation of printf scanf and malloc define CONSOLE API PRINTF 1 0 printf sendString 1 simple own implementation of printf define CONSOLE API_SCANF 0 0 none 1 simple own implementation of scanf define SRAM size ifdef LPC2101 define SRAM SIZE 2 1024 LPC2101 elif defined LPC2102 define SRAM SIZE 4 1024 LPC2102 elif defined LPC2103 define SRAM SIZE 8 1024 LPC2103 elif defined LPC2104 define SRAM SIZE 16 1024 LPC2104 elif defined LPC2105 Copyright 2005 Embedded Artists A
5. IAR Embedded Workbench for ARM Kickstart Edition with 32 Kbyte program size limit e Another complete development environment GCC GNUARM distribution including compiler linker make and debugger e The program Programmers Notepad which is a very good program development editor and project manager e The Eclipse development environment including the CDT C C Development Tools project 4 2 Product Registration By registering as a customer of Embedded Artists you will get access to more valuable material that will get you up and running instantly e Access to a Real Time Operating System RTOS in the form of a library that can be used for non commercial applications e Access to over 20 sample applications that demonstrates different peripheral functions in the LPC2xxx processor e Access to the latest versions of all information and programs on the CD ROM Registering is easy and done quickly 1 Go to http www EmbeddedArtists com select Support and then Register 2 Type in the products serial number can be found on the QuickStart Board or on the package carrying the board along with your personal information Copyright 2005 Embedded Artists AB QuickStart Program Development User s Guide Page 24 5 Further Information The LPC2xxx microcontroller is a complex circuit and there exist a number of other documents with a lot more information The following documents are recommended as a complement to this
6. is recommended for non experienced users A typical project has two subdirectories build files and startup Figure 5 below illustrate the general structure E sample_project C build files C startup Figure 5 Typical Project Directory Structure 3 1 Makefiles The subdirectory build files contains a general makefile and linker script files The subdirectory startup contains a configurable startup framework for QuickStart Board projects The startup files form a library that is linked to the main application The makefiles have a hierarchical structure Each project either an executable program file or a library has a simple makefile that just describe the specifics of the project This simple makefile includes the general makefile that is placed in the build files subdirectory Figure 6 below illustrates the simple makefile The example comes from the startup library found under the startup subdirectory The name of the resulting library is libea_startup_thumb a Two C source code files are listed consol c and framework c An assembler file called startup S is also included in the library FEE AEE E AE AE EH aE HR EE HR RE HR EE EHR RAE HR RAE EE ER HE General makefile for building executable programs and libraries for Embedded Artists QuickStart Boards C 2001 2005 Embedded Artists AB ame of resulting library Hat a at HE aE HE aE aE HE a aE HE aE HE aE aE EEE EE EE EE EE EE EE EEE EEE N or Tesu 8 bra y
7. lt ea_init h gt int main void eaInit Now the console printf can be used Also observe that whenever the BSP printf should be used the following include file must be included into the source code file include lt printf P h gt Copyright 2005 Embedded Artists AB QuickStart Program Development User s Guide Page 22 As a summary Embedded Artists QuickStart Build Environment is comprised of e A make build environment controlled by bash script A program or library build is started via the command make e A program download feature by using the LPC21ISP program A program build and download is started via the command make deploy e A Board Support Package BSP with startup code and console functions i e printfQ and scanf like functionality 3 3 GCC This will be very similar to the QuickStart Build Environment example except that you will have to set up all paths manually and create your own startup files The make files will also be a bit more complex An example makefile is presented in Figure 10 below Much more complex examples than the makefile below also exist Example makefile that creates a program called test containing the C source code files main c eeprom c and i2c c plus the assembler file startup s LIBS DEBUG g CFLAGS Wall nostartfiles mthumb interwork mthumb NCLUDE Iinc Iinc specific specify include paths here ARMCC arm elf gcc OBJS m
8. not be used in resource constraint systems The code size for the first two alternatives is minimal about 2k in program size for the entire framework When using printf from newlib the code size is about 30 k for the entire framework including a large part of the newlib library Just edit the configuration file above and recompile your project The recursive nature of the makefiles will make sure that the startup library is recompiled and linked with the final executable program You can find an example project under the QuickStart Build Environment installation See Figure 9 below for the path It is typically c program InfraBed evboards LPC2xxx gcc newlib vX_X X X The beginning of the path can be specific for your installation and the ending of the path is specific for the version of the build environment The figure below illustrates version 2 0 0 0 Your version may be different C Infrabed 9 docs co Bsics 3 evboards neex gcec newlib v2 0 0 0 C bin E 3 sample project build_files G startup Figure 9 Sample Project Files under QuickStart Build Environment Installation The startup framework BSP is very simple and can best be understood by studying the source code files If using the console functionality printf and scanf like functions observe that the function eaInit must be called before printf and the console can be used The following code segment illustrates this include
9. want to review or change any of your installation settings click Back Click Cancel to exit the wizard InstallShield stal J Cancel T Observe that if the compiler is not installed on the default location c Program GNUARM the new path must be set in the files build sh and build_environment sh Both files can be found in C Program InfraBed evboards LPC2xxx gcc newlib vxX_X X X bin It is the variable COMPILERDIR2 that must be set can be found on line 13 in both files The compiler path must be to the GNUARM bin directory Observe that the path above must contain the correct version number instead of wX_X_X_X bin It may for example be v2_2_0_0 bin Copyright 2005 Embedded Artists AB QuickStart Program Development User s Guide Page 15 3 QuickStart Build Environment The QuickStart Build Environment is a complete build environment for GCC including program downloading via ISP The build environment is built around a bash script This script sets up all necessary paths When installing the QuickStart Build Environment you will automatically get shortcuts to this bash script A practical feature is that there can be different scripts for different hardware platforms for controlling different hardware specific details of the platforms There can also be many different compilers including different versions of the same compiler without conflicting with each other The use of the bash script is optional but
10. B QuickStart Program Development User s Guide define SRAM SIZE 32 1024 LPC2105 elif defined LPC2106 define SRAM SIZE 64 1024 LPC2106 elif defined LPC2114 define SRAM SIZE 16 1024 LPC2114 elif defined LPC2124 define SRAM SIZE 16 1024 LPC2124 elif defined LPC2119 define SRAM SIZE 16 1024 LPC2119 elif defined LPC2129 define SRAM SIZE 16 1024 LPC2129 elif defined LPC2131 define SRAM SIZE 8 1024 LPC2131 elif defined LPC2132 define SRAM SIZE 16 1024 LPC2132 elif defined LPC2134 define SRAM SIZE 16 1024 LPC2134 elif defined LPC2136 define SRAM SIZE 32 1024 LPC2136 elif defined LPC2138 define SRAM SIZE 32 1024 LPC2138 10 lif defined LPC2141 define SRAM SIZE 8 1024 LPC2141 elif defined LPC2142 define SRAM SIZE 16 1024 LPC2142 elif defined LPC2144 define SRAM SIZE 16 1024 LPC2144 elif defined LPC2146 define SRAM SIZE 32 1024 LPC2146 elif defined LPC2148 define SRAM SIZE 32 1024 LPC2148 elif defined LPC2194 define SRAM SIZE 16 1024 LPC2194 elif defined LPC2210 define SRAM SIZE 16 1024 LPC2210 elif defined LPC2220 define SRAM SIZE 64 1024 LPC2220 elif defined LPC2212 define SRAM SIZE 16 1024 LPC2212 elif defined LPC2214 def
11. Copyright 2005 Embedded Artists AB QuickStart Program Development User s Guide Get Up and Running Quickly and Start Developing on Day 7 E QuickStart Program Development User s Guide Page 2 Embedded Artists AB Friisgatan 33 SE 214 21 Malm Sweden info EmbeddedArtists com http www EmbeddedArtists com Copyright 2005 Embedded Artists AB All rights reserved No part of this publication may be reproduced transmitted transcribed stored in a retrieval system or translated into any language or computer language in any form or by any means electronic mechanical magnetic optical chemical manual or otherwise without the prior written permission of Embedded Artists AB Disclaimer Embedded Artists AB makes no representation or warranties with respect to the contents hereof and specifically disclaim any implied warranties or merchantability or fitness for any particular purpose Information in this publication is subject to change without notice and does not represent a commitment on the part of Embedded Artists AB Feedback We appreciate any feedback you may have for improvements on this document Please send your comments to support EmbeddedArtists com Trademarks InfraBed and ESIC are trademarks of Embedded Artists AB All other brand and product names mentioned herein are trademarks services marks registered trademarks or registered service marks of their respective owners and should b
12. RA BE RAE RE BEE Figure 7 Example Root Makefile and Recursive Invocation To build the application program start a command prompt the bash script change directory to the project root and type make Depending on the make file content either an executable program or a library will be created To also download the executable program type make deploy instead of just make A final note about the make file make clean will erase all object files and make depend will recreate dependency files this is also always done when typing just make Finally make terminal will just start the terminal function in the download program Ipc2 lisp The specific settings for using the ISP download program can be set with the DL XXX variables as seen at the end of Figure 7 above 3 2 Startup Framework As already mentioned the startup files form a configurable startup framework This is often called a Board Support package or BSP for short It contains the very basic startup and initialization code as well as a console with printf and scanf like functionality The BSP is very configurable and can be changed according to your specific needs Each project can have its specific settings The configuration file is listed in Figure 8 below and can be found in file config h in the startup subdirectory J E RK KR K A e k KK k k k k k k k k k k k k k k k k k k k KAA k k k k k k k k k k k k k Copyright C 2000 2005 Embedded Arti
13. ady is the option Execute Code after Upload is checked 2 2 2 LPC21ISP The LPC21ISP program is made publicly available by Martin Maurer Source code is also available at http engelschall com martin Ipce2 1xx isp index html Figure 3 below shows the command syntax for the program Copyright 2005 Embedded Artists AB QuickStart Program Development User s Guide InfraBed Blue Webbkurs Evaluation Board v1 0 0 0 gt 1lpe21lisp ortable command line ISP for el Tipe LPC266 family and ersion 1 alog Devices ADUC 7 xx ompiled for Windows Nov 8 2004 21 04 11 opyright lt c gt by Martin Maurer 2003 2004 Email Martin Maurer clibb de ortions Copyright lt c by Aeolus Deve lopment 2004 ttp wuw aeo lusdeve lopment com lpc2iisp Options file comport baudrate Oscillator_in_kHz lpc2 isp test hex com 115266 14746 bin for uploading binary file hex for uploading file in intel hex format default term for starting terminal after upload termon ly for starting terminal without an upload debug for creating a lot of debug infos control for controlling R8232 lines for easier booting lt Reset DIR EnableBootLoader RTS gt logfile for enabling logging of terminal output to lpc2 isp log ADARM for downloading to an Analog Devices ARM microcontroller ADUC7 xx PHILIPSARM for downloading to a microcontroller from Philips LPC2006 family lt default gt Figure 3 LPC21ISP Portable Command Line ISP S
14. ain o eeprom o i2c o startup o LDFLAGS Wl Trom 1ld this file controls the linker all test hex test OBJS arm elf gcc CFLAGS LDFLAGS OBJS LIBS o test elf s5 arm elf gcc c INCLUDE CFLAGS lt 0O 3 8 arm elf gcc c INCLUDE CFLAGS lt el arm elf gcc c INCLUDE CFLAGS lt S hex arm elf objcopy O ihex lt elf oe Oo oo oe ae ie ov clean rm f o test elf test hex Figure 10 Example GCC Makefile Copyright 2005 Embedded Artists AB QuickStart Program Development User s Guide Page 23 4 CD ROM and Product Registration The CD ROM accompanying all QuickStart Boards contains a lot of information and programs that will QuickStart your program development Observe that there may be newer versions of different documents and programs available than the ones on the CD ROM See Section 4 2 for information about the product registration process which allows you to always have access to the latest versions 4 1 CD ROM The following is included on the CD ROM e The preloaded test program as a HEX file e The two different ISP download programs e Datasheets of all circuits on the QuickStart Board e QuickStart Build Environment from Embedded Artists which contains a complete setup of a build environment for GCC e A complete development environment Rowley Associates CrossWorks for ARM 30 day evaluation version e A complete development environment
15. am or library NAME testprogram 10m_eth Link program to RAM or ROM possible values for LD RAMROM is RAM or ROM if not specified ROM LD RAMROM ROM Name if specific CPU used used by linker scripts to define correct memory map Valid CPUs are LPC2101 LPC2102 LPC2103 LPC2104 LPC2105 LPC2106 LPC2114 LPC2119 LPC2124 LPC2129 LPC2131 LPC2132 LPC2134 LPC2136 LPC2138 LPC2141 LPC2142 LPC2144 LPC2146 LPC2148 LPC2194 LPC2210 LPC2220 LPC2212 LPC2214 LPC2290 LPC2292 LPC2294 If you have a new version not specified above just select one of the old versions with the same memory map CPU_VARIANT LPC2132 It is possible to override the automatic linker file selection with the variable below No not use this opion unless you have very specific needs LD_SCRIPT build_files myOwnLinkScript_rom 1d LD SCRIPT PATH Custom linker scripts can be used but not in this makefile ELF file contains debug information or not possible values for DEBUG are 0 or 1 Extra debug flags can be specified in DBFLAGS DEBUG 1 DBFLAGS Optimization setting Os for small code size 02 for speed OFLAGS Os Extra general flags For example compile for ARM THUMB interworking EFLAGS mthumb interwork EFLAGS The files are compiled in THUMB mode Program code run in ARM or THUMB mode Can be ARM THUMB CODE THUMB List C source files here CSRCS main c The root
16. continue click Next ie Ppa nemi b pstallSmeld Wizard License Agreement Please read the following license agreement carefully 1 Terms and conditions This document serves as Embedded Artists AB no nonsense license statement and limited warranty For the InfraBed License This license statement and limited warranty constitutes a legal agreement License Agreement between you either as an individual or a single entity and Embedded Artists AB Embedded Artists 4B For the software product Software identified above including any software media and accompanying on line or printed documentation BY INSTALLING THE SOFTWARE YOU AGREE TO BE BOUND BY ALL OF THE TERMS AND CONDITIONS OF THE LICENSE AGREEMENT accept the terms in the license agreement InstallShield QuickStart Program Development User s Guide is Papen b installsineld Wizard Destination Folder Click Next to install to this Folder or click Change to install to a different folder J Install LPC2xxx gec newlib to C Program Infrabed evboards LPC2xxx gcc newlib v2_0_0_0 M Use the default installation directory Please note that in order for the QuickStart Board to work with InfraBed tm you have to use the suggested path InstallShield iS Penei nale zand Ready to Install the Program The wizard is ready to begin installation Click Install to begin the installation IF you
17. creenshot A typical program download sequence may look like in Figure 4 below Here the test program is downloaded As seen the first part is the actual program download phase Then this is done the program switches to being a terminal the second part and the messages from the test program is displayed It also sends anything typed on the keyboard back to the QuickStart Board As seen the program ends when ESC is pressed This sequence illustrates the benefits from using the program as a terminal directly after program download No characters are missed after program start LPC2106 gcc newlib v1 0 0 0 O x lpc21iisp version 2 a File testprogram_ Tpe213x_4 qsb hex loaded Converting file testprogram_lpc213x_qsh hex to binary format File testprogram_lpc213x_qsh hex converted to binary format Warning data not aligned to 4 byte address address BxB0001 ESS padded arning data not aligned to 4 byte address address 6x 1E56 padded arning data not aligned to 4 byte address address xl B1ES padded arning data not aligned to 4 byte address address 6x 0262A padded Program arning data not aligned to 4 byte address address x00802628 padded Image address xBQBB0EU8 10688 bytes Download Synchronizing Read botcol PO fons 2 0 0 Phase Read part I LPC2132 64 kiB ROM 16 kiB SRAM 196369 gt Sector 2 Download Finished taking 3 seconds ow launching the brand new code erminal starte
18. d press Escape to abort Test program for LPC213x QuickStart Board Version 1 6 2005 07 11 ease Embedded So ara 2005 EEPROM and I2C test est 1 write string String 1 to address 6x 600 done status code OK program cycle completed a est 2 write string sTrInG 2 to address x 0a0 Terminal done lt status code OK program cycle completed Phase est 3 read string from address 6x66060 string is String 1 est 4 read string from address 6x86a8 string is sTrInG 2 est 5 write string sTrInG 2 to address 6x6004 done status code OK program cycle completed est 6 read string from address 6x8600 string is StrisTrInG 2 Summary of tests Passed all tests RTC test ti test OK e Figure 4 LPC21ISP Command Line ISP Download Screenshot Example Copyright 2005 Embedded Artists AB QuickStart Program Development User s Guide Page 9 Another benefit with this program is that it runs under Linux Use version 1 28 or later of LPC21ISP EXE since older versions must be recompiled with increased reset timeout when the program tries to synchronize to the QuickStart Board The timeout should be increased to at least 350 ms 2 3 Program Development Environment There are many options when it comes to the actual application program development First of all you must select a development environment i e an editor preferably wit
19. de build_files general mk This is a general make file that is part of the complete build environment This part contains all specific details of compiler and linker invocation Also at the end the target must be decided either an executable program or a library Either PROGRAM _MK or LIBRARY_MK must be set to true Copyright 2005 Embedded Artists AB QuickStart Program Development User s Guide The example makefile above is quite simple to its structure It is possible to create more complex project structures that contain many subprojects A typical example is to have an application project in a root folder Under this root folder a number of subdirectories exist containing different blocks of functionality For example this can be a Real Time Operating System and a TCP IP stack This calls for a recursive makefile structure The makefile in the root filer will create an executable program It also includes the makefile in each of the subdirectories The makefiles that exist in subdirectories will create libraries An example of a root make file is presented in Figure 7 below HARARE EE E AE EEE aE aE AEE E EAE AERA ERA EE ERA EE ERA AE FE FE General makefile for building executable programs and libraries for Embedded Artists QuickStart Boards C 2001 2005 Embedded Artists AB Name of resulting program file LALALALALALLLLLLLLELALALAELEALALALLLLLALALA LARA ELLA Name of target executable progr
20. document 1 Philips LPC2xxx Datasheet 2 Philips LPC2xxx User s Manual 3 Philips LPC2xxx Errata Sheet 4 ARM7TDMI Technical Reference Manual Document identity DDI0029G http www arm com pdfs DDI0029G_7TDMI R3_trm pdf 5 ARM Architecture Reference Manual Document identity DDIO100E Book Second Edition edited by David Seal Addison Wesley ISBN 0 201 73719 1 Also available in PDF form on the ARM Technical Publications CD 6 ARM System Developer s Guide Designing and Optimizing System Software by A N Sloss D Symes C Wright Elsevier ISBN 1 55860 874 5 7 Embedded System Design on a Shoestring by Lewin Edwards Newnes ISBN 0750676094 8 GNU Manuals http www gnu org manual 9 GNU ARM tool chain for Cygwin http www gnuarm com 10 An Introduction to the GNU Compiler and Linker by Bill Gatliff http www billgatliff com 11 LPC2000 Yahoo Group A discussion forum dedicated entirely to the Philips LPC2xxx series of microcontrollers http groups yahoo com group Ipc2000 12 The Insider s Guide to the Philips ARM7 Based Microcontrollers by Trevor Martin http www hitex co uk arm Ipc2000book index html Observe that there can be newer versions of the documents than the ones linked to here Always check for the latest information version Copyright 2005 Embedded Artists AB
21. e treated as such Copyright 2005 Embedded Artists AB QuickStart Program Development User s Guide Page 3 Table of Contents 1 Introduction 4 1 1 Low Cost QuickStart Boards 4 1 1 1 Design and Production Services 4 1 2 Other QuickStart Boards and Kits 4 2 Getting Started 5 2 1 Test program 5 2 2 Program Download 6 2 2 1 Philips LPC2000 Flash Utility 6 2 2 2 LPC21ISP 7 2 3 Program Development Environment 9 2 4 Installing the QuickStart Build Environment 10 3 QuickStart Build Environment 15 3 1 Makefiles 15 3 2 Startup Framework 18 3 3 GCC 22 4 CD ROM and Product Registration 23 4 1 CD ROM 23 4 2 Product Registration 23 5 Further Information 24 Copyright 2005 Embedded Artists AB QuickStart Program Development User s Guide Page 4 1 Introduction Thank you for buying a product from Embedded Artists This document is a User s Guide that describes how to get started with application program development on day using our QuickStart Build Environment for Philips LPC2xxx family of ARM7 microcontrollers This document is common for all LPC2xxx QuickStart Boards from Embedded Artists When buying a QuickStart Board from Embedded Artists a Resource CD ROM is always included with the board This CD is filled with useful information and programs that help you get started immediately with your application development A number of complete development environments are included specifically Embedded Artists unique QuickSta
22. folder only contains one file the main file List assembler source files here ASRCS List subdirectories to recursively invoke make in SUBDIRS startup tcpip pre _emptive_os Three different subdirectories that contains different blocks of functions in the final application Copyright 2005 Embedded Artists AB QuickStart Program Development User s Guide Page 18 The three libraries that are created in the recursive invocation of make are included in the final application Note the startup library List additional libraries to link with LIBS startup libea_startup_thumb a tcpip tcpip a pre emptive os pre emptive os a Add include search path for startup files and other include directories NC I startup Select if an executable program or a library shall be created PROGRAM MK true LIBRARY MK true Output format on hex file if making a program can be srec ihex HEX FORMAT ihex Program to download executable program file into microcontroller s FLASH DOWNLOAD lpc2lisp exe Configurations for download program Which com pot that is used which download speed and what crystal frequency on the board DL_COMPORT coml DL BAUDRATE 115200 DL CRYSTAL 14746 TR AR PE FE AE RARE AE E RAE E FE RA AE E AE BE AE A RA BA BE AEE A RAE AE AE RAE AE FE BH include build_files general mk FEAE AE AE AE RAR RE RE RA RE ARE AE E AE E RE RAE RE RAE BARA BE RAE RE BA
23. h project management capabilities a compiler package compiler plus linker and a debugger Fortunately there are many different choices for ARM program development each with its pros and cons The list below is far from complete but gives a general overview The accompanying CD ROM see Section 4 1 for more details contains many of these programs environments e QuickStart Build Environment from Embedded Artists Embedded Artists has created a complete GCC build environment for all QuickStart boards This will ease program development for novel users By installing the QuickStart Build Environment you will automatically get a complete setup of the build environment e Rowley Associates Cross Works for ARM A complete development environment from Rowley Associates including an editor project manager a complete compiler build environment and a debugger The version included on the CD is a 30 day fully functional evaluation version e TAR Embedded Workbench A complete development environment from IAR Systems including an editor project manager a complete compiler build environment and a debugger The version shipped on the CD ROM has a 32 Kbyte program size limit but is fully functional in all other aspects e Keil uVision This is another complete development environment but from Keil It includes an editor project manager a complete compiler build environment and a debugger An evaluation version can be downloaded from Keils
24. homepage One version of the development environment is based on the GCC compiler currently version 3 3 1 of GCC and a later version is based on Keils own compiler e Programmers notepad This is a very good editor and project manager that is increasing in popularity The program can easily be integrated with the GCC compiler e Eclipse CDT This is a very good development environment editor and project manager with specific support for C C code development It does not contain a compiler but can easily be connected to one for example GCC e GCC distribution GNUARM A complete distribution of GCC specifically for ARM processors Current version of GCC is 3 4 3 and the new 4 0 0 and it is constantly updated e WinARM This is another distribution that not only contains GCC but also Programmers Notepad LPC21ISP a terminal program and JTAG drivers Copyright 2005 Embedded Artists AB QuickStart Program Development User s Guide 2 4 Installing the QuickStart Build Environment This section describes the necessary steps of program installation that is needed to get the QuickStart Build Environment ready for your use e Start with installing the GNUARM distribution that is included in the CD ROM The current version of the file is called bu 2 15_gec 3 4 3 c ct t java_nl 1 12 0 _gi 6 1 exe There is also a newer but less well tested version based on GCC v4 0 Only use this newer version if you are an experienced user
25. ickStart Program Development User s Guide Page 6 2 2 Program Download For now it is assumed that the program to be downloaded is already developed and there exist a HEX file to be downloaded This HEX file represents the binary image of the application program There are basically two ways of downloading a program into a LPC2xxx microcontroller e ISP In System Programming The LPC2xxx microcontroller provides on chip bootloader software that allows programming of the internal flash memory over the serial channel The bootloader is activated by pulling port pin P0 14 low during reset of the microcontroller Most QuickStart Boards contains a circuit for automatically controlling pin P0 14 and the reset signal over the RS232 channel This allows the program download to be fully automated o Philips provides a utility program for In System Flash ISP programming called LPC2000 Flash Utility o Alternatively there is a program called LPC21ISP that can be used Source code is available This program also provides a terminal functionality which can be very helpful when developing your application program The same serial channel that is used to download the program is typically also used for printing out information from the running program The program immediately switch to terminal mode after program download and will hence not miss any characters sent on the serial channel directly after program start The installation files for bo
26. ine SRAM SIZE 16 1024 LPC2214 elif defined LPC2290 define SRAM SIZE 16 1024 LPC2290 elif defined LPC2292 define SRAM SIZE 16 1024 LPC2292 elif defined LPC2294 define SRAM SIZE 16 1024 LPC2294 else error CPU_VARIANT not defined in the makefile or illegal value endif define SRAM _SADDR 0x40000000 SRAM starting address define SRAM TOP SRAM SADDR SRAM SIZE SRAM end address 1 define SRAM _EADDR SRAM _SADDR SRAM SIZE 1 SRAM end address define STK_SIZE stackSize SYS stackSize SVCt stackSize UND stackSize ABTt stackSize IRQ tstackSize FIQ define STK_SADDR SRAM EADDR 1 STK_ SIZE Stack start address endif config h_ Figure 8 Board Support Package BSP Configuration File There are three versions of the consol in order to best fit different situations e A very simple version that basically only supports printing strings without any formatting parts and printing numbers decimal or hexadecimal Copyright 2005 Embedded Artists AB QuickStart Program Development User s Guide Page 21 e A simple printf implementation that supports the simplest formatting tags The implementation has been designed for lest possible stack usage about 40 bytes e A full ANSI printf implementation from newlib part of the compiler environment that comes with GNUARM This routine requires about 600 bytes of stack space and should normally
27. kits or contact your local distributor Copyright 2005 Embedded Artists AB QuickStart Program Development User s Guide Page 5 2 Getting Started 2 1 Test program All QuickStart Boards come with a pre installed test program The test program is great for verifying that the board really works and can for example be used if you suspect that the board has been damaged for some reason Simple connect a LED to each I O pin A running one pattern will typically present itself on the LEDs Internal functions like the Real Time Clock RTC and EEPROM will also be tested if present as well as the UART Connect the QuickStart Board to a terminal program on the PC A great one is included on the CD ROM The baud rate differs between the QuickStart Boards depending on different crystal clock frequencies Check with the User s Manual for the specific QuickStart Board you are using but in general the baud rate is 115200 bps for 14 7456 MHz crystals and 38400 bps for 12 0000 MHz crystals 8 data bits no parity bits and one stop bit i e 8N1 is typically always used The test program will output test result information regarding the internal tests on the terminal for example from the RTC PC and E PROM tests Also the UART RS232 channel can be tested by typing characters in the terminal program The output from the test program will look something like in Figure 7 below Observe that the screen shot below is just an example Ever
28. mpare Flash Manual Reset End Sector i Time Out sec 2 p Device Use DTR ATS Device pc2106 ng Patt ID Vv SoU ed XTAL Freq kHz 1 4746 Device ID Boot Loader ID Selection Figure 2 Philips LPC2000 Flash Utility Screenshot Configure the dialog as shown above The program will control the RS232 signals DTR and RTS if the appropriate checkbox is checked and hence provide fully automated program download You can easily test the connection with a QuickStart Board by pressing the Read Device ID button The text fields for Part ID and Boot Loader ID will then contain uploaded information from the microcontroller Observe that the XTAL Freq must be set to appropriate value For most QuickStart Boards it s either 14 7456 MHz or 12 0000 MHz In these cases the value 14746 or 12000 shall be written in the text box If the crystal frequency has been changed make sure the appropriate value is set Set the communication baud rate to 115200 for 14 7456 MHz crystal or 38400 a reliable connection cannot be achieved with higher baud rates if the crystal is 12 MHz If no connection can be established test with a low Baud Rate for example 1200 bps Also verify that the correct COM port has been selected under Connected to Port Select the HEX file to be downloaded and then press the Upload to Flash button The downloaded program will immediately start after the download i e the Upload to Flash operation is re
29. n directory Which components should be installed Select the components you want to install clear the components you do not want to install Click Next when you are ready to continue Full installation Little Endian M LE Libraries No Fast Multiplier M ARM THUMB Interworking THUMB V THUMB Libraries ARM THUMB Interworking Floating Point Unit V FPU Libraries 775MB E 3 8 MB F 3 8 MB 38MB 19 1 MB 35MB 3 6 MB 29 2 MB 3 7 MB bal Current selection requires at least 215 2 MB of disk space ToL Se TIP GhUARN Select Components Which components should be installed Select the components you want to install clear the components you do not want to install Click Next when you are ready to continue Custom installation RETT lt a save space on joating Point Unit Z FPU Libraries 37MB your harddisk No Fast Multiplier you can deseclect the Bt Libraries Big Endian C No Fast Multiplier i component C ARM THUMB Interworking 1 THUMB Current selection requires at least 137 7 MB of disk space Copyright 2005 Embedded Artists AB If you want to QuickStart Program Development User s Guide Copyright 2005 Embedded Artists AB iouSetip GNUARM Select Start Menu Folder Where should Setup place the program s shortcuts Setup will create the program s shortcuts in
30. rt Build Environment This document describes how to get started with application development on day 1 using this QuickStart Build Environment 1 1 Low Cost QuickStart Boards Our QuickStart Boards are very low cost and can be used for prototyping development as well as for OEM production Modifications for OEM production can easily be done even for modest production volumes Contact Embedded Artists for further information about design and production services 1 1 1 Design and Production Services Embedded Artists provide design services for custom designs either completely new or modification to existing boards Specific peripherals and or I O can easily be added to the different designs for example communication interfaces specific analogue or digital I O and power supplies Embedded Artists has a broad and long experience in designing industrial electronics in general and specifically with Philips LPC2xxx microcontroller family Our competence also include wireless and wired communication for embedded systems such as IEEE802 11b g WLAN Bluetooth ZigBee ISM RF Ethernet CAN RS485 and Fieldbuses e Prototype and low volume production takes place in Sweden for best flexibility and short lead times e High volume production takes place in China for lowest possible cost 1 2 Other QuickStart Boards and Kits Visit Embedded Artists home page www EmbeddedArtists com for information about other QuickStart boards
31. sts AB Description Framework for ARM7 processor AAA A A RRA AA RRA AA AAA A I ifndef config h_ define config h_ S EKK K K K k KK KKK KK k k k k k k k k k k k k k k k k k k k k k k k k k k k k k k k k k k k k k k k kk k k k k k k k k k k kk k k k kk kk k k Defines macros and typedefs FR A KA A KK A A AKA A A A KKK KKK KK define FOSC 14745600 External clock input frequency must be between 10 MHz and 25 MHz Copyright 2005 Embedded Artists AB QuickStart Program Development User s Guide define USE PLL 1 0 do not use on chip PLL 1 use on chip PLL define PLL MUL 4 PLL multiplication factor 1 to 32 define PLL DIV 2 PLL division factor 1 2 4 or 8 define PBSD 4 Peripheral bus speed divider 1 2 or 4 initialize the MAM Memory Accelerator Module if USE PLL define CORE FREQ FOSC PLL MUL else define CORE FREQ FOSC endif if CORE FREQ lt 20000000 define MAM TIMING al number of CCLK to read from the FLASH elif CORE FREQ lt 40000000 define MAM TIMING 2 number of CCLK to read from the FLASH else define MAM TIMING 3 number of CCLK to read from the FLASH endif define MAM SETTING 2 O disabled l partly enabled enabled for code prefetch but not for data 2 fully enabled define IRQ HANDLER 1 0 Jump to common IRQ handler 1 Load vector directly from VIC i e LDR PC PC OxFFO
32. th programs can be found on the accompanying CD ROM e JTAG For specific information about program download i e Flash programming with a JTAG interface consult the manual for the specific JTAG interface that is used e g CrossConnect from Rowley Associates J link from Segger Ulink from Keil or Wiggler from MacRaigor Most QuickStart Boards have two jumpers links that will connect the RS232 channel to the active control over pin P0 14 and the reset signal See the User s Manual for the specific QuickStart Board you are using for details After program download the jumpers links can be left connected or removed if needed If for example the PC end controls the RS232 signals DTR and or RTS during normal program execution then it might be required that the jumpers links are removed after program download 2 2 1 Philipp LPC2000 Flash Utility Philips LPC2000 Flash Utility program looks like Figure 2 below Never versions than v2 2 0 may exist when you read this document Copyright 2005 Embedded Artists AB QuickStart Program Development User s Guide Page 7 BH vedo Fri Unies File Buffer Help PHILIPS LPC2000 Flash Utility V2 2 0 r Flash Programming Erase Blank m Communication Filename A Connected To Port Vee Entire Device COM1 X es Eldo B C Selected Sectors SEEEN p ExeciteGade Use Baud Rate pload to Fla v __Uloatorish after Upload z Stat Sector 0 tisa rase E Co
33. the following Start Menu folder To continue click Next If you would like to select a different folder click Browse ENOARM Cancel ie JSetup GNUARM Select Additional Tasks Which additional tasks should be performed Select the additional tasks you would like Setup to perform while installing GNUARM then click Next Additional icons Install the Cygwin DLLs Cygwin options Install Cygwin DLLs oe lt Back Next gt Cancel e setup GNUARM Ready to Install Setup is now ready to begin installing GNUARM on your computer Click Install to continue with the installation or click Back if you want to review or change any settings Destination location C Program GNUARM Setup type Custom installation Selected components Little Endian LE Libraries No Fast Multiplier ARM THUMB Interworking THUMB THUMB Libraries QuickStart Program Development User s Guide Copyright 2005 Embedded Artists AB Now install the LPC2xxx gcec newlib_ vX_X_X_X QuickStart Build Environment vX_X_X_X is the current version n of the file The installation is also in this case very simple and straightforward Just follow the default installation steps H Pee newb Installs meld Wizard Welcome to the InstallShield Wizard for LPC2x88 gcc newlib The InstallShield R Wizard will allow you to modify repair or remove LPC2xxx gcc newlib To
34. y QuickStart Board is unique LPC2106 gcc newtib v1 0 0 0 deploy lolx a Test program for LPC213x QuickStart Board Version 1 8 Date 2005 87 12 lt C gt Embedded Artists 2005 EEPROM and I2C test Test 1 write string String 1 to address 6x8000 done status code OK program cycle completed write string sTrInG 2 to address 6x8GaG done lt status code OK program cycle completed read string from address 6x6000 string is String 1 read string from address x8 aG string is sTrInG 2 write string sTrInG 2 to address 6x 004 done lt status code OK gt program cycle completed read string from address 6x6006 string is StrisTrInG 2 Test 2 est 3 Test 4 Mest 5 est 6 EF ECT CECE CIEE TCE Summary of tests Passed all tests RTC test eae test OK I70 and UART test Loop through all 1 0 pins running gt P 4 to P 31 Pi 16 to P1 31 lt not in above order P 2 to P 3 tested via EEPROM and I2C test P to P 1 tested via UART test KKK KK KKK Press any key on terminal and verify echo back Received char t 116 decimal Received char e 1 1 decimal Received char s 115 decimal Received char t 116 decimal Received char i 105 decimal Received char n 110 decimal Received char g 183 decimal Figure 1 Example Test Program Output Copyright 2005 Embedded Artists AB Qu
Download Pdf Manuals
Related Search
Related Contents
取扱説明書等 - アイ・オー・データ機器 Samsung 171B Инструкция по использованию Copyright © All rights reserved.
Failed to retrieve file