[修改] 增加freeRTOS

1. 版本FreeRTOSv202212.01,命名为kernel;
This commit is contained in:
2023-05-06 16:43:01 +00:00
commit a345df017b
20944 changed files with 11094377 additions and 0 deletions

View File

@ -0,0 +1,71 @@
Apache Mynewt Port
=============
## Overview
This port is for Apache Mynewt available [here](https://mynewt.apache.org/).
It provides follows mynewt packages.
- crypto/wolfssl
- wolfssl library
- apps/wolfcrypttest
- wolfcrypt unit test application
## How to setup
### delopy wolfssl source to mynewt project
Specify the path of the mynewt project and execute `wolfssl/IDE/mynewt/setup.sh`.
```bash
./IDE/mynewt/setup.sh /path/to/myproject_path
```
This script will deploy wolfssl's mynewt package described in the Overview to the mynewt project.
## Customization
### logging
To 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.
mynewt/crypto.wolfssl.pkg.yml
```yaml
pkg.req_apis:
...
- log
- stats
- console
pkg.cflags: -DWOLFSSL_APACHE_MYNEWT ... -DDEBUG_WOLFSSL
```
Please add `wolfSSL_Debugging_ON()` to application code.
When it executes application, display tty device for output display devices.
please confirm with the `cat /dev/ttysXXX` command or `kermit` or `screen`.
## example setting example applications to targets
This section eplains how to set wolfssl example application to target device.
Please execute follows commands at only once.
create wolfcrypttest_sim that is simulator device for unit test of wolfcrypt.
```
cd /path/to/myproject_path
newt target create wolfcrypttest_sim
newt target set wolfcrypttest_sim app=apps/wolfcrypttest
newt target set wolfcrypttest_sim bsp=@apache-mynewt-core/hw/bsp/native
newt target set wolfcrypttest_sim build_profile=debug
```
## build & test
build and execute wolfcrypttest_sim
```
newt clean wolfcrypttest_sim
newt build wolfcrypttest_sim
./bin/targets/wolfcrypttest_sim/app/apps/wolfcrypttest/wolfcrypttest.elf
```

View File

@ -0,0 +1,32 @@
# Copyright (C) 2006-2020 wolfSSL Inc.
#
# This file is part of wolfSSL.
#
# wolfSSL is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# wolfSSL is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
#/
#
pkg.name: "apps/wolfcrypttest"
pkg.type: app
pkg.description: "wolfCrypt Test Application"
pkg.author: "wolfSSL <info@wolfssl.com>"
pkg.homepage: "https://www.wolfssl.com"
pkg.keywords:
pkg.deps:
- crypto/wolfssl
- "@apache-mynewt-core/kernel/os"
- "@apache-mynewt-core/sys/console/full"
pkg.cflags: -DWOLFSSL_APACHE_MYNEWT -Icrypto/wolfssl/src -Wno-error -DNO_FILESYSTEM -DWOLFSSL_IGNORE_FILE_WARN

View File

@ -0,0 +1,31 @@
# Copyright (C) 2006-2020 wolfSSL Inc.
#
# This file is part of wolfSSL.
#
# wolfSSL is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# wolfSSL is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
#/
#
pkg.name: "crypto/wolfssl"
pkg.description: "wolfSSL Embedded SSL/TLS Library"
pkg.author: "wolfSSL<info@wolfssl.com>"
pkg.homepage: "https://www.wolfssl.com"
pkg.keywords:
pkg.deps:
- "@apache-mynewt-core/net/ip/mn_socket"
pkg.cflags: -DWOLFSSL_APACHE_MYNEWT -DNO_FILESYSTEM -Wno-error -DHAVE_TLS_EXTENSIONS -DHAVE_SUPPORTED_CURVES # -DDEBUG_WOLFSSL -DWOLFSSL_IGNORE_FILE_WARN

View File

@ -0,0 +1,5 @@
syscfg.defs:
WOLFSSL_MNSOCK_MEM_BUF_COUNT:
value: 10
WOLFSSL_MNSOCK_MEM_BUF_SIZE:
value: 2048

View File

@ -0,0 +1,10 @@
# vim:ft=automake
# included from Top Level Makefile.am
# All paths should be given relative to the root
EXTRA_DIST+= IDE/mynewt/README.md
EXTRA_DIST+= IDE/mynewt/apps.wolfcrypttest.pkg.yml
EXTRA_DIST+= IDE/mynewt/crypto.wolfssl.pkg.yml
EXTRA_DIST+= IDE/mynewt/crypto.wolfssl.syscfg.yml
EXTRA_DIST+= IDE/mynewt/setup.sh

View File

@ -0,0 +1,73 @@
#!/bin/bash -e
# this scrypt deploy wolfssl and wolfcrypto source code to mynewt project
# run as bash "mynewt project root directory path"
SCRIPTDIR=`dirname $0`
SCRIPTDIR=`cd $SCRIPTDIR && pwd -P`
WOLFSSL_MYNEWTDIR=${SCRIPTDIR}
WOLFSSL_MYNEWTDIR=`cd $WOLFSSL_MYNEWTDIR && pwd -P`
BASEDIR=${SCRIPTDIR}/../..
BASEDIR=`cd ${BASEDIR} && pwd -P`
if [ $# -ne 1 ]; then
echo "Usage: $0 'mynewt project root directory path'" 1>&2
exit 1
fi
MYNEWT_PROJECT=$1
if [ ! -d $MYNEWT_PROJECT ] || [ ! -f $MYNEWT_PROJECT/project.yml ]; then
echo "target directory is not mynewt project.: $MYNEWT_PROJECT"
exit 1
fi
# create wolfssl pkgs to mynewt project
pushd $MYNEWT_PROJECT > /dev/null
echo "create crypto/wolfssl pkg"
/bin/rm -rf crypto/wolfssl
newt pkg new crypto/wolfssl
/bin/rm -rf crypto/wolfssl/include
/bin/mkdir -p crypto/wolfssl/include
/bin/rm -rf crypto/wolfssl/src
/bin/mkdir -p crypto/wolfssl/src
echo "create apps/wolfcrypttest pkg"
/bin/rm -rf apps/wolfcrypttest
newt pkg new -t app apps/wolfcrypttest
/bin/rm -rf apps/wolfcrypttest/include
/bin/rm -rf apps/wolfcrypttest/src
/bin/mkdir -p apps/wolfcrypttest/src
popd > /dev/null # $MYNEWT_PROJECT
# deploy source files and pkg
pushd $BASEDIR > /dev/null
# deploy to crypto/wolfssl
echo "deploy wolfssl sources to crypto/wolfssl"
/bin/cp $WOLFSSL_MYNEWTDIR/crypto.wolfssl.pkg.yml $MYNEWT_PROJECT/crypto/wolfssl/pkg.yml
/bin/cp $WOLFSSL_MYNEWTDIR/crypto.wolfssl.syscfg.yml $MYNEWT_PROJECT/crypto/wolfssl/syscfg.yml
/bin/mkdir -p $MYNEWT_PROJECT/crypto/wolfssl/src/src
/bin/cp ./src/*.c $MYNEWT_PROJECT/crypto/wolfssl/src/src
/bin/mkdir -p $MYNEWT_PROJECT/crypto/wolfssl/src/wolfcrypt/src
/bin/cp ./wolfcrypt/src/*.asm $MYNEWT_PROJECT/crypto/wolfssl/src/wolfcrypt/src
/bin/cp ./wolfcrypt/src/*.c $MYNEWT_PROJECT/crypto/wolfssl/src/wolfcrypt/src
/bin/mkdir -p $MYNEWT_PROJECT/crypto/wolfssl/src/wolfcrypt/src/port/mynewt
/bin/cp ./wolfcrypt/src/port/mynewt/* $MYNEWT_PROJECT/crypto/wolfssl/src/wolfcrypt/src/port/mynewt
/bin/mkdir -p $MYNEWT_PROJECT/crypto/wolfssl/include/wolfssl
/bin/cp -r wolfssl/* $MYNEWT_PROJECT/crypto/wolfssl/include/wolfssl/
# deploy to apps/wolfcrypttest
echo "deploy unit test sources to apps/wolfcrypttest"
/bin/cp $WOLFSSL_MYNEWTDIR/apps.wolfcrypttest.pkg.yml $MYNEWT_PROJECT/apps/wolfcrypttest/pkg.yml
/bin/mkdir -p $MYNEWT_PROJECT/apps/wolfcrypttest/include/wolfcrypt/test
/bin/cp -r wolfcrypt/test/test.h $MYNEWT_PROJECT/apps/wolfcrypttest/include/wolfcrypt/test/
/bin/mkdir -p $MYNEWT_PROJECT/apps/wolfcrypttest/src
/bin/cp wolfcrypt/test/test.c $MYNEWT_PROJECT/apps/wolfcrypttest/src/main.c
popd > /dev/null # $BASEDIR