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
550b9f7c
Commit
550b9f7c
authored
Feb 26, 2013
by
Matthieu Cattin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test23: Fix gensdbfs path top work from pts root dir.
Erase eeprom before reading content from binary file.
parent
f0260579
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
13 deletions
+14
-13
test23.py
test/fmcadc100m14b4cha/python/test23.py
+14
-13
No files found.
test/fmcadc100m14b4cha/python/test23.py
View file @
550b9f7c
...
...
@@ -48,12 +48,11 @@ def main (default_directory='.'):
SERIAL_FILENAME
=
os
.
path
.
join
(
default_directory
,
SERIAL_FILENAME
)
CALIBR_FILENAME
=
"calibration_data.txt"
CALIBR_FILENAME
=
os
.
path
.
join
(
default_directory
,
CALIBR_FILENAME
)
IPMI_BIN_FILENAME
=
"sdbfs/ipmi.sdb"
IPMI_BIN_FILENAME
=
os
.
path
.
join
(
default_directory
,
IPMI_BIN_FILENAME
)
CALIBR_BIN_FILENAME
=
"sdbfs/calibration.sdb"
CALIBR_BIN_FILENAME
=
os
.
path
.
join
(
default_directory
,
CALIBR_BIN_FILENAME
)
EEPROM_BIN_FILENAME
=
"sdbfs/eeprom_content.out"
EEPROM_BIN_FILENAME
=
os
.
path
.
join
(
default_directory
,
EEPROM_BIN_FILENAME
)
SDBFS_DIR
=
"sdbfs/"
SDBFS_DIR
=
os
.
path
.
join
(
default_directory
,
SDBFS_DIR
)
IPMI_BIN_FILENAME
=
SDBFS_DIR
+
"ipmi.sdb"
CALIBR_BIN_FILENAME
=
SDBFS_DIR
+
"calibration.sdb"
EEPROM_BIN_FILENAME
=
SDBFS_DIR
+
"eeprom_content.out"
EEPROM_SIZE
=
8192
# in Bytes
...
...
@@ -211,7 +210,15 @@ def main (default_directory='.'):
#==================================================
# Generate eeprom image with gensdbfs
os
.
system
(
'gensdbfs sdbfs '
+
EEPROM_BIN_FILENAME
)
cmd
=
"gensdbfs "
+
SDBFS_DIR
+
" "
+
EEPROM_BIN_FILENAME
print
(
"Generate eeprom image, cmd:
%
s"
%
(
cmd
))
os
.
system
(
cmd
)
#==================================================
# Erase EEPROM content
print
"Erase EEPROM content.
\n
"
eeprom_data
=
[
0x0
]
*
EEPROM_SIZE
fmc
.
sys_i2c_eeprom_write
(
eeprom_data
)
#==================================================
# Read eeprom content from binary file
...
...
@@ -223,12 +230,6 @@ def main (default_directory='.'):
byte
=
f_bin_eeprom
.
read
(
1
)
# reads one byte
f_bin_eeprom
.
close
()
#==================================================
# Erase EEPROM content
print
"Erase EEPROM content.
\n
"
eeprom_data
=
[
0x0
]
*
EEPROM_SIZE
fmc
.
sys_i2c_eeprom_write
(
eeprom_data
)
#==================================================
# Write content to EEPROM via I2C
print
"Write EEPROM content.
\n
"
...
...
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