Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
LOFAR
Manage
Activity
Members
Labels
Plan
Issues
Wiki
Jira issues
Open Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RadioObservatory
LOFAR
Commits
96cd2b7f
Commit
96cd2b7f
authored
19 years ago
by
wierenga
Browse files
Options
Downloads
Patches
Plain Diff
bugid:691
Specifying page -1 (all pages) is no longer supported.
parent
3ee8ae6c
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
MAC/APL/PIC/rsuctl/rsuctl
+36
-50
36 additions, 50 deletions
MAC/APL/PIC/rsuctl/rsuctl
with
36 additions
and
50 deletions
MAC/APL/PIC/rsuctl/rsuctl
+
36
−
50
View file @
96cd2b7f
...
...
@@ -14,7 +14,7 @@
# [-l] # List the images currently stored in all pages of the flash
#
# [-b in.ttf -f out.bin] # Convert a ttf file to a binary file
# [-e -p page [-F]] # Erase flash page,
use -1 for all pages; 0 <=
page
< 16
# [-e -p page [-F]] # Erase flash page,
0 <= page < 16 (-F forces erase of
page
0)
# [-x -p page # Start (load & reset) new firmware from the specified page
# [-w -p page -f image[.ttf] [-F]] # Write img.bin into specified page (-F forces write to page 0)
# [-v -p page -f image[.ttf]] # Compare flash page with img.bin
...
...
@@ -134,7 +134,7 @@ Usage: rsuctl [options] command
[-l] # List the images currently stored in all pages of the flash
[-b in.ttf -f out.bin] # Convert a ttf file to a binary file
[-e -p page [-F]] # Erase flash page,
use -1 for all pages; 0 <=
page
< 16
[-e -p page [-F]] # Erase flash page,
0 <= page < 16 (-F forces erase of
page
0)
[-x -p page # Start (load & reset) new firmware from the specified page
[-w -p page -f image[.ttf] [-F]] # Write img.bin into specified page (-F forces write to page 0)
[-v -p page -f image[.ttf]] # Compare flash page with img.bin
...
...
@@ -228,62 +228,48 @@ sub readresponse
}
#
# flash($sock, $pcap, $flashpage, $blockinc, $msg, $cmd, $size, $writecb, $readcb, $image)
# page = -1 means all pages
# flash($sock, $pcap, $page, $blockinc, $msg, $cmd, $size, $writecb, $readcb, $image)
#
sub
flash
{
my
(
$sock
,
$pcap
,
$flashpage
,
$blockinc
,
$msg
,
$cmd
,
$size
,
$writecb
,
$readcb
,
$image
)
=
@_
;
if
(
$flashpage
<
0
)
{
$startpage
=
0
;
$count
=
$PAGES
;
}
else
{
$startpage
=
$flashpage
;
$count
=
1
;
}
my
(
$sock
,
$pcap
,
$page
,
$blockinc
,
$msg
,
$cmd
,
$size
,
$writecb
,
$readcb
,
$image
)
=
@_
;
# process pages
my
(
$page
);
for
(
$page
=
$startpage
;
$page
<
$startpage
+
$count
;
$page
++
)
{
printf
STDERR
"
=== %s page %02d
\n
",
$msg
,
$page
;
print
STDERR
"
=== |
"
.
("
-
"
x
$SECTORS_PER_PAGE
)
.
"
|
\n
===
";
my
(
$success
)
=
1
;
# leave last block for directory entry
my
(
$block
);
for
(
$block
=
0
;
$block
<
$BLOCKS_PER_PAGE
-
1
;
$block
+=
$blockinc
)
{
printf
STDERR
"
=== %s page %02d
\n
",
$msg
,
$page
;
print
STDERR
"
=== |
"
.
("
-
"
x
$SECTORS_PER_PAGE
)
.
"
|
\n
===
";
my
(
$success
)
=
1
;
# leave last block for directory entry
my
(
$block
);
for
(
$block
=
0
;
$block
<
$BLOCKS_PER_PAGE
-
1
;
$block
+=
$blockinc
)
{
if
(
$writecb
)
{
$packet
=
pack_rsu
(
$TYPE_WRITE
,
$cmd
,
$size
,
(
$page
*
$BLOCKS_PER_PAGE
)
+
$block
);
$packet
.=
&$writecb
(
$page
,
$block
,
$image
);
if
(
$writecb
)
{
$packet
=
pack_rsu
(
$TYPE_WRITE
,
$cmd
,
$size
,
(
$page
*
$BLOCKS_PER_PAGE
)
+
$block
);
$packet
.=
&$writecb
(
$page
,
$block
,
$image
);
$sock
->
send_eth_frame
(
$packet
);
(
$payload
,
$error
)
=
readresponse
(
$pcap
);
return
$error
if
$error
;
}
if
(
$readcb
)
{
$packet
=
pack_rsu
(
$TYPE_READ
,
$cmd
,
$size
,
(
$page
*
$BLOCKS_PER_PAGE
)
+
$block
);
$sock
->
send_eth_frame
(
$packet
);
(
$payload
,
$error
)
=
readresponse
(
$pcap
);
return
$error
if
$error
;
}
if
(
$readcb
)
{
$packet
=
pack_rsu
(
$TYPE_READ
,
$cmd
,
$size
,
(
$page
*
$BLOCKS_PER_PAGE
)
+
$block
);
$sock
->
send_eth_frame
(
$packet
);
(
$payload
,
$error
)
=
readresponse
(
$pcap
);
return
$error
if
$error
;
$success
=
&$readcb
(
$page
,
$block
,
$payload
,
$image
)
&&
$success
;
}
if
(
0
==
$block
%
$BLOCKS_PER_SECTOR
)
{
if
(
$success
)
{
print
STDERR
"
.
";
}
else
{
print
STDERR
"
X
";
}
$success
=
1
;
}
$sock
->
send_eth_frame
(
$packet
);
(
$payload
,
$error
)
=
readresponse
(
$pcap
);
return
$error
if
$error
;
$success
=
&$readcb
(
$page
,
$block
,
$payload
,
$image
)
&&
$success
;
}
if
(
0
==
$block
%
$BLOCKS_PER_SECTOR
)
{
if
(
$success
)
{
print
STDERR
"
.
";
}
else
{
print
STDERR
"
X
";
}
$success
=
1
;
}
print
STDERR
"
\n
";
}
print
STDERR
"
\n
";
return
0
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment