General Elog -- 18:53:10 Thu Sep 15 2005

People: bill


Start of File Notes:  new file


Thu Sep 15 18:56:40
ap2bpm oac runs on dae02 

prstat -L -i 2 
to look at thread cpu usage 

do -> threads and dumps to file 
lists thread info to dae.log 

netstat | grep 5901 
can tell you who else is looking at your vnc session 

create a file called 'javaworkpath' 
containing the line 
'/export/users/ashmansk' 
this directory can be written by ashmansk on nova, 
e.g. to put in diagnostic/debug changes without cvs, 
new release, etc. 

 - 
Thu Sep 15 19:15:07
ap2bpm oac still needs a good 'restart' device. 
 - 
Fri Sep 16 10:32:13
D:BPI10D setup (written down by Keith) 

CF 53.1016 MHz 
VBW 30 Hz 
RBW 1 kHz 
SWP 500 ms 
span 0 Hz 
linear 
atten 10dB 
RL 100 uV 
 - 
Fri Sep 16 19:26:08
d:bpi10d averages 10ms starting 5ms after trigger, which is d:bpd1t7, which is nominally $80+
.44s; for rev prot $82 + .494s 

 - 
Sat Oct 8 00:56:35
testing 1 2 3
 - 
Sat Oct 8 00:58:24 testing 4 5 6 - 
Tue Nov 15 12:22:55 Sten tells me that the next board in our pipeline will use EP2C20 (cyclone II) vs EP1C6 (cyclone). Keep 240-pin quad flat pack package. Increases RAM 3x, logic 3.3x; adds hardware multipliers.  - 
Mon Feb 27 17:34:55
notes from mid-February meeting to review final component choices for ucdimm board
 - bill
