Archive for the ‘Teststand’ Category

We have a number of vme computers that I need to set up. All of them will be using an 8GB compact flash drive as their hard disk. The details for how to set this up are all on this page. Now, I need to install linux on a bunch of compact flash drives and was looking for a way to clone one after I’d set it up how I wanted. Since I normally use a mac laptop, I also wanted to be able to use that. Here’s what I did.

First, install linux on one of the compact flash drives by pulling all the internal drives out of a computer and using the linux expert method. Once this is installed and all the other required software is installed, use dd to make an image on my mac.

sudo dd if=/dev/disk2 of=~/Desktop/crate.img

I know the input is /dev/disk2 because when I mount the compact flash drive, it would show as:

/dev/disk2s3    6.9G   1.6G   5.0G    24%    /Volumes/:
/dev/disk2s1    101M   9.1M    87M    10%    /Volumes/:boot

The s3 is the partition for / and s1 is the partition for /boot. (s2 would also be the swap partition.) Since I want to copy the entire disk and not each partition, I use /dev/disk2.

Using dd to copy the disk takes a long time, but it can be left unattended. You can check that it’s working by doing a listing of ~/Desktop/crate.img. The size will slowly be increasing.

Once the image has been created, prepare a new compact flash drive to use for the clone. The key here is that the partition on the drive must first be deleted. I used Disk Utility for this.

Here’s how the new compact flash card looked when I attached it to my laptop.

I needed to delete that KINGSTON partition to be able to copy my image back. Change the Volume Scheme to 1 Partition and then format it with Free Space.

The disk is now still connected to the laptop, but it has no partitions, so nothing is mounted. Now use the dd command again to copy the image to the new compact flash card.

sudo dd of=/dev/disk2 if=crate.img

Again, it takes a long time, but when it’s done, I can put the card in the vme crate and it boots successfully. I just need to ok any new hardware changes it finds and configure a new ip address for it.

gcc vme7700_blocktransfer_dma.c -lvme -o outputfile

Bilbo is the teststand computer. There is another one as well, but bilbo is the main one that we use.

If it can be pinged, then you should be able to use the vme program (I don’t know who wrote it) to communicate between boards on the crate.

Here is an example. A TDC board is in slot 16. Issue the following command to read from memory:

vme bilbo read 16 0

The output of this command should be deadbe00.

You can also write (and turn on a light on the front panel) with:

vme bilbo write 3c 1

Since MaxPlusII is no longer maintained, we need to use Quartus to program our chips. We have some very old MaxPlusII files that we need to recompile (after making changes) and then use to program some chips.

Some notes on the process:

-File -> Convert Programming Files is where you create a single .pof file from our collection of .sof files.

Then just use the programmer to put it on the chip.

Starting over by creating an entirely new project.

