This repository was archived by the owner on May 26, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +53
-0
lines changed
Expand file tree Collapse file tree 1 file changed +53
-0
lines changed Original file line number Diff line number Diff line change 1+ # orbcode-scripts
2+ ### How-to-trace using SWO and ORBTrace mini
3+ Compile and upload (any) sketch for Arduino Portenta H7 / M7 core:
4+ ``` bash
5+ git clone https://github.com/arduino/arduino-examples && cd arduino-examples
6+ arduino-cli compile -b arduino:mbed_portenta:envie_m7 -v examples/01.Basics/Blink -u -p /dev/ttyACM1
7+ ```
8+ Note down the path to where the ELF-file is stored and edit [ .gdbinit] ( .gdbinit ) accordingly.
9+
10+ Start GDB using .gdbinit contained in this repository:
11+ ``` bash
12+ arm-none-eabi-gdb -iex ' add-auto-load-safe-path .'
13+ ```
14+ Start [ orbuculum] ( https://github.com/orbcode/orbuculum ) :
15+ ``` bash
16+ orbuculum --verbose 3 --monitor 1000
17+ ```
18+ Create a folder for captured SWO trace data and start [ orbfifo] ( https://github.com/orbcode/orbuculum ) :
19+ ``` bash
20+ cd /tmp
21+ mkdir swo
22+ orbfifo --verbose 3 --basedir swo/
23+ ```
24+ Now you are ready to observe some trace data, i.e.
25+ ``` bash
26+ cat swo/hwevent
27+ 2,1,** SLEEP**
28+ 2,1,** SLEEP**
29+ 2,1,0x08053e48
30+ 2,1,** SLEEP**
31+ 2,1,** SLEEP**
32+ ```
33+ or even better:
34+ ``` bash
35+ orbtop -e /tmp/arduino/sketches/817DC06D31EFAD33501697C59B5B9880/Blink.ino.elf -l
36+ ```
37+ which results in i.e.
38+ ``` bash
39+ 96.50% 34272 ** Sleeping **
40+ 1.05% 374 HAL_PCD_IRQHandler
41+ 0.23% 83 hal_critical_section_enter
42+ 0.23% 83 core_util_critical_section_enter
43+ 0.19% 70 lp_ticker_read
44+ 0.18% 66 update_present_time
45+ 0.15% 56 hal_critical_section_exit
46+ 0.13% 49 void mbed::internal::do_sleep_operation< mbed::internal::timed_predicate_op
47+ 0.12% 46 core_util_critical_section_exit
48+ 0.10% 36 mbed::internal::timed_predicate_op::wake_condition () const
49+ -----------------
50+ 98.88% 35135 of 35514 Samples
51+
52+ [---H] Interval = 999mS
53+ ```
You can’t perform that action at this time.
0 commit comments