Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
boards:sbc:multicomp:cycloneii-c:start [2018/07/19 17:17]
nealcrook [Downloads]
boards:sbc:multicomp:cycloneii-c:start [2018/08/28 16:21] (current)
nealcrook More details for debugging memory problems
Line 286: Line 286:
 Test the Serial A RS232 port. Use a "​straight"​ male-to-female cable (wire 2-2, 3-3, 5-5 as a minimum) to connect to a VT100.. or a terminal emulator. Configure the terminal for 115200baud, 8 data bits, 1 stop bit, no flow control. Press reset with the VDUFFD0 jumper fitted; the CamelForth message should be displayed on the monitor, and you should be able to interact with CamelForth using the terminal. Test the Serial A RS232 port. Use a "​straight"​ male-to-female cable (wire 2-2, 3-3, 5-5 as a minimum) to connect to a VT100.. or a terminal emulator. Configure the terminal for 115200baud, 8 data bits, 1 stop bit, no flow control. Press reset with the VDUFFD0 jumper fitted; the CamelForth message should be displayed on the monitor, and you should be able to interact with CamelForth using the terminal.
  
-<note important>​I made the mistake of fitting a male connector on my PCB, to match my female-to-female null-MoDem cable. The fix to this is to wire a female (F) connector back-to-back with a male (M) connector, wired F1-M5, F4-M3  F3-M2</​note>​+<note important>​I made the mistake of fitting a male connector on my PCB, to match my female-to-female null-MoDem cable. The fix to this is to wire a female (F) connector back-to-back with a male (M) connector, wired F1-M5, F4-M3 F3-M2</​note>​
  
 Test the external memory. CamelForth uses RAM internal to the FPGA, in the address range 0x0000-0x07FF. The ROM and I/O occupy address range 0xD000-0xFFFF. All the rest of the memory space is RAM. Test the external memory. CamelForth uses RAM internal to the FPGA, in the address range 0x0000-0x07FF. The ROM and I/O occupy address range 0xD000-0xFFFF. All the rest of the memory space is RAM.
  
-Run a single pass memory test like this:+Run a single pass memory test like this (note PASS - singular):
  
 <​code>​ <​code>​
Line 297: Line 297:
 </​code>​ </​code>​
  
-Or 16 (0x10) passes like this:+Or 16 (0x10) passes like this (note PASSES - plural):
  
 <​code>​ <​code>​
Line 314: Line 314:
  
 <​code>​ <​code>​
-simple memory test +simple memory test 
-: STUP  ​\ ​start-addr end-addr -- start-addr end-addr+: STUP 
 +start-addr end-addr -- start-addr end-addr
   2DUP SWAP DO I DUP      ! CELL +LOOP ;   2DUP SWAP DO I DUP      ! CELL +LOOP ;
-: STUPI start-addr end-addr -- start-addr end-addr+: STUPI 
 +start-addr end-addr -- start-addr end-addr
   2DUP SWAP DO I NEGATE I ! CELL +LOOP ;   2DUP SWAP DO I NEGATE I ! CELL +LOOP ;
  
-: TSTUP  ​\ ​start-addr end-addr -- start-addr end-addr+: TSTUP 
 +start-addr end-addr -- start-addr end-addr
   2DUP SWAP DO I DUP @      <> IF   2DUP SWAP DO I DUP @      <> IF
   ." ​ Error@"​ I U. THEN CELL +LOOP ;   ." ​ Error@"​ I U. THEN CELL +LOOP ;
-: TSTUPI ​start-addr end-addr -- start-addr end-addr+: TSTUPI 
 +start-addr end-addr -- start-addr end-addr
   2DUP SWAP DO I NEGATE I @ <> IF   2DUP SWAP DO I NEGATE I @ <> IF
   ." ​ Error@"​ I U. THEN CELL +LOOP ;   ." ​ Error@"​ I U. THEN CELL +LOOP ;
Line 330: Line 334:
 : PASSES 0 DO ." ." PASS LOOP ;  ( do N passes) : PASSES 0 DO ." ." PASS LOOP ;  ( do N passes)
 </​code>​ </​code>​
 +
 +Even if you don't know FORTH you should be able to see how definitions build on earlier (older) definitions. STUP does an incrementing memory fill where each pair of bytes contain their address (and TSTUP checks that pattern and reports errors); STUPI does an incrementing memory fill where each pair of bytes contain the 1-s complement (inverse) of their address (and TSTUPI checks that pattern and reports errors).
  
 If the memory test fails, try reading and writing a small group of locations and try to infer what's wrong: If the memory test fails, try reading and writing a small group of locations and try to infer what's wrong:
Line 348: Line 354:
 1000 30 DUMP       ( DISPLAY MEMORY FROM 1000 FOR 30 BYTES) 1000 30 DUMP       ( DISPLAY MEMORY FROM 1000 FOR 30 BYTES)
  
