Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
Conv TTL RS485 - Testing
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
3
Issues
3
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
Conv TTL RS485 - Testing
Commits
8fa136a0
Commit
8fa136a0
authored
Nov 05, 2014
by
Theodor-Adrian Stana
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sw: Work on flash chip test
parent
22fb2160
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
143 additions
and
26 deletions
+143
-26
Makefile
pts/Makefile
+18
-13
flash.py
pts/python/flash.py
+106
-0
pts.py
pts/python/pts.py
+15
-13
flash
pts/shell/flash
+4
-0
No files found.
pts/Makefile
View file @
8fa136a0
...
@@ -7,7 +7,8 @@ all:
...
@@ -7,7 +7,8 @@ all:
mkdir
-p
pts-conv-ttl-rs485/tests
mkdir
-p
pts-conv-ttl-rs485/tests
mkdir
-p
pts-conv-ttl-rs485/lib
mkdir
-p
pts-conv-ttl-rs485/lib
cp
-r
shell/ pts-conv-ttl-rs485/
cp
-r
shell/ pts-conv-ttl-rs485/
mv
pts-conv-ttl-rs485/shell/program pts-conv-ttl-rs485/boot
cp
pts-conv-ttl-rs485/shell/program pts-conv-ttl-rs485/boot
cp
pts-conv-ttl-rs485/shell/flash pts-conv-ttl-rs485/boot
cp
python/pts.py pts-conv-ttl-rs485
cp
python/pts.py pts-conv-ttl-rs485
cp
python/jpts.py pts-conv-ttl-rs485
cp
python/jpts.py pts-conv-ttl-rs485
cp
python/vv_pts.py pts-conv-ttl-rs485/lib/
cp
python/vv_pts.py pts-conv-ttl-rs485/lib/
...
@@ -24,6 +25,7 @@ all:
...
@@ -24,6 +25,7 @@ all:
cp
python/ttl_pulse_switch.py
pts-conv-ttl-rs485/tests/
cp
python/ttl_pulse_switch.py
pts-conv-ttl-rs485/tests/
cp
python/sfp_eeprom.py
pts-conv-ttl-rs485/tests/
cp
python/sfp_eeprom.py
pts-conv-ttl-rs485/tests/
cp
python/sfp_test.py
pts-conv-ttl-rs485/tests/
cp
python/sfp_test.py
pts-conv-ttl-rs485/tests/
cp
python/flash.py
pts-conv-ttl-rs485/tests/
ln
-s
tests/dac_vcxo_pll.py
pts-conv-ttl-rs485/test01.py
ln
-s
tests/dac_vcxo_pll.py
pts-conv-ttl-rs485/test01.py
ln
-s
tests/therm_id.py
pts-conv-ttl-rs485/test02.py
ln
-s
tests/therm_id.py
pts-conv-ttl-rs485/test02.py
...
@@ -31,8 +33,11 @@ all:
...
@@ -31,8 +33,11 @@ all:
ln
-s
tests/sfp_eeprom.py
pts-conv-ttl-rs485/test04.py
ln
-s
tests/sfp_eeprom.py
pts-conv-ttl-rs485/test04.py
ln
-s
tests/sfp_test.py
pts-conv-ttl-rs485/test05.py
ln
-s
tests/sfp_test.py
pts-conv-ttl-rs485/test05.py
ln
-s
tests/leds.py
pts-conv-ttl-rs485/test06.py
ln
-s
tests/leds.py
pts-conv-ttl-rs485/test06.py
ln
-s
tests/flash.py
pts-conv-ttl-rs485/test08.py
wget -P pts-conv-ttl-rs485/boot http
:
//www.ohwr.org/attachments/download/3648/pts.bit
wget -P pts-conv-ttl-rs485/boot http
:
//www.ohwr.org/attachments/download/3648/pts.bit
wget
-P
pts-conv-ttl-rs485/boot http://www.ohwr.org/attachments/download/3650/flash_load.bit
wget
-P
pts-conv-ttl-rs485/boot http://www.ohwr.org/attachments/download/3649/golden-v0.0_release-v1.0.bin
clean
:
clean
:
rm
-rf
pts-conv-ttl-rs485
rm
-rf
pts-conv-ttl-rs485
...
...
pts/python/flash.py
0 → 100644
View file @
8fa136a0
##_______________________________________________________________________________________________
##
## CONV-TTL-RS485 PTS
##
## CERN,BE/CO-HT
##_______________________________________________________________________________________________
##
##-----------------------------------------------------------------------------------------------
##
## CONV-TTL-RS485 flash test
##
##-----------------------------------------------------------------------------------------------
##
## Description FILL ME!!! FILL ME!!! FILL ME!!! FILL ME!!! FILL ME!!! FILL ME!!! FILL ME!!!
##
##
## Authors Julian Lewis (Julian.Lewis@cern.ch)
## Theodor-Adrian Stana (t.stana@cern.ch)
## Website http://www.ohwr.org/projects/pts
## Date 05/11/2014
##-----------------------------------------------------------------------------------------------
##
##------------------------------------------------------------------------------------------------
## GNU LESSER GENERAL PUBLIC LICENSE
## ------------------------------------
## This source file is free software; you can redistribute it and/or modify it under the terms of
## the GNU Lesser General Public License as published by the Free Software Foundation; either
## version 2.1 of the License, or (at your option) any later version.
## This source is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
## without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
## See the GNU Lesser General Public License for more details.
## You should have received a copy of the GNU Lesser General Public License along with this
## source; if not, download it from http://www.gnu.org/licenses/lgpl-2.1.html
##-------------------------------------------------------------------------------------------------
##-------------------------------------------------------------------------------------------------
## Import
##-------------------------------------------------------------------------------------------------
# Import system modules
import
sys
import
time
import
os
,
errno
,
re
,
sys
,
struct
import
os.path
import
traceback
import
glob
import
binascii
# Import common modules
from
ctypes
import
*
from
ptsexcept
import
*
from
vv_pts
import
*
from
ptsdefine
import
*
##-------------------------------------------------------------------------------------------------
## main --
##-------------------------------------------------------------------------------------------------
def
main
(
bus
,
tname
,
inf
,
log
):
"""
tests : EEPROM chip IC62
uses : release.bit and flash_test.py
"""
pel
=
PTS_ERROR_LOGGER
(
inf
,
log
)
try
:
bid
=
bus
.
vv_read
(
0x00
)
bid
=
binascii
.
unhexlify
(
"
%
s"
%
"{0:x}"
.
format
(
bid
))
if
(
bid
==
"T485"
):
msg
=
"Board ID '
%
s' correct
\n
"
%
bid
inf
.
write
(
msg
)
else
:
msg
=
"ERROR: Board ID incorrect, check IC62"
pel
.
set
(
msg
)
return
pel
.
get
()
except
BusException
,
e
:
raise
PtsError
(
"SKT Exception:
%
s"
%
(
e
))
except
BusWarning
,
e
:
raise
PtsError
(
"SKT Warning:
%
s"
%
(
e
))
if
__name__
==
'__main__'
:
bus
=
SKT
(
ELMASLOT
)
os
.
chdir
(
"log"
)
logname
=
glob
.
glob
(
'*.log'
)
infname
=
glob
.
glob
(
'*.inf'
)
log
=
open
(
logname
[
0
],
'a'
)
inf
=
open
(
infname
[
0
],
'a'
)
log
.
write
(
"Run:1 Begin: test08
\n
"
)
inf
.
write
(
"Run:1 Begin: test08
\n
"
)
ret
=
main
(
bus
,
'test08'
,
inf
,
log
)
if
(
ret
==
0
):
log
.
write
(
"PASS: test08
\n
"
)
else
:
log
.
write
(
"FAIL: test08
\n
"
)
log
.
write
(
"Run:1 End: test08
\n
"
)
inf
.
write
(
"Run:1 End: test08
\n
"
)
pts/python/pts.py
View file @
8fa136a0
...
@@ -178,24 +178,26 @@ if __name__ == '__main__':
...
@@ -178,24 +178,26 @@ if __name__ == '__main__':
print
"Running tests :
%
s
\n
"
%
(
cmd
)
print
"Running tests :
%
s
\n
"
%
(
cmd
)
subprocess
.
call
(
cmd
,
shell
=
True
,
stdout
=
fnull
,
stderr
=
fnull
)
subprocess
.
call
(
cmd
,
shell
=
True
,
stdout
=
fnull
,
stderr
=
fnull
)
# # After JPTS has finished, download release bitstream to EEPROM chip if none of the tests has failed
# After JPTS has finished, download release bitstream to EEPROM chip if none of the tests has failed
# print "Loading CONV-TTL-RS485 release bitstream\n"
print
"Loading CONV-TTL-RS485 golden and release bitstream...
\n
"
# ret = subprocess.call("cd /home/pts/ubuntu/ttlbl/boot; ./flash_release.sh", shell=True, stdout=sys.stdout, stderr=sys.stderr)
ret
=
subprocess
.
call
(
"cd boot; ./flash"
,
shell
=
True
,
stdout
=
sys
.
stdout
,
# if (ret == 0):
stderr
=
sys
.
stderr
)
# time.sleep(1)
if
(
ret
!=
0
):
#
print
"ERROR: Bitstream download failed"
else
:
time
.
sleep
(
1
)
# # ... power-cycle the crate
# # ... power-cycle the crate
# print "VME Crate power-cycle..."
# print "VME Crate power-cycle..."
# men_off()
# men_off()
# time.sleep(5)
# time.sleep(5)
# men_on()
# men_on()
#
# time.sleep(5)
time
.
sleep
(
5
)
#
# print ''
# .. and run the flash test
# # .. and run the flash test
cmd
=
"./test08.py"
# cmd = "cd /home/pts/ubuntu/ttlbl/pyts; python flash_test.py"
subprocess
.
call
(
cmd
,
shell
=
True
,
stdout
=
fnull
,
stderr
=
fnull
)
# subprocess.call(cmd, shell=True, stdout=sys.stdout, stderr=sys.stderr)
# After all testing has finished, grep the log files for PASS and FAIL messages and print the outcomes to the console
# After all testing has finished, grep the log files for PASS and FAIL messages and print the outcomes to the console
subprocess
.
call
(
"grep PASS log/*.log"
,
shell
=
True
,
stdout
=
sys
.
stdout
,
stderr
=
sys
.
stderr
)
subprocess
.
call
(
"grep PASS log/*.log"
,
shell
=
True
,
stdout
=
sys
.
stdout
,
stderr
=
sys
.
stderr
)
...
...
pts/shell/flash
0 → 100755
View file @
8fa136a0
#!/bin/bash
xc3sprog
-c
xpc flash_load.bit
xc3sprog
-c
xpc
-I
golden-v0.0_release-v1.0.bin:w:0:bin
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment