3 <title>Test cases
</title>
8 <H2>Test case results
</H2>
9 The test results are stored in seperate documents. One document for
10 each subversion number.
12 <tr><td>Test results
</td><td>comment
</td></tr>
13 <tr><td><a href=
"examples/SAM7S256Test/results/607.html">SAM7 R607
</a></td><td>PASS
</td></tr>
14 <tr><td><a href=
"examples/STR710Test/results/607.html">STR710 R607
</a></td><td>PASS
</td></tr>
16 <tr><td><a href=
"results/template.html">template
</a></td><td>Test results template
</td></tr>
22 <td width=
"100">Passed version
</td>
24 <td>The latest branch and version on which the test is known to pass
</td>
27 <td width=
"100">Broken version
</td>
28 <td>The latest branch and version on which the test is known to fail. n/a when older than passed version.
</td>
31 <td width=
"100">ID
</td>
32 <td>A unqiue ID to refer to a test. The unique numbers are maintained in this file. Note that the same test can be run on different hardware/interface. Each combination yields a unique id.
</td>
35 <td width=
"100">Test case
</td>
36 <td>An atomic entity that describes the operations needed to test a feature or only a part of it. The test case should:
38 <li>be uniquely identifiable
</li>
39 <li>define the complete prerequisites of the test (eg: the target, the interface, the initial state of the system)
</li>
40 <li>define the input to be applied to the system in order to execute the test
</li>
41 <li>define the expected output
</li>
42 <li>contain the output resulted by running the test case
</li>
43 <li>contain the result of the test (pass/fail)
</li>
48 <td width=
"100">Test suite
</td>
49 <td>A (completable) collection of test cases
</td>
52 <td width=
"100">Testing
</td>
53 <td>Testing refers to running the test suite for a specific revision of the software,
54 for one or many targets, using one or many JTAG interfaces. Testing should be be stored
55 along with all the other records for that specific revision. For releases, the results
56 can be stored along with the binaries
</td>
59 <td width=
"100">Target = ANY
</td>
60 <td>Any target can be used for this test
</td>
63 <td width=
"100">Interface = ANY
</td>
64 <td>Any interface can be used for this test
</td>
67 <td width=
"100">Target =
"reset_config srst_and_trst"</td>
68 <td>Any target which supports the reset_config above
</td>
81 <td>Initial state
</td>
83 <td>Expected output
</td>
87 <td><a name=
"CON001"/>CON001
</td>
90 <td>Telnet connection
</td>
91 <td>Power on, jtag target attached
</td>
92 <td>On console, type
<br><code>telnet ip port
</code></td>
93 <td><code>Open On-Chip Debugger
<br>></code></td>
97 <td><a name=
"CON002"/>CON002
</td>
100 <td>GDB server connection
</td>
101 <td>Power on, jtag target attached
</td>
102 <td>On GDB console, type
<br><code>target remote ip:port
</code></td>
103 <td><code>Remote debugging using
10.0.0.73:
3333</code></td>
115 <td>Initial state
</td>
117 <td>Expected output
</td>
121 <td><a name=
"RES001"/>RES001
</td>
124 <td>Reset halt on a blank target
</td>
125 <td>Erase all the content of the flash
</td>
126 <td>Connect via the telnet interface and type
<br><code>reset halt
</code></td>
127 <td>Reset should return without error and the output should contain
<br><code>target state: halted
<br>pc =
0</code></td>
131 <td><a name=
"RES002"/>RES002
</td>
134 <td>Reset init on a blank target
</td>
135 <td>Erase all the content of the flash
</td>
136 <td>Connect via the telnet interface and type
<br><code>reset init
</code></td>
137 <td>Reset should return without error and the output should contain
<br><code>executing reset script 'name_of_the_script'
</code></td>
141 <td><a name=
"RES003"/>RES003
</td>
144 <td>Reset after a power cycle of the target
</td>
145 <td>Reset the target then power cycle the target
</td>
146 <td>Connect via the telnet interface and type
<br><code>reset halt
</code> after the power was detected
</td>
147 <td>Reset should return without error and the output should contain
<br><code>target state: halted
</code></td>
151 <td><a name=
"RES004"/>RES004
</td>
152 <td>ARM7/
9,reset_config srst_and_trst
</td>
154 <td>Reset halt on a blank target where reset halt is supported
</td>
155 <td>Erase all the content of the flash
</td>
156 <td>Connect via the telnet interface and type
<br><code>reset halt
</code></td>
157 <td>Reset should return without error and the output should contain
<br><code>target state: halted
<br>pc =
0</code></td>
161 <td><a name=
"RES005"/>RES005
</td>
162 <td>arm926ejs,reset_config srst_and_trst
</td>
164 <td>Reset halt on a blank target where reset halt is supported. This target has problems with the reset vector catch being disabled by TRST
</td>
165 <td>Erase all the content of the flash
</td>
166 <td>Connect via the telnet interface and type
<br><code>reset halt
</code></td>
167 <td>Reset should return without error and the output should contain
<br><code>target state: halted
<br>pc =
0</code></td>
179 <td>Initial state
</td>
181 <td>Expected output
</td>
185 <td><a name=
"SPD001"/>RES001
</td>
188 <td>16MHz on normal operation
</td>
189 <td>Reset init the target according to RES002
</td>
190 <td>Exercise a memory access over the JTAG, for example
<br><code>mdw
0x0 32</code></td>
191 <td>The command should run without any errors. If any JTAG checking errors happen, the test failed
</td>
203 <td>Initial state
</td>
205 <td>Expected output
</td>
209 <td><a name=
"DBG001"/>DBG001
</td>
212 <td>Load is working
</td>
213 <td>Reset init is working, RAM is accesible, GDB server is started
</td>
214 <td>On the console of the OS:
<br>
215 <code>arm-elf-gdb test_ram.elf
</code><br>
216 <code>(gdb) target remote ip:port
</code><br>
217 <code>(gdb) load
</load>
219 <td>Load should return without error, typical output looks like:
<br>
221 Loading section .text, size
0x14c lma
0x0<br>
222 Start address
0x40, load size
332<br>
223 Transfer rate:
180 bytes/sec,
332 bytes/write.
<br>
229 <td><a name=
"DBG002"/>DBG002
</td>
232 <td>Software breakpoint
</td>
233 <td>Load the test_ram.elf application, use instructions from GDB001
</td>
234 <td>In the GDB console:
<br>
236 (gdb) monitor arm7_9 sw_bkpts enable
<br>
237 software breakpoints enabled
<br>
239 Breakpoint
1 at
0xec: file src/main.c, line
71.
<br>
244 <td>The software breakpoint should be reached, a typical output looks like:
<br>
246 target state: halted
<br>
247 target halted in ARM state due to breakpoint, current mode: Supervisor
<br>
248 cpsr:
0x000000d3 pc:
0x000000ec<br>
250 Breakpoint
1, main () at src/main.c:
71<br>
257 <td><a name=
"DBG003"/>DBG003
</td>
260 <td>Single step in a RAM application
</td>
261 <td>Load the test_ram.elf application, use instructions from GDB001, break in main using the instructions from GDB002
</td>
262 <td>In GDB, type
<br><code>(gdb) step
</code></td>
263 <td>The next instruction should be reached, typical output:
<br>
266 target state: halted
<br>
267 target halted in ARM state due to single step, current mode: Abort
<br>
268 cpsr:
0x20000097 pc:
0x000000f0<br>
269 target state: halted
<br>
270 target halted in ARM state due to single step, current mode: Abort
<br>
271 cpsr:
0x20000097 pc:
0x000000f4<br>
278 <td><a name=
"DBG004"/>DBG004
</td>
281 <td>Software break points are working after a reset
</td>
282 <td>Load the test_ram.elf application, use instructions from GDB001, break in main using the instructions from GDB002
</td>
283 <td>In GDB, type
<br><code>
284 (gdb) monitor reset
<br>
288 <td>The breakpoint should be reached, typical output:
<br>
290 target state: halted
<br>
291 target halted in ARM state due to breakpoint, current mode: Supervisor
<br>
292 cpsr:
0x000000d3 pc:
0x000000ec<br>
294 Breakpoint
1, main () at src/main.c:
71<br>
301 <td><a name=
"DBG005"/>DBG005
</td>
304 <td>Hardware breakpoint
</td>
305 <td>Flash the test_rom.elf application. Make this test after FLA004 has passed
</td>
306 <td>Be sure that
<code>gdb_memory_map
</code> and
<code>gdb_flash_program
</code> are enabled. In GDB, type
<br>
308 (gdb) monitor reset
<br>
310 Loading section .text, size
0x194 lma
0x100000<br>
311 Start address
0x100040, load size
404<br>
312 Transfer rate:
179 bytes/sec,
404 bytes/write.
<br>
313 (gdb) monitor arm7_9 force_hw_bkpts enable
<br>
314 force hardware breakpoints enabled
<br>
316 Breakpoint
1 at
0x100134: file src/main.c, line
69.
<br>
320 <td>The breakpoint should be reached, typical output:
<br>
324 Breakpoint
1, main () at src/main.c:
69<br>
331 <td><a name=
"DBG006"/>DBG006
</td>
334 <td>Hardware breakpoint is set after a reset
</td>
335 <td>Follow the instructions to flash and insert a hardware breakpoint from DBG005
</td>
336 <td>In GDB, type
<br>
338 (gdb) monitor reset
<br>
339 (gdb) monitor reg pc
0x100000<br>
340 pc (/
32):
0x00100000<br>
344 <td>The breakpoint should be reached, typical output:
<br>
348 Breakpoint
1, main () at src/main.c:
69<br>
355 <td><a name=
"DBG007"/>DBG007
</td>
358 <td>Single step in ROM
</td>
359 <td>Flash the test_rom.elf application and set a breakpoint in main, use DBG005. Make this test after FLA004 has passed
</td>
360 <td>Be sure that
<code>gdb_memory_map
</code> and
<code>gdb_flash_program
</code> are enabled. In GDB, type
<br>
362 (gdb) monitor reset
<br>
364 Loading section .text, size
0x194 lma
0x100000<br>
365 Start address
0x100040, load size
404<br>
366 Transfer rate:
179 bytes/sec,
404 bytes/write.
<br>
367 (gdb) monitor arm7_9 force_hw_bkpts enable
<br>
368 force hardware breakpoints enabled
<br>
370 Breakpoint
1 at
0x100134: file src/main.c, line
69.
<br>
374 Breakpoint
1, main () at src/main.c:
69<br>
379 <td>The breakpoint should be reached, typical output:
<br>
381 target state: halted
<br>
382 target halted in ARM state due to single step, current mode: Supervisor
<br>
383 cpsr:
0x60000013 pc:
0x0010013c<br>
392 Note: these tests are not designed to test/debug the target, but to test functionalities!
399 <td>Initial state
</td>
401 <td>Expected output
</td>
405 <td><a name=
"RAM001"/>RAM001
</td>
408 <td>32 bit Write/read RAM
</td>
409 <td>Reset init is working
</td>
410 <td>On the telnet interface
<br>
411 <code> > mww ram_address
0xdeadbeef 16<br>
415 <td>The commands should execute without error. A clear failure is a memory access exception. The result of running the commands should be a list of
16 locations
32bit long containing
0xdeadbeef.
<br>
417 > mww
0x0 0xdeadbeef 16<br>
419 0x00000000: deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef
<br>
420 0x00000020: deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef
<br>
421 0x00000040: e1a00000 e59fa51c e59f051c e04aa000
00080017 00009388 00009388 00009388<br>
422 0x00000060:
00009388 0002c2c0
0002c2c0
000094f8
000094f4
00009388 00009388 00009388<br>
428 <td><a name=
"RAM001"/>RAM001
</td>
431 <td>16 bit Write/read RAM
</td>
432 <td>Reset init is working
</td>
433 <td>On the telnet interface
<br>
434 <code> > mwh ram_address
0xbeef 16<br>
438 <td>The commands should execute without error. A clear failure is a memory access exception. The result of running the commands should be a list of
16 locations
16bit long containing
0xbeef.
<br>
440 > mwh
0x0 0xbeef 16<br>
442 0x00000000: beef beef beef beef beef beef beef beef beef beef beef beef beef beef beef beef
<br>
443 0x00000020:
00e0
0000 021c
0000 0240 0000 026c
0000 0288 0000 0000 0000 0388 0000 0350 0000<br>
450 <td><a name=
"RAM003"/>RAM003
</td>
453 <td>8 bit Write/read RAM
</td>
454 <td>Reset init is working
</td>
455 <td>On the telnet interface
<br>
456 <code> > mwb ram_address
0xab 16<br>
460 <td>The commands should execute without error. A clear failure is a memory access exception. The result of running the commands should be a list of
16 locations
8bit long containing
0xab.
<br>
463 > mwb ram_address
0xab 16<br>
464 > mdb ram_address
32<br>
465 0x00000000: ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00<br>
475 <H2>Flash access
</H2>
482 <td>Initial state
</td>
484 <td>Expected output
</td>
488 <td><a name=
"FLA002"/>FLA002
</td>
492 <td>Reset init is working, flash is probed
</td>
493 <td>On the telnet interface
<br>
494 <code> > flash fillw
0x1000000 0xdeadbeef 16
497 <td>The commands should execute without error. The output looks like:
<br>
499 wrote
64 bytes to
0x01000000 in
11.610000s (
0.091516 kb/s)
501 To verify the contents of the flash:
<br>
503 > mdw
0x1000000 32<br>
504 0x01000000: deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef
<br>
505 0x01000020: deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef
<br>
506 0x01000040: ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff
<br>
507 0x01000060: ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff
513 <td><a name=
"FLA003"/>FLA003
</td>
517 <td>Reset init is working, flash is probed
</td>
518 <td>On the telnet interface
<br>
519 <code> > flash erase_address
0x1000000 0x2000
522 <td>The commands should execute without error.
<br>
524 erased address
0x01000000 length
8192 in
4.970000s
526 To check that the flash has been erased, read at different addresses. The result should always be
0xff.
528 > mdw
0x1000000 32<br>
529 0x01000000: ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff
<br>
530 0x01000020: ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff
<br>
531 0x01000040: ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff
<br>
532 0x01000060: ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff
538 <td><a name=
"FLA004"/>FLA004
</td>
541 <td>Loading to flash from GDB
</td>
542 <td>Reset init is working, flash is probed, connectivity to GDB server is working
</td>
543 <td>Start GDB using a ROM elf image, eg: arm-elf-gdb test_rom.elf.
<br>
545 (gdb) target remote ip:port
<br>
546 (gdb) monitor reset
<br>
548 Loading section .text, size
0x194 lma
0x100000<br>
549 Start address
0x100040, load size
404<br>
550 Transfer rate:
179 bytes/sec,
404 bytes/write.
551 (gdb) monitor verify_image path_to_elf_file
554 <td>The output should look like:
<br>
556 verified
404 bytes in
5.060000s
558 The failure message is something like:
<br>
559 <code>Verify operation failed address
0x00200000. Was
0x00 instead of
0x18</code>