forked from wolfSSL/wolfssl
Update zephyr/README.md
This commit is contained in:
140
zephyr/README.md
140
zephyr/README.md
@ -3,134 +3,72 @@ Zephyr Project Port
|
|||||||
|
|
||||||
## Overview
|
## Overview
|
||||||
|
|
||||||
This port is for Zephyr Project available [here](https://www.zephyrproject.org/).
|
This port is for the Zephyr RTOS Project, available [here](https://www.zephyrproject.org/).
|
||||||
|
|
||||||
It provides the following zephyr code.
|
It provides the following zephyr code.
|
||||||
|
|
||||||
- modules/crypto/wolfssl
|
- modules/crypto/wolfssl
|
||||||
- wolfssl library code
|
- wolfssl library code
|
||||||
- zephyr/modules/crypto/wolfssl
|
- modules/crypto/wolfssl/zephyr/
|
||||||
- Configuration and make files for wolfSSL
|
- Configuration and CMake files for wolfSSL as a Zephyr module
|
||||||
- zephyr/samples/modules/wolfssl_test
|
- modules/crypto/wolfssl/zephyr/samples/wolfssl_test
|
||||||
- wolfcrypt unit test application
|
- wolfcrypt unit test application
|
||||||
- zephyr/samples/modules/wolfssl_tls_sock
|
- modules/crypto/wolfssl/zephyr/samples/wolfssl_tls_sock
|
||||||
- socket based sample of TLS
|
- socket based sample of TLS
|
||||||
- zephyr/samples/modules/wolfssl_tls_thread
|
- modules/crypto/wolfssl/zephyr/samples/wolfssl_tls_thread
|
||||||
- socket based sample of TLS using threads
|
- socket based sample of TLS using threads
|
||||||
|
|
||||||
## How to setup - automated
|
## How to setup as a Zephyr Module
|
||||||
|
|
||||||
### deploy wolfssl source to zephyr project
|
### Modify your project's west manifest
|
||||||
Specify the path of the zephyr project and execute `wolfssl/IDE/zephyr/setup.sh`.
|
|
||||||
|
|
||||||
```bash
|
Add wolfssl as a project:
|
||||||
./IDE/zephyr/setup.sh /path/to/zephyrproject
|
```
|
||||||
|
manifest:
|
||||||
|
remotes:
|
||||||
|
# <your other remotes>
|
||||||
|
- name: wolfssl
|
||||||
|
url-base: https://github.com/wolfssl
|
||||||
|
|
||||||
|
projects:
|
||||||
|
# <your other projects>
|
||||||
|
- name: wolfssl
|
||||||
|
path: modules/crypto/wolfssl
|
||||||
|
revision: master
|
||||||
|
remote: wolfssl
|
||||||
```
|
```
|
||||||
|
|
||||||
This script will deploy wolfssl's library code, configuration and samples as described in the Overview to the zephyr project.
|
Update west's modules:
|
||||||
|
|
||||||
## build & test
|
```bash
|
||||||
|
west update
|
||||||
|
```
|
||||||
|
|
||||||
|
Now west recognizes 'wolfssl' as a module, and will include it's Kconfig and CMakeFiles.txt in the build system.
|
||||||
|
|
||||||
|
## Build & test
|
||||||
|
|
||||||
build and execute wolfssl_test
|
build and execute wolfssl_test
|
||||||
|
|
||||||
```
|
```
|
||||||
cd [zephyrproject]
|
cd [zephyrproject]
|
||||||
west build -p auto -b qemu_x86 zephyr/samples/modules/wolfssl_test
|
west build -p auto -b qemu_x86 modules/crypto/wolfssl/zephyr/samples/wolfssl_test
|
||||||
west build -t run
|
west build -t run
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Run wolfSSL example wolfssl_tls_sock
|
||||||
## How to setup - step by step
|
|
||||||
|
|
||||||
export ZEPHYR_DIR=<Zephyr project directory>
|
|
||||||
export WOLFSSL_DIR=<wolfSSL directory>
|
|
||||||
|
|
||||||
### Install wolfSSL library code
|
|
||||||
|
|
||||||
```
|
```
|
||||||
(cd lib; ./install_lib.sh $ZEPHYR_DIR)
|
cd [zephyrproject]
|
||||||
|
west build -p auto -b qemu_x86 modules/crypto/wolfssl/zephyr/samples/wolfssl_tls_sock
|
||||||
|
west build -t run
|
||||||
```
|
```
|
||||||
|
|
||||||
or
|
### Run wolfSSL example wolfssl_tls_thread
|
||||||
|
|
||||||
```
|
```
|
||||||
mkdir -p $ZEPHYR_DIR/modules/crypto/wolfssl/wolfssl/library/src
|
cd [zephyrproject]
|
||||||
mkdir -p $ZEPHYR_DIR/modules/crypto/wolfssl/wolfssl/library/wolfcrypt/src
|
west build -p auto -b qemu_x86 modules/crypto/wolfssl/zephyr/samples/wolfssl_tls_thread
|
||||||
mkdir -p $ZEPHYR_DIR/modules/crypto/wolfssl/wolfssl/include
|
west build -t run
|
||||||
|
|
||||||
cp -r lib/* $ZEPHYR_DIR/modules/crypto/wolfssl
|
|
||||||
mv $ZEPHYR_DIR/modules/crypto/wolfssl/wolfssl/zephyr $ZEPHYR_DIR/modules/crypto/wolfssl/zephyr
|
|
||||||
|
|
||||||
cp -rf $WOLFSSL_DIR/src/*.c $ZEPHYR_DIR/modules/crypto/wolfssl/wolfssl/library/src/
|
|
||||||
cp -rf $WOLFSSL_DIR/wolfcrypt/src/*.c $ZEPHYR_DIR/modules/crypto/wolfssl/wolfssl/library/wolfcrypt/src/
|
|
||||||
cp -rf $WOLFSSL_DIR/wolfcrypt/src/*.i $ZEPHYR_DIR/modules/crypto/wolfssl/wolfssl/library/wolfcrypt/src/
|
|
||||||
cp -rf $WOLFSSL_DIR/wolfcrypt/src/*.S $ZEPHYR_DIR/modules/crypto/wolfssl/wolfssl/library/wolfcrypt/src/
|
|
||||||
|
|
||||||
cp lib/user_settings.h $ZEPHYR_DIR/modules/crypto/wolfssl/include
|
|
||||||
cp -rf $WOLFSSL_DIR/wolfssl $ZEPHYR_DIR/modules/crypto/wolfssl/include
|
|
||||||
rm -f $ZEPHYR_DIR/modules/crypto/wolfssl/include/wolfssl/options.h
|
|
||||||
touch $ZEPHYR_DIR/modules/crypto/wolfssl/include/wolfssl/options.h
|
|
||||||
rm -rf $ZEPHYR_DIR/modules/crypto/wolfssl/include/wolfssl/wolfcrypt/port
|
|
||||||
```
|
|
||||||
|
|
||||||
### Install wolfSSL mdule (build system hooks)
|
|
||||||
|
|
||||||
```
|
|
||||||
(cd module; ./install_module.sh $ZEPHYR_DIR)
|
|
||||||
```
|
|
||||||
|
|
||||||
or
|
|
||||||
|
|
||||||
```
|
|
||||||
mkdir $ZEPHYR_DIR/zephyr/modules/crypto/wolfssl;
|
|
||||||
cp module/* $ZEPHYR_DIR/zephyr/modules/crypto/wolfssl/
|
|
||||||
```
|
|
||||||
|
|
||||||
### Add wolfSSL to west
|
|
||||||
|
|
||||||
Add the following lines in 'projects' to: $ZEPHYR_DIR/zephyr/west.yml
|
|
||||||
|
|
||||||
```
|
|
||||||
- name: wolfssl
|
|
||||||
path: modules/crypto/wolfssl
|
|
||||||
```
|
|
||||||
|
|
||||||
### Install wolfSSL example wolfssl_test
|
|
||||||
|
|
||||||
```
|
|
||||||
(cd wolfssl_test; ./install_test.sh $ZEPHYR_DIR)
|
|
||||||
```
|
|
||||||
|
|
||||||
or
|
|
||||||
|
|
||||||
```
|
|
||||||
cp wolfssl_test $ZEPHYR_DIR/zephyr/samples/modules
|
|
||||||
mkdir $ZEPHYR_DIR/zephyr/samples/modules/src
|
|
||||||
cp $WOLFSSL_DIR/wolfcrypt/test/test.c $ZEPHYR_DIR/zephyr/samples/modules/src
|
|
||||||
cp $WOLFSSL_DIR/wolfcrypt/test/test.h $ZEPHYR_DIR/zephyr/samples/modules/src
|
|
||||||
```
|
|
||||||
|
|
||||||
### Install wolfSSL example wolfssl_tls_sock
|
|
||||||
|
|
||||||
```
|
|
||||||
(cd wolfssl_tls_sock; ./install_sample.sh $ZEPHYR_DIR)
|
|
||||||
```
|
|
||||||
|
|
||||||
or
|
|
||||||
|
|
||||||
```
|
|
||||||
cp wolfssl_tls_sock $ZEPHYR_DIR/zephyr/samples/modules
|
|
||||||
```
|
|
||||||
|
|
||||||
### Install wolfSSL example wolfssl_tls_thread
|
|
||||||
|
|
||||||
```
|
|
||||||
(cd wolfssl_tls_thread; ./install_sample.sh $ZEPHYR_DIR)
|
|
||||||
```
|
|
||||||
|
|
||||||
or
|
|
||||||
|
|
||||||
```
|
|
||||||
cp wolfssl_tls_thread $ZEPHYR_DIR/zephyr/samples/modules
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user