Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
Software for White Rabbit PTP Core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
32
Issues
32
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
CI / CD
CI / CD
Pipelines
Schedules
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
Software for White Rabbit PTP Core
Commits
2cfd1823
Commit
2cfd1823
authored
Sep 30, 2013
by
Theodor-Adrian Stana
Committed by
Grzegorz Daniluk
Jan 06, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
flash interface works
parent
c9b5aafe
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
16 deletions
+17
-16
flash.c
dev/flash.c
+1
-5
wrc_main.c
wrc_main.c
+16
-11
No files found.
dev/flash.c
View file @
2cfd1823
...
...
@@ -98,6 +98,7 @@ void flash_write(int nrbytes, uint32_t addr, uint8_t *dat)
bbspi_transfer
(
0
,(
addr
&
0xFF
));
for
(
i
=
0
;
i
<
nrbytes
;
i
++
)
{
mprintf
(
"dat: %02x
\n
"
,
dat
[
i
]);
bbspi_transfer
(
0
,
dat
[
i
]);
}
bbspi_transfer
(
1
,
0
);
...
...
@@ -107,15 +108,10 @@ void flash_read(int nrbytes, uint32_t addr, uint8_t *dat)
{
int
cnt
=
0
;
int
i
;
// d = 1;
bbspi_transfer
(
1
,
0
);
// mprintf("cmd\n");
bbspi_transfer
(
0
,
0x0b
);
// mprintf("addr0\n");
bbspi_transfer
(
0
,(
addr
&
0xFF0000
)
>>
16
);
// mprintf("addr1\n");
bbspi_transfer
(
0
,(
addr
&
0xFF00
)
>>
8
);
// mprintf("addr2\n");
bbspi_transfer
(
0
,(
addr
&
0xFF
));
bbspi_transfer
(
0
,
0
);
...
...
wrc_main.c
View file @
2cfd1823
...
...
@@ -228,7 +228,7 @@ static void check_reset(void) {}
void
w
()
{
uint64_t
i
;
for
(
i
=
0
;
i
<
1024
*
1024
*
100
0
;
i
++
)
for
(
i
=
0
;
i
<
1024
*
1024
*
100
;
i
++
)
asm
volatile
(
"nop"
);
}
...
...
@@ -248,22 +248,27 @@ int main(void)
timer_init
(
0
);
mprintf
(
"preinit
\n
"
);
//
w();
w
();
mprintf
(
"flash init
\n
"
);
uint8_t
d
=
0xaa
,
r
=
0x01
;
uint8_t
d
[
4
]
=
{
0xaa
,
0xbb
,
0xcc
,
0xdd
}
;
flash_init
();
// flash_serase(0x00);
// while (r & 0x01)
// {
// r = flash_rsr();
// mprintf("%d\n", r);
// }
flash_read
(
256
,
0x00
,
rdat
);
for
(
i
=
0
;
i
<
256
;
i
++
)
{
mprintf
(
"0x%02x "
,
rdat
[
i
]);
}
mprintf
(
"
\n
"
);
mprintf
(
"erase
\n
"
);
flash_serase
(
0x00
);
while
(
flash_rsr
()
&
0x01
)
;
// flash_write(1, 0x00, &d);
mprintf
(
"write
\n
"
);
flash_write
(
4
,
0x00
,
d
);
flash_read
(
256
,
0x00
,
rdat
);
// mprintf("0x%02x", rdat[0]);
for
(
i
=
0
;
i
<
256
;
i
++
)
{
mprintf
(
"0x%02x "
,
rdat
[
i
]);
...
...
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