Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
FMC ADC 100M 14b 4cha - Testing
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
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
FMC ADC 100M 14b 4cha - Testing
Commits
79a9a39a
Commit
79a9a39a
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
0139063e
Show 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 @
79a9a39a
...
@@ -62,6 +62,17 @@ def main (default_directory='.'):
...
@@ -62,6 +62,17 @@ def main (default_directory='.'):
NEW_EEPROM_BIN_FILENAME
=
os
.
path
.
join
(
default_directory
,
NEW_EEPROM_BIN_FILENAME
)
NEW_EEPROM_BIN_FILENAME
=
os
.
path
.
join
(
default_directory
,
NEW_EEPROM_BIN_FILENAME
)
EEPROM_SIZE
=
8192
# in Bytes
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
()
start_test_time
=
time
.
time
()
print
"================================================================================"
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
...
@@ -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
# Extract calibration data from bad eeprom image
#==================================================
#==================================================
print
(
"
\n
=================================================="
)
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
))
print
(
"Exctract calibration binary file from bad EEPROM image, cmd:
%
s"
%
(
cmd
))
os
.
system
(
cmd
)
os
.
system
(
cmd
)
cmd
=
"cp "
+
CALIBR_BIN_FILENAME
+
" "
+
BAK_CALIBR_BIN_FILENAME
cmd
=
"cp "
+
CALIBR_BIN_FILENAME
+
" "
+
BAK_CALIBR_BIN_FILENAME
print
(
"Copy calibration binary, cmd:
%
s"
%
(
cmd
))
print
(
"Copy calibration binary, cmd:
%
s"
%
(
cmd
))
#
os.system(cmd)
os
.
system
(
cmd
)
#==================================================
#==================================================
# Check that valid calibration data were extracted
# 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
...
@@ -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
(
"
\n
=================================================="
)
print
"Erase EEPROM content."
print
"Erase EEPROM content."
eeprom_data
=
[
0x0
]
*
EEPROM_SIZE
fmc
.
sys_i2c_eeprom_write
([
0x0
]
*
EEPROM_SIZE
)
fmc
.
sys_i2c_eeprom_write
(
eeprom_data
)
#==================================================
#==================================================
# Write content to EEPROM via I2C
# 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