OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [rtos/] [ecos-2.0/] [doc/] [sgml/] [user-guide/] [target-setup.sgml] - Blame information for rev 174

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 28 unneback
2
 
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
 
30
31
 
32
 
33
34
Target Setup
35
 
36
37
The following sections detail the setup of many of the targets
38
supported by eCos.
39
40
 
41
42
43
This information is presented here only temporarily. It is intended
44
that there will be separate documents detailing this information for
45
each target in future releases. Consequently not much effort has been
46
put into bringing the following documentation up to date -- much of it
47
is obsolete, bogus or just plain wrong.
48
49
50
 
51
59
 
60
61
 
62
63
MN10300 stdeval1 Hardware Setup
64
The eCos Developer’s Kit package comes with a pair
65
of EPROMs which provide GDB support for the Matsushita MN10300 (AM31)
66
series evaluation board using CygMon, the Cygnus ROM monitor. Images
67
of these EPROMs are also provided at BASE_DIR/loaders/mn10300-stdeval1/cygmon.bin.
68
The LSB EPROM (LROM) is installed to socket IC8 on the board and
69
the MSB EPROM (UROM) is installed to socket IC9. Attention should
70
be paid to the correct orientation of these EPROMs during installation.
71
The CygMon stubs allows communication with GDB by way of the
72
serial port at connector CN2. The communication parameters are fixed
73
at 38400 baud, 8 data bits, no parity bit, and 1 stop bit (8-N-1).
74
No flow control is employed. Connection to the host computer should
75
be made using a standard RS232C serial cable (not a null modem cable).
76
A gender changer may also be required.
77
78
 
79
80
 
81
82
MN10300 Architectural Simulator Setup
83
The MN10300 simulator is an architectural simulator for the
84
Matsushita MN10300 that implements all features of the microprocessor
85
 necessary to run eCos. The current implementation provides accurate
86
simulation of the instruction set, interrupt controller, timers,
87
and  serial I/O.
88
In this release, you can run the same eCos binaries in the
89
simulator that can run on target hardware, if built for ROM start-up,
90
with the  exception of those that use the watchdog timer.
91
However, note that AM33 devices required to run eCos are not
92
simulated; therefore you cannot run eCos binaries built for the
93
AM33 under the simulator. For the AM33, the simulator is effectively
94
an instruction-set only simulator.
95
To simplify connection to the simulator, you are advised to
96
create a GDB macro by putting the following code in your personal
97
GDB start-up file (gdb.ini on Windows and .gdbinit on UNIX).
98
define msim
99
 target sim --board=stdeval1 --memory-region 0x34004000,0x8
100
 
101
 rbreak cyg_test_exit
102
 rbreak cyg_assert_fail
103
end
104
You can then connect to the simulator by invoking the command msim on
105
the command line:
106
(gdb) msim
107
You can achieve the same effect by typing out the macro’s
108
content on  the command line if necessary.
109
110
 
111
112
 
113
114
AM33 STB Hardware Setup
115
The Matsushita AM33 STB System Reference Board may be used
116
in two modes: via a JTAG debugger, or by means of a GDB stub ROM.
117
118
Use with GDB Stub ROM
119
The eCos Developer’s Kit package comes with a ROM
120
image which provides GDB support for
121
the Matsushita(R) AM33 STB System Reference Board. To install the
122
GDB stub ROM requires the use of the JTAG debugger and the Flash ROM
123
programming code available from Matsushita. An image of this ROM
124
is also provided at loaders/am33-stb/gdbload.bin under
125
the root of your eCos installation.
126
Ensure that there is a Flash ROM card in MAIN MEMORY SLOT <0>.
127
Follow the directions for programming a Flash ROM supplied with
128
the programming software.
129
The final programming of the ROM will need to be done with
130
a command similar to the following:
131
fdown "gdbload.bin",0x80000000,16,1
132
Once the ROM has been programmed, close down the JTAG debugger,
133
turn the STB off, and disconnect the JTAG cable. Ensure that the
134
hardware switches are in the following configuration:
135
U U D D D U D D
136
 
