Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
rtic_f4xx_nucleo
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
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Edvin Åkerfeldt
rtic_f4xx_nucleo
Commits
472026b2
Commit
472026b2
authored
Dec 3, 2020
by
Edvin Åkerfeldt
Browse files
Options
Downloads
Patches
Plain Diff
rtt_timing, E complete
parent
11863fb6
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
.cargo/config
+2
-2
2 additions, 2 deletions
.cargo/config
examples/rtt_timing.rs
+40
-0
40 additions, 0 deletions
examples/rtt_timing.rs
with
42 additions
and
2 deletions
.cargo/config
+
2
−
2
View file @
472026b2
...
...
@@ -5,10 +5,10 @@
[target.'cfg(all(target_arch = "arm", target_os = "none"))']
# uncomment ONE of these three option to make `cargo run` start a GDB session
# which option to pick depends on your system
#
runner = "arm-none-eabi-gdb -q -x openocd.gdb"
runner = "arm-none-eabi-gdb -q -x openocd.gdb"
# runner = "gdb-multiarch -q -x openocd.gdb"
# runner = "gdb -q -x openocd.gdb"
runner = "probe-run --chip STM32F411RETx"
#
runner = "probe-run --chip STM32F411RETx"
rustflags = [
# This is needed if your flash or ram addresses are not aligned to 0x10000 in memory.x
...
...
...
...
This diff is collapsed.
Click to expand it.
examples/rtt_timing.rs
+
40
−
0
View file @
472026b2
...
...
@@ -260,11 +260,42 @@ A/C = 4790151/40001 = 119,7507812 ~= 120
// https://developer.arm.com/documentation/ddi0439/b/Data-Watchpoint-and-Trace-Unit/DWT-Programmers-Model
//
// [Your answer here]
/*
The content of r1 is 0xE0001004. This is the address for the DWT_CYCCNT (Cycle count Register).
There are no functions call in the loop function because the compiler has optimized the instructions to just reading from the
cycle register and saving it in r0.
*/
//
// Now check your answer by dumping the registers
// (gdb) info registers
//
// [Register dump here]
/*
r0 0x80000000 -2147483648
r1 0xe0001004 -536866812
r2 0x2710 10000
r3 0xa 10
r4 0x20000000 536870912
r5 0x20000430 536871984
r6 0x0 0
r7 0x2000ffe8 536936424
r8 0x0 0
r9 0x0 0
r10 0x0 0
r11 0x0 0
r12 0x1 1
sp 0x2000ff98 0x2000ff98
lr 0x8000373 134218611
pc 0x800023e 0x800023e <rtt_timing::timed_loop+12>
xPSR 0x81000000 -2130706432
fpscr 0x0 0
msp 0x2000ff98 0x2000ff98
psp 0x0 0x0
primask 0x1 1
basepri 0x0 0
faultmask 0x0 0
control 0x0 0
*/
//
// We can now set a breakpoint exactly at the `nop`.
//
...
...
@@ -290,6 +321,9 @@ A/C = 4790151/40001 = 119,7507812 ~= 120
// (gdb) x 0xe0001004
//
// [Your answer here]
/*
0xe0001004: 0xf73d58c8
*/
//
// Now, let's execute one iteration:
// (gdb) continue
...
...
@@ -297,10 +331,16 @@ A/C = 4790151/40001 = 119,7507812 ~= 120
// What is now the current value of the cycle counter?
//
// [Your answer here]
/*
0xe0001004: 0xf73d58cc
*/
//
// By how much does the cycle counter increase for each iteration?
//
// [Your answer here]
/*
It increases by 4.
*/
//
// ------------------------------------------------------------------------
// F) Reseting the cycle counter
...
...
...
...
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