Special Operations
How to directly command a JINF/TDR:
- Go to ~/TrackerUser/AMSWireCommands/ of the "tracker" user
- here you can find the program TESTjmdc
this is a program that let talk to JINJ boards and to all the nodes after it
The syntax for this program is:
./TESTjmdc port amsw_node cmd arg1 arg2 ...
- port
- amsw_node is the address (in AMSWire scheme, NOT in JMDC scheme!!! You can refer to the table below...) of the node you want talk to:
Node address examples:
JINJ-itself = ffff
JINF-T0 = 033f
TDR-0-00-A (T0 TDR00) = 003f033f
TDR-4-10-B (T4 TDR21) = 153f103f
AllTDR-7 = 4000173f
- cmd is the command to send to the node (from Kounine document
)
Examples of Command (from Kounine document
):
Read Status: C [no pars]
Read Flash: 7 [no pars]
Read last Event Number: 2 [no pars]
- args are the parameters you want to pass to cmd
you can pass how many args (command's parameters) you need
- numbers must be written in hex
|
|
|
|
|
JINJ |
|
JMDC |
|
X |
Y |
Z |
OCT |
Crate |
ADDR |
NUM |
A |
B |
P |
S |
|
+ |
WAKE |
+ |
1 |
T0 |
0x033f |
03 |
0xA6 |
0xA7 |
0xA8 |
0xA9 |
|
- |
WAKE |
+ |
2 |
T1 |
0x093f |
09 |
0xAA |
0xAB |
0xAC |
0xAD |
|
- |
RAM |
+ |
4 |
T2 |
0x003f |
00 |
0xAE |
0xAF |
0xB0 |
0xB1 |
|
+ |
RAM |
+ |
3 |
T3 |
0x013f |
01 |
0xB2 |
0xB3 |
0xB4 |
0xB5 |
|
+ |
WAKE |
- |
5 |
T4 |
0x103f |
16 |
0xB6 |
0xB7 |
0xB8 |
0xB9 |
|
- |
WAKE |
- |
6 |
T5 |
0x113f |
17 |
0xBA |
0xBB |
0xBC |
0xBD |
|
- |
RAM |
- |
8 |
T6 |
0x163f |
22 |
0xBE |
0xBF |
0xC0 |
0xC1 |
|
+ |
RAM |
- |
7 |
T7 |
0x173f |
23 |
0xC2 |
0xC3 |
0xC4 |
0xC5 |
|
Filenames convention and history:
The dsp codes are stored in :
/home/ams/TrackerUser/AMSWireCommands/DspCodes/
the file name has to be
file_ node _ name.dat
where:
- node = tdr, jinft, jinj, jlvl1
- name = versnumber = same name as in Philipp list i.e. 3ee3, MUST be THE SAME as the first line in the contents of the file itself.
How to Load a new JINF-T/TDR firmware
- Get the new dsp code in : /home/ams/TrackerUser/AMSWireCommands/DspCodes/file_ node _ name.dat
- copy the file as file.dat in : /home/ams/TrackerUser/AMSWireCommands/
- edit the first line of the file.dat and set it as:
- 29F2 if it will be the default file for JINF-T
- 29F3 if it will be the default file for TDR
- WHEN WRITING SOFTWARE ON JINF-T REMEMBER TO REPEAT THE SAME OPERATION ALSO ON THE OTHER SIDE JINF
- REMEMBER: when a DSP code is written in the flash it will be effectively used only if it is loaded in memory with the right command (AMSWire 0x46).
- There are useful scripts:
- DeleteFlashFileOnAllnodes.sh port# filename#
where node=TDR,JINF
- a - WriteFlashFileOnAllnodesFromHere.sh port# filename#
where node=TDR,JINF
It loads file.dat from the current directory, read back the flash content and
checks that filename# is in the flash memory.
b - WriteFlashFileOnAllnodesFromDSPCodes.sh port# filename#
where node=TDR,JINF
checks for file_ node _ name.dat in the /DspCodes directory and copies it in file.dat in current directory before uploading.
- SetDefaultFlashFileOnAllnodes.sh port# filename# #status
where node=TDR,JINF
looks for the filename in the flash and if it is found and set the default bit according to #status
status=1 set it to default (from 3xxx to 2xxx, from 7xxx to 6xxx)
status=0 downgrade from default
- LoadFlashFileOnAllnodes #port #filename
runs the #filename on all nodes
- WriteANewnodesCodeOnAllnodesFromHereAndSetAsDefault.sh port# new_filename# old_filename#
- WriteANewnodesCodeOnAllnodesFromDSPCodesAndSetAsDefault.sh port# new_filename# old_filename#
Performs either 2a or 2b on the new_filename + 3 with status=0 on old filename and 3 with status=1 + 4 on new filename.
- Output:
during the running of these script you can see two types of info/output:
if the AMSWire Command was sended without (with) problems -> rxdone=0x0000 (0x0001)
if the operations was done -> File Erased (Not Erased) / File Loaded (Not Loaded)
How to Create and Load a TDR config file:
- The stuff to create a config files, create the script to load config files, and then load config files is in:
/home/ams/TrackerUser/AMSWireCommands/ConfigurationFileTDR/
In this directory you can find all the stuff (except for TESTjmdc of which there's a simbolic link) needed for create and load configuration files for TDRs:
- ConfigFile: this is the program to create binary config files for TDRs starting from a "human readable" parameters file
(as example TDRParamFile.txt) and to create the script (LoadConfs.sh) usefull to uplaod the binary files
- LoadConfs.sh: the script that load the correct configuration file in each TDR
- TDRParamFile.txt: can be used as a template for the "human readable" parameter file for TDR
The file of parameters ("human readable file") can be filled using the TDR documentation by Philipp Azzarello
and taking into account that for "compliantness" a parameter indicated as "N" here has to written as "0 0 N"
(where the first two numbers are the Group and the SubGroup, here 0).
The script for loading the configuration file has to be called using 1 parameter
(the JMDC port to be used, i.e.
to use JINF-T-B [JMDC ports: 0,3]
to use JINF-T-A [JMDC ports: 1,2])
- The procedure has to be, the 6 thresholds for external planes HAS TO BE PASSED EXPLICITELY (Thresholds have to be passed in 'standard' way (1, 2, 3.5, ...)):
- Create a parameter file or edit the template (TDRParamFile.txt)
- ./ConfigFile TDRParamFile.txt <S1HighThresh> <S1LowThresh> <S2HighThresh> <S2LowThresh> <KHighThresh> <KLowThresh>
- ./LoadConfs.sh #port
How to Create and Load a JINF config file:
- The stuff to create a config files, create the script to load config files, and then load config files is in:
/home/ams/TrackerUser/AMSWireCommands/ConfigurationFileJINF/
In this directory you can find all the stuff (except for TESTjmdc of which there's a simbolic link)
needed for create and load configuration files for JINF-Ts:
- ConfigFile: this is the program to create binary config files for JINF-Ts starting from a "human readable" parameters file
(as example JINFParamFile_X.txt, with X is the crate number in [0-8])
and to create the script (LoadConfs_X.sh, with X is the crate number in [0-8])
usefull to uplaod the binary files
- LoadConfs_X.sh: the script that load the correct configuration file in JINF-T number X
- LoadConfs.sh: the script that load the correct configuration file in each JINF-T
- JINFParamFile_X.txt: can be used as a template for the "human readable" parameter file for JINF-T X
8 different configuration files are created for the 8 crates/JINFs (for now all equals except for crate/JINF 4 [PowerGroup3 with Bias 60V]).
The file of parameters ("human readable file") can be filled using the JINF documentation by Kounine or the JINF-T one by Philipp Azzarello.
- The procedure has to be
- to change and load the config file only for the JINF-T X using JINJ NN and JINJ MM to talk with JINF-T A and JINF-T B:
1. Create a parameter file or edit the template (JINFParamFile_X.txt)
2. ./ConfigFile JINFParamFile_X.txt NN MM
3. ./LoadConfs_X.sh
- to change and load the config file on all JINF-Ts using JINJ NN and JINJ MM to talk with JINF-T's A and JINF-T's B:
1. Edit the template parameter files (JINFParamFile_X.txt)
2. ./LoadConfs.sh NN MM
--
PaoloZuccon - 03-Dec-2009