137
D = lower part of rocker switch pushed in
138
U = upper part of rocker switch pushed in
139
This is also the configuration required by the Flash programming
140
code, so it should not be necessary to change these.
141
Restart the STB and the stub ROM will now be able to communicate
142
with GDB. eCos programs should be built
143
with RAM startup.
144
Programs can then be downloaded via a standard RS232 null
145
modem serial cable connected to the SERIAL1 connector on the STB
146
front panel (the AM33"s serial port 0). This line is programmed
147
to run at 38400 baud, 8 data bits, no parity and 1 stop bit (8-N-1)
148
with no flow control. A gender changer may also be required. Diagnostic
149
output will be output to GDB using the same connection.
150
This procedure also applies for programming ROM startup eCos
151
programs into ROM, given a binary format image of the program from mn10300-elf-objcopy.
152
153
154
Use with the JTAG debugger
155
To use eCos from the JTAG debugger, executables must be built
156
with ROM startup and then downloaded via the JTAG debugger. For
157
this to work there must be an SDRAM memory card in SUB MEMORY SLOT <0> and
158
the hardware switches on the front panel set to the following: 
159
D U D D D U D D
160
 
161
D = lower part of rocker switch pushed in
162
U = upper part of rocker switch pushed in
163
Connect the JTAG unit and run the debugger as described in
164
the documentation that comes with it.
165
eCos executables should be renamed to have a “.out” extension
166
and may then be loaded using the debugger"s “l” or “lp” commands.
167
Diagnostic output generated by the program will be sent out
168
of the AM33"s serial port 0 which is connected to the SERIAL1
169
connector on the STB front panel. This line is programmed to run
170
at 38400 baud, 8 data bits, no parity, and one stop bit (8-N-1)
171
with no flow control. Connection to the host computer should be
172
using a standard RS232 null modem serial cable. A gender changer
173
may also be required.
174
175
176
Building the GDB stub ROM image
177
eCos comes with a pre-built GDB stub ROM image for the AM33-STB
178
platform. This can be found at loaders/am33-stb/gdbload.bin relative
179
to the eCos installation directory.
180
If necessary, the ROM image can be re-built as follows:
181
182
183
                On Windows hosts, open a Bash session using
184
Start->Programs->Red Hat eCos->eCos
185
Development Environment
186
187
188
Create a build directory and cd into it
189
190
191
Run (all as one line):
192
 
193
cygtclsh80 BASE_DIR/packages/pkgconf.tcl                          \
194
  --target=mn10300_am33 --platform stb --startup rom              \
195
  --disable-kernel --disable-uitron --disable-libc --disable-libm \
196
  --disable-io --disable-io_serial --disable-wallclock
197
--disable-watchdog
198
            
199
where BASE_DIR is the path to the eCos installation
200
directory.
201
202
203
Edit the configuration file
204
pkgconf/hal.h
205
 in the build directory tree by ensuring the following configuration
206
options are set as follows:
207
 
208
#define CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS
209
#define CYGDBG_HAL_DEBUG_GDB_BREAK_SUPPORT
210
#undef  CYGDBG_HAL_DEBUG_GDB_CTRLC_SUPPORT
211
#define CYGDBG_HAL_DEBUG_GDB_THREAD_SUPPORT
212
#define CYG_HAL_ROM_MONITOR
213
            
214
215
216
Run: make
217
218
219
Run: make -C hal/common/current/current/src/stubrom
220
221
222
The file
223
hal/common/current/src/stubrom
224
 will be an ELF format executable of the ROM image. Use mn10300-elf-objcopy to
225
convert this to the appropriate format for loading into the Matsushita
226
FLASH ROM programmer, mode “binary” in this case:
227
 
228
$ mn10300-elf-objcopy -O binary hal/common/current/src/stubrom/ \
229
  stubrom stubrom.img
230
231
232
233
234
 
235
236
 
237
238
TX39 Hardware Setup
239
The eCos Developer’s Kit package comes with a pair
240
of ROMs that provide GDB support for
241
the Toshiba JMR-TX3904 RISC processor reference board by way of CygMon. 
242
Images of these ROMs are also provided at BASE_DIR/loaders/tx39-jmr3904/cygmon50.bin and BASE_DIR/loaders/tx39-jmr3904/cygmon66.bin for
243
50 MHz and 66 MHz boards respectively. The ROMs are installed to
244
sockets IC6 and IC7 on the memory daughterboard according to their
245
labels. Attention should be paid to the correct orientation of these
246
ROMs during installation.
247
The GDB stub allows communication with GDB using the serial
248
port (channel C) at connector PJ1. The communication parameters
249
are fixed at 38400 baud, 8 data bits, no parity bit, and 1 stop
250
bit (8-N-1). No handshaking is employed. Connection to the host
251
computer should be made using an RS232C null modem cable.
252
CygMon and eCos currently provide support for a 16Mbyte 60ns
253
72pin DRAM SIMM fitted to the PJ21 connector. Different size DRAMs
254
may require changes in the value stored in the DCCR0 register. This
255
value may be found near line 211 in hal/mips/arch/&Version;/src/vectors.S
256
in eCos, and near line 99 in
257
          libstub/mips/tx39jmr/tx39jmr-power.S in
258
CygMon. eCos does not currently use the DRAM for any purpose itself,
259
so it is entirely available for application use.
260
261
 
262
263
 
264
265
TX39 Architectural Simulator Setup
266
The TX39 simulator is an architectural simulator which implements
267
all  the features of the Toshiba TX39 needed to run eCos. The current
268
implementation provides accurate simulation of the instruction set,
269
 interrupt controller, and timers, as well as having generic support
270
for diagnostic output, serial I/O, and exceptions.
271
In this release, you can run the same eCos binaries in the
272
simulator that can run on target hardware, if it is built for ROM
273
start-up.
274
To simplify connection to the simulator, you are advised to
275
create a GDB macro by putting the following code in your personal
276
GDB start-up file (gdb.ini on Windows and .gdbinit on UNIX).
277
define tsim
278
 target sim --board=jmr3904pal --memory-region 0xffff8000,0x900 \
279
            --memory-region 0xffffe000,0x4 \
280
            --memory-region 0xb2100000,0x4
281
 rbreak cyg_test_exit
282
 rbreak cyg_assert_fail
283
end
284
You can then connect to the simulator by invoking the command tsim on
285
the command line:
286
(gdb) tsim
287
You can achieve the same effect by typing out the macro’s
288
content on the command line if necessary.
289
290
 
291
292
 
293
294
TX49 Hardware Setup
295
The eCos installation CD contains a copy of the eCos GDB stubs
296
in  SREC format which must be programmed into the board’s
297
FLASH memory.
298
299
Preparing the GDB stubs
300
These stub preparation steps are not strictly necessary as
301
the eCos distribution ships with pre-compiled stubs in the directory loaders/tx49-ref4955 relative
302
to the installation root.
303
304
Building the GDB stub image with the eCos Configuration Tool
305
306
307
                  Start with a new document - selecting the
308
File->New
309
 menu item if necessary to do this.
310
311
312
Choose the
313
Build->Templates
314
 menu item, and then select the TX49 REF4955 hardware.
315
316
317
While still displaying the
318
Build->Templates
319
 dialog box, select the stubs package template to build a GDB stub.
320
Click
321
OK.
322
323
324
Build eCos stubs using
325
Build->Library.
326
327
328
When the build completes, the image files can be found
329
in the bin/ subdirectory of the install tree. GDB stub
330
images have the prefix gdb_module.
331
332
333
334
335
 Building the GDB stub image with ecosconfig
336
337
338
                  Make an empty directory to contain the build tree,
339
                  and cd into it.
340
341
342
To build a GDB stub ROM image, enter the command:
343
$ ecosconfig new ref4955 stubs 
344
345
346
Enter the commands:
347
$ ecosconfig tree
348
$ make
349
350
351
When the build completes, the image files can be found
352
in the bin/ subdirectory of the install tree. GDB stub
353
images have the prefix gdb_module.
354
355
356
357
358
359
 Installing GDB stubs into FLASH
360
Boot into the board’s firmware in little-endian mode:
361
Set the switches like this:   
362
SW1: 10000000 (first lever up, the rest down)
363
SW2: 10000010
364
Connect serial cable on the lower connector, configure terminal
365
emulator for 38400, 8-N-1.
366
When booting the board, you should get this prompt:
367
HCP5 rev 0.9B .
368
HCP5?
369
Select o (option), a (FLASH) and b (boot write). You should
370
see this:
371
Boot ROM Write
372
ROM address-ffffffffbd000000, Boot Bus-[32bit]
373
ID2 0 4 ffffffffa002ad40
374
zzz SS-40000 IV-1 CS-20000 CC-2
375
Flash ROM-[28F640J5], [16bit chip] * 2 * 1
376
Block size-00040000  count-64
377
ROM adr ffffffffbd000000-ffffffffbe000000  mask-00fc0000
378
Send Srecord file sa=00000000 size=ffffffffffffffff
379
ra=fffffffffe000000
380
          
381
Now send the stub SREC data down to the board using the terminal
382
 emulator’s ‘send ASCII’ (or similar)
383
functionality. 
384
Red Hat has experienced some sensitivity to how fast the data
385
is written to the board. Under Windows you should configure Minicom
386
to use a line delay of 100 milliseconds. Under Linux, use the slow_cat.tcl
387
 script:
388
% cd BASE_DIR/packages/hal/mips/ref4955/&Version;/misc
389
% slow_cat.tcl < [path]/gdb_module.srec > /dev/ttyS0
390
Power off the board, and change it to boot the GDB stubs in
391
big-endian mode by setting the switches like this:
392
SW1: 00000000 (all levers down)
393
SW2: 10001010
394
The GDB stubs allow communication with GDB using the serial
395
port at connector PJ7A (lower connector). The communication parameters
396
are  fixed at 38400 baud, 8 data bits, no parity bit and 1 stop
397
bit  (8-N-1). No flow control is employed. Connection to the host
398
computer should be made using a straight through serial cable.
399
400
401
 
402
403
 
404
405
VR4300 Hardware Setup
406
The eCos Developer’s Kit package comes with an EPROM
407
which provides GDB support for the NEC
408
VRC4373 evaluation board. An image of this EPROM is also provided
409
at loaders/vr4300-vrc4373/gdbload.bin under
410
the root of your eCos installation.
411
The EPROM is installed to socket U12 on the board. Attention
412
should be paid to the correct orientation of the EPROM during installation.
413
Only replace the board"s existing ROM using a proper PLCC
414
extraction tool, as the socket would otherwise risk getting damaged. 
415
The GDB stub in the EPROM allows communication with GDB using
416
the serial port at connector J1. The communication parameters are
417
fixed at 38400 baud, 8 data bits, no parity bit and 1 stop bit (8-N-1).
418
No flow control is employed. Connection to the host computer should
419
be made using a straight-through serial cable. 
420
421
422
VRC4375 Hardware Setup
423
For information about setting up the VRC4375 to run with RedBoot,
424
consult the RedBoot User"s Guide. If using serial debugging,
425
the serial line runs at 38400 baud 8-N-1 and should be connected
426
to the debug host using the cable supplied with the board.
427
428
429
Atlas/Malta Hardware Setup
430
For information about setting up the Atlas and Malta boards to
431
run with RedBoot, consult the RedBoot User"s Guide.
432
433
434
PowerPC Cogent Hardware Setup
435
The eCos Developer’s Kit package comes with an EPROM
436
which provides GDB support for the Cogent
437
evaluation board. An image of this EPROM is also provided at
438
          loaders/powerpc-cogent/gdbload.bin under
439
the root of your eCos installation. The same EPROM and image can
440
be used on all three supported daughterboards: CMA287-23 (MPC823),
441
CMA287-50 (MPC850), and CMA286-60 (MPC860).
442
The EPROM is installed to socket U4 on the board. Attention
443
should be paid to the correct orientation of the EPROM during installation. 
444
If you are going to burn a new EPROM using the binary image,
445
be careful to get the byte order correct. It needs to be big-endian.
446
If the EPROM burner software has a hex-editor, check that the first
447
few bytes of the image look like: 
448
00000000: 3c60 fff0 6063 2000 7c68 03a6 4e80 0020 <`..`c.|h..N.. 
449
If the byte order is wrong you will see 603c instead of 3c60
450
etc. Use the EPROM burner software to make a byte-swap before you
451
burn to image to the EPROM. 
452
If the GDB stub EPROM you burn does not work, try reversing
453
the byte-order, even if you think you have it the right way around.
454
At least one DOS-based EPROM burner program is known to have the
455
byte-order upside down.
456
The GDB stub in the EPROM allows communication with GDB using
457
the serial port at connector P12 (CMA101) or P3 (CMA102). The communication parameters
458
are fixed at 38400 baud, 8 data bits, no parity bit and 1 stop bit
459
(8-N-1). No flow control is employed. Connection to the host computer
460
should be made using a dedicated serial cable as specified in the
461
Cogent CMA manual.
462
463
Installing the Stubs into ROM
464
465
Preparing the Binaries
466
These two binary preparation steps are not strictly necessary
467
as the eCos distribution ships with pre-compiled binaries in the
468
directory loaders/powerpc-cogent relative to the installation
469
root.
470
471
Building the ROM images with the eCos Configuration Tool
472
473
474
Start with a new document - selecting the
475
File->New
476
 menu item if necessary to do this.
477
478
479
Choose the
480
Build->Templates
481
 menu item, and then select the PowerPC    CMA28x hardware.
482
483
484
While still displaying the
485
Build->Templates
486
 dialog box, select the “stubs” package template
487
to build a GDB stub. Click
488
OK.
489
490
491
Build eCos using
492
Build->Library.
493
494
495
When the build completes, the image files can be found
496
in the bin/ subdirectory of the install tree. GDB stub
497
ROM images have the  prefix “gdb_module”.
498
499
500
501
502
Building the ROM images with ecosconfig
503
504
505
Make an empty directory to contain the build tree,
506
and cd into it.
507
508
509
To build a GDB stub ROM image, enter the command:
510
 
511
$ ecosconfig new cma28x stubs 
512
513
514
Enter the commands:
515
 
516
$ ecosconfig tree
517
$ make
518
 
519
520
521
When the build completes, the image files can be found
522
in the bin/ subdirectory of the install tree. GDB stub
523
ROM images have the prefix “gdb_module”.
524
525
526
527
528
529
 Installing the Stubs into ROM or FLASH
530
531
532
Program the binary image file gdb_module.bin
533
into ROM or FLASH referring to the instructions of your ROM programmer.
534
535
536
 Plug the ROM/FLASH into socket U4 as described
537
at the beginning of this Hardware Setup section.
538
539
540
541
542
543
544
PowerPC MBX860 Hardware Setup
545
The eCos Developer’s Kit package comes with an EPROM
546
which provides GDB support for the Motorola
547
PowerPC MBX860 evaluation board. An image of this EPROM is also
548
provided at loaders/powerpc-mbx/gdbload.bin under
549
the root of your eCos installation.
550
The EPROM is installed to socket XU1 on the board. Attention
551
should be paid to the correct orientation of the EPROM during installation.
552
Only replace the board"s existing ROM using a proper PLCC
553
extraction tool, as the socket would otherwise risk getting damaged.
554
The GDB stub in the EPROM allows communication with GDB using
555
the serial port at connector SMC1/COM1. The communication
556
parameters are fixed at 38400 baud, 8 data bits, no parity bit and
557
1 stop bit (8-N-1). No flow control is employed. Connection to the
558
host computer should be made using a suitable serial cable.
559
In order to make the board execute the EPROM that you just
560
installed (rather than the on-board FLASH memory), it may be necessary
561
move some links on the board. Specifically, ensure that link J4
562
is in position 1-2. If in doubt, refer to the MBX documentation
563
from Motorola, ensuring that Boot Port Size=8 Bits/ROM
564
for BOOT (CS#7), in their terminology.
565
566
Installing the Stubs into FLASH
567
568
Preparing the Binaries
569
These two binary preparation steps are not strictly necessary
570
as the eCos distribution ships with pre-compiled binaries in the
571
directory loaders/powerpc-mbx relative to the installation
572
root.
573
574
Building the ROM images with the eCos Configuration Tool
575
576
577
Start with a new document - selecting the
578
File->New
579
 menu item if necessary to do this.
580
581
582
Choose the
583
Build->Templates
584
 menu item, and then select the PowerPC    Motorola MBX860/821
585
hardware.
586
587
588
While still displaying the
589
Build->Templates
590
 dialog box, select the “stubs” package template
591
to build a GDB stub. Click
592
OK.
593
594
595
Build eCos using
596
Build->Library. 
597
598
599
When the build completes, the image files can be found
600
in the bin/ subdirectory of the install tree. GDB stub
601
ROM images have the prefix “gdb_module”.
602
603
604
605
606
Building the ROM images with ecosconfig
607
608
609
Make an empty directory to contain the build tree,
610
and cd into it.
611
612
613
To build a GDB stub ROM image, enter the command:
614
 
615
$ ecosconfig new mbx stubs 
616
617
618
Enter the commands:
619
 
620
$ ecosconfig tree
621
$ make 
622
623
624
When the build completes, the image files can be found
625
in the bin/ subdirectory of the install tree. GDB stub
626
ROM images have the prefix “gdb_module”.
627
628
629
630
631
632
 Installing the Stubs into ROM
633
634
635
 Program the binary image file gdb_module.bin
636
into ROM or FLASH referring to the instructions of your ROM programmer.
637
638
639
 Plug the ROM/FLASH into socket XU1 as described
640
near the beginning of this Hardware Setup section.
641
642
643
644
645
Installing the Stubs into FLASH
646
This assumes you have EPPC-Bug in the on-board FLASH. This
647
can be determined by setting up the board according to the below
648
instructions and powering up the board. The EPPC-Bug prompt should
649
appear on the SMC1 connector at 9600 baud, 8N1.
650
651
652
Set jumper 3 to 2-3     [allow XU2 FLASH to
653
be programmed]
654
655
656
Set jumper 4 to 2-3     [boot EPPC-Bug]
657
658
659
660
 Program FLASH
661
662
663
 Prepare EPPC-Bug for download:
664
EPPC-Bug>lo 0
665
At this point the monitor is ready for input. It will not return
666
the prompt until the file has been downloaded.
667
668
669
Use the terminal emulator’s ASCII download feature
670
(or a simple clipboard     copy/paste operation) to download
671
the gdb_module.srec data.
672
 
673
Note that on Linux, Minicom’s ASCII download feature seems
674
to be broken. A workaround is to load the file into Emacs (or another
675
editor) and copy the full contents to the clipboard. Then press
676
the mouse paste-button (usually the middle one) over the Minicom
677
window.
678
679
680
Program the FLASH with the downloaded data:
681
 
682
EPPC-Bug>pflash 40000 60000 fc000000
683
684
685
Switch off the power, and change jumper 4 to 1-2. Turn
686
on the power again. The board should now boot using the newly programmed
687
stubs.
688
689
690
691
692
693
694
695
PowerPC Architectural Simulator Setup
696
The PowerPC simulator is an architectural simulator which
697
implements all the features of the PowerPC needed to run eCos. The
698
current implementation provides accurate simulation of the instruction
699
set and timers, as well as having generic support for diagnostic
700
output  and exceptions.
701
The simulator also allows devices to be simulated, but no
702
device simulation support has been defined for the serial device
703
drivers in this release.
704
To simplify connection to the simulator, you are advised to
705
create a GDB macro by putting the following code in your personal
706
GDB start-up file (gdb.ini on Windows and .gdbinit on UNIX).
707
define psim
708
 target sim -o ’/iobus/pal@0xf0001000/reg 0xf0001000 32’
709
 rbreak cyg_test_exit
710
 rbreak cyg_assert_fail
711
end
712
You can then connect to the simulator by invoking the command psim on
713
the command line:
714
(gdb) psim
715
You can achieve the same effect by typing out the macro’s
716
content on the command line if necessary.
717
718
The PowerPC simulator cannot execute binaries built for any
719
of the supported hardware targets. You must generate a configuration
720
using the PowerPC simulator platform:
721
$ ecosconfig new psim
722
 or some such.
723
724
725
726
SPARClite Hardware Setup
727
The eCos Developer’s Kit package comes with a ROM
728
which provides GDB support for the Fujitsu SPARClite Evaluation
729
Board by way of CygMon. 
730
An image of this ROM is also provided at
731
          BASE_DIR/loaders/sparclite-sleb/cygmon.bin. The
732
ROM is installed in socket IC9 on the evaluation board. Attention
733
should be paid to the correct orientation of the ROM during installation.
734
The GDB stub allows communication with GDB using a TCP channel
735
via the ethernet port at connector J5.
736
737
<!-- <index></index> --><!-- <xref> -->Ethernet Setup
738
The ethernet setup is described in the board’s manual,
739
but here is a recapitulation.
740
Set the board’s ethernet address using SW1 on the
741
motherboard:
742
            SW1-4 SW1-3 SW1-2 SW1-1    Ethernet Address
743
            ----- ----- ----- -----    ----------------
744
            OFF   OFF   OFF   OFF     No ethernet, use serial
745
            OFF   OFF   OFF    ON     00:00:0E:31:00:01
746
            OFF   OFF    ON   OFF     00:00:0E:31:00:02
747
            OFF   OFF    ON    ON     00:00:0E:31:00:03
748
            OFF    ON   OFF   OFF     00:00:0E:31:00:04
749
            OFF    ON   OFF    ON     00:00:0E:31:00:05
750
            OFF    ON    ON   OFF     00:00:0E:31:00:06
751
            OFF    ON    ON    ON     00:00:0E:31:00:07
752
            ON    OFF   OFF   OFF     00:00:0E:31:00:08
753
            ON    OFF   OFF    ON     00:00:0E:31:00:09
754
            ON    OFF    ON   OFF     00:00:0E:31:00:0A
755
            ON    OFF    ON    ON     00:00:0E:31:00:0B
756
            ON     ON   OFF   OFF     00:00:0E:31:00:0C
757
            ON     ON   OFF    ON     00:00:0E:31:00:0D
758
            ON     ON    ON   OFF     00:00:0E:31:00:0E
759
            ON     ON    ON    ON     00:00:0E:31:00:0F
760
761
BOOTP/DHCP service on Linux
762
Configure the BOOTP or DHCP server on the network to recognize
763
the evaluation board’s ethernet address so it can assign
764
the board an IP address. Below is a sample DHCP server configuration
765
from a Linux system (/etc/dhcpd.conf).
766
It shows a setup for three evaluation boards.
767
#
768
# DHCP server configuration.
769
#
770
allow bootp;
771
 
772
subnet 192.168.1.0 netmask 255.255.255.0 {
773
  host mb831evb {
774
    hardware ethernet 00:00:0e:31:00:01;
775
    fixed-address mb831evb;
776
  }
777
  host mb832evb {
778
    hardware ethernet 00:00:0e:31:00:02;
779
    fixed-address mb832evb;
780
  }
781
  host mb833evb {
782
    hardware ethernet 00:00:0e:31:00:03;
783
    fixed-address mb833evb;
784
  }
785
} 
786
787
788
BOOTP/DHCP boot process
789
Even when configured to use a TCP channel, CygMon will still
790
print a boot message to the serial channel. If the BOOTP process
791
was successful and an IP address was found, a message “BOOTP
792
found xxx.xxx.xxx.xxx” will be printed where xxx.xxx.xxx.xxx
793
is the IP address assigned by the BOOTP or DHCP server. If the BOOTP
794
process fails, a message indicating failure will be printed and
795
the serial port will be used as the debug channel.
796
Once the board finds an IP address it will respond to ICMP
797
echo request packets (ping). This gives a simple means to test the
798
health of the board.
799
As described in “Ethernet Setup” on page 72,
800
it should now be possible to connect to the SPARClite board from
801
within GDB by using the command:
802
(gdb) target remote <host>:1000
803
804
805
806
Serial Setup
807
The CygMon stubs also allow communication with GDB by way
808
of the serial port at connector CON1. The communication parameters
809
are fixed at 19200 baud, 8 data bits, no parity bit and 1 stop bit
810
(8-N-1). No flow control is employed. Connection to the host computer
811
should be made using a null modem cable. A gender changer may also
812
be required.
813
814
815
816
SPARClite Architectural Simulator Setup
817
The ESA SPARClite simulator is an architectural simulator
818
which implements all the features of the SPARClite needed to run
819
eCos. The current implementation provides accurate simulation of
820
the instruction set, interrupt controller, and timers, as well as
821
having generic support for diagnostic output and exceptions.
822
Note that the ESA SPARClite simulator is unsupported, but
823
is included in the release as a convenience.
824
To simplify connection to the simulator, you are advised to
825
create a GDB macro by putting the following code in your personal
826
GDB start-up file (gdb.ini on Windows and .gdbinit on UNIX).
827
define ssim
828
 target sim -nfp -sparclite -dumbio
829
 rbreak cyg_test_exit
830
 rbreak cyg_assert_fail
831
end
832
You can then connect to the simulator by invoking the command ssim on
833
the command line:
834
(gdb) ssim
835
You can achieve the same effect by typing out the macro’s
836
content on the command line if necessary.
837
838
839
<!-- <index></index> --><!-- <xref> -->ARM PID Hardware Setup
840
eCos comes with two ROM images that provide GDB support for
841
the ARM PID board. The first ROM image provides a port of the CygMon
842
ROM monitor, which includes a command-line interface and a GDB remote
843
stub. The second ROM image provides a remote GDB stub only, which
844
is a minimal environment for downloading and debugging eCos programs
845
solely using GDB.
846
eCos, CygMon and the GDB stubs all support the PID fitted
847
with both ARM7T and ARM9 daughterboards. CygMon and the stubs can
848
be programmed into either the programmable ROM (U12) or the FLASH
849
(U13). Pre-built forms of both ROM images are provided in the directory
850
loaders/arm-pid under the root of your eCos installation,
851
along with a tool that will program the stubs into the FLASH memory on
852
the board. CygMon images are prefixed with the name 'cygmon' and
853
GDB stub ROM images are given the prefix 'gdb_module'.
854
Images may be provided in a number of formats including ELF (.img
855
extension), binary (.bin extension) and SREC (.srec extension).
856
Note that some unreliability has been experienced in downloading
857
files using Angel 1.00. Angel 1.02 appears to be more robust in
858
this application.
859
860
Installing the Stubs into FLASH
861
862
Preparing the Binaries
863
These two binary preparation steps are not strictly necessary
864
as the eCos distribution ships with pre-compiled binaries in the
865
directory loaders/arm-pid relative to the installation
866
root.
867
868
869
Building the ROM images with the eCos Configuration Tool
870
871
872
Start with a new document - selecting the
873
File->New
874
 menu item if necessary to do this.
875
876
877
Choose the
878
Build
879
->
880
Templates
881
 menu item, and then select the ARM PID hardware.
882
883
884
While still displaying the
885
Build
886
->
887
Templates
888
 dialog box, select either the "stubs" package template to build
889
a GDB stub image, or the "cygmon" template to build the CygMon ROM
890
Monitor. Click
891
OK.
892
893
894
Build eCos using
895
Build
896
->
897
Library
898
899
900
When the build completes, the image files can be found
901
in the bin/ subdirectory of the install tree. GDB stub
902
ROM images have the prefix "gdb_module". CygMon images
903
have the prefix "cygmon".
904
905
906
907
908
Building the ROM images with ecosconfig
909
910
911
912
                    Make an empty directory to contain the build tree,
913
and cd into it.
914
915
916
To build a GDB stub ROM image, enter the command:
917
$ ecosconfig new pid stubs
918
or to build a CygMon ROM monitor image, enter the command:
919
$ ecosconfig new pid cygmon
920
921
922
Enter the commands:
923
$ ecosconfig tree
924
$ make
925
926
927
When the build completes, the image files can be found
928
in the bin/ subdirectory of the install tree. GDB stub
929
ROM images have the prefix "gdb_module". CygMon images
930
have the prefix "cygmon".
931
932
933
934
935
Building the FLASH Tool with the eCos Configuration Tool
936
937
938
Start with a new document - selecting the
939
File->New
940
 menu item if necessary to do this.
941
942
943
Choose the
944
Build->Templates
945
 menu item, and then select the ARM PID hardware.
946
947
948
Enable the "Build flash programming tool" option in the
949
ARM PID HAL (CYGBLD_BUILD_FLASH_TOOL)
950
and resolve any resulting configuration conflicts.
951
952
953
Build eCos using
954
Build
955
->
956
Library
957
958
959
When the build completes, the FLASH tool image file can
960
be found in the bin/ subdirectory of the install tree,
961
with the prefix "prog_flash"
962
963
964
965
966
Building the FLASH Tool with ecosconfig
967
968
969
970
                    Make an empty directory to contain the build tree,
971
and cd into it
972
                    
973
974
975
Enter the command:
976
$ ecosconfig new pid
977
978
979
Edit the file ecos.ecc and enable the option CYGBLD_BUILD_FLASH_TOOL
980
by uncommenting its user_value property and setting it
981
to 1.
982
983
984
Enter the commands:
985
$ ecosconfig resolve
986
[there will be some output]
987
$ ecosconfig tree
988
$ make
989
990
991
When the build completes, the FLASH tool image file can
992
be found in the bin/ subdirectory of the install tree,
993
with the prefix "prog_flash"
994
995
996
997
998
Prepare the Board for FLASH Programming
999
Each time a new image is to be programmed in the FLASH, the
1000
jumpers on the board must be set to allow Angel to run:
1001
1002
1003
                    Set jumper 7-8 on LK6   [using the Angel code
1004
in the 16 bit EPROM]
1005
1006
1007
Set jumper 5-6 on LK6   [select 8bit ROM mode]
1008
1009
1010
Set jumper LK18         [ROM remap - this is
1011
also required for eCos]
1012
1013
1014
Set S1 to 0-0-1-1       [20MHz operation]
1015
1016
1017
Open jumper LK4  [enable little-endian operation]
1018
 
1019
Attach a serial cable from Serial A on the PID board to connector
1020
1 on the development system. This is the cable through which the
1021
binaries will be downloaded. Attach a serial cable from Serial B
1022
on the PID board to connector 2 on the development system (or any
1023
system that will work as a terminal). Through this cable, the FLASH
1024
tool will write its instructions (at 38400 baud).
1025
1026
1027
1028
1029
Program the FLASH
1030
1031
1032
Download the FLASH ROM image onto the PID board. For
1033
example. for the GDB stubs image:
1034
 
1035
bash$ arm-elf-gdb -nw gdb_module.img
1036
GNU gdb 4.18-DEVTOOLSVERSION
1037
Copyright 1998 Free Software Foundation, Inc.
1038
GDB is free software, covered by the GNU General Public License,
1039
and you are welcome to change it and/or distribute copies
1040
of it under certain conditions. Type "show copying" to see the conditions.
1041
There is absolutely no warranty for GDB. Type "show warranty" for details.
1042
This GDB was configured as "--host=i586-pc-cygwin32 --target=arm-elf".
1043
(no debugging symbols found)...
1044
(gdb) target rdi s=com1
1045
Angel Debug Monitor for PID (Built with Serial(x1), Parallel, DCC) 1.00
1046
(Advanced RISC Machines SDT 2.10)
1047
Angel Debug Monitor rebuilt on Jan 20 1997 at 02:33:43
1048
Connected to ARM RDI target.
1049
(gdb) load
1050
Loading section .rom_vectors, size 0x44 lma 0x60000
1051
Loading section .text, size 0x1f3c lma 0x60044
1052
Loading section .rodata, size 0x2c lma 0x61f80
1053
Loading section .data, size 0x124 lma 0x61fac
1054
Start address 0x60044 , load size 8400
1055
Transfer rate: 5169 bits/sec.
1056
(gdb) q
1057
The program is running.  Exit anyway? (y or n) y 
1058
 
1059
1060
 On a UNIX or Linux system, the serial port must be
1061
 /dev/ttyS0 instead of COM1.
1062
 You need to make sure that the /dev/ttyS0 files
1063
have the right permissions:
1064
$ su
1065
 Password:
1066
 # chmod o+rw /dev/ttyS0*
1067
 # exit
1068
                      
1069
If you are programming the GDB stub image, it will now be located
1070
at 0x60000..0x64000. If you are programming the Cygmon ROM Monitor,
1071
it will be located at 0x60000..0x80000.
1072
1073
1074
1075
Now download the FLASH programmer tool
1076
bash$ arm-elf-gdb prog_flash.img
1077
GNU gdb 4.18-DEVTOOLSVERSION
1078
Copyright 1998 Free Software Foundation, Inc.
1079
GDB is free software, covered by the GNU General Public License,
1080
and you are welcome to change it and/or distribute
1081
copies of it under certain conditions. Type "show copying" to see
1082
the conditions. There is absolutely no warranty for GDB.  Type "show
1083
warranty" for details.
1084
This GDB was configured as "--host=i586-pc-cygwin32 --target=arm-elf".
1085
(gdb) target rdi s=com1
1086
Angel Debug Monitor for PID (Built with Serial(x1), Parallel, DCC) 1.00
1087
(Advanced RISC Machines SDT 2.10)
1088
Angel Debug Monitor rebuilt on Jan 20 1997 at 02:33:43
1089
Connected to ARM RDI target.
1090
(gdb) load
1091
Loading section .rom_vectors, size 0x44 lma 0x40000
1092
Loading section .text, size 0x44a4 lma 0x40044
1093
Loading section .rodata, size 0x318 lma 0x444e8
1094
Loading section .data, size 0x1c8 lma 0x44800
1095
Start address 0x40044 , load size 18888
1096
Transfer rate: 5596 bits/sec.
1097
(gdb) c
1098
1099
1100
The FLASH tool will output some text on the board serial
1101
port B at 38400 baud:
1102
ARM
1103
eCos
1104
 
1105
FLASH here!
1106
manuf: 8, device: 40
1107
Error: Wrong Manufaturer: 08
1108
... Please change FLASH jumper
1109
1110
1111
This text is repeated until you remove the jumper 7-8
1112
on LK6. Then the output will be:
1113
manuf: 1F, device: A4
1114
AT29C040A recognised
1115
About to program FLASH using data at 60000..64000
1116
*** Press RESET now to abort!
1117
1118
1119
 You have about 10 seconds to abort the operation by pressing
1120
reset. After this timeout, the FLASH programming happens:
1121
...Programming FLASH
1122
All done!
1123
1124
1125
Quit/kill the GDB process, which will hang.
1126
1127
1128
Next time you reset the board, the stub will be in control,
1129
communicating on Serial A at 38400 baud.
1130
1131
1132
1133
If you do not have two serial ports available on your host
1134
computer, you may still verify the FLASH programming completed successfully
1135
by quitting/killing the GDB process after running "c" in
1136
step 2 above. Then switch the serial cable on the PID from Serial
1137
A to Serial B and run a terminal emulator on the host computer.
1138
In a few seconds you should see the the repeated text described
1139
in step 2 above and you may continue the remaining steps as normal.
1140
1141
1142
1143
Programming the FLASH for big-endian mode
1144
The process is almost identical to the previous instructions
1145
which apply to a PID board running in little-endian mode only.
1146
The only adjustments to make are that if programming a GDB stub
1147
ROM image (or CygMon ROM monitor image), you must enable the option "Use
1148
Big-endian mode" in the eCos Configuration Tool (CYGHWR_HAL_ARM_BIGENDIAN
1149
if using ecosconfig and editing ecos.ecc).
1150
When programming the FLASH there are two options:
1151
1152
1153
Program FLASH using the little-endian FLASH tool. After
1154
powering off, replace the ROM controller with the special big-endian
1155
version which can be acquired from ARM. (This has not been tested
1156
by Red Hat).
1157
1158
1159
Use a special big-endian version of the FLASH tool which
1160
byte-swaps all the words as they are written to the FLASH.
1161
1162
1163
Build this tool by enabling the "Build flash programming tool
1164
for BE images on LE boards" option (CYGBLD_BUILD_FLASH_TOOL_BE),
1165
resulting in a utility with the prefix "prog_flash_BE_image_LE_system"
1166
which should be used instead of "prog_flash".
1167
Note that there is a limitation to this method: no sub-word
1168
data can be read from the ROM. To work around this, the .rodata
1169
section is folded into the .data section and thus copied to RAM
1170
before the system starts.
1171
Given that Thumb instructions are 16 bit, it is not possible
1172
to run ROM-startup Thumb binaries on the PID board using this method.
1173
When the image has been programmed, power off the board, and
1174
set jumper LK4 to enable big-endian operation.
1175
1176
1177
1178
Installing the Stubs into ROM
1179
1180
1181
Program the binary image file gdb_module.bin
1182
into ROM referring to the instructions of your ROM programmer.
1183
1184
1185
Plug the ROM into socket U12 and install jumper LK6 pins
1186
7-8 to enable the ROM.
1187
1188
1189
1190
1191
1192
<!-- <index></index> -->ARM AEB-1 Hardware Setup
1193
1194
Overview
1195
The ARM AEB-1 comes with tools in ROM. These include a simple
1196
FLASH management tool and the Angel® monitor. eCos for
1197
the ARM AEB-1 comes with GDB stubs suitable for programming into
1198
the onboard FLASH. GDB is the preferred debug environment for GDB,
1199
and while Angel provides a subset of the features in the eCos GDB
1200
stub, Angel is unsupported.
1201
Both eCos and the stubs support both Revision B and Revision
1202
C of the AEB-1 board. Stub ROM images for both types of board can
1203
be found in the loaders/arm-aeb directory under the root
1204
of your eCos installation. You can select which board you are using
1205
by selecting either the aeb or aebC platform by selecting the appropriate
1206
platform HAL in the eCos Configuration Tool.
1207
The GDB stub can be downloaded to the board for programming
1208
in the FLASH using the board's on-board ROM monitor:
1209
1210
1211
talk to the AEB-1 board with a terminal emulator (or
1212
a real terminal!)
1213
1214
1215
use the board's rom menu to download a UU-encoded
1216
version of the GDB stubs which will act as a ROM monitor
1217
1218
1219
tell the board to use this new monitor, and then hook
1220
GDB up to it for real debugging
1221
1222
1223
1224
1225
Talking to the Board
1226
Connect a terminal or computer's serial port to the
1227
ARM AEB-1. On a PC with a 9-pin serial port, you can use the cable
1228
shipped by ARM with no modification. 
1229
Set the terminal or terminal emulator to 9600N1 (9600 baud,
1230
no parity, 1 stop bit). 
1231
Reset the board by pressing the little reset button on the
1232
top. You will see the following text: 
1233
        ARM Evaluation Board Boot Monitor 0.01 (19 APR 1998)
1234
        Press ENTER within 2 seconds to stop autoboot
1235
Press ENTER quickly, and you will get the boot prompt: 
1236
        Boot:
1237
1238
1239
Downloading the Stubs via the Rom Menu
1240
Using the AEB-1 rom menu to download the GDB stubs from the
1241
provided ".UU" file.
1242
1243
This is an annotated 'terminal' session
1244
with the AEB-1 monitor:
1245
1246
+Boot: help
1247
Module is BootStrap       1.00 (14 Aug 1998)
1248
Help is available on:
1249
Help          Modules       ROMModules    UnPlug        PlugIn
1250
Kill          SetEnv        UnSetEnv      PrintEnv      DownLoad
1251
Go            GoS           Boot          PC            FlashWrite
1252
FlashLoad     FlashErase
1253
Boot: download c000
1254
Ready to download. Use 'transmit' option on terminal
1255
emulator to download file.
1256
... at this point, download the ASCII file "loaders/arm-aeb/
1257
    gdb_module.img.UU". The details of this operation differ
1258
    depending on which terminal emulator is used. It may be
1259
    necessary to enter "^D" (control+D) when the download completes
1260
   to get the monitor to return to command mode. 
1261
Loaded file gdb_module.img.bin at address
1262
0000c000, size = 19392 
1263
1264
1265
Activating the GDB Stubs
1266
Commit the GDB stubs module to FLASH: 
1267
        Boot: flashwrite 4018000 C000 8000
1268
    
1269
Verify that the eCos/"GDB stubs" module is now added
1270
in the list of modules in the board: 
1271
        Boot: rommodules
1272
    
1273
You should see output similar to the following: 
1274
        Header   Base     Limit
1275
        04000004 04000000 040034a8 BootStrap       1.00 (14 Aug 1998)
1276
        04003a74 04003800 04003bc0 Production Test 1.00 (13 Aug 1998)
1277
        0400e4f4 04004000 0400e60f Angel           1.02 (12 MAY 1998)
1278
        0401c810 04018000 0401cbc0 eCos              1.3  (27 Jan 2000)
1279
GDB stubs
1280
    
1281
Now make the eCos/"GDB stubs" module be the default
1282
monitor: 
1283
        Boot: plugin eCos
1284
    
1285
1286
Since the GDB stubs are always linked at the same address
1287
(0x4018000), the operation of writing to the FLASH and selecting
1288
the stubs as default monitor is an idempotent operation. You can
1289
download a new set of stubs following the same procedure - you do
1290
not have to unregister or delete anything.
1291
1292
1293
1294
Building the GDB Stub FLASH ROM Images
1295
Pre-built GDB stubs images are provided in the directory loaders/arm-aeb
1296
relative to the root of your eCos installation, but here are instructions
1297
on how to rebuild them if you should ever need to.
1298
1299
1300
Building the GDB Stubs with the eCos Configuration Tool
1301
1302
1303
Start with a new document - selecting the
1304
File
1305
->
1306
New
1307
 menu item if necessary to do this.
1308
1309
1310
Choose the
1311
Build
1312
->
1313
Templates
1314
 menu item, and then select the ARM AEB-1 hardware.
1315
1316
1317
While still displaying the
1318
Build->Templates
1319
 dialog box, select the "stubs" package template to build a GDB
1320
stub image. Click
1321
OK.
1322
1323
1324
If applicable, set the "AEB board revision" option to
1325
"C" from "B" depending on the board revision being used.
1326
1327
1328
Build eCos using
1329
Build
1330
->
1331
Library.
1332
1333
1334
When the build completes, the image files can be found
1335
in the bin/ subdirectory of the install tree. The GDB stub
1336
ROM images have the prefix "gdb_module".
1337
1338
1339
1340
1341
Building the GDB Stub ROMs with ecosconfig
1342
1343
1344
1345
Make an empty directory to contain the build tree,
1346
and cd into it.
1347
1348
1349
To build a GDB stub ROM image, enter the command:
1350
$ ecosconfig new aeb stubs
1351
1352
1353
If applicable, edit ecos.ecc and set the AEB board revision. (CYGHWR_HAL_ARM_AEB_REVISION)
1354
from the default "B" to "C" by uncommenting the user_value
1355
property and setting it to "C".
1356
1357
1358
Enter the commands
1359
 
1360
$ ecosconfig tree
1361
$ make
1362
1363
1364
When the build completes, the image files can be found
1365
in the bin/ subdirectory of the install tree. The GDB stub
1366
ROM images have the prefix "gdb_module".
1367
1368
1369
1370
1371
1372
<!-- <index></index> -->ARM Cogent CMA230 Hardware Setup
1373
The eCos Developer's Kit package comes with an EPROM
1374
which provides GDB support for the Cogent evaluation board. An image
1375
of this EPROM is also provided at loaders/arm-cma230/gdbload.bin
1376
under the root of your eCos installation. 
1377
The EPROM is installed to socket U3 on the board. Attention
1378
should be paid to the correct orientation of the EPROM during installation.
1379
If you are going to burn a new EPROM using the binary image,
1380
be careful to get the byte order correct. It needs to be little-endian,
1381
which is usually the default in PC based programmer software.
1382
If the GDB stub EPROM you burn does not work, try reversing
1383
the byte-order, even if you think you have it the right way around.
1384
At least one DOS-based EPROM burner program is known to have the
1385
byte-order upside down.
1386
The GDB stub in the EPROM allows communication with GDB using
1387
the serial port at connector P12 (CMA101) or P3 (CMA102). The communication parameters
1388
are fixed at 38400 baud, 8 data bits, no parity bit and 1 stop bit
1389
(8-N-1).  No flow control is employed. Connection to the host computer
1390
should be made using a dedicated serial cable as specified in the
1391
Cogent CMA manual.
1392
1393
Building the GDB Stub FLASH ROM images
1394
Pre-built GDB stubs images are provided in the directory loaders/arm-cma230 relative
1395
to the root of your eCos installation, but here are instructions
1396
on how to rebuild them if you should ever need to.
1397
CygMon images are prefixed with the name 'cygmon' and
1398
GDB stub ROM images
1399
are given the prefix 'gdb_module'.
1400
Images may be provided in a number of formats including ELF (.img
1401
extension), binary (.bin extension) and SREC (.srec extension). 
1402
1403
1404
Building the GDB Stubs with the eCos Configuration Tool
1405
1406
1407
1. Start with a new document - selecting the File->New
1408
menu item if necessary to do this.
1409
1410
1411
Choose the
1412
Build->Templates
1413
 menu item, and then select the ARM CMA230 hardware.
1414
1415
1416
While still displaying the
1417
Build
1418
->
1419
Templates
1420
 dialog box, select the "stubs" package template to build a GDB
1421
stub image. Click
1422
OK.
1423
1424
1425
Build eCos using
1426
Build
1427
->
1428
Library
1429
1430
1431
When the build completes, the image files can be found
1432
in the bin/ subdirectory of the install tree. The GDB stub
1433
ROM images have the prefix "gdb_module".
1434
1435
1436
1437
1438
Building the GDB Stub ROMs with ecosconfig
1439
1440
1441
1442
1. Make an empty directory to contain the build tree,
1443
and cd into it.
1444
1445
1446
To build a GDB stub ROM image, enter the command:
1447
$ ecosconfig new cma230 stubs
1448
1449
1450
Enter the commands:
1451
 
1452
$ ecosconfig tree
1453
$ make
1454
1455
1456
When the build completes, the image files can be found
1457
in the bin/ subdirectory of the install tree. The GDB stub
1458
ROM images have the prefix "gdb_module".
1459
1460
1461
1462
1463
1464
<!-- <index></index> --><!-- <xref> -->Cirrus Logic ARM EP7211 Development</code></pre></td>
      </tr>
      <tr valign="middle">
         <td>1465</td>
         <td></td>
         <td></td>
         <td class="code"><pre><code>Board Hardware Setup
1466
eCos comes with two Flash ROM images that provide GDB support
1467
for the Cirrus Logic EP7211 Development Board (also known as the
1468
EDB7211).. Note that on some board revisions, the board is silk-screened
1469
as EDB7111-2. The first Flash ROM image provides a port of the CygMon
1470
ROM monitor, which includes a command-line interface and a GDB remote
1471
stub. The second Flash ROM image provides a remote GDB stub only.
1472
Both ROM images are provided in the directory loaders/arm-edb7211
1473
under the root of your eCos installation. CygMon images are prefixed
1474
with the name 'edb7211_cygmon' and are
1475
provided in a number of formats including binary (.bin extension)
1476
and SREC (.srec) extension. GDB stub ROM images are given the prefix 'edb7211_gdb_module'. 
1477
The ROM images provided for the EP7211 Development Board must
1478
be programmed into the FLASH. Please refer to the section titled
1479
"Loading the ROM image into On-Board flash" on how to program the
1480
ROM onto the board.
1481
Both Cygmon and GDB Stub ROMS allow communication with GDB
1482
via the serial connector labelled 'UART 1'. The
1483
communication parameters are fixed at 38400 baud, 8 data bits, no
1484
parity bit and 1 stop bit (8-N-1). No flow control is employed.
1485
Connection to the host computer should be made using a null modem cable.
1486
A gender changer may also be required. Note that the GDB Configuration tool
1487
uses the serial port identifiers 0 and 1 to identify the EB7211
1488
serial ports UART1 and UART2 respectively.
1489
Both eCos and the ROM images assume the core clock is generated
1490
with a 3.6864 MHz PLL input. The CPU will be configured to run at
1491
73.728MHz.
1492
Note: The EP7211 CPU needs a two step RESET process. After
1493
pressing the `URESET' pushbutton, the `WAKEUP' pushbutton
1494
must be pressed to complete the process.
1495
1496
When an eCos program is run on an EDB7211 board fitted with
1497
either CygMon or a GDB stub ROM, then the code in ROM loses control.
1498
This means that if you require the ability to remotely stop execution
1499
on the target, or want thread debugging capabilities, you must include
1500
GDB stub support when configuring eCos.
1501
1502
1503
Building programs for programming into FLASH
1504
If your application is to be run directly from FLASH, you
1505
must configure eCos appropriately for "ROM" startup. This can be
1506
done in the eCos Configuration Tool by setting
1507
the "Startup type" HAL option to "ROM". If using the ecosconfig utility,
1508
set the user_value of the CYG_HAL_STARTUP
1509
option in ecos.ecc to "ROM".
1510
When you have linked your application with eCos, you will
1511
then have an ELF executable. To convert this into a format appropriate
1512
for the Cirrus Logic FLASH download utility, or the dl_7xxx
1513
utility on Linux, you can use the utility arm-elf-objcopy, as in
1514
the following example:
1515
$ arm-elf-objcopy -O binary helloworld.exe helloworld.bin
1516
This will produce a binary format image helloworld.bin which
1517
can be downloaded into FLASH.
1518
1519
1520
Building the GDB Stub FLASH ROM images
1521
Pre-built GDB stubs images are provided in the directory loaders/arm-edb7211 relative
1522
to the root of your eCos installation, but here are instructions
1523
on how to rebuild them if you should ever need to.
1524
CygMon images are prefixed with the name 'cygmon' and
1525
GDB stub ROM images are given the prefix 'gdb_module'.
1526
Images may be provided in a number of formats including ELF (.img
1527
extension), binary (.bin extension) and SREC (.srec extension). 
1528
1529
1530
Building the ROM images with the eCos Configuration Tool
1531
1532
1533
Start with a new document - selecting the
1534
File->New
1535
 menu item if necessary to do this.
1536
1537
1538
Choose the
1539
Build->Templates
1540
 menu item, and then select the "Cirrus Logic development board"
1541
hardware.
1542
1543
1544
While still displaying the
1545
Build
1546
->
1547
Templates
1548
 dialog box, select either the "stubs" package template to build
1549
a GDB stub image, or the "cygmon" template to build the CygMon ROM
1550
Monitor. Click
1551
OK.
1552
1553
1554
Build eCos using
1555
Build
1556
->
1557
Library
1558
1559
1560
When the build completes, the image files can be found
1561
in the bin/ subdirectory of the install tree. GDB stub
1562
ROM images have the prefix "gdb_module". CygMon images
1563
have the prefix "cygmon".
1564
1565
1566
1567
1568
Building the ROM images with ecosconfig
1569
1570
1571
1572
Make an empty directory to contain the build tree,
1573
and cd into it.
1574
1575
1576
To build a GDB stub ROM image, enter the command:
1577
$ ecosconfig new edb7xxx stubs
1578
or to build a CygMon ROM monitor image, enter the command:
1579
$ ecosconfig new edb7xxx cygmon
1580
1581
1582
Enter the commands:
1583
$ ecosconfig tree
1584
$ make
1585
1586
1587
When the build completes, the image files can be found
1588
in the bin/ subdirectory of the install tree. GDB stub
1589
ROM images have the prefix "gdb_module". CygMon images
1590
have the prefix "cygmon".
1591
1592
1593
1594
1595
<!-- <xref> -->Loading the ROM Image into On-board Flash
1596
Program images can be written into Flash memory by means of
1597
a bootstrap program which is built into the  EDB7211.  This program
1598
communicates with a support program on your host to download and
1599
program an image into the Flash memory.
1600
Cirrus Logic provides such a program for use with Windows/DOS.
1601
 eCos comes with a similar program which will run under Linux. The
1602
basic operation of both programs is the same.
1603
1604
1605
Connect a serial line to 'UART 1'.
1606
1607
1608
Power off the  EDB7211.
1609
1610
1611
Install jumper 'PROGRAM ENABLE' which
1612
enables this special mode for downloading Flash images. Note that
1613
some board revisions have this jumper labelled “BOOT ENABLE”.
1614
1615
1616
Power on the  EDB7211.
1617
1618
1619
Execute the Flash writing program on your host.  On Linux,
1620
this would be:
1621
     # dl_edb7xxx <PATH>/gdb_module.bin
1622
where '<PATH>' is the path to
1623
the binary format version of the ROM image you wish to load, either
1624
as built in the previous section or the "loaders/arm-edb7211/" subdirectory
1625
of your eCos installation. The download tool defaults to 38400 baud and
1626
device /dev/ttyS1 for communication. To change
1627
these, specify them as parameters, e.g.
1628
              
1629
# dl_edb7xxx <PATH>/gdb_module.bin 9600 /dev/ttyS0
1630
1631
1632
The download program will indicate that it is waiting
1633
for the board to come alive.  At this point, press 'RESET' and
1634
then 'WAKEUP' switches in order.  There should be
1635
some indication of progress, first of the code being downloaded,
1636
then of the programming process.
1637
1638
1639
Upon completion of the programming, power off the  EDB7211.
1640
1641
1642
Remove the 'PROGRAM ENABLE/BOOT ENABLE' jumper.
1643
1644
1645
Power on the  EDB7211, press 'RESET' and 'WAKEUP'.
1646
 The new ROM image should now be running on the board.
1647
1648
1649
The GDB debugger will now be able to communicate with
1650
the board to download and debug RAM based programs.
1651
 
1652
This procedure also applies for loading ROM-startup eCos programs
1653
into the on-board FLASH memory, given a binary format image of the
1654
program from arm-elf-objcopy.  Loading a ROM-startup eCos program
1655
into Flash will overwrite the GDB Stub ROM/CygMon in Flash,
1656
so you would have to reload the GDB Stub ROM/CygMon to
1657
return to normal RAM-startup program development.
1658
1659
1660
1661
1662
Building the Flash Downloader on Linux
1663
eCos provides a Flash download program suitable for use with
1664
the  EP7211 Development Board which will run on Linux.  Follow these
1665
steps to build this program.  Note: at the time of the writing of
1666
these instructions, the download program is built directly within
1667
the eCos source repository since it is
1668
not configuration specific.
1669
  # cd <eCos install dir>/packages/hal/arm/edb7xxx/&Version;/support
1670
  # make
1671
(where '# ' is your shell prompt)
1672
Note: this program was adapted from the Cirrus Logic original
1673
DOS program and still contains some vestiges of that environment.
1674
1675
1676
Developing eCos Programs with the ARM Multi-ICE
1677
The EP7211 Development Board supports use of the ARM
1678
            Multi-processor EmbeddedICE(tm), also known as the
1679
            Multi-ICE. Full instructions on how to install and use the
1680
            Multi-ICE in conjunction with GDB are provided in the
1681
            "GNUPro Toolkit Reference for eCos
1682
              ARM/Thumb" manual. However, the following
1683
            platform-specific details should be noted.
1684
You will need an ARM Multi-ICE Server configuration
1685
            file for the EP7211 Development Board. Here is a suggested
1686
            configuration file to use:
1687
======== File "720T.cfg" ========
1688
;Total IR length = 4
1689
[TITLE]
1690
Multi-ICE configuration for EP7211
1691
 
1692
[TAP 0]
1693
ARM720T
1694
 
1695
[TAPINFO]
1696
YES
1697
 
1698
[Timing]
1699
Low=0
1700
High=0
1701
Adaptive=OFF
1702
==================================
1703
You must ensure that the board has the appropriate soldered
1704
connections. For the EP7211 this involves connecting TEST0 and TEST1
1705
of the EP7211 to ground. To do this you must solder a wire from
1706
ground at JP33 to TP8 and TP9.
1707
With respect to using multiple devices simultaneously, note
1708
that the EP7211 is not ID sensitive.
1709
If you wish to view diagnostic output from your program that
1710
was downloaded via the Multi-ICE, you will note that by default
1711
the output on the serial line (as viewed by a terminal such as Hyperterm
1712
in Windows, or cu in Unix) is in the form of GDB packets.
1713
To get legible output, the solution is to set the "GDB Serial
1714
port" to a different device from the "Diagnostic serial port", and
1715
you should use the Diagnostic serial port to view the diagnostic
1716
output.
1717
Warning: The multi-ice-gdb-server will fail on startup if
1718
the board has not been both reset and awakened before running the
1719
server. 
1720
To resolve this, it is necessary to free up the connection
1721
from within the ARM Multi-ICE server itself. However when this happens,
1722
the next time you use GDB to load the program into the board, you
1723
will see lots of "Readback did not match original data" messages
1724
in the output of the multi-ice-gdb-server program. This indicates
1725
your program did not load correctly, and you should restart the
1726
multi-ice-gdb-server program, taking care to reset the board correctly
1727
before reconnecting. 
1728
As a reminder, you must specify --config-dialog to the
1729
            multi-ice-gdb-server program to connect to the board
1730
            correctly. If you do not, the multi-ice-gdb-server program
1731
            will not be able to connect.
1732
1733
1734
 
1735
1736
<!-- <conditionaltext> -->Cirrus Logic ARM EP7212 Development Board</code></pre></td>
      </tr>
      <tr valign="middle">
         <td>1737</td>
         <td></td>
         <td></td>
         <td class="code"><pre><code>Hardware Setup
1738
The Cirrus Logic EP7212 Development Board is almost identical
1739
to the EP7211 Development Board from a hardware setup viewpoint,
1740
and is based on the same port of eCos. Therefore the earlier documentation
1741
for the EP7211 Development Board can be considered equivalent, but
1742
with the following changes:
1743
1744
1745
The first serial port is silk screened as "UART 1" on
1746
the EP7211 Development Board, but is silk screened as "Serial Port
1747
0" on the EP7212 Development Board. Similarly "UART 2" is silk screened
1748
as "Serial Port 1" on the EP7212 Development Board.
1749
1750
1751
JP2 (used to control reprogramming of the FLASH) is not
1752
silkscreened with "Boot Enable".
1753
1754
1755
To setup the EP7212 Development Board for use with the
1756
ARM Multi-ICE JTAG debugging interface unit, it is necessary to
1757
connect TEST0 and TEST1 of the EP7212 to ground.  On the Development
1758
Board, this is accomplished by placing shorting blocks on JP47 and
1759
JP48. When the shorting blocks are fitted, the board can only be
1760
operated through the Multi-ICE - debugging over a serial line is
1761
not possible.
1762
1763
1764
Pre-built GDB stubs are
1765
              provided in the directory
1766
              loaders/arm-edb7212 relative to the
1767
              root of your eCos installation
1768
1769
1770
When rebuilding the GDB stub ROM image, change the "Cirrus
1771
Logic processor variant" option (CYGHWR_HAL_ARM_EDB7XXX_VARIANT)
1772
from the EP7211 to the EP7212. This can be selected in the
1773
eCos Configuration Tool
1774
, or if using ecosconfig, can be set by uncommenting the user_value
1775
property of this option in ecos.ecc and setting it to "EP7212".
1776
1777
1778
1779
1780
<!-- <conditionaltext> -->Cirrus Logic ARM EP7312 Development Board</code></pre></td>
      </tr>
      <tr valign="middle">
         <td>1781</td>
         <td></td>
         <td></td>
         <td class="code"><pre><code>Hardware Setup
1782
The Cirrus Logic EP7312 Development Board is similar
1783
to the EP7212 Development Board from a hardware setup viewpoint,
1784
and is based on the same port of eCos.
1785
When rebuilding the RedBoot ROM image or an eCos application,
1786
change the "Cirrus Logic processor variant" option
1787
(CYGHWR_HAL_ARM_EDB7XXX_VARIANT)
1788
from the EP7211 to the EP7312. This can be selected in the
1789
eCos Configuration Tool
1790
, or if using ecosconfig, can be set by uncommenting the user_value
1791
property of this option in ecos.ecc and setting it to "EP7312".
1792
1793
1794
See the RedBoot documentation for building and installing RedBoot for this
1795
target.  Only RedBoot is supported as a boot image; ROMRAM startup is
1796
recommended.
1797
1798
1799
90MHz Operation
1800
1801
The EP7xxx targets offer a choice of clock speeds, from 18MHz to a maximum,
1802
normally, of 72MHz.  These are described as kHz values 18432 36864 49152
1803
and 73728 within the configuration tool.  If you have a release which
1804
supports it, you will also see 90317 as an available option here, for 90MHz
1805
operation.
1806
1807
1808
This option only applies to certain EP7312 hardware, not all EP7312 boards
1809
support it.  Do not select 90MHz when building RedBoot or your eCos
1810
application unless you are absolutely sure that your board supports it.
1811
1812
1813
If you do have a 90MHz board and wish to execute at 90MHz, it is in fact
1814
not necessary to build RedBoot specially, if you build your eCos
1815
application configured for 90MHz.  RedBoot will run at 72MHz and your
1816
application will run at 90MHz.  If you do install a 90MHz RedBoot, then you
1817
must build eCos for 90MHz or timing and baud rates on serial I/O will be
1818
wrong.
1819
1820
1821
In other words, code (either eCos app or RedBoot) built for 90MHz will
1822
“change up a gear” when it starts up; but code built for 72MHz,
1823
because it needs to run correctly on boards without the
1824
“gearbox” does not change back down, so if you mix the two,
1825
unexpected timing can result.  To run a non-eCos application without any
1826
hardware initialization code at 90MHz, you must install a specially-built
1827
RedBoot.
1828
1829
1830
1831
1832
Cirrus Logic ARM EP7209 Development Board Hardware Setup
1833
Note: At time of writing, no EP7209 Development Board is available,
1834
and consequently eCos has not been verified for use with the EP7209
1835
Development Board.
1836
The Cirrus Logic EP7209 Development Board is almost identical
1837
to the EP7212 Board in all respects, except that it is not fitted
1838
with DRAM, nor has it a DRAM controller.
1839
The only valid configuration for the EDB7209 is ROM based.
1840
The STUBS and RAM startup modes are not available as no DRAM is
1841
fitted.
1842
1843
1844
<!-- <index></index> -->Cirrus Logic ARM CL-PS7111 Evaluation Board Hardware Setup
1845
The implementation of the port of eCos to the Cirrus Logic
1846
ARM CL-PS7111 Evaluation Board (also known as EB7111) is based on
1847
the EP7211 Development Board port.
1848
For that reason, the setup required is identical to the  EP7211
1849
Development Board as described above, with the following exceptions:
1850
1851
1852
The Cygmon ROM monitor is not supported
1853
1854
1855
The ARM Multi-ICE is not supported
1856
1857
1858
Pre-built GDB stubs are provided in the
1859
directory loaders/arm-eb7111 relative to the root of your
1860
eCos installation
1861
1862
1863
If rebuilding the GDB stub ROM image, change the "Cirrus
1864
Logic processor variant" option (CYGHWR_HAL_ARM_EDB7XXX_VARIANT)
1865
from the EP7211 to the CL_PS7111. This can be selected
1866
in the
1867
eCos Configuration Tool
1868
, or if using ecosconfig, can be set by uncommenting the user_value
1869
property of this option in ecos.ecc and setting it to "CL_PS7111"
1870
1871
1872
All remote serial communication is done with the serial I/O
1873
connector
1874
/misc
1875
% slow_cat.tcl < [path]/gdb_module.srec > /dev/ttyS0
1876
Power off the board, and change it to boot the GDB stubs in
1877
big-endian mode by setting the switches like this:
1878
SW1: 00000000 (all levers down)
1879
SW2: 10001010
1880
The GDB stubs allow communication with GDB using the serial
1881
port at connector PJ7A (lower connector). The communication parameters
1882
are  fixed at 38400 baud, 8 data bits, no parity bit and 1 stop
1883
bit  (8-N-1). No flow control is employed. Connection to the host
1884
computer should be made using a straight through serial cable.
1885
1886
1887
StrongARM EBSA-285 Hardware Setup
1888
The eCos Developer’s Kit package comes with a ROM
1889
image which provides GDB support for
1890
the Intel® StrongARM® Evaluation Board EBSA-285.
1891
 Both eCos and the Stub ROM image assume the clocks are: 3.6864
1892
MHz PLL input for generating the core clock, and 50MHz osc input
1893
for external clocks. An image of this ROM is also provided at loaders/arm-ebsa285/gdbload.bin under
1894
the root of your eCos installation.
1895
The ROM monitor image (an eCos GDB
1896
stub) provided for the EBSA-285 board must be programmed into the
1897
flash, replacing the Angel monitor on the board. Please refer to
1898
the section titled "Loading the ROM Image into On-Board flash" on how
1899
to program the ROM onto the board.
1900
The Stub ROM allows communication with GDB via the serial
1901
connector on the bulkhead mounting bracket COM0.  The communication
1902
parameters are fixed at 38400 baud, 8 data bits, no parity bit and
1903
1 stop bit (8-N-1).  No flow control is employed.
1904
1905
Building the GDB Stub FLASH ROM images
1906
Pre-built GDB stubs images are provided in the directory loaders/arm-ebsa285 relative
1907
to the root of your eCos installation, but here are instructions
1908
on how to rebuild them if you should ever need to.
1909
1910
1911
Building the GDB Stubs with the eCos Configuration Tool
1912
1913
1914
Start with a new document - selecting the
1915
File
1916
->
1917
New
1918
 menu item if necessary to do this.
1919
1920
1921
Choose the
1922
Build
1923
->
1924
Templates
1925
 menu item, and then select the StrongARM EBSA285 hardware.
1926
1927
1928
While still displaying the
1929
Build
1930
->
1931
Templates
1932
 dialog box, select the "stubs" package template to build a GDB
1933
stub image. Click
1934
OK.
1935
1936
1937
Build eCos using
1938
Build
1939
->
1940
Library
1941
1942
1943
When the build completes, the image files can be found
1944
in the bin/ subdirectory of the install tree. The GDB stub
1945
ROM images have the prefix "gdb_module".
1946
1947
1948
1949
1950
Building the GDB Stub ROMs with ecosconfig
1951
(See “Using ecosconfig on UNIX” on page 72)
1952
1953
1954
Make an empty directory to contain the build tree,
1955
and cd into it.
1956
1957
1958
To build a GDB stub ROM image, enter the command:
1959
 
1960
$ ecosconfig new ebsa285 stubs
1961
1962
1963
Enter the commands:
1964
 
1965
$ ecosconfig tree
1966
$ make
1967
1968
1969
When the build completes, the image files can be found
1970
in the bin/ subdirectory of the install tree. The GDB stub
1971
ROM images have the prefix "gdb_module".
1972
1973
1974
1975
1976
Loading the ROM Image into On-board Flash
1977
There are several ways to install the eCos gdb stub ROM image
1978
in the EBSA board’s flash memory. Once installed, the gdb
1979
stub ROM provides standard eCos download and debug via the EBSA
1980
board"s serial port. The options available include the
1981
Linux based EBSA flash upgrade utility provided by Red Hat, direct writing
1982
of the flash via MultiICE (JTAG) hardware debugger, and other flash management
1983
utilities from Intel (these only support DOS, and proprietary ARM tools
1984
and image formats). Only the Red Hat flash upgrade tool is supported
1985
and tested in this release.
1986
The flash upgrade tool requires the EBSA board to be configured
1987
as a PCI slave (rather than a master, its normal operating mode)
1988
and plugged into a Linux host computer"s PCI bus.
1989
Configuring the board for flash loading: Follow the instructions
1990
in the EBSA-285 Reference Manual, pages A-2 and A-3 to configure
1991
the board as an add-in card, and enable flash blank programming.
1992
 Briefly: assuming the board was in the default setting to execute
1993
as a bus master ("Host Bridge") make jumper 9 (J9), move jumper
1994
10 (J10) to external reset (PCI_RST), and move jumper 15
1995
(J15) link 4-6-5 to connect 5-6 instead of 4-6.
1996
Configuring the board for execution of eCos programs: Follow
1997
the instructions in the EBSA-285 Reference Manual, pages A-2 and
1998
A-3 to configure the board as a "Host Bridge" with "Central Function".
1999
 Briefly: unset J9, move J10 to on-board reset (BRD_RST),
2000
and set J15 to make 4-6 instead of 5-6 (see page A-8 also).  Plug
2001
the card into its own PCI bus, not the Linux PC used for the flash-programming
2002
process.
2003
Building the Linux software: the Linux software sources are
2004
in directory
2005
      <BASE_DIR>/packages/hal/arm/ebsa285/v1_3/support/linux/safl_util
2006
in the eCos source repository.  There are two parts to the
2007
system: a loadable kernel module and the flash utility.  The loadable
2008
kernel module is safl.o and the utility is sa_flash.  To
2009
build:
2010
  cd to this directory, or a copy of it.
2011
  make
2012
This builds safl.o and sa_flash. The kernel module
2013
must be installed, and a device file created for it. Both of these
2014
operations require root permissions.  Create the device file by: 
2015
      % mknod /dev/safl c 10 178
2016
Programming the flash: switch off the EBSA-285, and remove
2017
the EBSA-285 board from its PCI bus.  Take appropriate anti-static
2018
precautions. Configure it for flash loading as above, halt your
2019
Linux system and turn it off.  Install the EBSA-285 board in the
2020
PCI bus of the Linux system and boot it up. (Single user is good enough,
2021
assuming your image and safl_util build dir are on a local
2022
disc partition.)  Change directory to the safl_util directory,
2023
then, to load the kernel module and flash an image onto the eval
2024
board (as root): 
2025
       % insmod safl.o
2026
       % sa_flash <image_file>
2027
Halt and turn off the Linux machine and remove the EBSA-285
2028
card.  Take appropriate anti-static precautions.  Configure it for
2029
execution of eCos programs as above, and plug it into its own PCI
2030
bus.  Restart the Linux machine however you wish.
2031
This information is replicated in the README file within the
2032
safl_util directory and its parents, and in the EBSA-285
2033
Reference Manual from Intel, appendix A "Configuration Guide".
2034
If in doubt, please refer to those documents also.
2035
This procedure also applies for loading ROM-startup eCos programs
2036
into the on-board flash memory, given a binary format image of the
2037
program from arm-elf-objcopy.  Loading a ROM-startup eCos program
2038
into flash will overwrite the StubROM in flash, so you would have
2039
to reload the StubROM to return to normal RAM-startup program development.
2040
2041
2042
Running your eCos Program Using GDB and the StubROM
2043
2044
You must first load the StubROM image into the flash memory
2045
on the EBSA-285 board before doing this.  See “Loading
2046
the ROM Image into On-board Flash”, page 93 for details.
2047
2048
Connect to the StubROM in the board and run your eCos program <PROGRAM> as
2049
follows:
2050
      $ arm-elf-gdb -nw <PROGRAM>
2051
      (gdb) set remotebaud 38400
2052
      (gdb) target remote <DEVICE>
2053
Where <DEVICE> is /dev/ttyS0
2054
or COM1: or similar, depending on your environment and how you connected
2055
your serial line to the host computer. Expect some output here,
2056
for example:
2057
      Remote debugging using /dev/ttyS0
2058
      0x410026a4 in ?? ()
2059
then, to load the program
2060
        (gdb) load
2061
    
2062
which will report locations and sizes of sections as they
2063
load, then begin execution using
2064
      (gdb) continue
2065
If you have no eCos program yet, but you want to connect to
2066
the board just to verify serial communications, tell gdb "set endian
2067
little" before anything else, so that it understands the board (GDB
2068
normally infers this from information within the eCos program).
2069
2070
When an eCos program is run on the EBSA-285 board, the GDB
2071
stub in ROM loses control. This means that if you require the ability
2072
to stop execution on the target remotely, or want thread debugging
2073
capabilities, you must include GDB stub support when configuring
2074
eCos.
2075
2076
2077
2078
2079
<!-- <conditionaltext> --> <!-- NOTE: could not find it --><!-- <index></index> -->Compaq iPAQ PocketPC Hardware Setup
2080
For setting up the iPAQ to run with RedBoot, see the the RedBoot
2081
User's Guide. Connections may be made using
2082
the Compact Flash Ethernet interface.  A serial cable may be connected
2083
directly, or via the cradle. Serial communication uses the parameters
2084
38400,8,N,1. The LCD/Touchscreen may also be used as an
2085
interface to RedBoot and eCos applications.
2086
2087
2088
SH3/EDK7708 Hardware Setup
2089
The eCos Developer’s Kit package comes with a ROM
2090
which provides GDB support for the Hitachi EDK7708 board (a big-endian
2091
and a little-endian version). Images of these  ROMs are also provided
2092
at loaders/sh-edk7708/gdbload.bin and
2093
          loaders/sh-edk7708le/gdbload.bin under
