1Apache Mynewt Port
2=============
3
4## Overview
5
6This port is for Apache Mynewt available [here](https://mynewt.apache.org/).
7
8It provides follows mynewt packages.
9
10- crypto/wolfssl
11    - wolfssl library
12- apps/wolfcrypttest
13    - wolfcrypt unit test application
14
15## How to setup
16
17### delopy wolfssl source to mynewt project
18Specify the path of the mynewt project and execute  `wolfssl/IDE/mynewt/setup.sh`.
19
20```bash
21./IDE/mynewt/setup.sh /path/to/myproject_path
22```
23
24This script will deploy wolfssl's mynewt package described in the Overview to the mynewt project.
25
26## Customization
27### logging
28
29To enable logging, please append `-DDEBUG_WOLFSSL` to `crypto.wolfssl.pkg.yml`(or `/path/to/myproject_path/crypto/wolfssl/pkg.yml`) in `pkg.cflags:` and inject dependency of mynewt log modules.
30
31mynewt/crypto.wolfssl.pkg.yml
32```yaml
33pkg.req_apis:
34    ...
35    - log
36    - stats
37    - console
38pkg.cflags: -DWOLFSSL_APACHE_MYNEWT ... -DDEBUG_WOLFSSL
39```
40
41Please add `wolfSSL_Debugging_ON()` to application code.
42
43When it executes application, display tty device for output display devices.
44please confirm with the `cat /dev/ttysXXX` command or `kermit` or `screen`.
45
46## example setting example applications to targets
47
48This section eplains how to set wolfssl example application to target device.
49
50Please execute follows commands at only once.
51
52create wolfcrypttest_sim that is simulator device for unit test of wolfcrypt.
53
54```
55cd /path/to/myproject_path
56newt target create wolfcrypttest_sim
57newt target set wolfcrypttest_sim app=apps/wolfcrypttest
58newt target set wolfcrypttest_sim bsp=@apache-mynewt-core/hw/bsp/native
59newt target set wolfcrypttest_sim build_profile=debug
60```
61
62## build & test
63
64build and execute wolfcrypttest_sim
65
66```
67newt clean wolfcrypttest_sim
68newt build wolfcrypttest_sim
69./bin/targets/wolfcrypttest_sim/app/apps/wolfcrypttest/wolfcrypttest.elf
70```
71
72