mkdir ~/fdaq/v3mary
cp -r /fnal/ups/prd/cdfvme_teststand/v1_1/NULL/* .
./newTestStand fdaq pfred pfredsumet

Edit ups/fdaq.table and remove any -native flags

ups declare -f NULL -r $PWD -M ups -m fdaq.table fdaq v3mary
setup fdaq v3mary

In fdaq, run

grep swing *

In all the files that come up, edit them so that any line that reads:
import com.sun.java.swing…
reads as
import javax.swing…

Back in $FDAQ_DIR, run gmake.

Now it’s complaining about the pfred package not being here. So go back to your home area and do the setup for pfred.

mkdir pfred
mkdir pfred/v3mary
cd pfred/v3mary
cp -r /fnal/ups/prd/cdfvme_template/v1.1/* .
./newPackage pfred pfredsumet
ups declare -f NULL -r $PWD -M ups -m pfred.table pfred v3mary
setup pfred v3mary

Edit the pfred/*java files for com.sun.java.swing and change to javax.swing

gmake

We’re back to this error of getting:

g -I/fnal/ups/prd/cdfvme_common/Linux+2/v3.0/server/crate -I/fnal/ups/prd/robin/v2_4_10/NULL/include -I/fnal/ups/prd/fision/v2_16/include                                                  pfredsumet_able.c -o ../lib///pfredsumet_able.o
gmake[1]: g: Command not found

I’m sure this should be gcc commands running, but I don’t know why they’re not.

I edited the file make.rules and changed:

[maryh@blue server]$ diff make.rules make.rules.ORIG 
8c8
< CFLAGS = gcc -g -I$(CDFVME_COMMON_DIR)/server/crate \
---
> CFLAGS = -g -I$(CDFVME_COMMON_DIR)/server/crate \

Now I get an error about vxWorks.h: No such file or directory

I’d like to just setup vxworks, but it hasn’t been declared.

I tried a bunch of different ways of declaring vxworks, but I always get errors when I try to run setup vxworks (and I tried a bunch of different parameters after this). So, my main problem is that gmake can’t find vxWorks.h when compiling. This file is in /fnal/ups/prd/vxworks/v5_3b/target/h. I should be able to manually add this directory and all will be good.

Tried manually setting CFLAGS and CPPFLAGS to the h directory above, but it didn’t matter.

Got desperate. In /fnal/ups/prd/vxworks/v5_3c/ups/vxworks-powerpc.table, commented out this line:

# setupRequired(“-H VxWorks+5.3.1 vxworks_powerpc ${UPS_PROD_VERSION}”)

ups declare -f NULL -H VxWorks+5.3 -q ppc -r $PWD -M ups -m vxworks-powerpc.table vxworks v5_3c -c
setup vxworks -q ppc

Ok, now we’re getting somewhere. UNMAKE the change to make.rules because got some other weirdness with the gcc commands.

Now things ran for a bit before we got errors. Here is the part of the output that concerns me:

cd ../..; ridl -repository=server/interface_rep -language=Java-client -JavaPrefix=pfred server/pfredsumet/pfredsumetVme.idl
../extendBoard pfredsumet
../extendBoard pfredsumetClient
../addDummyConstructor pfredsumetClient
javac pfredsumet.java
javac pfredsumetClient.java
pfredsumetClient.java:86: cannot find symbol
symbol  : method _get_implementation()
location: interface org.omg.CORBA.Object
    return( ourObject._get_implementation() );
                     ^
pfredsumetClient.java:90: cannot find symbol
symbol  : method _get_interface()
location: interface org.omg.CORBA.Object
    return( ourObject._get_interface() );
                     ^
pfredsumetClient.java:105: cannot find symbol
symbol  : method _create_request(org.omg.CORBA.Context,java.lang.String,org.omg.CORBA.NamedValue,org.omg.CORBA.ExceptionList,org.omg.CORBA.ContextList)
location: interface org.omg.CORBA.Object
    return( ourObject._create_request( ctx, operation, result, exclist, ctxlist ) );
                     ^
3 errors

This CORBA stuff is all from the robin package. I did set up the latest version of robin v2_4_10. So, I’m not sure what to do next.

We are trying to resurrect our teststand to use for testing boards, without having to take them to Fermilab to be tested. These are the notes I’m taking while attempting to get this working.

In my home directory, I am trying to compile admem. First problem is that the version of java has changed. We get lots of errors about com/sun/java/swing not being found. This is fixed by editing the java file and changing:

import com.sun.java.swing.*;
import com.sun.java.swing.text.*;

to

import javax.swing.*;
import javax.swing.text.*;

cd $ADMEM_DIR and gmake gives errors about ridl: command not found.

ridl is a robin command, so need to add setup robin to our setup_vme file. This adds /fnal/ups/prd/robin/v2_4_10/NULL/Linux-2.6-2.3.4/i686 to our path. Alas, this is not a directory, so in $ROBIN_DIR, I’m making it a link to Linux-2.0.35 which is what all the linux versions link to.

ln -s Linux-2.0.35 Linux-2.6-2.3.4

Now, in $ADMEM_DIR, we get lots of new errors.

Most of the form:

g -I/fnal/ups/prd/cdfvme_common/Linux+2/v3.0/server/crate -I/fnal/ups/prd/robin/v2_4_10/NULL/include -I/fnal/ups/prd/fision/v2_16/include                                             admem_able.c -o ../lib///admem_able.o
gmake[1]: g: Command not found

This looks to me like it’s trying to run gcc, but is only using g on the command line. This appears to be coming from the GNUmakefile in server/admem.