2094
the root of your eCos installation.
2095
The ROM is installed to socket U6 on the board. When using
2096
the big-endian ROM, jumper 9 must be set to 2-3. When using the
2097
little-endian ROM, jumper 9 must be set to 1-2. Attention should
2098
be paid to the correct orientation of the ROM during installation.
2099
Only replace the board"s existing ROM using a proper PLCC extraction
2100
tool, as the socket would otherwise risk being damaged. 
2101
If you are going to program a new ROM or FLASH using the binary
2102
image, you may have to experiment to get the right byte-order in
2103
the device. Depending on the programming software you use, it might
2104
be necessary to enable byte-swapping.  If the GDB stub ROM/FLASH
2105
you program does not work, try reversing the byte-order.
2106
The GDB stub in the EPROM allows communication with GDB using
2107
the serial port at connector J1. The communication parameters are
2108
fixed at 38400 baud, 8 data bits, no parity bit and 1 stop bit (8-N-1).
2109
No flow control is employed. Connection to the host computer should
2110
be made using the dedicated serial cable included in the EDK package. 
2111
2112
Installing the Stubs into FLASH
2113
2114
Preparing the Binaries
2115
These two binary preparation steps are not strictly necessary
2116
as the eCos distribution ships with pre-compiled binaries in the
2117
directory loaders/sh-edk7708 and loaders/sh-edk7708le
2118
relative to the installation root.
2119
2120
Building the ROM images with the eCos Configuration Tool
2121
2122
2123
Start with a new document - selecting the
2124
File->New
2125
 menu item if necessary to do this.
