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
b43c3c91
Commit
b43c3c91
authored
May 13, 2011
by
Juan David González Cobas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add example test program by Samuel
parent
30c966a0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
61 additions
and
0 deletions
+61
-0
test_load_firmware_flash.py
test_load_firmware_flash.py
+61
-0
No files found.
test_load_firmware_flash.py
0 → 100755
View file @
b43c3c91
#!/acc/src/dsc/drivers/cohtdrep/siglesia/Python-2.7/python
# It needs Python 2.7 or higher!
import
sys
import
rr
import
time
import
os
from
ctypes
import
*
class
CGennumFlash
:
GENNUM_FLASH
=
1
;
GENNUM_FPGA
=
2
;
FPGA_FLASH
=
3
;
def
__init__
(
self
,
bus
):
self
.
bus
=
bus
;
self
.
lib
=
cdll
.
LoadLibrary
(
"./libfpga_loader.so"
);
self
.
lib
.
rr_init
();
self
.
lib
.
gpio_init
();
if
__name__
==
'__main__'
:
gennum
=
rr
.
Gennum
();
flash
=
CGennumFlash
(
gennum
);
start
=
time
.
time
();
flash
.
lib
.
gpio_bootselect
(
flash
.
GENNUM_FLASH
);
version
=
hex
(
flash
.
lib
.
flash_read_id
());
if
(
version
!=
"0x202016"
):
raise
Exception
(
'Error: version of the flash is not correct: '
+
version
);
# Load a new firmware to the Flash memory.
print
"Starting the process to load a FW into Flash memory"
flash
.
lib
.
load_mcs_to_flash
(
"./test_flash.bin"
);
time
.
sleep
(
1
);
print
"Forcing to load FW from Flash memory to FPGA"
# Force the FPGA to load the FW from the Flash memory
flash
.
lib
.
force_load_fpga_from_flash
();
finish
=
time
.
time
();
print
"Time elapsed: "
+
str
(
finish
-
start
)
+
" seconds"
ask
=
""
;
while
((
ask
!=
"Y"
)
and
(
ask
!=
"N"
))
:
ask
=
raw_input
(
"Are the LEDs blinking? [Y/N]"
)
if
(
ask
==
"N"
)
:
raise
Exception
(
"Error loading FW through the Flash memory"
);
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