Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
D
d7020e_srp
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
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
d7020e
d7020e_srp
Commits
639d90a0
Commit
639d90a0
authored
8 years ago
by
Per
Browse files
Options
Downloads
Patches
Plain Diff
doc
parent
bc7d52c5
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
README.md
+20
-1
20 additions, 1 deletion
README.md
include/SRP.h
+1
-1
1 addition, 1 deletion
include/SRP.h
src/main.c
+2
-0
2 additions, 0 deletions
src/main.c
with
23 additions
and
2 deletions
README.md
+
20
−
1
View file @
639d90a0
...
...
@@ -38,16 +38,35 @@ Start the ITM tracing tool
```
itmdump /tmp/swo.log
```
Notice, the itmdump tool must be started BEFORE the openocd session (see Debug) in order to capture the ITM trace.
## Debug
To run the program you will use the debugger integrated in eclipse. It uses openocd to communicate with the nucleo board, and gdb to
flash the image (generated .elf file) and interact (running, stepping, setting breakpoints etc.).
Clic on the
small green bug icon and
select the d7020e_srp Debug oldgdb. (There other ways as well.)
Clic
k
on the select the
boxed
`
d7020e_srp Debug oldgdb
`
and click the boxed green bug icon
. (There
are
other ways as well.)
This will start openocd and gdb, and by default break at main. To execute the program to end, click the play icon.
For further info on gdb debugging in eclipse see e.g., http://gnuarmeclipse.github.io/debug/
The trace_printf is redirected to the ITM port, and you should get a trace of your program in the terminal.
Notice, that setting breakpoints in the code may be a bit wonky, we use macros and that confuses the eclipse gdb interface.
The
`BREAKPOINT`
macro infers a compiler barrier that "should" allow you to put breakpoints in the code. Stepping in code that
is creating interrupts is also wonky, e.g., if sigle stepping over a
`JOB_REQUEST`
(that "pends" the corresponding interrupt handler),
the pend bit is correctly handeled. This is not a problem for this project only, but a general problem of the gdb integration, so
be aware.
## Problems
If openocd fails to start, one possible error is that the
`/tmp/swo.log`
file has been locked to a bad state. Actually its not an
ordinary file but rather a (linux/posix) FIFO, allowing the openocd to pipe data to the itmdump tool. You may want to stop the itmdump
and restart it, and try to launch the debugger again.
## Tips
This diff is collapsed.
Click to expand it.
include/SRP.h
+
1
−
1
View file @
639d90a0
...
...
@@ -34,5 +34,5 @@
#define TASK(J) void IRQh(J) ()
#define BREAKPOINT { asm volatile("" ::: "memory"); }
This diff is collapsed.
Click to expand it.
src/main.c
+
2
−
0
View file @
639d90a0
...
...
@@ -38,6 +38,7 @@ int main() {
JOB_REQUEST
(
j1
);
// comment out in assignment c
//JOB_REQUEST(j3); // use in assignment c
BREAKPOINT
;
while
(
1
)
;
return
0
;
}
...
...
@@ -47,6 +48,7 @@ TASK(j1) {
LOCK
(
r2
);
JOB_REQUEST
(
j2
);
// job execution request for j2
trace_printf
(
"j1 after job request j2
\n
"
);
BREAKPOINT
;
LOCK
(
r1
);
trace_printf
(
"j1_r1_locked, before job request j2
\n
"
);
JOB_REQUEST
(
j2
);
...
...
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