2126
2127
2128
Choose the
2129
Build->Templates
2130
 menu item, and then select the SH EDK7708 hardware.
2131
2132
2133
While still displaying the
2134
Build->Templates
2135
 dialog box, select the “stubs” package template
2136
to build a GDB stub. Click
2137
OK.
2138
2139
2140
If building a little-endian image, disable the “Use
2141
big-endian mode” option in the SH EDK7708 HAL (CYGHWR_HAL_SH_BIGENDIAN).
2142
2143
2144
Build eCos using
2145
Build->Library. 
2146
2147
2148
When the build completes, the image files can be found
2149
in the bin/ subdirectory of the install tree. GDB stub
2150
ROM images have the prefix “gdb_module”.
2151
2152
2153
2154
2155
Building the ROM images with ecosconfig
2156
2157
2158
Make an empty directory to contain the build tree,
2159
and cd into it.
2160
2161
2162
To build a GDB stub ROM image, enter the command:
2163
 
2164
$ ecosconfig new edk7708 stubs
2165
 
2166
2167
2168
If building a little-endian image, uncomment the user
2169
value in ecos.ecc for CYGHWR_HAL_SH_BIGENDIAN
2170
and change it to 0.   
2171
2172
2173
Enter the commands:
2174
 
2175
$ ecosconfig tree
2176
$ make 
2177
2178
2179
When the build completes, the image files can be found
2180
in the bin/ subdirectory of the install tree. GDB stub
2181
ROM images have the  prefix “gdb_module”.
2182
2183
2184
2185
2186
2187
 Installing the Stubs into ROM or FLASH
