OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

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

Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

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