Thu Mar 23 12:11:23 uCdimm demo board has arrived! (Terry is nearly done with the routing for our own uCdimm-based board.) I powered up the board, connected to its serial port at 9600 bps, and I got the expected boot prompt. After booting, the board came up on the network (the private network in my office, for now), and I was able to telnet to the board and to log into it!  - Bill
Thu Mar 23 12:32:14
[ashmansk@pbardebuncher ashmansk]$ telnet 192.168.1.200 
Trying 192.168.1.200... 
Connected to RFC1918.private.net (192.168.1.200). 
Escape character is '^]'. 
login: root 
Password:  
# ls /bin 
[             agetty        arp           basename      busybox        
cat           chmod         chown         cp            dd             
df            dhcpcd        dirname       echo          eraseall       
false         flashloader   free          gdbserver     hostname       
ifconfig      inetd         init          insmod        kill           
killall       ln            login         logname       ls             
lsmod         mii-tool-fec  mkdir         mknod         mount          
mv            ping          portmap       printbenv     printenv       
ps            pwd           qspirx        qspitest      ramloader      
reset         rm            rmmod         route         setbenv        
sh            sleep         stty          sync          telnetd        
test          touch         true          umount        xloader        
yes            
# ls /proc 
1            2            3            34           35           37            
38           4            5            6            72           73            
75           bus          cmdline      cpuinfo      devices      dma           
driver       execdomains  filesystems  fs           interrupts   iomem         
ioports      kcore        kmsg         ksyms        loadavg      locks         
mem_map      meminfo      misc         modules      mounts       net           
partitions   self         slabinfo     stat         swaps        tty           
uptime       version       
# cat /proc/meminfo 
        total:    used:    free:  shared: buffers:  cached: 
Mem:  15323136  1146880 14176256        0     4096    16384 
Swap:        0        0        0 
MemTotal:        14964 kB 
MemFree:         13844 kB 
MemShared:           0 kB 
Buffers:             4 kB 
Active:              0 kB 
Inactive:           20 kB 
HighTotal:           0 kB 
HighFree:            0 kB 
LowTotal:        14964 kB 
LowFree:         13844 kB 
SwapTotal:           0 kB 
SwapFree:            0 kB 
# 
 - 
Thu Mar 23 12:34:23
# ping 192.168.1.1 
PING 192.168.1.1 (192.168.1.1): 56 data bytes 
64 bytes from 192.168.1.1: icmp_seq=0 ttl=64 time=1.2 ms 
64 bytes from 192.168.1.1: icmp_seq=1 ttl=64 time=0.8 ms 
64 bytes from 192.168.1.1: icmp_seq=2 ttl=64 time=0.8 ms 
64 bytes from 192.168.1.1: icmp_seq=3 ttl=64 time=0.8 ms 
64 bytes from 192.168.1.1: icmp_seq=4 ttl=64 time=0.8 ms 
64 bytes from 192.168.1.1: icmp_seq=5 ttl=64 time=0.8 ms 

--- 192.168.1.1 ping statistics --- 
6 packets transmitted, 6 packets received, 0% packet loss 
round-trip min/avg/max = 0.8/0.8/1.2 ms 
# cat /proc/net/arp 
IP address       HW type     Flags       HW address            Mask     Device 
192.168.1.1      0x1         0x2         00:A0:CC:D7:86:48     *        eth0 
# 
 - 
Thu Mar 23 12:39:34
 - 
Thu Mar 23 13:28:46
Managed to recompile and reload the kernel! 

[ashmansk@pbardebuncher uClinux-dist]$ cd images/ 
[ashmansk@pbardebuncher images]$ ls -ltr 
total 1120 
-rw-rw-r--    1 ashmansk ashmansk        6 Mar 23 13:12 romfs.img 
-rw-rw-r--    1 ashmansk ashmansk  1138688 Mar 23 13:13 image.cramfs 
[ashmansk@pbardebuncher images]$ tftp 192.168.1.200 
tftp> verbose 
Verbose mode on. 
tftp> binary 
mode set to octet 
tftp> put image.cramfs 
putting image.cramfs to 192.168.1.200:image.cramfs [octet] 
Sent 1138688 bytes in 8.3 seconds [1097531 bits/sec] 
tftp> q 
[ashmansk@pbardebuncher images]$  
 - 
Thu Mar 23 15:44:12
[ashmansk@pbardebuncher ashmansk]$ telnet 192.168.1.200 
Trying 192.168.1.200... 
Connected to RFC1918.private.net (192.168.1.200). 
Escape character is '^]'. 
login: root 
Password:  
# mount -t nfs -o nolock,nfsvers=2 192.168.1.1:/export/ashmansk /mnt 
# cd /mnt 
# ls 
foobar.dat  hello       hello.txt   joshua      wja          
# cat hello.txt 
hello 
# joshua 
Greetings, Professor Falken.  Shall we play a game? 
#  
# Connection closed by foreign host. 
[ashmansk@pbardebuncher ashmansk]$  


============= 


[ashmansk@pbardebuncher myprog]$ cat joshua.c 

#include <stdio.h> 

int 
main(int argc, char **argv) 
{ 
  printf("Greetings, Professor Falken.  " 
         "Shall we play a game?\n"); 
} 
[ashmansk@pbardebuncher myprog]$ touch joshua.c 
[ashmansk@pbardebuncher myprog]$ make 
m68k-elf-gcc -I~/code/ucdimm/uClinux-dist/lib/libc/include -I~/code/ucdimm/uClinux-dist/lib/libnet
-I~/code/ucdimm/uClinux-dist -I/linux-2.4.x/include -Wl,-elf2flt -m5200 -msep-data -g -Os
-fno-builtin -fomit-frame-pointer -DCONFIG_LINEO -D__linux__ -Dlinux -Dunix -D__uClinux__ -DEMBED
-L~/code/ucdimm/uClinux-dist/lib/libc/ -L~/code/ucdimm/uClinux-dist/lib/libc/lib
-L~/code/ucdimm/uClinux-dist/lib/libnet -o joshua joshua.c -lc 

cp joshua /export/ashmansk 
[ashmansk@pbardebuncher myprog]$ pwd 
/diska7/home/ashmansk/code/ucdimm/myprog 
[ashmansk@pbardebuncher myprog]$  
 - 
Fri Mar 24 19:34:54
Today's big accomplishment: got LED to blink from user-mode code, after modifying /dev/mem
device driver (drivers/char/mem.c) not to check that address is beyond end of RAM.  (You might think
of using /dev/port instead, but it's not implemented for the Motorola architecture.) 

 - 
Tue Mar 28 14:48:41
I figured out on Saturday that the "general purpose I/O" lines that we're planning to use to
interface to the FPGA are in fact shared with the SDRAM and the flash memory.  This pretty much
rules out the kludge of simply turning control of those I/O pins over to a user-space program, since
SDRAM access happens during normal operations.  So I'm learning how to do this inside a kernel
module.  I managed to follow an online example to make a trivial kernel module, and I can compile
and load it! 


$ cat module.c 

#define MODULE 
#include <linux/module.h> 

int  
init_module(void) 
{ 
  printk("<1>Hello, world\n"); 
  return 0; 
} 

void 
cleanup_module(void) 
{ 
  printk("<1>Goodbye, cruel world\n"); 
} 

$ m68k-elf-gcc -c module.c -I/home/ashmansk/code/ucdimm/uClinux-2.4.x/include 

# cd /mnt                                                                        
# insmod module.o                                                                
Using module.o                                                                   
Hello, world                                                                     
<9>Nov 30 01:31:02 klogd: Hello, world                                           
# rmmod module                                                                   
Goodbye, cruel world                                                             
<9>Nov 30 01:31:05 klogd: Goodbye, cruel world                                   
#  
 - bill
Fri Mar 31 11:58:57
I now know how to drive the eight general-purpose I/O pins that are ordinarily used for
programmable timer I/O.  The MCF5282 manual names them GPTA0-3 and GPTB0-3.  Here's a little table
of names and pins.  (It's annoying that the names change so many times.) 


uCdimm uCdimm  CPU CPU evalBd Terry's Terry's 
 name    pin  name pin  name   name   function 
PTA0    63   GPTA0 N13  PB0    PA0    dclk 
PTA1    64   GPTA1 ?13  PB1    PA1    cfgdat 
PTA2    65   GPTA2 ?13  PB2    PA2    nconfig 
PTA3    66   GPTA3 T13  PB3    PA3    nstatus 
PTB0    67   GPTB0 N12  PB4    PB0    confdone 
PTB1    68   GPTB1 ?12  PB5    PB1    csflash 
PTB2    69   GPTB2 ?12  PB6    PB2    cntrldacld 
PTB3    70   GPTB3 T12  PB7    PB3    dsr 

The uCevolution evaluation board connects these 8 pins to 
LEDs, and I was able to drive them as outputs individually. 
 - Bill
-- Fri Mar 31 12:07:40 comment by... --  The board also has buttons on these pins, and I was able to test them also as inputs. They work. The code to do this is in ~ashmansk/code/ucdimm/myprog/hello.c .
-- Fri Mar 31 12:11:22 comment by... --  One needs to clear the GPTEN bit (bit 7) from each GPTSCR1[AB] register, to turn off timer functionality. Then the low 4 bits of the GPTDDR[AB] registers determine 0=input, 1=output for each pin. The low 4 bits of GPTPORT[AB] are the data driven out to the pins or read in from the pins. All of this can be done from user-mode code, using /dev/mem.
-- Fri Mar 31 12:30:42 comment by... --  
address map:
GPTDDR[AB]  = 0x1[AB]001E
GPTSCR1[AB] = 0x1[AB]0006
GPTPORT[AB] = 0x1[AB]001D

Fri Mar 31 12:15:47
The next pins that I need to learn to use are these: 

uCdimm uCdimm  CPU CPU evalBd Terry's Terry's  
 name    pin  name pin  name   name   function  
PTC0    71  DTOUT0 J13  PC0    PC0    udddsrst 
PTC1    72  DTOUT1 J14  PC1    PC1    udbdrst 
PTC2    73  DTIN0  J15  PC2    PC2    led1 
PTC3    74  DTIN1  J16  PC3    PC3    led2 

 - 
-- Fri Mar 31 13:21:31 comment by... --  
OK, I tested these 4 pins both as outputs and as inputs.
Here are the pertinent register definitions:

PTDPAR  = 0x10005b : set bits 7-0 to zero for digital i/o
DDRTD   = 0x100025 : bits 3-0 are 0 for input, 1 for output
PORTTD  = 0x100010 : bits 3-0 drive output values
PORTTDP = 0x100039 : bits 3-0 read input pin state


Fri Mar 31 15:14:53
Key parts of MCF5282 user's manual: 

Table 14-2 lists all i/o pins and their functions. 

Chapter 12 describes chip selects for external bus 
  and associated memory map. 

Chapter 20 describes GPT (timer i/o), which covers 
  PA & PB i/o pins. 

Chapter 26 describes GPIO. 

 - 
Mon Apr 3 18:46:57
Woo-hoo!  I figured out why I was never seeing strobes on CS1* or CS2* (chip select lines). 
They share functionality with GPIO port J, which appears to be enabled by default.  I had to turn on
bits PJPA1 and PJPA2 in register PJPAR in order to get CS1,2 to work.  Now the length of the CS
strobe responds to the wait state count, etc. 


An important clue was that I was in fact able to make the address lines jiggle at a rate that was
affected by the number of wait states, when rapidly accessing locations mapped to CS1.  Also, the
bus errors went away when I turned on auto acknowledge.  So I then began to suspect the chip select
pins themselves, rather than the memory map. 


I think this implies that I can now access all of the I/Os that I will need in order to use Terry's
board. 

 - Bill
-- Mon Apr 3 18:49:44 comment by... Bill --  Downloading the RTEMS source code and looking at its chip-select setup code was very helpful for debugging this, by the way!
Mon Apr 3 18:56:45
Potential applications for this board: 

crate CPU e.g. for AP2 BPMs 

various 1-off applications of BPMs 
  would be much easier to implement 

     - 75/79 MHz schottky 
     - mcginnis TBT readout 

potentially analyze booster beam signals 

bring more AD people on board with 
  FPGA-based instrumentation 

single-channel damper; other feedback apps. 

sophisticated test-bench signal source 

acnet/mooc fun & games 

gpib/ethernet bridge (more versatile than NI GPIB/ENET) 

 - bill
Tue Apr 4 09:59:05
Some time I'd like to look into RTAI and RTlinux.  But not now.  I also have been meaning to
ask Ted Liu what his linux PCs do to achieve "real time" performance in the CDF Level2 trigger.   

 - 
Tue Apr 4 10:00:27
My short-term to-do list for the uCdimm project was 

  - boot 
  - program 
  - check memory lines 
  - respond to OAC 
  - FPGA i/o 

I've done all of this except to respond to the OAC. 
That is a problem that has been solved several times 
before, so I won't worry about it for now. 
 - 
Tue Apr 4 13:04:44
USB 1.1 speeds: 1.5 Mb/s (low); 12 Mb/s (full) 
USB 2.0 adds 480 Mb/s (high) 

JDL thinks USB is a good choice to replace VME backplanes. 

Sten suggests MIL-STD-1553b (which controls F16 aircraft!) 

http://www.condoreng.com/support/downloads/tutorials/MIL-STD-1553Tutorial.pdf 
 - 
Tue Apr 4 14:37:53
Factoid:  the annoying "project XXX does not exist" error message when opening a samba-served
quartus project happens with quartus v4.1 but does not happen with v5.1.  I haven't tried
intermediate versions. 

 - 
Tue Apr 11 12:38:55
OTR (optical transition radiation) devices for AP1 and AP2. 

AP1 detector goes just downstream of EB6, upstream of HDP.  Pipe (4" diameter) has "OTR" written on
it.  Distance from center of beam pipe to ceiling is 24.5 inches. 


AP2 detector goes just upstream of Q728.  Existing beam pipe diameter is 5.5 inches.  Distance from
center of beam pipe to ceiling is 19 inches. 


Vic, scarpine@fnal.gov, x2571, is the OTR guy. 

Duane, newhart@fnal.gov, x6378, is dealing with the cables. 

 - 
Tue Apr 11 16:58:51 On the $50 laptop I got from fnalgrad, I have kernel 2.6.16, which includes an open source cp2101 driver. So I can talk to the USB/RS232 interface chip on the Sten boards without the proprietary driver (which used to crash my computer regularly). I also have ndiswrapper talking with the PCMCIA wifi card that's installed. Now I can use this cheap computer to go out into the field to debug misbehaving boards.  - 
Thu Apr 27 13:15:50
 - bill
Mon Jul 31 09:41:53
notes from an early mumu meeting
 - 

Security, Privacy, Legal