2188
2189
2190
Program the binary image file gdb_module.bin
2191
into ROM or FLASH referring to the instructions of your ROM programmer.
2192
2193
2194
Plug the ROM/FLASH into socket U6. If the image
2195
is little-endian set jumper 9 to 1-2. If the image is big-endian
2196
set jumper 9 to 2-3.
2197
2198
2199
2200
2201
2202
2203
SH3/CQ7708 Hardware Setup
2204
2205
Preparing the board
2206
Make sure the DIP switches on the board are set as follows:
2207
  
2208
SW1-1 ON
2209
SW1-2 OFF
2210
SW1-3 ON
2211
SW1-4 OFF
2212
SW2-1 ON
2213
SW2-2 ON
2214
SW2-3 OFF
2215
SW2-4 OFF
2216
If you are using a straight through serial cable which has
2217
flow control lines, you will also need to cut JP12 (5-6) as the
2218
flow control lines can cause NMIs.
2219
2220
2221
eCos GDB Stubs
2222
The eCos installation CD contains a copy of the eCos GDB stubs
2223
in  binary format which must be programmed into an EPROM or FLASH
2224
and  installed on the board.
2225
2226
 Preparing the GDB stubs
2227
These stub preparation steps are not strictly necessary as
2228
the eCos distribution ships with pre-compiled stubs in the directory
2229
loaders/sh3-cq7708 relative to the installation root.
2230
2231
2232
Building the GDB stub image with the eCos Configuration Tool
2233
2234
2235
Start with a new document - selecting the
2236
File->New
2237
 menu item if necessary to do this.
