You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

566 lines
26 KiB

  1. <html>
  2. <head>
  3. <title>Test cases</title>
  4. </head>
  5. <body>
  6. <H1>Test cases</H1>
  7. <H2>Test case results</H2>
  8. The test results are stored in seperate documents. One document for
  9. each subversion number.
  10. <table border="1">
  11. <tr><td>Test results</td><td>comment</td></tr>
  12. <tr><td><a href="examples/SAM7S256Test/results/607.html">SAM7 R607</a></td><td>PASS</td></tr>
  13. <tr><td><a href="examples/STR710Test/results/607.html">STR710 R607</a></td><td>PASS</td></tr>
  14. <tr><td><a href="results/template.html">template</a></td><td>Test results template</td></tr>
  15. </table>
  16. <H2>Vocabulary</H2>
  17. <table border="1">
  18. <tr>
  19. <td width="100">Passed version</td>
  20. <td>The latest branch and version on which the test is known to pass</td>
  21. </tr>
  22. <tr>
  23. <td width="100">Broken version</td>
  24. <td>The latest branch and version on which the test is known to fail. n/a when older than passed version.</td>
  25. </tr>
  26. <tr>
  27. <td width="100">ID</td>
  28. <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>
  29. </tr>
  30. <tr>
  31. <td width="100">Test case</td>
  32. <td>An atomic entity that describes the operations needed to test a feature or only a part of it. The test case should:
  33. <ul>
  34. <li>be uniquely identifiable</li>
  35. <li>define the complete prerequisites of the test (eg: the target, the interface, the initial state of the system)</li>
  36. <li>define the input to be applied to the system in order to execute the test</li>
  37. <li>define the expected output</li>
  38. <li>contain the output resulted by running the test case</li>
  39. <li>contain the result of the test (pass/fail)</li>
  40. </ul>
  41. </td>
  42. </tr>
  43. <tr>
  44. <td width="100">Test suite</td>
  45. <td>A (completable) collection of test cases</td>
  46. </tr>
  47. <tr>
  48. <td width="100">Testing</td>
  49. <td>Testing refers to running the test suite for a specific revision of the software,
  50. for one or many targets, using one or many JTAG interfaces. Testing should be be stored
  51. along with all the other records for that specific revision. For releases, the results
  52. can be stored along with the binaries</td>
  53. </tr>
  54. <tr>
  55. <td width="100">Target = ANY</td>
  56. <td>Any target can be used for this test</td>
  57. </tr>
  58. <tr>
  59. <td width="100">Interface = ANY</td>
  60. <td>Any interface can be used for this test</td>
  61. </tr>
  62. <tr>
  63. <td width="100">Target = "reset_config srst_and_trst"</td>
  64. <td>Any target which supports the reset_config above</td>
  65. </tr>
  66. </table>
  67. <H1>Test cases</H1>
  68. <H2>Connectivity</H2>
  69. <table border=1>
  70. <tr>
  71. <td>ID</td>
  72. <td>Target</td>
  73. <td>Interface</td>
  74. <td>Description</td>
  75. <td>Initial state</td>
  76. <td>Input</td>
  77. <td>Expected output</td>
  78. <td>Pass/Fail</td>
  79. </tr>
  80. <tr>
  81. <td><a name="CON001"/>CON001</td>
  82. <td>ALL</td>
  83. <td>ALL</td>
  84. <td>Telnet connection</td>
  85. <td>Power on, jtag target attached</td>
  86. <td>On console, type<br><code>telnet ip port</code></td>
  87. <td><code>Open On-Chip Debugger<br>></code></td>
  88. <td>PASS/FAIL</td>
  89. </tr>
  90. <tr>
  91. <td><a name="CON002"/>CON002</td>
  92. <td>ALL</td>
  93. <td>ALL</td>
  94. <td>GDB server connection</td>
  95. <td>Power on, jtag target attached</td>
  96. <td>On GDB console, type<br><code>target remote ip:port</code></td>
  97. <td><code>Remote debugging using 10.0.0.73:3333</code></td>
  98. <td>PASS/FAIL</td>
  99. </tr>
  100. </table>
  101. <H2>Reset</H2>
  102. <table border=1>
  103. <tr>
  104. <td>ID</td>
  105. <td>Target</td>
  106. <td>Interface</td>
  107. <td>Description</td>
  108. <td>Initial state</td>
  109. <td>Input</td>
  110. <td>Expected output</td>
  111. <td>Pass/Fail</td>
  112. </tr>
  113. <tr>
  114. <td><a name="RES001"/>RES001</td>
  115. <td>Fill in!</td>
  116. <td>Fill in!</td>
  117. <td>Reset halt on a blank target</td>
  118. <td>Erase all the content of the flash</td>
  119. <td>Connect via the telnet interface and type <br><code>reset halt</code></td>
  120. <td>Reset should return without error and the output should contain<br><code>target state: halted<br>pc = 0</code></td>
  121. <td>PASS/FAIL</td>
  122. </tr>
  123. <tr>
  124. <td><a name="RES002"/>RES002</td>
  125. <td>Fill in!</td>
  126. <td>Fill in!</td>
  127. <td>Reset init on a blank target</td>
  128. <td>Erase all the content of the flash</td>
  129. <td>Connect via the telnet interface and type <br><code>reset init</code></td>
  130. <td>Reset should return without error and the output should contain <br><code>executing reset script 'name_of_the_script'</code></td>
  131. <td>PASS/FAIL</td>
  132. </tr>
  133. <tr>
  134. <td><a name="RES003"/>RES003</td>
  135. <td>Fill in!</td>
  136. <td>Fill in!</td>
  137. <td>Reset after a power cycle of the target</td>
  138. <td>Reset the target then power cycle the target</td>
  139. <td>Connect via the telnet interface and type <br><code>reset halt</code> after the power was detected</td>
  140. <td>Reset should return without error and the output should contain<br><code>target state: halted</code></td>
  141. <td>PASS/FAIL</td>
  142. </tr>
  143. <tr>
  144. <td><a name="RES004"/>RES004</td>
  145. <td>ARM7/9,reset_config srst_and_trst</td>
  146. <td>ANY</td>
  147. <td>Reset halt on a blank target where reset halt is supported</td>
  148. <td>Erase all the content of the flash</td>
  149. <td>Connect via the telnet interface and type <br><code>reset halt</code></td>
  150. <td>Reset should return without error and the output should contain<br><code>target state: halted<br>pc = 0</code></td>
  151. <td>PASS/FAIL</td>
  152. </tr>
  153. <tr>
  154. <td><a name="RES005"/>RES005</td>
  155. <td>arm926ejs,reset_config srst_and_trst</td>
  156. <td>ANY</td>
  157. <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>
  158. <td>Erase all the content of the flash</td>
  159. <td>Connect via the telnet interface and type <br><code>reset halt</code></td>
  160. <td>Reset should return without error and the output should contain<br><code>target state: halted<br>pc = 0</code></td>
  161. <td>PASS/FAIL</td>
  162. </tr>
  163. </table>
  164. <H2>JTAG Speed</H2>
  165. <table border=1>
  166. <tr>
  167. <td>ID</td>
  168. <td>Target</td>
  169. <td>Interface</td>
  170. <td>Description</td>
  171. <td>Initial state</td>
  172. <td>Input</td>
  173. <td>Expected output</td>
  174. <td>Pass/Fail</td>
  175. </tr>
  176. <tr>
  177. <td><a name="SPD001"/>RES001</td>
  178. <td>Fill in!</td>
  179. <td>Fill in!</td>
  180. <td>16MHz on normal operation</td>
  181. <td>Reset init the target according to RES002 </td>
  182. <td>Exercise a memory access over the JTAG, for example <br><code>mdw 0x0 32</code></td>
  183. <td>The command should run without any errors. If any JTAG checking errors happen, the test failed</td>
  184. <td>PASS/FAIL</td>
  185. </tr>
  186. </table>
  187. <H2>Debugging</H2>
  188. <table border=1>
  189. <tr>
  190. <td>ID</td>
  191. <td>Target</td>
  192. <td>Interface</td>
  193. <td>Description</td>
  194. <td>Initial state</td>
  195. <td>Input</td>
  196. <td>Expected output</td>
  197. <td>Pass/Fail</td>
  198. </tr>
  199. <tr>
  200. <td><a name="DBG001"/>DBG001</td>
  201. <td>Fill in!</td>
  202. <td>Fill in!</td>
  203. <td>Load is working</td>
  204. <td>Reset init is working, RAM is accesible, GDB server is started</td>
  205. <td>On the console of the OS: <br>
  206. <code>arm-elf-gdb test_ram.elf</code><br>
  207. <code>(gdb) target remote ip:port</code><br>
  208. <code>(gdb) load</load>
  209. </td>
  210. <td>Load should return without error, typical output looks like:<br>
  211. <code>
  212. Loading section .text, size 0x14c lma 0x0<br>
  213. Start address 0x40, load size 332<br>
  214. Transfer rate: 180 bytes/sec, 332 bytes/write.<br>
  215. </code>
  216. </td>
  217. <td>PASS/FAIL</td>
  218. </tr>
  219. <tr>
  220. <td><a name="DBG002"/>DBG002</td>
  221. <td>Fill in!</td>
  222. <td>Fill in!</td>
  223. <td>Software breakpoint</td>
  224. <td>Load the test_ram.elf application, use instructions from GDB001</td>
  225. <td>In the GDB console:<br>
  226. <code>
  227. (gdb) monitor arm7_9 sw_bkpts enable<br>
  228. software breakpoints enabled<br>
  229. (gdb) break main<br>
  230. Breakpoint 1 at 0xec: file src/main.c, line 71.<br>
  231. (gdb) continue<br>
  232. Continuing.
  233. </code>
  234. </td>
  235. <td>The software breakpoint should be reached, a typical output looks like:<br>
  236. <code>
  237. target state: halted<br>
  238. target halted in ARM state due to breakpoint, current mode: Supervisor<br>
  239. cpsr: 0x000000d3 pc: 0x000000ec<br>
  240. <br>
  241. Breakpoint 1, main () at src/main.c:71<br>
  242. 71 DWORD a = 1;
  243. </code>
  244. </td>
  245. <td>PASS/FAIL</td>
  246. </tr>
  247. <tr>
  248. <td><a name="DBG003"/>DBG003</td>
  249. <td>Fill in!</td>
  250. <td>Fill in!</td>
  251. <td>Single step in a RAM application</td>
  252. <td>Load the test_ram.elf application, use instructions from GDB001, break in main using the instructions from GDB002</td>
  253. <td>In GDB, type <br><code>(gdb) step</code></td>
  254. <td>The next instruction should be reached, typical output:<br>
  255. <code>
  256. (gdb) step<br>
  257. target state: halted<br>
  258. target halted in ARM state due to single step, current mode: Abort<br>
  259. cpsr: 0x20000097 pc: 0x000000f0<br>
  260. target state: halted<br>
  261. target halted in ARM state due to single step, current mode: Abort<br>
  262. cpsr: 0x20000097 pc: 0x000000f4<br>
  263. 72 DWORD b = 2;
  264. </code>
  265. </td>
  266. <td>PASS/FAIL</td>
  267. </tr>
  268. <tr>
  269. <td><a name="DBG004"/>DBG004</td>
  270. <td>Fill in!</td>
  271. <td>Fill in!</td>
  272. <td>Software break points are working after a reset</td>
  273. <td>Load the test_ram.elf application, use instructions from GDB001, break in main using the instructions from GDB002</td>
  274. <td>In GDB, type <br><code>
  275. (gdb) monitor reset<br>
  276. (gdb) load<br>
  277. (gdb) continue<br>
  278. </code></td>
  279. <td>The breakpoint should be reached, typical output:<br>
  280. <code>
  281. target state: halted<br>
  282. target halted in ARM state due to breakpoint, current mode: Supervisor<br>
  283. cpsr: 0x000000d3 pc: 0x000000ec<br>
  284. <br>
  285. Breakpoint 1, main () at src/main.c:71<br>
  286. 71 DWORD a = 1;
  287. </code>
  288. </td>
  289. <td>PASS/FAIL</td>
  290. </tr>
  291. <tr>
  292. <td><a name="DBG005"/>DBG005</td>
  293. <td>Fill in!</td>
  294. <td>Fill in!</td>
  295. <td>Hardware breakpoint</td>
  296. <td>Flash the test_rom.elf application. Make this test after FLA004 has passed</td>
  297. <td>Be sure that <code>gdb_memory_map</code> and <code>gdb_flash_program</code> are enabled. In GDB, type <br>
  298. <code>
  299. (gdb) monitor reset<br>
  300. (gdb) load<br>
  301. Loading section .text, size 0x194 lma 0x100000<br>
  302. Start address 0x100040, load size 404<br>
  303. Transfer rate: 179 bytes/sec, 404 bytes/write.<br>
  304. (gdb) monitor arm7_9 force_hw_bkpts enable<br>
  305. force hardware breakpoints enabled<br>
  306. (gdb) break main<br>
  307. Breakpoint 1 at 0x100134: file src/main.c, line 69.<br>
  308. (gdb) continue<br>
  309. </code>
  310. </td>
  311. <td>The breakpoint should be reached, typical output:<br>
  312. <code>
  313. Continuing.<br>
  314. <br>
  315. Breakpoint 1, main () at src/main.c:69<br>
  316. 69 DWORD a = 1;<br>
  317. </code>
  318. </td>
  319. <td>PASS/FAIL</td>
  320. </tr>
  321. <tr>
  322. <td><a name="DBG006"/>DBG006</td>
  323. <td>Fill in!</td>
  324. <td>Fill in!</td>
  325. <td>Hardware breakpoint is set after a reset</td>
  326. <td>Follow the instructions to flash and insert a hardware breakpoint from DBG005</td>
  327. <td>In GDB, type <br>
  328. <code>
  329. (gdb) monitor reset<br>
  330. (gdb) monitor reg pc 0x100000<br>
  331. pc (/32): 0x00100000<br>
  332. (gdb) continue
  333. </code>
  334. </td>
  335. <td>The breakpoint should be reached, typical output:<br>
  336. <code>
  337. Continuing.<br>
  338. <br>
  339. Breakpoint 1, main () at src/main.c:69<br>
  340. 69 DWORD a = 1;<br>
  341. </code>
  342. </td>
  343. <td>PASS/FAIL</td>
  344. </tr>
  345. <tr>
  346. <td><a name="DBG007"/>DBG007</td>
  347. <td>Fill in!</td>
  348. <td>Fill in!</td>
  349. <td>Single step in ROM</td>
  350. <td>Flash the test_rom.elf application and set a breakpoint in main, use DBG005. Make this test after FLA004 has passed</td>
  351. <td>Be sure that <code>gdb_memory_map</code> and <code>gdb_flash_program</code> are enabled. In GDB, type <br>
  352. <code>
  353. (gdb) monitor reset<br>
  354. (gdb) load<br>
  355. Loading section .text, size 0x194 lma 0x100000<br>
  356. Start address 0x100040, load size 404<br>
  357. Transfer rate: 179 bytes/sec, 404 bytes/write.<br>
  358. (gdb) monitor arm7_9 force_hw_bkpts enable<br>
  359. force hardware breakpoints enabled<br>
  360. (gdb) break main<br>
  361. Breakpoint 1 at 0x100134: file src/main.c, line 69.<br>
  362. (gdb) continue<br>
  363. Continuing.<br>
  364. <br>
  365. Breakpoint 1, main () at src/main.c:69<br>
  366. 69 DWORD a = 1;<br>
  367. (gdb) step
  368. </code>
  369. </td>
  370. <td>The breakpoint should be reached, typical output:<br>
  371. <code>
  372. target state: halted<br>
  373. target halted in ARM state due to single step, current mode: Supervisor<br>
  374. cpsr: 0x60000013 pc: 0x0010013c<br>
  375. 70 DWORD b = 2;<br>
  376. </code>
  377. </td>
  378. <td>PASS/FAIL</td>
  379. </tr>
  380. </table>
  381. <H2>RAM access</H2>
  382. Note: these tests are not designed to test/debug the target, but to test functionalities!
  383. <table border=1>
  384. <tr>
  385. <td>ID</td>
  386. <td>Target</td>
  387. <td>Interface</td>
  388. <td>Description</td>
  389. <td>Initial state</td>
  390. <td>Input</td>
  391. <td>Expected output</td>
  392. <td>Pass/Fail</td>
  393. </tr>
  394. <tr>
  395. <td><a name="RAM001"/>RAM001</td>
  396. <td>Fill in!</td>
  397. <td>Fill in!</td>
  398. <td>32 bit Write/read RAM</td>
  399. <td>Reset init is working</td>
  400. <td>On the telnet interface<br>
  401. <code> > mww ram_address 0xdeadbeef 16<br>
  402. > mdw ram_address 32
  403. </code>
  404. </td>
  405. <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>
  406. <code>
  407. > mww 0x0 0xdeadbeef 16<br>
  408. > mdw 0x0 32<br>
  409. 0x00000000: deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef<br>
  410. 0x00000020: deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef<br>
  411. 0x00000040: e1a00000 e59fa51c e59f051c e04aa000 00080017 00009388 00009388 00009388<br>
  412. 0x00000060: 00009388 0002c2c0 0002c2c0 000094f8 000094f4 00009388 00009388 00009388<br>
  413. </code>
  414. </td>
  415. <td>PASS/FAIL</td>
  416. </tr>
  417. <tr>
  418. <td><a name="RAM001"/>RAM001</td>
  419. <td>Fill in!</td>
  420. <td>Fill in!</td>
  421. <td>16 bit Write/read RAM</td>
  422. <td>Reset init is working</td>
  423. <td>On the telnet interface<br>
  424. <code> > mwh ram_address 0xbeef 16<br>
  425. > mdh ram_address 32
  426. </code>
  427. </td>
  428. <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>
  429. <code>
  430. > mwh 0x0 0xbeef 16<br>
  431. > mdh 0x0 32<br>
  432. 0x00000000: beef beef beef beef beef beef beef beef beef beef beef beef beef beef beef beef<br>
  433. 0x00000020: 00e0 0000 021c 0000 0240 0000 026c 0000 0288 0000 0000 0000 0388 0000 0350 0000<br>
  434. >
  435. </code>
  436. </td>
  437. <td>PASS/FAIL</td>
  438. </tr>
  439. <tr>
  440. <td><a name="RAM003"/>RAM003</td>
  441. <td>Fill in!</td>
  442. <td>Fill in!</td>
  443. <td>8 bit Write/read RAM</td>
  444. <td>Reset init is working</td>
  445. <td>On the telnet interface<br>
  446. <code> > mwb ram_address 0xab 16<br>
  447. > mdb ram_address 32
  448. </code>
  449. </td>
  450. <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>
  451. <code>
  452. > mwh 0x0 0x0 16<br>
  453. > mwb ram_address 0xab 16<br>
  454. > mdb ram_address 32<br>
  455. 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>
  456. >
  457. </code>
  458. </td>
  459. <td>PASS/FAIL</td>
  460. </tr>
  461. </table>
  462. <H2>Flash access</H2>
  463. <table border=1>
  464. <tr>
  465. <td>ID</td>
  466. <td>Target</td>
  467. <td>Interface</td>
  468. <td>Description</td>
  469. <td>Initial state</td>
  470. <td>Input</td>
  471. <td>Expected output</td>
  472. <td>Pass/Fail</td>
  473. </tr>
  474. <tr>
  475. <td><a name="FLA002"/>FLA002</td>
  476. <td>Fill in!</td>
  477. <td>Fill in!</td>
  478. <td>flash fillw</td>
  479. <td>Reset init is working, flash is probed</td>
  480. <td>On the telnet interface<br>
  481. <code> > flash fillw 0x1000000 0xdeadbeef 16
  482. </code>
  483. </td>
  484. <td>The commands should execute without error. The output looks like:<br>
  485. <code>
  486. wrote 64 bytes to 0x01000000 in 11.610000s (0.091516 kb/s)
  487. </code><br>
  488. To verify the contents of the flash:<br>
  489. <code>
  490. > mdw 0x1000000 32<br>
  491. 0x01000000: deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef<br>
  492. 0x01000020: deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef<br>
  493. 0x01000040: ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff<br>
  494. 0x01000060: ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff
  495. </code>
  496. </td>
  497. <td>PASS/FAIL</td>
  498. </tr>
  499. <tr>
  500. <td><a name="FLA003"/>FLA003</td>
  501. <td>Fill in!</td>
  502. <td>Fill in!</td>
  503. <td>Flash erase</td>
  504. <td>Reset init is working, flash is probed</td>
  505. <td>On the telnet interface<br>
  506. <code> > flash erase_address 0x1000000 0x2000
  507. </code>
  508. </td>
  509. <td>The commands should execute without error.<br>
  510. <code>
  511. erased address 0x01000000 length 8192 in 4.970000s
  512. </code>
  513. To check that the flash has been erased, read at different addresses. The result should always be 0xff.
  514. <code>
  515. > mdw 0x1000000 32<br>
  516. 0x01000000: ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff<br>
  517. 0x01000020: ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff<br>
  518. 0x01000040: ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff<br>
  519. 0x01000060: ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff
  520. </code>
  521. </td>
  522. <td>PASS/FAIL</td>
  523. </tr>
  524. <tr>
  525. <td><a name="FLA004"/>FLA004</td>
  526. <td>Fill in!</td>
  527. <td>Fill in!</td>
  528. <td>Loading to flash from GDB</td>
  529. <td>Reset init is working, flash is probed, connectivity to GDB server is working</td>
  530. <td>Start GDB using a ROM elf image, eg: arm-elf-gdb test_rom.elf. <br>
  531. <code>
  532. (gdb) target remote ip:port<br>
  533. (gdb) monitor reset<br>
  534. (gdb) load<br>
  535. Loading section .text, size 0x194 lma 0x100000<br>
  536. Start address 0x100040, load size 404<br>
  537. Transfer rate: 179 bytes/sec, 404 bytes/write.
  538. (gdb) monitor verify_image path_to_elf_file
  539. </code>
  540. </td>
  541. <td>The output should look like:<br>
  542. <code>
  543. verified 404 bytes in 5.060000s
  544. </code><br>
  545. The failure message is something like:<br>
  546. <code>Verify operation failed address 0x00200000. Was 0x00 instead of 0x18</code>
  547. </td>
  548. <td>PASS/FAIL</td>
  549. </tr>
  550. </table>
  551. </body>
  552. </html>