You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by cc...@apache.org on 2017/07/14 19:06:13 UTC

[mynewt-site] 01/02: segger rtt and sysview

This is an automated email from the ASF dual-hosted git repository.

ccollins pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/mynewt-site.git

commit 2efb3e0cd6693ef83c79fb9e681fac5003ad3132
Author: Jacob Rosenthal <ja...@gmail.com>
AuthorDate: Thu Jul 13 02:38:11 2017 -0400

    segger rtt and sysview
---
 docs/os/tutorials/pics/segger_sysview1.png | Bin 0 -> 373713 bytes
 docs/os/tutorials/segger_rtt.md            |  91 +++++++++++++++++++++++++++++
 docs/os/tutorials/segger_sysview.md        |  65 +++++++++++++++++++++
 docs/os/tutorials/tutorials.md             |   4 ++
 4 files changed, 160 insertions(+)

diff --git a/docs/os/tutorials/pics/segger_sysview1.png b/docs/os/tutorials/pics/segger_sysview1.png
new file mode 100644
index 0000000..e1bdcb0
Binary files /dev/null and b/docs/os/tutorials/pics/segger_sysview1.png differ
diff --git a/docs/os/tutorials/segger_rtt.md b/docs/os/tutorials/segger_rtt.md
new file mode 100644
index 0000000..ecd1633
--- /dev/null
+++ b/docs/os/tutorials/segger_rtt.md
@@ -0,0 +1,91 @@
+## SEGGER RTT Console
+
+<br>
+
+### Objective
+
+Sometimes you dont have UART on your board, or you want to use it for something else while still having newt logs/shell capability. With [SEGGER's RTT](https://www.segger.com/jlink-rtt.html) capability you can swap UART for RTT, which is a very high-speed memory-mapped I/O.
+
+<br>
+
+### Hardware needed
+
+You'll need a SEGGER J-Link programmer in order to use this advanced functionality. You might have an external J-Link programmer you're already using, or maybe your board has a dedicated J-Link onboard as some development kits do. Another possibilty is J-Link OB firmware available for some devices like the micro:bit. 
+
+### Setup the target
+
+We'll assume you have an existing project with some kind of console/shell like [Check stats on a BLE device](bletiny_project.md) that we're switching over to RTT from UART. We can disable uart and enable rtt with the newt target command:
+```
+newt target amend myble syscfg=CONSOLE_UART=0
+newt target amend myble syscfg=CONSOLE_RTT=1
+```
+
+<br>
+
+### Run the target executables 
+Now 'run' the newt target as you'll need an active debugger process to attach to:
+
+```
+$ newt run myble 0
+App image succesfully generated: ~/Downloads/myapp1/bin/targets/myble/app/apps/bletiny/bletiny.img
+Loading app image into slot 1
+[~Downloads/myapp1/repos/apache-mynewt-core/hw/bsp/nrf52-thingy/nrf52-thingy_debug.sh ~/Downloads/myapp1/repos/apache-mynewt-core/hw/bsp/nrf52-thingy ~/Downloads/myapp1/bin/targets/myble/app/apps/bletiny/bletiny]
+Debugging ~/Downloads/myapp1/bin/targets/myble/app/apps/bletiny/bletiny.elf
+GNU gdb (GNU Tools for ARM Embedded Processors) 7.8.0.20150604-cvs
+Copyright (C) 2014 Free Software Foundation, Inc.
+License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
+This is free software: you are free to change and redistribute it.
+There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
+and "show warranty" for details.
+This GDB was configured as "--host=x86_64-apple-darwin10 --target=arm-none-eabi".
+Type "show configuration" for configuration details.
+For bug reporting instructions, please see:
+<http://www.gnu.org/software/gdb/bugs/>.
+Find the GDB manual and other documentation resources online at:
+<http://www.gnu.org/software/gdb/documentation/>.
+For help, type "help".
+Type "apropos word" to search for commands related to "word"...
+Reading symbols from ~/Downloads/myapp1/bin/targets/myble/app/apps/bletiny/bletiny.elf...done.
+0x000000d8 in ?? ()
+Resetting target
+0x000000dc in ?? ()
+(gdb) 
+```
+
+<br>
+
+### Connect to console
+
+In a seperate terminal window ```telnet localhost 19021``` and when you continue your gdb session you should see your output. If you're not familiar with telnet, when you're ready to exit you may by using the hotkey ctrl+] then typing quit
+
+```
+$ telnet localhost 19021
+Trying ::1...
+telnet: connect to address ::1: Connection refused
+Trying fe80::1...
+telnet: connect to address fe80::1: Connection refused
+Trying 127.0.0.1...
+Connected to localhost.
+Escape character is '^]'.
+SEGGER J-Link V6.14e - Real time terminal output
+SEGGER J-Link EDU V8.0, SN=268006294
+Process: JLinkGDBServer
+```
+
+Then you can interact with the device:
+```
+stat
+stat
+000262 Must specify a statistic name to dump, possible names are:
+000262 	stat
+000262 	ble_l2cap
+000262 	ble_att
+000262 	ble_gap
+000262 	ble_gattc
+000262 	ble_gatts
+000262 	ble_hs
+000262 	ble_ll_conn
+000262 	ble_ll
+000262 	ble_phy
+000262 compat> 
+```
diff --git a/docs/os/tutorials/segger_sysview.md b/docs/os/tutorials/segger_sysview.md
new file mode 100644
index 0000000..53fc964
--- /dev/null
+++ b/docs/os/tutorials/segger_sysview.md
@@ -0,0 +1,65 @@
+## SEGGER SystemView
+
+<br>
+
+### Objective
+
+With [SEGGER's SystemView](https://www.segger.com/systemview.html) you can "record data from the target system while it is running. The recorded data is analyzed and the system behavior is visualized in different views." 
+
+<br>
+
+### Hardware needed
+
+You'll need a SEGGER J-Link programmer in order to use this advanced functionality. You might have an external J-Link programmer you're already using, or maybe your board has a dedicated J-Link onboard as some development kits do. Another possibilty is J-Link OB firmware available for some devices like the micro:bit. 
+
+### Software needed
+
+* Download [SEGGER's SystemView app](https://www.segger.com/downloads/free-utilities/).
+* Copy the description file from sys/sysview/SYSVIEW_Mynewt.txt to the /Description/ directory of SystemView
+
+### Setup the target
+
+We'll assume you have an existing example we're enabling SystemView on, in this case [blinky on nrf52](nRF52.md). We can do so with the newt target amend command:
+```
+newt target amend blink_nordic syscfg=OS_SYSVIEW=1
+```
+
+<br>
+
+### Run the target executables 
+Now 'run' the newt target as you'll need an active debugger process to attach to:
+
+```
+$ newt run blink_nordic 0
+App image succesfully generated: ~/Downloads/myproj/bin/targets/blink_nordic/app/apps/bleprph/bleprph.img
+Loading app image into slot 1
+[~/Downloads/myproj/repos/apache-mynewt-core/hw/bsp/nrf52-thingy/nrf52-thingy_debug.sh ~/Downloads/myproj/repos/apache-mynewt-core/hw/bsp/nrf52-thingy ~/Downloads/myproj/bin/targets/blink_nordic/app/apps/bleprph/bleprph]
+Debugging ~/Downloads/myproj/bin/targets/blink_nordic/app/apps/bleprph/bleprph.elf
+GNU gdb (GNU Tools for ARM Embedded Processors) 7.8.0.20150604-cvs
+Copyright (C) 2014 Free Software Foundation, Inc.
+License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
+This is free software: you are free to change and redistribute it.
+There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
+and "show warranty" for details.
+This GDB was configured as "--host=x86_64-apple-darwin10 --target=arm-none-eabi".
+Type "show configuration" for configuration details.
+For bug reporting instructions, please see:
+<http://www.gnu.org/software/gdb/bugs/>.
+Find the GDB manual and other documentation resources online at:
+<http://www.gnu.org/software/gdb/documentation/>.
+For help, type "help".
+Type "apropos word" to search for commands related to "word"...
+Reading symbols from ~/Downloads/myproj/bin/targets/blink_nordic/app/apps/bleprph/bleprph.elf...done.
+0x000000d8 in ?? ()
+Resetting target
+0x000000dc in ?? ()
+```
+
+<br>
+
+### Launch the app
+
+Launch app and start recording events
+
+![SEGGER SystemView](pics/segger_sysview1.png)
+
diff --git a/docs/os/tutorials/tutorials.md b/docs/os/tutorials/tutorials.md
index 2f16ed1..a3419ee 100644
--- a/docs/os/tutorials/tutorials.md
+++ b/docs/os/tutorials/tutorials.md
@@ -37,6 +37,10 @@ The tutorials fall into a few broad categories. Some examples in each category a
     * [Adding a unit test for a package](unit_test.md)
     * [Adding task to manage multiple events](event_queue.md)
 
+* Tooling
+    * [SEGGER RTT](segger_rtt.md)
+    * [SEGGER SystemView](segger_sysview.md)
+
 <br>
 
 * Bluetooth Low Energy

-- 
To stop receiving notification emails like this one, please contact
"commits@mynewt.apache.org" <co...@mynewt.apache.org>.