2238
2239
2240
Choose the
2241
Build->Templates
2242
 menu item, and then select the SH3 cq7708 hardware.
2243
2244
2245
While still displaying the
2246
Build->Templates
2247
 dialog box, select the stubs package template to build a GDB stub.
2248
Click
2249
OK.
2250
2251
2252
 Build eCos stubs using
2253
Build->Library.
2254
2255
2256
 When the build completes, the image files can be found
2257
in the
2258
bin/
2259
 subdirectory of the install tree. GDB stub images have the prefix
2260
gdb_module.
2261
2262
2263
2264
2265
 Building the GDB stub image with ecosconfig
2266
2267
2268
Make an empty directory to contain the build tree,
2269
and cd into it.
2270
2271
2272
 To build a GDB stub ROM image, enter the command:
2273
 
2274
$ ecosconfig new cq7708 stubs 
2275
2276
2277
 Enter the commands:
2278
 
2279
$ ecosconfig tree
2280
$ make
2281
2282
2283
When the build completes, the image files can be found
2284
in the
2285
bin/
2286
 subdirectory of the install tree. GDB stub images have the prefix
2287
gdb_module.  
2288
2289
2290
2291
2292
2293
Programming the stubs in EPROM/FLASH
2294
The board can use different sizes of ROMs. Use this table
2295
to adjust the board’s jumpers to the ROM sizes you are
2296
using.
2297
size(kbit)    JP7   JP9   JP10   JP11
2298
256           2-3   2-3   open   open
2299
512           1-2   2-3   open   open
2300
1000          1-2   open  open   2-3
2301
2000          1-2   1-2   open   2-3
2302
4000          1-2   1-2   short  2-3
2303
8000          1-2   1-2   short  1-2
2304
There are two ways to program the stubs. We advise you to
2305
use method 1, since it is simpler. Method 2 is unsupported and requires
2306
a bit of fiddling.
2307
Method 1:  
2308
Program the binary stub image into two EPROMs, E and O. EPROM
2309
E should  contain the even bytes, and O the odd bytes (your EPROM
2310
programmer should  have the ability to split the image).
2311
EPROM E should be installed in socket IC8, and EPROM O should
2312
be  installed in socket IC4.
2313
Set JP6 to 16 bit mode (1-2 soldered, 2-3 cut)  Set SW1-4
2314
to ON and SW2-1 to OFF.
2315
2316
Method2:  
2317
Assuming that the stub binary is smaller than 32 KB, you can
2318
install it in a single EPROM.
2319
Compile the mkcqrom.c program
2320
found in the misc directory.
2321
Use it to convert the binary image to the required format.
2322
See the  mkcqrom.c source for a
2323
description of what is done, and why it is  necessary. 
2324
 % mkcqrom gdb_module.bin gdb_mangled.bin