-( LOOK FOR DUPLICATE VALUES IN THE DUMP. REPEAT THE DUMP, CHANGING THE RANGE. TRY USING STUPI TO FILL IN THE OPPOSITE DIRECTION)+( LOOK FOR DUPLICATE VALUES IN THE DUMP. REPEAT THE DUMP, CHANGING THE RANGE. TRY USING STUPI TO FILL WITH INVERSE VALUES)
 </​code>​ </​code>​
 +
 +You can also use STUP and DUMP to fill/​inspect memory. For example:
 +
 +<​code>​
 +
 +OK 1000 1080 STUP 1000 80 DUMP
 +1000  10 00 10 02 10 04 10 06  10 08 10 0A 10 0C 10 0E  ................
 +1010  10 10 10 12 10 14 10 16  10 18 10 1A 10 1C 10 1E  ................
 +1020  10 20 10 22 10 24 10 26  10 28 10 2A 10 2C 10 2E  . ."​.$.&​.(.*.,​..
 +1030  10 30 10 32 10 34 10 36  10 38 10 3A 10 3C 10 3E  .0.2.4.6.8.:​.<​.>​
 +1040  10 40 10 42 10 44 10 46  10 48 10 4A 10 4C 10 4E  .@.B.D.F.H.J.L.N
 +1050  10 50 10 52 10 54 10 56  10 58 10 5A 10 5C 10 5E  .P.R.T.V.X.Z.\.^
 +1060  10 60 10 62 10 64 10 66  10 68 10 6A 10 6C 10 6E  .`.b.d.f.h.j.l.n
 +1070  10 70 10 72 10 74 10 76  10 78 10 7A 10 7C 10 7E  .p.r.t.v.x.z.|.~
 +OK 1000 1080 STUPI 1000 80 DUMP
 +1000  F0 00 EF FE EF FC EF FA  EF F8 EF F6 EF F4 EF F2  ................
 +1010  EF F0 EF EE EF EC EF EA  EF E8 EF E6 EF E4 EF E2  ................
 +1020  EF E0 EF DE EF DC EF DA  EF D8 EF D6 EF D4 EF D2  ................
 +1030  EF D0 EF CE EF CC EF CA  EF C8 EF C6 EF C4 EF C2  ................
 +1040  EF C0 EF BE EF BC EF BA  EF B8 EF B6 EF B4 EF B2  ................
 +1050  EF B0 EF AE EF AC EF AA  EF A8 EF A6 EF A4 EF A2  ................
 +1060  EF A0 EF 9E EF 9C EF 9A  EF 98 EF 96 EF 94 EF 92  ................
 +1070  EF 90 EF 8E EF 8C EF 8A  EF 88 EF 86 EF 84 EF 82  ................
 +OK
 +</​code>​
 +
 +(typing the commands in this way will leave extra stuff on the stack, which you can ignore or clean up with ABORT. It makes the examples self-contained).
  
 If the RAM appears to fail catastrophically,​ try removing it and see if you get the same behaviour. If you do, what you're seeing is just capacitance. Either the RAM is faulty or, more likely, you have set the jumpers wrongly (Ahem, I did exactly that and it took me ages to realise my mistake). If the RAM appears to fail catastrophically,​ try removing it and see if you get the same behaviour. If you do, what you're seeing is just capacitance. Either the RAM is faulty or, more likely, you have set the jumpers wrongly (Ahem, I did exactly that and it took me ages to realise my mistake).
Line 357: Line 390:
 The most likely RAM problems are a short or open or a bent pin or bad jumpers. If you get stuck, go to to the forum and ask for help. The most likely RAM problems are a short or open or a bent pin or bad jumpers. If you get stuck, go to to the forum and ask for help.
  
-If you have a RAM problem, you might suspect a faulty PCB. Although this is possible, it's very unlikely. At least five batches of these boards have been manufactured,​ by multiple companies, with no apparent problems and the boards themselves are individually electrically tested.+If you have a RAM problem, you might suspect a faulty PCB. Although this is possible, it's very unlikely. At least 12 batches of these boards have been manufactured,​ by multiple companies, with no apparent problems and the boards themselves are individually electrically tested.
  
 Test the "​Drive"​ LED. With no SDcard fitted, type this: Test the "​Drive"​ LED. With no SDcard fitted, type this:
Line 374: Line 407:
 0 200 SDRD 0 200 SDRD
 200 80 DUMP 200 80 DUMP
-</​code> ​+</​code>​
  
 The 2nd line inspects the current contents of memory from 0x200-0x27F. The 3rd line loads block 0 (512 bytes in size) from the SDcard to RAM at address 0x200. The 4th line shows the final contents of memory. Assuming the SDcard is not filled with 0, you will see the memory contents change between the first and the second DUMP. The 2nd line inspects the current contents of memory from 0x200-0x27F. The 3rd line loads block 0 (512 bytes in size) from the SDcard to RAM at address 0x200. The 4th line shows the final contents of memory. Assuming the SDcard is not filled with 0, you will see the memory contents change between the first and the second DUMP.
  
-If the system hangs when you press return after the SDRD, the SDcard is not recognised or there is a connection problem. ​+If the system hangs when you press return after the SDRD, the SDcard is not recognised or there is a connection problem.
  
 Once everything is working, you can reprogram the FPGA with the full image - this uses the external RAM, which frees up internal RAM on the FPGA so that the VDU can be configured for 80-column operation. Once everything is working, you can reprogram the FPGA with the full image - this uses the external RAM, which frees up internal RAM on the FPGA so that the VDU can be configured for 80-column operation.
  
 <note important>​If the system does not boot with the full image, go back to the minimal image and test the memory. This is really the only thing that can be causing a problem</​note>​ <note important>​If the system does not boot with the full image, go back to the minimal image and test the memory. This is really the only thing that can be causing a problem</​note>​
 +
  
 ===== Preparing an SDcard (6809 system) ===== ===== Preparing an SDcard (6809 system) =====
boards/sbc/multicomp/cycloneii-c/start.txt · Last modified: 2018/08/28 16:21 by nealcrook
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0