Home

TiniARM Development Kit

image

Contents

1. To work with the target board you will need the target board the development board power supply rs232 cable PC with COM port compiler downloader terminal program patience luck and the NMI help forum 1 1 Overview First edit your source code compile it with a compiler link it and write it out with a loader possibly translate the output to one suitable for downloading download the result to the target board attach test equipment and reset board to test it out Note all the steps and also note that this is a command line affair no GUI Although some are available have none to recommend yet So crack the knuckles rub the palms rapidly and push up the sleeves In addition to being command line user interface CLUI it is Unixish and needs a Unix like environment to run in This means using the terminal window in Mac OSX and an extra download in Windows 1 2 Get with the Program s Whether you are running MacOSX Windows or Linux there s a precompiled application out there waiting to be downloaded These are big and always come with many more things that you and all of your related family would never be able to use so be prepared for a long download even on high speed connections This document is tied to the gnude 1 2 1 1 release on Windows 2000 and MacOSX Search for gnude download or if this link is valid http sourceforge net projects gnude Page down and download the appropriate vers
2. TiniARM Development Kit User Manual V 2 NEW MICROS INC 1601 Chalk Hill Road Dallas Texas 75212 Tel 214 339 2204 TiniARM Development Kit User Manual Nov 1 2004 Table of Contents DUM I EET EE EE ER N EE OE ON 2 1 1 OVCIVIGW 22 2 Saracen SALE OER ER RE WEE Es DS bu MOER RE ME DE DE ER OES 2 1 2 Get with the Program s 2 1 3 LPC2000 Flash Utility Notes osuere RR IIR 3 1 4 Installing gnude on W2K 3 1 5 Included Files ES EERS RD OE GEE SE BE Be DE RE AE EE DE HE EED 3 2 0 Compiling vors ss Ds he IK EE ED EE EEE Ee EEE 3 2 1 Makefile siens te kes se HEDE ee lide REEDE HI ye DR NE IE IE eg 4 2 2 simple cmd ERROR EE ET OE OE EE ER EO EN 5 zr Ee ii RE DRS ON eae ee eee wee ee EE A AD 5 Me CN PT IE ERG 8 20 ER TE OE OR RT OO ER EE 10 3 0 Downloading is EE EER pL enol oie eure ER ERR dra ed o oa We EE De ke 10 40 TESNO RE napa dtu Dos EE EER DA dod Sus Q asa p u Roh dor Ta pusana 11 5 8 Final Result sscan v REV ERE DER GE a RR CS oe SERE DE RURSUS aa aaa 11 600 Le MP PITT 11 6 1 Compiler arm elf gcc help 11 6 1 1 Compiler Target arm elf gcc target help 12 6 2 Assembler arm elf as help 13 6 3 Loader arm elf Id help 14 6 4 Translation arm elf objcopy
3. F SHLIB filter SHLIB Filter for shared object symbol table g Ignored G SIZE gpsize SIZ f SHLIB auxiliary SHLIB Auxiliary filter for shared object symbol table F1 h FILENAME soname FILENAME Set internal name of shared library I PROGRAM dynamic linker PROGRAM Set PROGRAM as the dynamic linker to use 1 LIBNAME library LIBNAME Search for library LIBNAI L DIRECTORY library path DIRECTORY Add DIRECTORY to library search path T m EMULATION Set emulation M print map Print map file on standard output n nmagic Do not page align data N omagic Do not page align data do not make text readonly no omagic Page align data make text readonly o FILE output FILE Set output file name O Optimize output file Qy Ignored for SVR4 compatibility q emit relocs Generate relocations in final output Ps sis relocateabl Generate relocateable output R FILE just symbols FILE Just link symbols if directory same as rpath s strip all Strip all symbols S strip debug Strip debugging symbols strip discarded Strip symbols in discarded sections no strip discarded Do not strip symbols in discarded sections t trace Trace file opens T FILE script FILE Read linker script u SYMBOL undefined SYMBOL Start with undefined reference to SYMBOL
4. Options pass exit codes Exit with highest error code from a phase help Display this information target help Display target specific command line options Use v help to display command line options of sub processes dumpspecs Display all of the built in spec strings dumpversion Display the version of the compiler dumpmachine Display the compiler s target processor print search dirs Display the directories in the compiler s search path print libgcc file nam Display the name of the compiler s companion library print file name lib Display the full path to library lib print prog name prog Display the full path to compiler component prog print multi directory Display the root directory for versions of libgcc print multi lib Display the mapping between command line options and multiple library search directories print multi os directory Display the relative path to OS libraries Wa options Pass comma separated options on to the assembler Wp options Pass comma separated options on to the preprocessor W1l lt options gt Pass comma separated lt options gt on to the linker Xlinker lt arg gt Pass lt arg gt on to the linker save temps Do not delete intermediate files pipe Use pipes rather than intermediate files time Time the execution of each subprocess specs file Override built in specs with the contents of file std
5. amp THRE void tx char c UARTO_THR c char rx void return UARTO_RBR void tx_str char s send a string while s if tx query tx stt s Mk REK KKKK RR R RR kk k SK kk ko ko kk RR SK K ko ke ko ee A AA AAA I kk e ee MAIN kk kk A A AA AA ee A kc AAA ee A AAA RR KOR KOK R KO void main void char x char 0 y char 0x1000 Initialize the system Initialize Start timer Interrupts not working yet so this code is commented out for now TIMER1 TCR 0x1 For testing library inclusion memcpy x y 100 test banner tx_str n rTest echo n r echo for main loop while 1 if rx query amp amp tx query received and ready to send tx rx get and send Mk REK KK SK SK k K IK SK Yk Ck YK K A A RR SK K K ko kk ko ee ke KOK RR RR RR I koe ke ee Initialize CKOK kk kk A AA k K SK SK K K SK ee YK ko K RR K K K K K KOK KOK K KOK OK KOK KOK AAA I KOK KOK Ef TiniARM Development Kit User Manual Nov 1 2004 extern const char text start text end extern char data start data end define PLOCK 0x400 void Initialize void memcpy amp data start amp text end amp data end amp data start set io pins for leds red off yellow off green on IODIR 0x03800000 23 25 are outputs IOSET 0x00800000 green led on IOCLR 0x03000000 red and yellow off Initialize PLL Configured for
6. 0x1E000 but the program prevents the user from seeing that part of flash This has been fixed as of version V2 2 0 and is available from the LPC2000 files section in Yahoo groups http groups yahoo com group lpc2000 files There is a button to calculate the security code at 0x14 but it is on the flash buffer tool and is not needed for normal downloads The tool cannot handle files which are both RAM and Flash You will get messages complaining about memory out of range This could be something destined for RAM space like an initialized variable and could warrant a second look or it might not bother you at all 1 4 Installing gnude on W2K Download and install cygwin to create a unix environment under windows Put gnude under cygwin This is seen as just inside a cygwin shell To set the PATH variable export PATH SPATH gnude bin gnude arm elf bin This will give you access to the tools with or without their prefixes This means if there is no other gcc tools installed in your paths then gcc will be the same as arm el gcc and can be used as a shortcut 1 5 Included Files a lst assembly listing of example ivt o object file from compiling ivt s ivt s source code containin the exception vectors for the beginning of flash libc a C library precompiled archive for use if needed pc210x h header file with names for all the registers main c test program in C main cmd extra complicated lo
7. in so the end user need not worry about it If the tool does not provide this feature then the value has to be computed manually and has to be inserted at 0x14 Details on computation of checksum could be found in the Flash programming chapter in the LPC2104 5 6 User Manual NOP for code to be LDR PC FIQ Addr Undefined_Addr word Undefined_Handler SWI_Addr word SWI Handler Prefetch Addr word Prefetch Handler Abort Addr word Abort Handler FIQ Addr word FIQ Handler Exception Handlers The following dummy handlers do not do anything useful in this example They are set up here for completeness Undefined_Handler B Undefined_Handler SWI_Handler B SWI_Handler Prefetch_Handler B Prefetch_Handler Abort_Handler B Abort_Handler FIQ Handler B FIQ Handler END LDR PC PC 0xFFFFF010 load irq vector from vic TiniARM Development Kit User Manual Nov 1 2004 2 5 start s code originally from phillips appnote 10254 Assembler Directives Section asm code ax New Code section CODE32 Q ARM code extern _ main 8 main not defined Q in this section global start global symbol referenced in Q ivt s Start co cO CD cO CO G CO c CO cO cO cO D TO Set SP for Supervisor mode Depending upon the stack the application needs this value needs to be set St bu ot ack
8. out start o ivt o main o libc a Koner echo compiling CC S CAFLAGS lt gt a lst mainin start s ivt s main c echo compiling CC S CFLAGS start s ivt s main c TiniARM Development Kit User Manual Nov 1 2004 4 2 2 simple cmd Simple command script for organizing memory Rob Chapman Apr 1 04 n ECTIONS interrupt vectors 0x0 start of flash interp interp code and constants text text strings rodata init comment uninitialized data 0x40000000 start of ram bss bss COMMON data 2 3 main c code originally from phillips appnote 10254 KKK KK KK k lt lt ck ck ck ck ck ck KKK KKK kk Ck kk Sk kk RR RR kk x Ck KKK KKK KK KKK KKK KKK Function declarations kk k k Ck k k k lt Ck k kk Ck k k lt Ck x Ck lt ck Ck lt kk lt k lt lt lt k x RR RR x KKK KKK KKK void IRQHandler void void feed void void Initialize void Mk RR RR k a SK k K IK RR YK K kk ko K YK kk RR SK K RR ko TK K ee K KOK AA AA ko ke eee Header files kk ok K k 3k S k K SK RR ee K K ke K k RR K K KOK ee A A KOK RR RR RR K KOR KOK K K f include LPC210x h include lt string h gt serial port define RDR 0x01 define THRE 0x20 char rx_query void TiniARM Development Kit User Manual Nov 1 2004 return UARTO LSR amp RDR char tx query void return UARTO_LSR
9. symbols lt file gt weaken symbols lt file gt alt machine code index prefix symbols prefix prefix sections prefix prefix alloc sections prefix v verbose V version h help info Set section name s properties to flags Add section name found in file to output lt flags gt Rename section old to new Force output format s leading character style Remove leading character from global symbols Redefine symbol name old to new Restrict the length of generated Srecords Restrict the type of generated Srecords to 3 N for all symbols listed in file K for all symbols listed in file L for all symbols listed in file G for all symbols listed in file W for all symbols listed in file Use alternate machine code for output Add prefix to start of every symbol name Add prefix to start of every section name Add prefix to start of every allocatable section name List all object files modified Display this program s version number Display this output List object formats amp architectures supported arm elf objcopy supported targets 1f32 littlearm elf32 bigarm elf2 littl 1f32 big srec symbolsrec tekhex binary ihex TiniARM Development Kit User Manual Nov 1 2004 18
10. unigue SECTION Don t merge input SECTION orphan sections Ur Build global constructor destructor tables v version Print version information V Print version and emulation information x discard all Discard all local symbols X discard locals Discard temporary local symbols default discard none Don t discard any local symbols y SYMBOL trace symbol SYMBOL Trace mentions of SYMBOL Y PATH Default search path for Solaris compatibility start group Start a group end group End a group accept unknown input arch Accept input files whose architecture cannot be determined no accept unknown input arch assert KEYWORD Ignored for SunOS compatibility Small data size if no size same as shared Reject input files whose architecture is unknown TiniARM Development Kit User Manual Nov 1 2004 15 Bdynamic dy Bstatic dn Bsymbolic check sections no check sections cref defsym SYMBOL EXPR demangle STYLE embedded relocs fini SYMBOL force exe suffix non shared call shared Link against shar static ed libraries Do not link against shared libraries Bind global refer ences locally Check section addresses for overlaps default Do not check section addresses for overlaps Output cross refe ESSION Define a symbol Demangle symbol names using STYLE rence table Ge
11. RTO LCR 0x3 disable divisor latches I 3 sk k 3k SK KK I ko ko kk KICK K K K ke RR A A RR RR ER I ko e ee Timer 1 ISR kk KK A A A AAA ee ko ke K k AA ee ko X AAA I I I ke ee void __attribute__ interrupt IRQHandler void The Interrupt Service Routine code will come here The interrupt needs to be cleared in Timerl and a write must be performed on the VIC Vector Address Register to update the VIC priority hardware Here the user could blink a few LED s or toggle some port pins as an indication of being in the ISR IOSET 0x01000000 yellow led on TIMER1_IR 0x1 VICVectAddr 0xff void feed void PLLFEED 0xAA ED 0x55 rg Frj 2 4 ivt s code originally from phillips appnote 10254 TiniARM Development Kit User Manual Nov 1 2004 Assembler Directives ARM code section interp ax alocateable and executable New Code section compiler option CODE32 extern start start symbol not defined in this section Entry Defines entry point LDR PC _start LDR PC Undefined_Addr LDR PC SWI_Addr LDR PC Prefetch_Addr LDR PC Abort_Addr At 0x14 the user should insert a signature checksum This signature enables the bootloader to determine if there is valid user code in the Flash Currently most of the Flash programming tools debuggers and ISP utility have this feature built
12. a 10MHz crystal to boost processor clock to 60MHz a Setting Multiplier and divider values PLLCFG 0x25 feed Enabling the PLL PLLCON 0x1 feed Wait for the PLL to lock to set frequency while PLLSTAT amp PLOCK Connect the PLL as the clock source PLLCON 0x3 feed Enabling MAM and setting number of clocks used for Flash memory fetch sy MAMCR O make sure MAM is off before adjusting MAMTIM 0x3 MAMCR 0x2 Setting peripheral Clock pclk to System Clock cclk y VPBDIV 0x1 Initialize GPIO IODIR OxFFFF IOSET OxFFFF Initialize Timer 1 IMER1 TCR 0x0 IMER1_TC 0x0 IMER1_PR 0x0 TiniARM Development Kit User Manual Nov 1 2004 IMER1 PC 0x0 End user has to fill in the match value IMER1_MRO 0x123456 Reset and interrupt on match IMER1_MCR 0x3 Initialize VIC VICIntSelect 0x0 Timer 1 selected as IRQ VICIntEnable 0x20 Timer 1 interrupt enabled VICVectCntl0 0x25 Address of the ISR VICVectAddr0 unsigned long IRQHandler initialize serial port initialize UART PINSELO 5 enable UARTO in out UARTO FCR 0x7 enable and reset fifos UARTO LCR 0x83 8 bits enable divisor latches UARTO DLL 0x87 LSB divider for 60mhz to be 9600x16 UARTO DLM 0x01 MSB UA
13. ader script adapted from the tools main hex final output from compilation process main map map of symbols and memory main o compiled object from main c main out the output from the loader linker makefile the script on how to make the test application simple cmd the script for where the test application fits in memory start o compiled object file for start s start s start up code to set up the micro and transition into main in 2 0 Compiling All the pieces for compiling in this example reside in one directory This makes compiling simple Just enter this command in the directory with everything in it make test Like magic all the and only the required steps are executed to get from multiple source files and libraries to a singular hex file ready for download along with a memory map file and an assembled code listing For the first run you should see something like this arm elf as o start o start s arm elf as o ivt o ivt s TiniARM Development Kit User Manual Nov 1 2004 3 compiling linking arm elf ld v Map main map nostartfiles T simple cmd o main out start o ivt o main o libc a GNU ld version 2 14 20030612 Copying arm elf objcopy O ihex main out main hex As projects go they are seldom simple once underway for any length of time so it is best to have some organization up front in terms of structure This is where the makefile and loader script come in The makefile provides a si
14. elopment Kit User Manual Nov 1 2004 13 K warn when differences altered for long displacements L keep locals keep local symbols e g starting with L M mri assemble in MRI compatibility mode MD FILE write dependency information in FILE default none nocpp ignored 0o OBJFILE name the object file output OBJFILE default a out R fold data section into text section statistics print various measured statistics from execution strip local absolute stri p local absolute symbols traditional format Use same format as native assembler when possible version print assembler version number and exit W no warn suppress warnings warn don t suppress warnings fatal warnings treat warnings as errors itbl INSTTBL extend instruction set to include instructions matching the specifications defined in file INSTTBL wW ignored X ignored Z gen listing lhs width set the listing lhs width2 set of t the listing rhs width set the rate object fil ven after errors the width in words of the output data column of listing the width in words of the continuation lines he output data column ignored if smaller than width of the first line the max width in characters of the lines from source file listing cont lines set for ARM specific assembler option k gene mthumb asse mthumb interwork supp moab
15. help 17 TiniARM Development Kit User Manual Nov 1 2004 Compiling an Application for the TiniARM From Scratch Programming the Arm processor in C can be done for free with the use of the freely available and multi optioned GNU compilers It can be a little daunting with 7OMB downloads and thousands of pages of text to wade through to find the essential ingredients to make the recipe you re trying to implement This manual assumes a neophyte level user and walks through the paces to get a bare application running on the TiniARM With the knowledge of this journey it is hoped that you will be able to forge your own NOTE Changes from previous manual V 1 are marked with a change bar like the one on the left 1 0 Introduction The first job is to get programs and documentation Some comes with the software but sometimes they need documentation Don t get me wrong it s great that there is a lot of documentation but it is vast and too many variables lie in the way of getting what want Where s my hello world program with an interrupt for only 234 bytes Not 42K of behemoth layers of OS parts and services which have their own empire of documentation often have to dig for a nugget of info to let me know which variable to modify each time something goes wrong in compiling but to find that nugget again would be almost impossible So here are the steps and nuggets most of them took to get to the finish line
16. i use mapcs 32 code mapcs 26 code mapcs float floa mapcs reentrant re e matpcs code mbig endian asse mlittle endian asse mapcs frame use mapcs stack check use mcpu cpu name asse march arch name asse mfpu lt fpu name gt asse EB asse EL asse 6 3 Loader arm elf Id help Usage arm elf ld options fi Options a KEYWORD the maximum number of continuation lines used the output data column of the listing S rate PIC code mble Thumb code ort ARM Thumb interworking old ABI ELF only uses 32 bit program counter uses 26 bit program counter ting point args are in fp regs ntrant code is ATPCS conformant mole for big endian mole for little endian frame pointer stack size checking mble for CPU cpu name mol mol mol mbl for architecture lt arch name gt for FPU architecture lt fpu name gt code for a big endian cpu code for a little endian cpu le Shared library control for HP UX compatibility A ARCH architecture ARCH Set architecture TiniARM Development Kit User Manual Nov 1 2004 14 b TARGET format TARGET Specify target for following input files c FILE mri script FILE Read MRI format linker script d dc dp Force common symbols to be defined e ADDRESS entry ADDRESS Set start address E export dynamic Export all dynamic symbols EB Link big endian objects EL Link little endian objects
17. ion for your platform s In addition for the Windows platform you will also need to download from redhat http www redhat com download cygwin html To communicate with the board you will need to run another program on the PC available from Philips at http www semiconductors philips com files products standard microcontrollers utilities lpc2000 flash utility zip Download what you need and install cygwin first on Windows TiniARM Development Kit User Manual Nov 1 2004 2 1 3 LPC2000 Flash Utility Notes This tool is used to interact with the TiniARM processor over the serial port to move data between it RAM flash and the host computer It is mainly used to program the processor The following points will save some time working with this tool The utility for communicating with the processor for transferring data to and from the chip cannot be used to create a file which is downloadable back to the chip because the first OX3F bytes are not from the program in the rest of flash but are from the flash bootloader and when the contents of flash is transferred to the program buffer it takes the first Ox3F bytes from the bootloader program and the rest of flash from whatever program is there If this hex file is then put back into flash the chip will not boot To fix it the first Ox3F bytes must come from a file source which has the values figured Or the bytes can be edited in the buffer The vector block has been shifted to
18. is already set by bootloader t if this point is entered by any her means than reset the stack pointer needs to be set explicity LD Se Ch R SP 0x40001000 tting up SP for IRQ and FIQ mode ange mode before setting each one move back again to Supervisor mode Ea re co in us se be mov sub sub msr mov msr mov msr ch interrupt has its own link gister stack pointer and program unter The stack pointers must be itialized for interrupts to be ed later tup for fiq and irq interrupt stacks to run low current stack by 1000 r0 sp copy current stack pointer rO rO 1000 rl r0 1000 cpsr c 0x12 make irq stack pointer make fiq stack pointer switch to irq mode sp r0 set irq stack pointer cpsr c 0x11 fiq mode sp rl set fiq stack pointer c CO c CD G G cpsr c 40x13 supervisor mode F I enabled Jump to C code LDR lr main MOV pc lr 3 0 Downloading Once you ve produced the Intel hex file output as the final result of compiling linking and translating it is time to download it to the component board A word of note here to the unwary of jargon Sometimes you will see upload to flash other times you will see download to flash As either transaction is just electrons jiggling in a wire the direction doesn t make sense so just pay attention to the TiniARM Development Kit User Manual Nov 1 2004 destination The flash utility is fairl
19. k mwords littl ndian mlittle endian mbig endian mhard float msoft float malignment traps mapcs reentrant mapcs float mapcs 26 mapcs 32 mpoke function name mapcs frame mpic register Thumb Generate leaf stack frames even if not needed Thumb Generate non leaf stack frames even if not needed Compile for the Thumb not the ARM Generate call insns as indirect calls if necessary Do not load the PIC register in function prologues Do not move instructions into a function s prologue Generate a call to abort if a noreturn function returns Support calls between Thumb and ARM instruction sets Assume big endian bytes little endian words Assume target CPU is configured as little endian Assume target CPU is configured as big endian Use hardware floating point instructions Use library calls to perform FP operations The MMU will trap on unaligned accesses Generate re entrant PIC code Pass FP arguments in FP registers Use the 26 bit version of the APCS Use the 32 bit version of the APCS Store function names in object code Generate APCS conformant stack frames Specify the register to be used for PIC addressing mstructure size boundary Specify the minimum bit alignment of structures mfp march mcpu ARM specific assembler options k mthumb mthumb interwork moabi mapcs 32 mapcs 26 mapcs float mapcs reentrant matpcs mbig endian Specif
20. mand lin Specify target of Ignored for Linux Relax branches on Keep only symbols e output file compatibility certain targe listed in FIL S Pr Set runtime shared library search path Set link time shared library search path Create a shared 1 Sort common symbo Split output sect Print memory usag Display target sp Do task level lin ibrary ls by size ions every SIZI How many tags to reserve in dynamic section E octets e statistics ecific options king Tbss ADDRI Tdata ADD P verbose version script FILE RI Ttext ADDRI version xports section SYMBOL Set address of Set address of Set address of Set address of Output lots of Re Ta named section bss section data section text section Split output sections every COUNT relocs Use same format as native linker tart SECTION ADDRESS information during link ad version information script ke export symbols list from exports using TiniARM Development Kit User Manual Nov 1 2004 16 SYMBOL as the version warn common Warn about duplicate common symbols warn constructors Warn if global constructors destructors are seen warn multiple gp Warn if the multiple GP values are used warn once Warn only once per undefined symbol warn section align Warn if start of section changes due to alignment fatal warnings Treat warnings as errors whole archiv Incl
21. namic relocs into one section Don t create copy relocs Mark object not to use default search paths z nodelete z nodlopen z nodump Z now z origin z KI EYWORD Mark DSO non deletable at runtime Mark DSO not available to dlopen Mark DSO not available to dldump Mark object non lazy runtime binding Mark object requiring immediate SORIGIN processing at runtime Ignored for Solaris compatibility thumb ent ry lt sym gt no pipeline knowledg Stop the linker knowing about the pipeline length Set the entry point to be Thumb symbol lt sym gt 6 2 Assembler arm elf as help Usage arm elf as option asmfile Options a sub option D de f fsym SYM VAL gstabs gdwarf2 help target help I D gt g IR turn on listings Sub options default hls omit false conditionals omit debugging directives include high level source include assembly include macro expansions 5 B F Pp o no omit forms processing s include symbols FILE list to FILE must be last sub option produce assembler debugging messages define symbol SYM to given value skip whitespace and comment preprocessing generate stabs debugging information generate DWARF2 debugging information show this message and exit show target specific options add DIR to search list for include directives don t warn about signed overflow TiniARM Dev
22. nerat mbedded relocs Call SY OL at unload time Force generation of file with exe suffix gc sections no qc sections Remove unused sections on some targets Don t remove unused sections default help init SYMBOL Map FILE no define common no demangle no keep memory no undefined allow shlib undefined Print option help Call SYMBOL at lo Write a map file ad time Do not define Common storage Do not demangle s ymbol names Use less memory and more disk I O Allow no undefine Allow undefined symbols in shared objects d symbols the default no allow shlib undefined Do not allow undefined symbols in shared objects allow multiple definition Allow multiple definitions no undefined version no warn mismatch no whole archiv noinhibit exec nostdlib oformat TARGET qmagic relax retain symbols file FILE rpath PATH rpath link PATH Bshareabl sort common shared spare dynamic tags COUNT split by file split by reloc stats target help task link SYMBOL traditional format section s SIZE COUNT Disallow undefine d version Don t warn about mismatched input files whol archiv Turn off Create an output file even if errors occur Only use library directories specified on the com
23. ngular point of controlling the compiling process and a way of managing compiler options and file groupings The loader script is the recipe for all the ingredients from the compiler output and other precompiled archives a The two files for these included here are simple and will need to be augmented as an application grows Probably the next best thing to add to the makefile is some semblence of proper directory structure where source is kept separate from all the other pieces The libc a file is in the source directory for the simple directory structure in the makefile The following code example has been taken from application note 10254 and modified for this document and for the GNU compiler But itis a working example which can be built upon The interrupt does not work yet and has not been debugged other than a test to see if the interrupt routine was ever called it wasn t indicating probably a configuration problem 2 1 Makefile for making arm code Rob Chapman Apr 1 04 NAME test io cc arm elf gcc LD arm elf ld v AR arm elf ar AS arm elf as CP arm elf objcopy SUFFIXES O c S CFLAGS I c 03 AFLAGS ahls mapcs 32 CAFLAGS CFLAGS Wa ahls mapcs 32 LFLAGS Map main map nostartfiles T simple cmd CPFLAGS O ihex test main out echo copying S CP S CPFLAGS main out main hex main out start o ivt o main o simple cmd echo linking LD S LFLAGS o main
24. standard Assume that the input sources are for standard B directory Add directory to the compiler s search paths b machine Run gcc for target machine if installed V version Run gcc version number version if installed y Display the programs invoked by the compiler Tini ARM Development Kit User Manual Nov 1 2004 11 HHH o lt file gt x lt language gt Like v but options quoted and commands not executed Preprocess only do not compile assemble or link Compile only do not assemble or link Compile and assemble but do not link Place the output into lt file gt Specify the language of the following input files Permissible languages include c c assembler none none means revert to the default behavior of guessing the language based on the file s extension Options starting with g passed on to the various f em SO N O param are automatically sub processes invoked by arm elf gcc In order to pass other options on to thes processes th W letter options must be used 6 1 1 Compiler Target arm elf gcc target help Target specific options mcaller super interworki Thumb Assume function pointers may go to non Thumb aware code mcall super interworki Thumb Assume non static functions may be called from ARM code mtpcs leaf fram mtpcs frame mthumb mlong calls msingle pic bas mno sched prolog mabort on noreturn mthumb interwor
25. t Set the entry point to be Thumb symbol lt sym gt 6 4 Translation arm elf objcopy help Usage arm elf objcopy option s in file out file Copies a binary file possibly transforming it in the process The options are E input target bfdname Assume input file is in format lt bfdname gt O output target lt bfdname gt Create an output file in format lt bfdname gt B binary architecture lt arch gt Set arch of output file when input is binary F target lt bfdname gt Set both input and output format to lt bfdname gt debugging Convert debugging information if possible p preserve dates Copy modified access timestamps to the output j only section lt name gt Only copy section name into the output R remove section name Remove section name from the output S strip all Remove all symbol and relocation information g strip debug Remove all debugging symbols strip unneeded Remove all symbols not needed by relocations TiniARM Development Kit User Manual Nov 1 2004 17 N strip symbol name K keep symbol name L localize symbol name G keep global symbol name W weaken symbol name weaken x discard all X discard locals i interleave number b byte num gap fill val pad to lt addr gt set start lt addr gt Do not copy symbol lt name gt Only copy symbol lt name gt Force symbol l
26. t name gt to be marked as a local Localize all symbols except lt name gt Force symbol lt name gt to be marked as a weak Force all global symbols to be marked as weak Remove all non global symbols Remove any compiler generated symbols Only copy one out of every number bytes Select byte num in every interleaved block Fill gaps between sections with val Pad the last section up to address lt addr gt Set the start address to lt addr gt change start adjust start incr Add incr to the start address change addresses adjust vma lt incr gt Add incr to LMA VMA and start addresses change section address adjust section vma lt name gt lt val gt change section lma name change section vma name no change warnings no Change LMA and VMA of section name by val lt val gt Change the LMA of section lt name gt by val lt val gt Change the VMA of section lt name gt by lt val gt adjust warnings Warn if a named section does not exist set section flags lt name gt lt flags gt add section lt name gt lt file gt rename section lt old gt lt new gt change leading char remove leading char redefine sym lt old gt lt new gt srec len number srec forces3 strip symbols file keep symbols file localize symbols lt file gt keep global
27. ude all objects from following archives wrap SYMBOL Use wrapper functions for SYMBOL mpc860c0 WORDS Modify problematic branches in last WORDS 1 10 default 5 words of a page arm elf ld supported targets elf32 littlearm elf32 bigarm elf32 littl 1f32 big srec symbolsrec tekhex binary ihex arm elf ld supported emulations armelf arm elf ld emulation specific options armelf Bgroup Selects group name lookup rules for DSO disable new dtags Disable new dynamic tags enable new dtags Enable new dynamic tags eh frame hdr Create eh frame hdr section z combreloc erge dynamic relocs into one section and sort z defs Disallows undefined symbols z initfirst ark DSO to be initialized first at runtime z interpose ark object to interpose all DSOs but executable z loadfltr ark object requiring immediate process z muldefs Allow multiple definitions z nocombreloc Don t merge dynamic relocs into one section z nocopyreloc Don t create copy relocs z nodefaultlib Mark object not to use default search paths z nodelete Mark DSO non deletable at runtime z nodlopen Mark DSO not available to dlopen z nodump Mark DSO not available to dldump Zz now Mark object non lazy runtime binding z origin Mark object requiring immediate SORIGIN processing at runtime z KEYWORD Ignored for Solaris compatibility p no pipeline knowledg Stop the linker knowing about the pipeline length thumb ent ry lt sym g
28. y straight forward Press the button to set the flash programming filename to the hex file generated after all the making is done main hex Then press the update flash button The first time is likely to fail because you ve run your test program So wait for tthe timeout and error dialog and try again This time you will receive a dialog asking you to reset the board Make sure the reboot jumper is on before you press the reset button After you press the reset button then click on the dialog and in about 10 seconds the download should be finished and it can be tested 4 0 Testing This phase usually ends quickly The biggest part is the setup Switch either cables plugged into the board for a different com port hookup or switch comports between the download application and the terminal application unless an LED display is fine for your purposes With three colors 8 states are possible The other thing to remember is to remove the reboot jumper Otherwise you will just boot back into the boot software Press the reset pin with your terminal program set to 9600 8 bits and no parity Hyperterm on Windows or Zterm on Mac OSX 5 0 Final Result There is a lot to get right and when it does you should see Test echo and if you type it should be echoed Congratulations 6 0 Helps These are the help screens from some of the tools and can be a useful reference 6 1 Compiler arm elf gcc help Usage arm elf gcc options file
29. y the version of the floating point emulator Specify the name of the target architecture Specify the name of the target CPU generate PIC code assemble Thumb code support ARM Thumb interworking use old ABI ELF only code uses 32 bit program counter code uses 26 bit program counter floating point args are in fp regs re entrant code code is ATPCS conformant assemble for big endian TiniARM Development Kit User Manual Nov 1 2004 12 mlittle endian mapcs frame mapcs stack check mcpu cpu name gt march arch name mfpu fpu name gt B L ral pj assemble for little endian use frame pointer use stack size checking assemble for CPU cpu name assemble for architecture arch name assemble for FPU architecture fpu name assemble code for a big endian cpu assemble code for a little endian cpu armelf Bgroup disable new dtags enable new dtags eh frame hdr combreloc defs initfirst interpose loadfltr muldefs nocombreloc nocopyreloc nodefaultlib Selects group name lookup rules for DSO Disable new dynamic tags Enable new dynamic tags ark ark ark Allow multiple definitions Creat erge dynamic relocs into one section and sort h frame hdr section Disallows undefined symbols DSO to be initialized first at runtime object to interpose all DSOs but executable object requiring immediate process Don t merge dy

Download Pdf Manuals

image

Related Search

Related Contents

Confort Carrelage  Samsung M1736N Instrukcja obsługi  Samsung YP-F3QB دليل المستخدم  Leggi PDF completo  カタログ (3.82MB  Smeg SNZ91MFA Instructions for Installation and Use  Rheem Value Series: 80% AFUE Single-Stage PSC Motor Product Literature  C.メンバー登録編 JVA MRS 技術プロジェクト  QuickSpecs - Hewlett Packard  膨脹式救命胴衣 取扱説明書  

Copyright © All rights reserved.
Failed to retrieve file