Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
K
klee-examples
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
Samuel Karlsson
klee-examples
Commits
654619be
Commit
654619be
authored
5 years ago
by
Per
Browse files
Options
Downloads
Patches
Plain Diff
programmnig, reading and writing cleanup
parent
8c346413
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
runner/src/main.rs
+18
-12
18 additions, 12 deletions
runner/src/main.rs
with
18 additions
and
12 deletions
runner/src/main.rs
+
18
−
12
View file @
654619be
...
...
@@ -4,6 +4,7 @@ use ktest::{read_ktest, KTEST};
use
probe_rs
::{
config
::
registry
::{
Registry
,
SelectionStrategy
},
coresight
::
access_ports
::
AccessPortError
,
coresight
::
memory
::
MI
,
flash
::
download
::{
download_file
,
download_file_with_progress_reporting
,
FileDownloadError
,
Format
,
},
...
...
@@ -12,6 +13,7 @@ use probe_rs::{
target
::
info
::{
self
,
ChipInfo
},
};
// le byte order
fn
main
()
{
let
mut
probe
=
open_probe
();
println!
(
"probe connected"
);
...
...
@@ -32,6 +34,8 @@ fn main() {
let
path_str
=
"../target/thumbv7em-none-eabihf/debug/examples/f401_break"
;
// programming
print!
(
"flashing..."
);
download_file
(
&
mut
session
,
std
::
path
::
Path
::
new
(
&
path_str
.to_string
()
.as_str
()),
...
...
@@ -41,6 +45,8 @@ fn main() {
.map_err
(|
e
|
format_err!
(
"failed to flash {}: {}"
,
path_str
,
e
))
.unwrap
();
println!
(
"... done"
);
// session.probe.target_reset().unwrap();
let
cpu_info
=
session
.target
...
...
@@ -49,22 +55,22 @@ fn main() {
.unwrap
();
println!
(
"Core stopped at address 0x{:08x}"
,
cpu_info
.pc
);
let
mut
data
=
[
0u8
;
4
];
session
.target
.core
.read_block8
(
&
mut
session
.probe
,
0x0000_0000
,
&
mut
data
)
.unwrap
();
let
data
=
session
.probe
.read32
(
0x0000_0000
)
.unwrap
();
println!
(
"stack 0x{:08x}"
,
data
);
let
data
=
session
.probe
.read32
(
0x0000_0004
)
.unwrap
();
println!
(
"reset 0x{:08x}"
,
data
);
println!
(
"stack {:?}, 0x{:08x}"
,
data
,
u32
::
from_le_bytes
(
data
));
let
mut
data
=
[
0u8
;
4
];
session
.target
.core
.read_block8
(
&
mut
session
.probe
,
0x0000_0004
,
&
mut
data
)
.probe
.write_block32
(
0x2000_0000
,
&
[
0x0123_4567
,
0x89ab_cdef
])
.unwrap
();
println!
(
"reset {:?}, 0x{:08x}"
,
data
,
u32
::
from_le_bytes
(
data
));
let
mut
r
=
[
0u32
;
2
];
session
.probe
.read_block32
(
0x2000_0000
,
&
mut
r
)
.unwrap
();
println!
(
"0x2000_0000 = 0x{:08x}"
,
r
[
0
]);
println!
(
"0x2000_0004 = 0x{:08x}"
,
r
[
1
]);
let
cpu_info
=
session
.target.core
.step
(
&
mut
session
.probe
)
.unwrap
();
println!
(
"Core stopped at address 0x{:08x}"
,
cpu_info
.pc
);
...
...
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