2325
Program the gdb_mangled.bin file
2326
into an EPROM and install it in  socket IC4
2327
Set JP6 to 8 bit mode (cut 1-2, solder 2-3)
2328
The GDB stubs allow communication with GDB using the serial
2329
port at connector CN7. The communication parameters are fixed at
2330
38400 baud, 8 data bits, no parity bit and 1 stop bit (8-N-1). No
2331
flow control is employed. Connection to the host computer should
2332
be made using a  straight through serial cable.
2333
2334
2335
2336
SH3/HS7729PCI Hardware Setup
2337
Please see the RedBoot manual for instructions on how to prepare
2338
the board for use with eCos.
2339
2340
2341
SH3/SE77x9 Hardware Setup
2342
Please see the RedBoot manual for instructions on how to prepare
2343
the board for use with eCos.
2344
2345
2346
SH4/CQ7750 Hardware Setup
2347
2348
Preparing the board
2349
Make sure the DIP switches on the board are set as follows:
2350
  
2351
SW1-1 ON
2352
SW1-2 OFF
2353
SW1-3 ON
2354
SW1-4 OFF
2355
SW2-1 ON
2356
SW2-2 ON
2357
SW2-3 OFF
2358
SW2-4 OFF
2359
If you are using a straight through serial cable which has
2360
flow control lines, you will also need to cut JP12 (5-6) as the
2361
flow control lines can cause NMIs.
2362
2363
2364
eCos GDB Stubs
2365
The eCos installation CD contains a copy of the eCos GDB stubs
2366
in  binary format which must be programmed into an EPROM or FLASH
2367
and  installed on the board.
2368
2369
 Preparing the GDB stubs
2370
These stub preparation steps are not strictly necessary as
2371
the eCos distribution ships with pre-compiled stubs in the directory
2372
loaders/sh3-cq7708 relative to the installation root.
2373
2374
2375
Building the GDB stub image with the eCos Configuration Tool
2376
2377
2378
Start with a new document - selecting the
2379
File->New
2380
 menu item if necessary to do this.
2381
2382
2383
Choose the
2384
Build->Templates
2385
 menu item, and then select the SH3 cq7708 hardware.
2386
2387
2388
While still displaying the
2389
Build->Templates
2390
 dialog box, select the stubs package template to build a GDB stub.
2391
Click
2392
OK.
2393
2394
2395
 Build eCos stubs using
2396
Build->Library.
2397
2398
2399
 When the build completes, the image files can be found
2400
in the
2401
bin/
2402
 subdirectory of the install tree. GDB stub images have the prefix
2403
gdb_module.
2404
2405
2406
2407
2408
 Building the GDB stub image with ecosconfig
2409
2410
2411
Make an empty directory to contain the build tree,
2412
and cd into it.
2413
2414
2415
 To build a GDB stub ROM image, enter the command:
2416
 
2417
$ ecosconfig new cq7708 stubs 
2418
2419
2420
 Enter the commands:
2421
 
2422
$ ecosconfig tree
2423
$ make
2424
2425
2426
When the build completes, the image files can be found
2427
in the
2428
bin/
2429
 subdirectory of the install tree. GDB stub images have the prefix
2430
gdb_module.  
2431
2432
2433
2434
2435
2436
Programming the stubs in EPROM/FLASH
2437
The board can use different sizes of ROMs. Use this table
2438
to adjust the board’s jumpers to the ROM sizes you are
2439
using.
2440
size(kbit)    JP7   JP9   JP10   JP11
2441
256           2-3   2-3   open   open
2442
512           1-2   2-3   open   open
2443
1000          1-2   open  open   2-3
2444
2000          1-2   1-2   open   2-3
2445
4000          1-2   1-2   short  2-3
2446
8000          1-2   1-2   short  1-2
2447
There are two ways to program the stubs. We advise you to
2448
use method 1, since it is simpler. Method 2 is unsupported and requires
2449
a bit of fiddling.
2450
Method 1:  
2451
Program the binary stub image into two EPROMs, E and O. EPROM
2452
E should  contain the even bytes, and O the odd bytes (your EPROM
2453
programmer should  have the ability to split the image).
2454
EPROM E should be installed in socket IC8, and EPROM O should
2455
be  installed in socket IC4.
2456
Set JP6 to 16 bit mode (1-2 soldered, 2-3 cut)  Set SW1-4
2457
to ON and SW2-1 to OFF.
2458
2459
Method2:  
2460
Assuming that the stub binary is smaller than 32 KB, you can
2461
install it in a single EPROM.
2462
Compile the mkcqrom.c program
2463
found in the misc directory.
2464
Use it to convert the binary image to the required format.
2465
See the  mkcqrom.c source for a
2466
description of what is done, and why it is  necessary. 
2467
 % mkcqrom gdb_module.bin gdb_mangled.bin
2468
Program the gdb_mangled.bin file
2469
into an EPROM and install it in  socket IC4
2470
Set JP6 to 8 bit mode (cut 1-2, solder 2-3)
2471
The GDB stubs allow communication with GDB using the serial
2472
port at connector CN7. The communication parameters are fixed at
2473
38400 baud, 8 data bits, no parity bit and 1 stop bit (8-N-1). No
2474
flow control is employed. Connection to the host computer should
2475
be made using a  straight through serial cable.
2476
2477
2478
2479
SH4/SE7751 Hardware Setup
2480
Please see the RedBoot manual for instructions on how to prepare
2481
the board for use with eCos.
2482
2483
2484
NEC CEB-V850/SA1 Hardware Setup
2485
The CEB-V850 board is fitted with a socketed EPROM. The internal
2486
Flash of the V850 supplied with the CEB-V850 boards defaults to
2487
vectoring into this EPROM. A  GDB stub image should be programmed
2488
into an EPROM fitted to this board, and a pre-built image is provided
2489
at loaders/v850-ceb_v850/v850sa1/gdb_module.bin under
2490
the root of your eCos installation.
2491
The EPROM is installed to the socket labelled U7 on the board.
2492
Attention should be paid to the correct orientation of the EPROM
2493
during installation. 
2494
When programming an EPROM using the binary image, be careful
2495
to get the byte order correct. It needs to be little-endian. If
2496
the EPROM burner software has a hex-editor, check that the first
2497
few bytes of the image look similar to: 
2498
00000000: 0018 8007 5e02 0000 0000 0000 0000 0000
2499
If the byte order is wrong you will see 1800 instead of 0018
2500
etc. Use the EPROM burner software to make a byte-swap before you
2501
burn to image to the EPROM. 
2502
If the GDB stub EPROM you burn does not work, try reversing
2503
the byte-order, even if you think you have it the right way around.
2504
At least one DOS-based EPROM burner program is known to have the
2505
byte-order upside down.
2506
The GDB stub in the EPROM allows communication with GDB using
2507
the serial port. The communication parameters are fixed at 38400
2508
baud, 8 data bits, no parity bit and 1 stop bit (8-N-1). No flow
2509
control is employed. Connection to the host computer should be made
2510
using a dedicated serial cable as specified in the CEB-V850/SA1
2511
manual.
2512
2513
Installing the Stubs into ROM
2514
2515
Preparing the Binaries
2516
These two binary preparation steps are not strictly necessary
2517
as the eCos distribution ships with pre-compiled binaries in the
2518
directory loaders/v850-ceb_v850 relative to the
2519
installation root.
2520
2521
Building the ROM images with the eCos Configuration Tool
2522
2523
2524
Start with a new document - selecting the
2525
File->New
2526
 menu item if necessary to do this.
2527
2528
2529
Choose the
2530
Build->Templates
2531
 menu item, and then select the NEC CEB-V850/SA1 hardware.
2532
2533
2534
While still displaying the
2535
Build->Templates
2536
 dialog box, select the “stubs” package template
2537
to build a GDB stub. Click
2538
OK.
2539
2540
2541
Build eCos using
2542
Build->Library. 
2543
2544
2545
When the build completes, the image files can be found
2546
in the bin/ subdirectory of the install tree. GDB stub
2547
ROM images have the  prefix “gdb_module”.
2548
2549
2550
2551
2552
Building the ROM images with ecosconfig
2553
2554
2555
Make an empty directory to contain the build tree,
2556
and cd into it. 
2557
2558
2559
To build a GDB stub ROM image, enter the command:
2560
 
2561
$ ecosconfig new ceb-v850 stubs 
2562
2563
2564
Enter the commands:
2565
 
2566
$ ecosconfig tree
2567
$ make
2568
 
2569
2570
2571
When the build completes, the image files can be found
2572
in the bin/ subdirectory of the install tree. GDB stub
2573
ROM images have the prefix “gdb_module”.
2574
2575
2576
2577
2578
2579
 Installing the Stubs into ROM or FLASH
2580
2581
2582
 Program the binary image file gdb_module.bin
2583
into ROM or FLASH referring to the instructions of your ROM
2584
                  programmer. 
2585
2586
2587
 Plug the ROM/FLASH into the socket as described
2588
at the beginning of this section.
2589
2590
2591
2592
2593
2594
Debugging with the NEC V850 I.C.E.
2595
eCos applications may be debugged using the NEC V850 In Circuit
2596
Emulator (I.C.E.) A PC running Microsoft Windows is required in
2597
order to run the NEC ICE software and drivers. In addition Red Hat
2598
have developed a “libremote” server application
2599
named v850ice.exe which is used on the PC connected to the I.C.E.
2600
in order to allow connections from GDB.
2601
The I.C.E. must be physically connected to a Windows NT system
2602
through NEC"s PCI or PC Card interface.  A driver, DLLs,
2603
and application are provided by NEC to control the I.C.E.
2604
v850ice is a Cygwin based server that runs on the NT system
2605
and provides an interface between the gdb client and the I.C.E.
2606
software. v850-elf-gdb may be run on the Windows NT system or on
2607
a remote system. v850-elf-gdb communicates with the libremote server
2608
using the gdb remote protocol over a TCP/IP socket.  v850ice
2609
communicates with the I.C.E. by calling functions in the NECMSG.DLL provided
2610
by NEC.
2611
2612
INITIAL SETUP
2613
2614
2615
Configure the hardware including the I.C.E., SA1 or
2616
SB1 Option Module, and target board.  Install the interface card
2617
in the Windows NT system. Reference NEC"s documentation
2618
for interface installation, jumper settings, etc.
2619
2620
2621
Install the Windows NT device driver provided by NEC.
2622
2623
2624
Copy the NEC DLLs, MDI application, and other support
2625
files to a directory on the Windows NT system. The standard location
2626
is C:\NecTools32. This directory will be referred to as
2627
the "libremote server directory" in this document. v850ice.exe must
2628
also be copied to this directory after being built. The required
2629
files are:  cpu.cfg, Nec.cfg, MDI.EXE, NECMSG.DLL, EX85032.DLL,
2630
V850E.DLL, IE850.MON, IE850E.MON, and D3037A.800.
2631
2632
2633
Make certain the file cpu.cfg contains the line:
2634
CpuOption=SA1
2635
if using a V850/SA1 module, or:
2636
CpuOption=SB1
2637
if using a V850/SB1 module.
2638
2639
2640
Set the environment variable IEPATH to point to the libremote
2641
server
2642
directory.
2643
2644
2645
2646
2647
BUILD PROCEDURES
2648
A pre-built v850ice.exe executable is supplied in the loaders/v850-ceb_v850 directory
2649
relative to the root of the eCos installation. However the following process
2650
will allow the rebuilding of this executable if required:
2651
For this example assume the v850ice libremote tree has been
2652
copied to a directory named "server".  The directory structure will
2653
be similar to the following diagram:
2654
                server
2655
                   |
2656
                 devo
2657
                 /  \
2658
           config    libremote
2659
                      /     \
2660
                   lib       v850ice
2661
Build the v850ice source as follows.  Be sure to use the native
2662
Cygwin compiler tools that were supplied alongside eCos.
2663
cd server
2664
mkdir build
2665
cd build
2666
../devo/configure --target=v850-elf --host=i686-pc-cygwin
2667
make
2668
The resultant libremote server image (v850ice.exe) can be
2669
found in build/libremote/v850ice.  Copy v850ice.exe
2670
to the lib remote server directory.
2671
2672
2673
V850ICE.EXE EXECUTION
2674
The v850ice command line syntax is:
2675
v850ice [-d] [-t addr] [port number]
2676
The optional -d option enables debug output.  The -t option
2677
is associated with thread debugging - see the "eCos thread debugging"
2678
section below for details. By default v850ice listens on port 2345
2679
for an attach request from a gdb client.  A different port number
2680
may be specified on the command line.
2681
To run the libremote server:
2682
2683
2684
Power on the I.C.E. and target board.
2685
2686
2687
Open a Cygwin window.
2688
2689
2690
Run v850ice.
2691
2692
2693
You will see the MDI interface window appear.  In this
2694
window you should see the "Connected to In-Circuit Emulator" message.
2695
 In the Cygwin window, the libremote server will indicate it is
2696
ready to accept a gdb client connection with the message "v850ice:
2697
 listening on port 2345."
