Commit e8aea1a8 authored by Miguel Jimenez Lopez's avatar Miguel Jimenez Lopez

doc: Updated with remote configuration spec section

parent 88780b8c
% WR SPEC Starting Kit
% Benoit RAT, Jose Jimenez, Javier Diaz (Seven Solutions)
% Benoit RAT, Jose Jimenez, Javier Diaz (Seven Solutions) & Miguel Jimenez (UGR)
Introduction
=============
......@@ -1328,6 +1328,115 @@ on the EEPROM to boot in grandmaster mode.
Please refer to *Writing EEPROM and calibration* Section of the [wrpc.pdf] document.
Remote configuration of SPEC card
--------------------
You can also use SPEC card in standalone mode as we have seen before but... how can you configure spec card if you
do not use drivers? In wr-nic project, Etherbone core has been added to design and it allows to you configure
memory map with UDP/TCP packets. To ease this function, we have added a eb-mem script in scripts folder. This tool
uses Etherbone tools to connect with device and perform read/write operations.
~~~~~~{.sh}
## It shows you Device memory map
eb-mem.sh --scan --ip 10.10.10.10
## Read a memory address
eb-mem.sh --read --ip 10.10.10.10 --address 0x62000
## Write a memory address
eb-mem.sh --write --ip 10.10.10.10 --address 0x62000 --value 0x01
## Show help
eb-mem.sh --help
~~~~~~~~~~~~~
eb-mem can be used to configure DIO FMC card.
~~~~~~{.bash}
## Generate an inmediate pulse with max width
pulse_imm() {
ip=$1
ch=$2
len=$3
addr=0x62348
offset[0]=0x00
offset[1]=0x04
offset[2]=0x08
offset[3]=0x0c
offset[4]=0x10
addr=$(($addr+${offset[$ch]}))
eb-mem.sh --write --ip $ip --address $addr --value $len
addr=0x6235c
val=0xffffffff
mask[0]=0x01
mask[1]=0x02
mask[2]=0x04
mask[3]=0x08
mask[4]=0x10
val=$(($val & ${mask[$ch]}))
eb-mem.sh --write --ip $ip --address $addr --value $val
}
pulse_imm 10.10.10.10 1 0xffffffff
## Configure channel 1 as Output
config_ch_o() {
ip=$1
ch=$2
mask1[0]=0xfffffffc
mask1[1]=0xffffffcf
mask1[2]=0xfffffcff
mask1[3]=0xffffcfff
mask1[4]=0xfffcffff
mask2[0]=0x01
mask2[1]=0x10
mask2[2]=0x100
mask2[3]=0x1000
mask2[4]=0x10000
mask3[0]=0xfffffffb
mask3[1]=0xffffffbf
mask3[2]=0xfffffbff
mask3[3]=0xffffbfff
mask3[4]=0xfffbffff
eb-mem.sh --read --ip $ip --address 0x6233c > value.txt
value=`cat value.txt`
value=0x$value
value=$(($value & ${mask1[$ch]}))
eb-mem.sh --write --ip $ip --address 0x6233c --value $value
eb-mem.sh --read --ip $ip --address 0x6233c > value.txt
value=`cat value.txt`
value=0x$value
value=$(($value | ${mask2[$ch]}))
eb-mem.sh --write --ip $ip --address 0x6233c --value $value
eb-mem.sh --read --ip $ip --address 0x6233c > value.txt
value=`cat value.txt`
value=0x$value
value=$(($value & ${mask3[$ch]}))
eb-mem.sh --write --ip $ip --address 0x6233c --value $value
}
config_ch_o 10.10.10.10 1
~~~~~~~~~~~~~
FAQS & Bugs
============
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment