1 <!-- Copyright (C) 2003 Red Hat, Inc. -->
2 <!-- This material may be distributed only subject to the terms -->
3 <!-- and conditions set forth in the Open Publication License, v1.0 -->
4 <!-- or later (the latest version is presently available at -->
5 <!-- http://www.opencontent.org/openpub/). -->
6 <!-- Distribution of the work or derivative of the work in any -->
7 <!-- standard (paper) book form is prohibited unless prior -->
8 <!-- permission is obtained from the copyright holder. -->
12 >ARM PID Hardware Setup</TITLE
13 ><meta name="MSSmartTagsPreventParsing" content="TRUE">
16 CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
19 TITLE="eCos User Guide"
20 HREF="ecos-user-guide.html"><LINK
23 HREF="appendix-target-setup.html"><LINK
25 TITLE="SPARClite Architectural Simulator Setup"
26 HREF="setup-sparclite-sim.html"><LINK
28 TITLE="ARM AEB-1 Hardware Setup"
29 HREF="setup-arm-aeb1.html"></HEAD
40 SUMMARY="Header navigation table"
57 HREF="setup-sparclite-sim.html"
65 >Appendix A. Target Setup</TD
71 HREF="setup-arm-aeb1.html"
85 NAME="SETUP-ARM-PID">ARM PID Hardware Setup</H1
87 >eCos comes with two ROM images that provide GDB support for
88 the ARM PID board. The first ROM image provides a port of the CygMon
89 ROM monitor, which includes a command-line interface and a GDB remote
90 stub. The second ROM image provides a remote GDB stub only, which
91 is a minimal environment for downloading and debugging eCos programs
94 >eCos, CygMon and the GDB stubs all support the PID fitted
95 with both ARM7T and ARM9 daughterboards. CygMon and the stubs can
96 be programmed into either the programmable ROM (U12) or the FLASH
97 (U13). Pre-built forms of both ROM images are provided in the directory
98 loaders/arm-pid under the root of your eCos installation,
99 along with a tool that will program the stubs into the FLASH memory on
100 the board. CygMon images are prefixed with the name 'cygmon' and
101 GDB stub ROM images are given the prefix 'gdb_module'.
102 Images may be provided in a number of formats including ELF (.img
103 extension), binary (.bin extension) and SREC (.srec extension).
104 Note that some unreliability has been experienced in downloading
105 files using Angel 1.00. Angel 1.02 appears to be more robust in
112 NAME="AEN3542">Installing the Stubs into FLASH</H2
118 NAME="AEN3544">Preparing the Binaries</H3
120 >These two binary preparation steps are not strictly necessary
121 as the eCos distribution ships with pre-compiled binaries in the
122 directory loaders/arm-pid relative to the installation
130 NAME="AEN3547">Building the ROM images with the eCos Configuration Tool</H3
137 >Start with a new document - selecting the
151 menu item if necessary to do this.</P
171 menu item, and then select the ARM PID hardware.</P
175 >While still displaying the
191 dialog box, select either the "stubs" package template to build
192 a GDB stub image, or the "cygmon" template to build the CygMon ROM
223 >When the build completes, the image files can be found
224 in the bin/ subdirectory of the install tree. GDB stub
225 ROM images have the prefix "gdb_module". CygMon images
226 have the prefix "cygmon".</P
235 NAME="AEN3569">Building the ROM images with ecosconfig</H3
242 > Make an empty directory to contain the build tree,
247 >To build a GDB stub ROM image, enter the command:</P
255 CLASS="PROGRAMLISTING"
256 >$ ecosconfig new pid stubs</PRE
261 >or to build a CygMon ROM monitor image, enter the command:</P
269 CLASS="PROGRAMLISTING"
270 >$ ecosconfig new pid cygmon</PRE
277 >Enter the commands:</P
285 CLASS="PROGRAMLISTING"
294 >When the build completes, the image files can be found
295 in the bin/ subdirectory of the install tree. GDB stub
296 ROM images have the prefix "gdb_module". CygMon images
297 have the prefix "cygmon".</P
306 NAME="AEN3584">Building the FLASH Tool with the eCos Configuration Tool</H3
313 >Start with a new document - selecting the
327 menu item if necessary to do this.</P
345 menu item, and then select the ARM PID hardware.</P
349 >Enable the "Build flash programming tool" option in the
350 ARM PID HAL (CYGBLD_BUILD_FLASH_TOOL)
351 and resolve any resulting configuration conflicts.</P
374 >When the build completes, the FLASH tool image file can
375 be found in the bin/ subdirectory of the install tree,
376 with the prefix "prog_flash"</P
385 NAME="AEN3603">Building the FLASH Tool with ecosconfig</H3
392 > Make an empty directory to contain the build tree,
398 >Enter the command:</P
406 CLASS="PROGRAMLISTING"
407 >$ ecosconfig new pid</PRE
414 >Edit the file ecos.ecc and enable the option CYGBLD_BUILD_FLASH_TOOL
415 by uncommenting its user_value property and setting it
420 >Enter the commands:</P
428 CLASS="PROGRAMLISTING"
429 >$ ecosconfig resolve</PRE
434 >[there will be some output]</P
442 CLASS="PROGRAMLISTING"
451 >When the build completes, the FLASH tool image file can
452 be found in the bin/ subdirectory of the install tree,
453 with the prefix "prog_flash"</P
462 NAME="AEN3620">Prepare the Board for FLASH Programming</H3
464 >Each time a new image is to be programmed in the FLASH, the
465 jumpers on the board must be set to allow Angel to run:</P
472 > Set jumper 7-8 on LK6 [using the Angel code
473 in the 16 bit EPROM]</P
477 >Set jumper 5-6 on LK6 [select 8bit ROM mode]</P
481 >Set jumper LK18 [ROM remap - this is
482 also required for eCos]</P
486 >Set S1 to 0-0-1-1 [20MHz operation]</P
490 >Open jumper LK4 [enable little-endian operation]
492 Attach a serial cable from Serial A on the PID board to connector
493 1 on the development system. This is the cable through which the
494 binaries will be downloaded. Attach a serial cable from Serial B
495 on the PID board to connector 2 on the development system (or any
496 system that will work as a terminal). Through this cable, the FLASH
497 tool will write its instructions (at 38400 baud).</P
506 NAME="AEN3634">Program the FLASH</H3
513 >Download the FLASH ROM image onto the PID board. For
514 example. for the GDB stubs image:
523 CLASS="PROGRAMLISTING"
524 >bash$ arm-elf-gdb -nw gdb_module.img
525 GNU gdb 4.18-DEVTOOLSVERSION
526 Copyright 1998 Free Software Foundation, Inc.
527 GDB is free software, covered by the GNU General Public License,
528 and you are welcome to change it and/or distribute copies
529 of it under certain conditions. Type "show copying" to see the conditions.
530 There is absolutely no warranty for GDB. Type "show warranty" for details.
531 This GDB was configured as "--host=i586-pc-cygwin32 --target=arm-elf".
532 (no debugging symbols found)...
533 (gdb) target rdi s=com1
534 Angel Debug Monitor for PID (Built with Serial(x1), Parallel, DCC) 1.00
535 (Advanced RISC Machines SDT 2.10)
536 Angel Debug Monitor rebuilt on Jan 20 1997 at 02:33:43
537 Connected to ARM RDI target.
539 Loading section .rom_vectors, size 0x44 lma 0x60000
540 Loading section .text, size 0x1f3c lma 0x60044
541 Loading section .rodata, size 0x2c lma 0x61f80
542 Loading section .data, size 0x124 lma 0x61fac
543 Start address 0x60044 , load size 8400
544 Transfer rate: 5169 bits/sec.
546 The program is running. Exit anyway? (y or n) y </PRE
559 > On a UNIX or Linux system, the serial port must be
560 /dev/ttyS0 instead of COM1.
561 You need to make sure that the /dev/ttyS0 files
562 have the right permissions:
573 # chmod o+rw /dev/ttyS0*
580 If you are programming the GDB stub image, it will now be located
581 at 0x60000..0x64000. If you are programming the Cygmon ROM Monitor,
582 it will be located at 0x60000..0x80000.</P
589 >Now download the FLASH programmer tool</P
597 CLASS="PROGRAMLISTING"
598 >bash$ arm-elf-gdb prog_flash.img
599 GNU gdb 4.18-DEVTOOLSVERSION
600 Copyright 1998 Free Software Foundation, Inc.
601 GDB is free software, covered by the GNU General Public License,
602 and you are welcome to change it and/or distribute
603 copies of it under certain conditions. Type "show copying" to see
604 the conditions. There is absolutely no warranty for GDB. Type "show
605 warranty" for details.
606 This GDB was configured as "--host=i586-pc-cygwin32 --target=arm-elf".
607 (gdb) target rdi s=com1
608 Angel Debug Monitor for PID (Built with Serial(x1), Parallel, DCC) 1.00
609 (Advanced RISC Machines SDT 2.10)
610 Angel Debug Monitor rebuilt on Jan 20 1997 at 02:33:43
611 Connected to ARM RDI target.
613 Loading section .rom_vectors, size 0x44 lma 0x40000
614 Loading section .text, size 0x44a4 lma 0x40044
615 Loading section .rodata, size 0x318 lma 0x444e8
616 Loading section .data, size 0x1c8 lma 0x44800
617 Start address 0x40044 , load size 18888
618 Transfer rate: 5596 bits/sec.
626 >The FLASH tool will output some text on the board serial
627 port B at 38400 baud:</P
635 CLASS="PROGRAMLISTING"
641 Error: Wrong Manufaturer: 08
642 ... Please change FLASH jumper</PRE
649 >This text is repeated until you remove the jumper 7-8
650 on LK6. Then the output will be:</P
658 CLASS="PROGRAMLISTING"
659 >manuf: 1F, device: A4
661 About to program FLASH using data at 60000..64000
662 *** Press RESET now to abort!</PRE
669 > You have about 10 seconds to abort the operation by pressing
670 reset. After this timeout, the FLASH programming happens:</P
679 >...Programming FLASH
687 >Quit/kill the GDB process, which will hang.</P
691 >Next time you reset the board, the stub will be in control,
692 communicating on Serial A at 38400 baud.</P
702 >If you do not have two serial ports available on your host
703 computer, you may still verify the FLASH programming completed successfully
704 by quitting/killing the GDB process after running "c" in
705 step 2 above. Then switch the serial cable on the PID from Serial
706 A to Serial B and run a terminal emulator on the host computer.
707 In a few seconds you should see the the repeated text described
708 in step 2 above and you may continue the remaining steps as normal.</P
717 NAME="AEN3661">Programming the FLASH for big-endian mode</H3
719 >The process is almost identical to the previous instructions
720 which apply to a PID board running in little-endian mode only.</P
722 >The only adjustments to make are that if programming a <SPAN
729 ROM image (or CygMon ROM monitor image), you must enable the option "Use
730 Big-endian mode" in the <SPAN
734 >eCos Configuration Tool</I
736 > (CYGHWR_HAL_ARM_BIGENDIAN
737 if using ecosconfig and editing ecos.ecc).</P
739 >When programming the FLASH there are two options:</P
746 >Program FLASH using the little-endian FLASH tool. After
747 powering off, replace the ROM controller with the special big-endian
748 version which can be acquired from ARM. (This has not been tested
753 >Use a special big-endian version of the FLASH tool which
754 byte-swaps all the words as they are written to the FLASH.</P
758 >Build this tool by enabling the "Build flash programming tool
759 for BE images on LE boards" option (CYGBLD_BUILD_FLASH_TOOL_BE),
760 resulting in a utility with the prefix "prog_flash_BE_image_LE_system"
761 which should be used instead of "prog_flash".</P
763 >Note that there is a limitation to this method: no sub-word
764 data can be read from the ROM. To work around this, the .rodata
765 section is folded into the .data section and thus copied to RAM
766 before the system starts.</P
768 >Given that Thumb instructions are 16 bit, it is not possible
769 to run ROM-startup Thumb binaries on the PID board using this method.</P
771 >When the image has been programmed, power off the board, and
772 set jumper LK4 to enable big-endian operation.</P
780 NAME="AEN3677">Installing the Stubs into ROM</H2
787 >Program the binary image file gdb_module.bin
788 into ROM referring to the instructions of your ROM programmer.</P
792 >Plug the ROM into socket U12 and install jumper LK6 pins
793 7-8 to enable the ROM.</P
803 SUMMARY="Footer navigation table"
814 HREF="setup-sparclite-sim.html"
823 HREF="ecos-user-guide.html"
832 HREF="setup-arm-aeb1.html"
842 >SPARClite Architectural Simulator Setup</TD
848 HREF="appendix-target-setup.html"
856 >ARM AEB-1 Hardware Setup</TD