summaryrefslogtreecommitdiff
path: root/examples/readme.md
diff options
context:
space:
mode:
authorhathach <[email protected]>2020-04-22 19:50:23 +0700
committerhathach <[email protected]>2020-04-22 19:50:23 +0700
commit7acdcc2ebcf0d3e5a9949212d26d61357190dd7e (patch)
tree5dc4a6782a6028fab081b88cb6465a2994e19107 /examples/readme.md
parent19181ea11d4058b2b34672731bb650549f592418 (diff)
parente2cd5159fd041240257eb2d200ccee09ce26d08c (diff)
Merge branch 'master' into add-more-example
Diffstat (limited to 'examples/readme.md')
-rw-r--r--examples/readme.md37
1 files changed, 35 insertions, 2 deletions
diff --git a/examples/readme.md b/examples/readme.md
index b661d169f..8d3d2e415 100644
--- a/examples/readme.md
+++ b/examples/readme.md
@@ -32,12 +32,46 @@ Then compile with `make BOARD=[your_board] all`, for example
$ make BOARD=feather_nrf52840_express all
```
+### Debug Log
+
+### Log Level
+
+Should you have an issue running example and/or submitting an bug report. You could enable TinyUSB built-in debug logging with optional `LOG=`. LOG=1 will only print out error message, LOG=2 print more information with on-going events. LOG=3 or higher is not used yet.
+
+```
+$ make LOG=2 BOARD=feather_nrf52840_express all
+```
+
+### Logger
+
+By default log message is printed via on-board UART which is slow and take lots of CPU time comparing to USB speed. If your board support on-board/external debugger, it would be more efficient to use it for logging. There are 2 protocols:
+
+- `LOGGER=rtt`: use [Segger RTT protocol](https://www.segger.com/products/debug-probes/j-link/technology/about-real-time-transfer/)
+ - Cons: requires jlink as the debugger.
+ - Pros: work with most if not all MCUs
+ - Software viewer is JLink RTT Viewer/Client/Logger which is bundled with JLink driver package.
+- `LOGGER=swo`: Use dedicated SWO pin of ARM Cortex SWD debug header.
+ - Cons: only work with ARM Cortex MCUs minus M0
+ - Pros: even faster than RTT, and should be compatible with hardware and software debugger that support SWO.
+ - Software viewer is JLink SWO Viewer which is also bundled with JLink driver package.
+
+```
+$ make LOG=2 LOGGER=rtt BOARD=feather_nrf52840_express all
+$ make LOG=2 LOGGER=swo BOARD=feather_nrf52840_express all
+```
+
## Flash
-`flash` target will use the on-board debugger (jlink/cmsisdap/stlink/dfu) to flash the binary. We should install those debugger/programmer software in advance. Furthermore, since external jlink can be used with most of the board, there is also `flash-jlink` target for your convenience.
+`flash` target will use the default on-board debugger (jlink/cmsisdap/stlink/dfu) to flash the binary, please install those support software in advance. Some board use bootloader/DFU via serial which is required to pass to make command
```
$ make BOARD=feather_nrf52840_express flash
+$ make SERIAL=/dev/ttyACM0 BOARD=feather_nrf52840_express flash
+```
+
+Since jlink can be used with most of the boards, there is also `flash-jlink` target for your convenience.
+
+```
$ make BOARD=feather_nrf52840_express flash-jlink
```
@@ -46,4 +80,3 @@ Some board use uf2 bootloader for drag & drop in to mass storage device, uf2 can
```
$ make BOARD=feather_nrf52840_express all uf2
```
-