Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
P
Production Test Suite
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
9
Issues
9
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
Production Test Suite
Commits
021bfdf4
Commit
021bfdf4
authored
Aug 29, 2013
by
Matthieu Cattin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test31: Fix bug with eeprom erase, add arguments to program.
parent
8d88818b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
5 deletions
+14
-5
test31.py
test/fmcadc100m14b4cha/python/test31.py
+14
-5
No files found.
test/fmcadc100m14b4cha/python/test31.py
View file @
021bfdf4
...
...
@@ -62,6 +62,17 @@ def main (default_directory='.'):
NEW_EEPROM_BIN_FILENAME
=
os
.
path
.
join
(
default_directory
,
NEW_EEPROM_BIN_FILENAME
)
EEPROM_SIZE
=
8192
# in Bytes
arg_nb
=
len
(
sys
.
argv
[
1
:])
if
arg_nb
==
2
:
BAD_SDB_DIR_OFFSET
=
sys
.
argv
[
1
]
BAD_CALIBR_BIN_FILENAME
=
sys
.
argv
[
2
]
elif
arg_nb
>
2
:
print
(
"Too many arguments."
)
sys
.
exit
()
else
:
BAD_SDB_DIR_OFFSET
=
"0x1000"
BAD_CALIBR_BIN_FILENAME
=
"calibration.sdb"
start_test_time
=
time
.
time
()
print
"================================================================================"
...
...
@@ -240,12 +251,12 @@ P1 Bank A nb signal=%d, P1 Bank B nb signal=%d, P2 Bank A nb signal=%d, P2 Bank
# Extract calibration data from bad eeprom image
#==================================================
print
(
"
\n
=================================================="
)
cmd
=
'sdb-read -e
0x1000 '
+
BAD_EEPROM_BIN_FILENAME
+
' calibration.sdb
> '
+
CALIBR_BIN_FILENAME
cmd
=
'sdb-read -e
'
+
BAD_SDB_DIR_OFFSET
+
' '
+
BAD_EEPROM_BIN_FILENAME
+
' '
+
BAD_CALIBR_BIN_FILENAME
+
'
> '
+
CALIBR_BIN_FILENAME
print
(
"Exctract calibration binary file from bad EEPROM image, cmd:
%
s"
%
(
cmd
))
os
.
system
(
cmd
)
cmd
=
"cp "
+
CALIBR_BIN_FILENAME
+
" "
+
BAK_CALIBR_BIN_FILENAME
print
(
"Copy calibration binary, cmd:
%
s"
%
(
cmd
))
#
os.system(cmd)
os
.
system
(
cmd
)
#==================================================
# Check that valid calibration data were extracted
...
...
@@ -290,9 +301,7 @@ P1 Bank A nb signal=%d, P1 Bank B nb signal=%d, P2 Bank A nb signal=%d, P2 Bank
#==================================================
print
(
"
\n
=================================================="
)
print
"Erase EEPROM content."
eeprom_data
=
[
0x0
]
*
EEPROM_SIZE
fmc
.
sys_i2c_eeprom_write
(
eeprom_data
)
fmc
.
sys_i2c_eeprom_write
([
0x0
]
*
EEPROM_SIZE
)
#==================================================
# Write content to EEPROM via I2C
...
...
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