1 # SPDX-License-Identifier: GPL-2.0-or-later
4 # Measure the CPU clock frequency of an ARM Cortex-M based device.
7 # The CPU clock frequency in Hz. A negative value indicates that the loop
8 # counter was saturated.
11 # You may need to adapt the number of cycles for your device.
13 add_help_text cortex_m_test_cpu_speed
"Measure the CPU clock frequency of an ARM Cortex-M based device"
14 add_usage_text cortex_m_test_cpu_speed
{address
[timeout
[cycles_per_loop
]]}
15 proc cortex_m_test_cpu_speed
{ address
{ timeout
200 } { cycles_per_loop
4 } } {
16 set loop_counter_start
0xffffffff
20 # Backup registers and memory.
21 set backup_regs
[get_reg
-force {pc r0 xpsr
}]
22 set backup_mem
[read_memory
$address 16 3]
24 # We place the following code at the given address to measure the
25 # CPU clock frequency:
30 write_memory
$address 16 {0x3801 0xd1fd 0xe7fe}
32 set_reg
"pc $address r0 $loop_counter_start"
37 # Get the loop counter value from register r0.
38 set loop_counter_end
[dict values
[get_reg r0
]]
39 set loop_counter_diff
[expr {$loop_counter_start - $loop_counter_end}]
41 # Restore registers and memory.
43 write_memory
$address 16 $backup_mem
45 if { [expr {$loop_counter_end == 0}] } {
49 return [expr {double
($loop_counter_diff) * $cycles_per_loop / $timeout * 1000}]
Linking to existing account procedure
If you already have an account and want to add another login method
you
MUST first sign in with your existing account and
then change URL to read
https://review.openocd.org/login/?link
to get to this page again but this time it'll work for linking. Thank you.
SSH host keys fingerprints
1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=.. |
|+o.. . |
|*.o . . |
|+B . . . |
|Bo. = o S |
|Oo.+ + = |
|oB=.* = . o |
| =+=.+ + E |
|. .=o . o |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)