Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
Compact Universal Timing Endpoint based on White Rabbit
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
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
Compact Universal Timing Endpoint based on White Rabbit
Commits
e8e6d9c0
Commit
e8e6d9c0
authored
Jan 13, 2015
by
Qiang Du
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Flash write/readback verified.
parent
2dc1f007
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
11 deletions
+12
-11
flash_m25p.py
tools/lib-multiboot/flash_m25p.py
+3
-2
mbtest.py
tools/lib-multiboot/mbtest.py
+9
-9
No files found.
tools/lib-multiboot/flash_m25p.py
View file @
e8e6d9c0
...
...
@@ -41,7 +41,6 @@ class FlashM25P:
self
.
ebone
=
comm_params
[
1
]
self
.
mb_base
=
comm_params
[
2
]
# Low-level SPI transfer using communication type defined in the constructor
#
# This method handles the OR-ing together of the data bytes and the control
...
...
@@ -77,7 +76,9 @@ class FlashM25P:
else
:
for
i
in
xrange
(
len
(
dat
)):
wval
.
append
((
ctrl
<<
24
)
|
dat
[
i
])
self
.
ebone
.
writemregs
(
self
.
mb_base
+
0x10
,
wval
)
#self.ebone.writemregs(self.mb_base+0x10, wval)
for
v
in
wval
:
self
.
ebone
.
write
(
self
.
mb_base
+
0x10
,
v
)
# Read the data and prepare the return value
while
(
retval
&
(
1
<<
28
)
==
0
):
...
...
tools/lib-multiboot/mbtest.py
View file @
e8e6d9c0
...
...
@@ -16,22 +16,22 @@ def main():
target
=
EB
(
ip
)
target
.
open
()
baseaddr
=
0x20800
flash_address
=
0x
1
0
flash_length
=
0x
1
f
flash_address
=
0x0
flash_length
=
0x
0f
f
file_name
=
'foo_bit'
mb
=
XilMultiboot
(
ETHERBONE
,
target
,
baseaddr
,
file_name
)
# read id
id
=
mb
.
flash
.
read_id
()
logging
.
info
(
'Flash ID: 0x'
+
id
.
encode
(
'hex'
))
#logging.info('Programming file %s'% file_name)
#mb.write(flash_address)
#mb.read(0,0xff)
# id = mb.flash.read_id()
# logging.info('Flash ID: 0x' + id.encode('hex'))
# mb.flash.serase(flash_address)
mb
.
flash
.
write
(
flash_address
,
range
(
0x15
,
0x15
+
flash_length
))
logging
.
info
(
'Programming file
%
s'
%
file_name
)
mb
.
write
(
flash_address
)
mb
.
read
(
0
,
0xff
)
mb
.
flash
.
write
(
flash_address
,
range
(
0x0
,
0x0
+
flash_length
))
status
=
mb
.
flash
.
rsr
()
logging
.
info
(
'Status: 0x
%
x'
,
status
)
...
...
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