2698
2699
2700
2701
2702
V850-ELF-GDB EXECUTION
2703
Run the v850-elf-gdb client to debug the V850 target.  It
2704
is necessary to issue certain configuration commands to the I.C.E.
2705
software.  These commands may be issued directly in the MDI window
2706
or they may be issued from the gdb client through the "monitor"
2707
command.
2708
On the Cosmo CEB-V850 board, on-chip Flash is mapped at address
2709
0x0, the on-board EPROM at 0x100000 and the on-board RAM at 0xfc0000.
2710
Since a stand alone V850 will start executing from address 0x0 on
2711
reset, it is normal to load either an application or a bootstrap
2712
loader for Flash at this address. eCos programs may be built to
2713
boot from Flash or the on-board EPROM. If building for the on-board
2714
EPROM, it would be expected that the Flash will contain the default
2715
CEB-V850 flash contents. An ELF format version of the default contents
2716
may be found in the eCos distribution with the name v850flash.img.
2717
In stand alone operation, normally the code in this flash image
2718
would have been programmed into the V850 on the Cosmo board, and
2719
this would cause it to vector into the on-board EPROM to run the
2720
application located there. In the case of eCos, this application
2721
may be a GDB stub ROM application, allowing the further download
2722
to RAM over serial of actual applications to debug.
2723
As an example, we shall demonstrate how to use the I.C.E.
2724
to download the v850flash.img and GDB stub EPROM image using I.C.E.
2725
emulator memory only, and not requiring any actual programming of
2726
devices.
2727
v850-elf-gdb -nw
2728
(gdb) file v850flash.img
2729
(gdb) target remote localhost:2345
2730
(gdb) monitor reset
2731
(gdb) monitor cpu r=256 a=16
2732
(gdb) monitor map r=0x100000-L 0x80000
2733
(gdb) monitor map u=0xfc0000-L 0x40000
2734
(gdb) monitor pinmask k
2735
(gdb) monitor step
2736
(gdb) monitor step
2737
(gdb) monitor step
2738
(gdb) monitor step
2739
(gdb) load
2740
(gdb) detach
2741
(gdb) file gdb_module.img
2742
(gdb) target remote localhost:2345
2743
(gdb) load
2744
(gdb) continue
2745
NOTE: The four "monitor step" commands are only required the
2746
first time the board is connected to the I.C.E., otherwise the program
2747
will fail.
2748
This is because of a limitation of the I.C.E. hardware that
2749
means that the first time it is used, the "map" commands are not
2750
acted on and the addresses "0x100000" and "0xfc0000" are not mapped.
2751
This can be observed using the command "td e-20" in the MDI application"s
2752
console to display the trace buffer, which will show that the contents
2753
of address 0x100000 are not valid. Subsequent runs do not require
2754
the "monitor step" commands.
2755
It is unusual to load two executable images to a target through
2756
gdb.  From the example above notice that this is accomplished by
2757
attaching to the libremote server, loading the flash image, detaching,
2758
reattaching, and loading the ROM/RAM image. It is more
2759
normal to build an executable image that can be executed directly.
2760
In eCos this is achieved by selecting either the ROM or ROMRAM startup
2761
type, and optionally enable building for the internal FLASH. The
2762
I.C.E. emulator memory can emulate both the internal FLASH and the
2763
EPROM, so real hardware programming is not required.
2764
Upon running this example you will notice that the libremote
2765
server does not exit upon detecting a detach request, but simply
2766
begins listening for the next attach request.  To cause v850ice
2767
to terminate, issue the "monitor quit" or "monitor exit" command
2768
from the gdb client.  v850ice will then terminate with the next
2769
detach request.  (You can also enter control-c in the Cygwin/DOS
2770
window where v850ice is running.)
2771
2772
2773
MDI INTERFACE VS. GDB INTERFACE
2774
If a filename is referenced in an MDI command, whether the
2775
command is entered in the MDI window or issued from the gdb client
2776
with the monitor command, the file must reside on the Windows NT
2777
libremote server system.  When specifying a filename when entering
2778
a command in the MDI window it is obvious that a server local file
2779
is being referenced.  When issuing an MDI command from the gdb client, the
2780
user must remember that the command line is simply passed to the
2781
I.C.E. software on the server system.  The command is executed by
2782
the I.C.E. software as though it were entered locally.
2783
Executable images may be loaded into the V850 target by entering
2784
the "load" command in the MDI window or with the gdb "load" command.
2785
 If the MDI load command is used, the executable image must be located
2786
on the server system and must be in S Record format.  If the gdb
2787
load command is used, the executable image must be located on the
2788
client system and must be in ELF format.
2789
Be aware that the gdb client is not aware of debugger commands
2790
issued from the MDI window.  It is possible to cause the gdb client
2791
and the I.C.E. software to get out of sync by issuing commands from
2792
both interfaces during the same debugging session.
2793
2794
2795
eCos THREAD DEBUGGING
2796
eCos and the V850 I.C.E. libremote server have been written
2797
to work together to allow debugging of eCos threads. This is an
2798
optional feature, disabled by default because of the overheads trying
2799
to detect a threaded program involves.
2800
Obviously thread debugging is not possible for programs with
2801
"RAM" startup type, as they are expected to operate underneath a
2802
separate ROM monitor (such as a GDB stub ROM), that itself would
2803
provide its own thread debugging capabilities over the serial line.
2804
Thread debugging is relevant only for programs built for Flash, ROM,
2805
or ROMRAM startup.
2806
To configure the libremote server to support thread debugging,
2807
use the command:
2808
(gdb) monitor syscallinfo ADDRESS
2809
at the GDB console prompt, where ADDRESS is the address of
2810
the syscall information structure included in the applications.
2811
In eCos this has been designed to be located at a consistent address
2812
for each CPU model (V850/SA1 or V850/SB1). It
2813
may be determined from an eCos executable using the following command
2814
at a cygwin bash prompt:
2815
v850-elf-nm EXECUTABLE | grep hal_v85x_ice_syscall_info
2816
At the current time, this address is 0xfc0400 for a Cosmo
2817
board fitted with a V850/SA1, or 0xfc0540 for a Cosmo board
2818
fitted with a V850/SB1.
2819
So for example, the GDB command for the SB1 would be:
2820
(gdb) monitor syscallinfo 0xfc0540
2821
Given that the syscallinfo address is fixed over all eCos
2822
executables for a given target, it is possible to define it on the
2823
libremote command line as well using the "-t" option, for example:
2824
bash$ v850ice -t 0xfc0400
2825
v850ice: listening on port 2345
2826
2827
2828
2829
2830
NEC CEB-V850/SB1 Hardware Setup
2831
The instructions for setting up the CEB-V850/SB1
2832
are virtually identical to those of the CEB-V850/SA1 above.
2833
The only significant differences are that pre-built loaders are available
2834
at loaders/v850-ceb_v850/v850sb1 within
2835
the eCos installation. Binaries supporting boards with both 16MHz
2836
and 8MHz clock speeds are supplied. Also when building applications,
2837
or rebuilding the stubs for a V850/SB1 target, then the
2838
V850 CPU variant must be changed in the CEB-V850 HAL to the SB1.
2839
2840
2841
i386 PC Hardware Setup
2842
2843
eCos application on the PC can be run in three ways: via RedBoot,
2844
loaded directly from a floppy disk, or loaded by the GRUB bootloader.
2845
2846
2847
RedBoot Support
2848
For information about setting up the PC to run with RedBoot,
2849
consult the RedBoot User"s Guide. If using serial debugging,
2850
the serial line runs at 38400 baud 8-N-1 and should be connected
2851
to the debug host using a null modem cable. If ethernet debugging
2852
is required, an i82559 compatible network interface card, such as
2853
an Intel EtherExpress Pro 10/100,  should be installed
2854
on the target PC and connected to the development PC running GDB.
2855
When RedBoot is configured appropriately to have an IP address set,
2856
then GDB will be able to debug directly over TCP/IP to the
2857
target PC.
2858
2859
2860
Floppy Disk Support
2861
2862
If an application is built with a startup type of FLOPPY, then it is
2863
configured to be a self-booting image that must be written onto a
2864
formatted floppy disk. This will erase any existing file system or
2865
data that is already on the disk, so proceed
2866
with caution.
2867
2868
2869
To write an application to floppy disk, it must first be converted to
2870
a pure binary format. This is done with the following command:
2871
2872
2873
$ i386-elf-objcopy -O binary app.elf app.bin
2874
2875
2876
Here app.elf is the final linked application
2877
executable, in ELF format (it may not have a .elf
2878
extension). The file app.bin is the resulting
2879
pure binary file. This must be written to the floppy disk with the
2880
following command:
2881
2882
$ dd conv=sync if=app.bin of=/dev/fd0
2883
2884
2885
For NT Cygwin users, this can be done by first ensuring that the raw
2886
floppy device is mounted as /dev/fd0. To check if this
2887
is the case, type the command mount at the Cygwin bash
2888
prompt. If the floppy drive is already mounted, it will be listed as something
2889
similar to the following line:
2890
  \\.\a: /dev/fd0 user binmode
2891
If this line is not listed, then mount the floppy drive using the command:
2892
2893
$ mount -f -b //./a: /dev/fd0
2894
To actually install the boot image on the floppy, use the command:
2895
2896
$ dd conv=sync if=app.bin of=/dev/fd0
2897
2898
Insert this floppy in the A: drive of the PC to be used as a target
2899
and ensure that the BIOS is configured to boot from A: by default. On reset,
2900
the PC will boot from the floppy and the eCos application will load
2901
itself and execute immediately.
2902
NOTE
2903
Unreliable floppy media may cause the write to silently fail. This
2904
can be determined if the RedBoot image does not correctly
2905
boot. In such cases, the floppy should be (unconditionally) reformatted
2906
using the fdformat command on Linux, or
2907
format a: /u on DOS/Windows. If this fails, try a
2908
different disk.
2909
2910
2911
2912
GRUB Bootloader Support
2913
2914
If an application is built with the GRUB startup type, it is
2915
configured to be loaded by the GRUB bootloader.
2916
2917
2918
GRUB is an open source boot loader that supports many different
2919
operating systems. It is available from
2920
2921
url="http://www.gnu.org/software/grub">http://www.gnu.org/software/grub.
2922
The latest version of GRUB should be downloaded from there and installed.
2923
In Red Hat Linux version 7.2 and later it is the default bootloader
2924
for Linux and therefore is already installed.
2925
2926
2927
To install GRUB on a floppy disk from Linux you need to execute the
2928
following commands:
2929
2930
2931
$ mformat a:
2932
$ mount /mnt/floppy
2933
$ grub-install --root-directory=/mnt/floppy '(fd0)'
2934
Probing devices to guess BIOS drives. This may take a long time.
2935
Installation finished. No error reported.
2936
This is the contents of the device map /mnt/floppy/boot/grub/device.map.
2937
Check if this is correct or not. If any of the lines is incorrect,
2938
fix it and re-run the script `grub-install'.
2939
 
2940
(fd0)   /dev/fd0
2941
$ cp $ECOS_REPOSITORY/packages/hal/i386/pc/current/misc/menu.lst /mnt/floppy/boot/grub
2942
$ umount /mnt/floppy
2943
2944
2945
The file menu.lst is an example GRUB menu
2946
configuration file. It contains menu items to load some of the
2947
standard eCos tests from floppy or from partition zero of the first
2948
hard disk. You should, of course, customize this file to load your own
2949
application. Alternatively you can use the command-line interface of
2950
GRUB to input commands yourself.
2951
2952
2953
Applications can be installed, or updated simply by copying them to
2954
the floppy disk at the location expected by the
2955
menu.lst file. For booting from floppy disks it
2956
is recommended that the executable be stripped of all debug and symbol
2957
table information before copying. This reduces the size of the file
2958
and can make booting faster.
2959
2960
2961
To install GRUB on a hard disk, refer to the GRUB documentation. Be
2962
warned, however, that if you get this wrong it may compromise any
2963
existing bootloader that exists on the hard disk and may make any
2964
other operating systems unbootable. Practice on floppy disks or
2965
sacrificial hard disks first. On machines running Red Hat Linux
2966
version 7.2 and later, you can just add your own menu items to the
2967
/boot/grub/menu.lst file that already exists.
2968
2969
2970
2971
Debugging FLOPPY and GRUB Applications
2972
2973
When RedBoot loads an application it also provides debugging services
2974
in the form of GDB remote protocol stubs. When an application is
2975
loaded stand-alone from a floppy disk, or by GRUB, these services are
2976
not present. To allow these application to be debugged, it is possible
2977
to include GDB stubs into the application.
2978
2979
2980
To do this, set the "Support for GDB stubs"
2981
(CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS) configuration
2982
option. Following this any application built will allow GDB to connect
2983
to the debug serial port (by default serial device 0, also known as
2984
COM1) whenever the application takes an exception, or if a Control-C
2985
is typed to the debug port. Ethernet debugging is not supported.
2986
2987
2988
The option "Enable initial breakpoint"
2989
(CYGDBG_HAL_DEBUG_GDB_INITIAL_BREAK) causes the HAL
2990
to take a breakpoint immediately before calling cyg_start(). This
2991
gives the developer a chance to set any breakpoints or inspect the
2992
system state before it proceeds. The configuration sets this option by
2993
default if GDB stubs are included, and this is not a RedBoot build. To
2994
make the application execute immediately either disable this option,
2995
or disable CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS.
2996
2997
2998
2999
3000
<!-- <conditionaltext> --><!-- <index></index> -->i386/Linux Synthetic Target Setup
3001
When building for the synthetic Linux target, the resulting
3002
binaries are native Linux applications with the HAL providing suitable
3003
bindings between the eCos kernel and the Linux kernel.
3004
3005
Please be aware that the current implementation of the Linux
3006
synthetic target does not allow thread-aware debugging.
3007
3008
These Linux applications cannot be run on a Windows system.
3009
However, it is possible to write a similar HAL emulation for the
3010
Windows kernel if such a testing target is desired.
3011
3012
Tools
3013
 
3014
For the synthetic target, eCos relies on features not available
3015
in native compilers earlier than gcc-2.95.1. It also requires version
3016
2.9.5 or later of the GNU linker. If you have gcc-2.95.1 or later
3017
and ld version 2.9.5 or later, then you do not need to build new
3018
tools. eCos does not support earlier versions. You can check the compiler
3019
version using gcc -v
3020
and the linker version using ld
3021
-v.
3022
 
3023
If you have native tools that are sufficiently recent for
3024
use with eCos, you should be aware that by default eCos assumes
3025
that the tools i686-pc-linux-gnu-gcc, i686-pc-linux-gnu-ar,
3026
 i686-pc-linux-gnu-ld, and i686-pc-linux-gnu-objcopy are
3027
on your system and are the correct versions for use with eCos. But
3028
instead, you can tell eCos to use your native tools by editing the
3029
configuration value "Global command prefix" (CYGBLD_GLOBAL_COMMAND_PREFIX)
3030
in your eCos configuration. If left empty (i.e. set to the empty
3031
string) eCos will use your native tools when building.
3032
If you have any difficulties, it is almost certainly easiest
3033
overall to rebuild the tools as described on: http://sources.redhat.com/ecos/getstart.html
3034
3035
3036
 
3037
 
3038

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.