Update code to v1.0.14 (10)

This commit is contained in:
Caten
2024-02-29 19:35:00 +08:00
parent c2ee3b694c
commit a956d26f6d
3188 changed files with 2317293 additions and 146 deletions

View File

@@ -0,0 +1 @@
**/.xdcenv.mak

17
android/extern/wolfssl/tirtos/README vendored Normal file
View File

@@ -0,0 +1,17 @@
# wolfSSL library for TI-RTOS
This directory contains the files that build wolfSSL library for TI-RTOS.
Please follow the instructions in "Using wolfSSL with TI-RTOS" (http://processors.wiki.ti.com/index.php/Using_wolfSSL_with_TI-RTOS) to build the wolfSSL
library and the example applications.
Also read TI-RTOS Getting Started Guide and TI-RTOS User Guide to learn more
about TI-RTOS (http://www.ti.com/tool/ti-rtos).
For more information see:
(https://github.com/wolfSSL/wolfssl-examples/blob/master/tirtos_ccs_examples/README.md)
## Example Application
A simple "TCP echo server with TLS" example application is provided with TI-RTOS
product. Look in the TI-RTOS Getting Started Guide for instructions to build
examples.

View File

@@ -0,0 +1,23 @@
# vim:ft=automake
# included from Top Level Makefile.am
# All paths should be given relative to the root
EXTRA_DIST += \
tirtos/README \
tirtos/wolfssl.bld \
tirtos/wolfssl.mak \
tirtos/products.mak \
tirtos/packages/ti/net/wolfssl/package.bld \
tirtos/packages/ti/net/wolfssl/package.xdc \
tirtos/packages/ti/net/wolfssl/package.xs \
tirtos/packages/ti/net/wolfssl/tests/EK_TM4C1294XL/wolfcrypt/test/package.bld.hide \
tirtos/packages/ti/net/wolfssl/tests/EK_TM4C1294XL/wolfcrypt/test/package.xdc \
tirtos/packages/ti/net/wolfssl/tests/EK_TM4C1294XL/wolfcrypt/test/test.cfg \
tirtos/packages/ti/net/wolfssl/tests/EK_TM4C1294XL/wolfcrypt/test/TM4C1294NC.icf \
tirtos/packages/ti/net/wolfssl/tests/EK_TM4C1294XL/wolfcrypt/test/main.c \
tirtos/packages/ti/net/wolfssl/tests/EK_TM4C1294XL/wolfcrypt/benchmark/package.bld.hide \
tirtos/packages/ti/net/wolfssl/tests/EK_TM4C1294XL/wolfcrypt/benchmark/package.xdc \
tirtos/packages/ti/net/wolfssl/tests/EK_TM4C1294XL/wolfcrypt/benchmark/benchmark.cfg \
tirtos/packages/ti/net/wolfssl/tests/EK_TM4C1294XL/wolfcrypt/benchmark/TM4C1294NC.icf \
tirtos/packages/ti/net/wolfssl/tests/EK_TM4C1294XL/wolfcrypt/benchmark/main.c

View File

@@ -0,0 +1,67 @@
/*
* ======== package.bld ========
* Build script for wolfSSL library
*/
var Build = xdc.useModule('xdc.bld.BuildEnvironment');
var Pkg = xdc.useModule('xdc.bld.PackageContents');
/* make command to search for the srcs */
Pkg.makePrologue = "vpath %.c $(subst ;, ,$(XPKGPATH))";
/* WOLFSSL sources */
var wolfSSLObjList = [
"wolfcrypt/src/aes.c",
"wolfcrypt/src/arc4.c",
"wolfcrypt/src/asm.c",
"wolfcrypt/src/asn.c",
"wolfcrypt/src/blake2b.c",
"wolfcrypt/src/camellia.c",
"wolfcrypt/src/chacha.c",
"wolfcrypt/src/coding.c",
"wolfcrypt/src/des3.c",
"wolfcrypt/src/dh.c",
"wolfcrypt/src/dsa.c",
"wolfcrypt/src/ecc.c",
"wolfcrypt/src/error.c",
"wolfcrypt/src/hmac.c",
"wolfcrypt/src/hash.c",
"wolfcrypt/src/integer.c",
"wolfcrypt/src/kdf.c",
"wolfcrypt/src/logging.c",
"wolfcrypt/src/md4.c",
"wolfcrypt/src/md5.c",
"wolfcrypt/src/memory.c",
"wolfcrypt/src/poly1305.c",
"wolfcrypt/src/pwdbased.c",
"wolfcrypt/src/random.c",
"wolfcrypt/src/rsa.c",
"wolfcrypt/src/sha.c",
"wolfcrypt/src/sha256.c",
"wolfcrypt/src/sha512.c",
"wolfcrypt/src/sp_int.c",
"wolfcrypt/src/sp_c32.c",
"wolfcrypt/src/sp_cortexm.c",
"wolfcrypt/src/tfm.c",
"wolfcrypt/src/wc_port.c",
"wolfcrypt/src/wolfmath.c",
"wolfcrypt/src/wc_encrypt.c",
"src/internal.c",
"src/wolfio.c",
"src/keys.c",
"src/ssl.c",
"src/tls.c",
];
for each (var targ in Build.targets) {
var libOptions = {incs: wolfsslPathInclude};
var lib = Pkg.addLibrary("lib/wolfssl", targ, libOptions);
lib.addObjects(wolfSSLObjList);
var hwLibptions = {incs: wolfsslPathInclude, defs: " -DWOLFSSL_TI_HASH "
+ "-DWOLFSSL_TI_CRYPT -DTARGET_IS_SNOWFLAKE_RA2"};
var hwLib = Pkg.addLibrary("lib/wolfssl_tm4c_hw", targ, hwLibptions);
hwLib.addObjects(wolfSSLObjList);
}

View File

@@ -0,0 +1,6 @@
/*!
* ======== ti.net.wolfssl ========
* wolfSSL library for TI-RTOS
*/
package ti.net.wolfssl [1, 0, 0] {
}

View File

@@ -0,0 +1,12 @@
/*
* ======== package.xs ========
*/
/*
* ======== getLibs ========
* Contribute wolfSSL library.
*/
function getLibs(prog)
{
return ("lib/wolfssl.a" + prog.build.target.suffix);
}

View File

@@ -0,0 +1,29 @@
/*###ICF### Section handled by ICF editor, don't touch! ****/
/*-Editor annotation file-*/
/* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */
/*-Specials-*/
define symbol __ICFEDIT_intvec_start__ = 0x00000000;
/*-Memory Regions-*/
define symbol __ICFEDIT_region_ROM_start__ = 0x00000000;
define symbol __ICFEDIT_region_ROM_end__ = 0x000FFFFF;
define symbol __ICFEDIT_region_RAM_start__ = 0x20000000;
define symbol __ICFEDIT_region_RAM_end__ = 0x2003FFFF;
/*-Sizes-*/
define symbol __ICFEDIT_size_cstack__ = 0x8000;
define symbol __ICFEDIT_size_heap__ = 0x10000;
/**** End of ICF editor section. ###ICF###*/
define memory mem with size = 4G;
define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__];
define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__];
define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { };
define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { };
initialize by copy { readwrite };
do not initialize { section .noinit };
place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec };
place in ROM_region { readonly };
place in RAM_region { readwrite,
block CSTACK, block HEAP };

View File

@@ -0,0 +1,81 @@
/*
* ======== benchmark.cfg ========
*/
/* ================ General configuration ================ */
var Defaults = xdc.useModule('xdc.runtime.Defaults');
var Diags = xdc.useModule('xdc.runtime.Diags');
var Error = xdc.useModule('xdc.runtime.Error');
var Log = xdc.useModule('xdc.runtime.Log');
var Main = xdc.useModule('xdc.runtime.Main');
var Memory = xdc.useModule('xdc.runtime.Memory');
var System = xdc.useModule('xdc.runtime.System');
var Text = xdc.useModule('xdc.runtime.Text');
var Timestamp = xdc.useModule('xdc.runtime.Timestamp');
var BIOS = xdc.useModule('ti.sysbios.BIOS');
var Clock = xdc.useModule('ti.sysbios.knl.Clock');
var Task = xdc.useModule('ti.sysbios.knl.Task');
var Semaphore = xdc.useModule('ti.sysbios.knl.Semaphore');
var Hwi = xdc.useModule('ti.sysbios.hal.Hwi');
var HeapMem = xdc.useModule('ti.sysbios.heaps.HeapMem');
var Timer = xdc.useModule('ti.sysbios.hal.Timer');
BIOS.heapSize = 86016;
Task.idleTaskStackSize = 768;
/*
* Program.stack is ignored with IAR. Use the project options in
* IAR Embedded Workbench to alter the system stack size.
*/
if (!Program.build.target.$name.match(/iar/)) {
/*
* Reducing the system stack size (used by ISRs and Swis) to reduce
* RAM usage.
*/
Program.stack = 2048;
}
/* ================ System configuration ================ */
var SysMin = xdc.useModule('xdc.runtime.SysMin');
SysMin.bufSize = 128;
System.SupportProxy = SysMin;
/* Enable Semihosting for GNU targets to print to CCS console */
if (Program.build.target.$name.match(/gnu/)) {
var SemiHost = xdc.useModule('ti.sysbios.rts.gnu.SemiHostSupport');
}
/* ================ NDK configuration ================ */
var Ndk = xdc.loadPackage('ti.ndk.config');
var Global = xdc.useModule('ti.ndk.config.Global');
var Tcp = xdc.useModule('ti.ndk.config.Tcp');
Global.IPv6 = false;
Global.stackLibType = Global.MIN;
Global.pktNumFrameBufs = 10;
Global.memRawPageCount = 6;
Global.ndkThreadStackSize = 1536;
Global.lowTaskStackSize = 1024;
Global.normTaskStackSize = 1024;
Global.highTaskStackSize = 1024;
Tcp.transmitBufSize = 1024;
Tcp.receiveBufSize = 1024;
/* ================ Driver configuration ================ */
var TIRTOS = xdc.useModule('ti.tirtos.TIRTOS');
TIRTOS.useEMAC = true;
TIRTOS.useGPIO = true;
/* ================ wolfSSL configuration ================ */
try {
var wolfSSL = xdc.loadPackage('ti.net.wolfssl');
}
catch (e) {
print("Error: Could not find wolfSSL library! Make sure the wolfSSL library"
+ " is built and package path is updated for the build tool"
+ " to find the library. More detailed wolfSSL build instructions"
+ " can be found in the TI-RTOS user guide.");
}

View File

@@ -0,0 +1,106 @@
/*
* ======== main.c ========
* Entry point for Benchmark application
*/
/* BIOS Header files */
#include <ti/sysbios/BIOS.h>
#include <ti/sysbios/knl/Swi.h>
#include <xdc/runtime/System.h>
#include <ti/sysbios/knl/Task.h>
#include <ti/sysbios/hal/Timer.h>
static int initialized = 0;
static double msTicks = 0;
static Timer_Handle hdl = NULL;
double current_time(int reset);
static void tick(unsigned int arg0);
void msTimer_init(void);
void runBenchmarks(UArg arg0, UArg arg1);
extern int benchmark_test(void* args);
/*
* ======== runBenchmarks ========
* Run the wolfSSL benchmark application
*/
void runBenchmarks(UArg arg0, UArg arg1)
{
void *args = NULL;
msTimer_init();
System_printf("Running benchmarks...\n");
System_flush();
benchmark_test(args);
System_printf("Benchmarks completed.\n");
BIOS_exit(0);
}
/*
* ======== ticks ========
* Keeps track of time in millisec
*/
static void tick(unsigned int arg0)
{
Swi_disable();
msTicks++;
Swi_enable();
}
/*
* ======== current_time ========
* Returns the time in sec (double precision)
*/
double current_time(int reset)
{
if (reset) {
msTicks = 0;
}
return (msTicks/1000);
}
/*
* ======== msTimer_init ========
* Sets up a BIOS timer with millisec period
*/
void msTimer_init(void)
{
Timer_Params params;
if (initialized) {
return;
}
Timer_Params_init(&params);
params.period = 1000;
params.periodType = Timer_PeriodType_MICROSECS;
params.runMode = Timer_RunMode_CONTINUOUS;
params.startMode = Timer_StartMode_AUTO;
hdl = Timer_create(-1, (ti_sysbios_hal_Timer_FuncPtr)tick,
&params, NULL);
if (!hdl) {
System_abort("msTimer_init: Timer creation failed.\n");
}
/* Set flag indicating that initialization has completed */
initialized = 1;
}
/*
* ======== main ========
*/
int main(int argc, char** argv)
{
/* Initialize the defaults and set the parameters. */
Task_Handle handle;
Task_Params taskParams;
Task_Params_init(&taskParams);
taskParams.stackSize = 65535;
handle = Task_create(runBenchmarks, &taskParams, NULL);
if (handle == NULL) {
System_printf("main: Failed to create new Task.\n");
}
BIOS_start();
}

View File

@@ -0,0 +1,53 @@
/*
* ======== package.bld ========
* Build script for benchmark application
*/
if ((typeof(TivaWareDir) == undefined) || (TivaWareDir == "")) {
throw("ERROR: NO VALID TIVAWARE PATH DEFINED!!!");
}
var Build = xdc.useModule('xdc.bld.BuildEnvironment');
var Pkg = xdc.useModule('xdc.bld.PackageContents');
/* make command to search for the srcs */
Pkg.makePrologue = "vpath %.c $(subst ;, ,$(XPKGPATH))";
var srcs = [
"main.c",
"wolfcrypt/benchmark/benchmark.c",
"examples/boards/EK_TM4C1294XL/EK_TM4C1294XL.c",
];
for each (var targ in Build.targets) {
var lnkOpts = "";
var platform = "ti.platforms.tiva:TM4C1294NCPDT:1";
if (targ.$name.match(/^ti/)) {
lnkOpts = " -l" + TivaWareDir + "/driverlib/ccs/Debug/driverlib.lib";
lnkOpts += " -x ";
}
else if (targ.$name.match(/^iar/)) {
lnkOpts = TivaWareDir + "/driverlib/ewarm/Exe/driverlib.a"
+ " --config TM4C1294NC.icf";
platform = "ti.platforms.tiva:TM4C1294NCPDT";
/* Floating point print support */
var suffix = targ.$orig.lnkOpts.suffix;
targ.$orig.lnkOpts.suffix = suffix.replace(/PrintfSmall/, "PrintfFull");
}
else if (targ.$name.match(/^gnu/)) {
targ.$orig.lnkOpts.suffix += " -L" + TivaWareDir + "/driverlib/gcc "
+ " -Wl,--start-group -ldriver -Wl,--end-group ";
targ.$orig.bspLib = "rdimon";
}
var exeOptions = { incs: wolfsslPathInclude
+ " -DNO_MAIN_DRIVER -D_INCLUDE_NIMU_CODE -DBENCH_EMBEDDED "
+ " -DTIVAWARE -DPART_TM4C1294NCPDT",
lopts: lnkOpts
};
var exe = Pkg.addExecutable("benchmark", targ, platform, exeOptions);
exe.addObjects(srcs);
}

View File

@@ -0,0 +1,6 @@
/*
* ======== ti.net.wolfssl.tests.EK_TM4C1294XL.wolfcrypt.benchmark ========
* wc_ Benchmark Application
*/
package ti.net.wolfssl.tests.EK_TM4C1294XL.wolfcrypt.benchmark [1, 0, 0] {
}

View File

@@ -0,0 +1,29 @@
/*###ICF### Section handled by ICF editor, don't touch! ****/
/*-Editor annotation file-*/
/* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */
/*-Specials-*/
define symbol __ICFEDIT_intvec_start__ = 0x00000000;
/*-Memory Regions-*/
define symbol __ICFEDIT_region_ROM_start__ = 0x00000000;
define symbol __ICFEDIT_region_ROM_end__ = 0x000FFFFF;
define symbol __ICFEDIT_region_RAM_start__ = 0x20000000;
define symbol __ICFEDIT_region_RAM_end__ = 0x2003FFFF;
/*-Sizes-*/
define symbol __ICFEDIT_size_cstack__ = 0x8000;
define symbol __ICFEDIT_size_heap__ = 0x10000;
/**** End of ICF editor section. ###ICF###*/
define memory mem with size = 4G;
define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__];
define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__];
define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { };
define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { };
initialize by copy { readwrite };
do not initialize { section .noinit };
place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec };
place in ROM_region { readonly };
place in RAM_region { readwrite,
block CSTACK, block HEAP };

View File

@@ -0,0 +1,55 @@
/*
* ======== main.c ========
* Entry point to wolfcrypt Test Application
*/
/* XDCtools Header files */
#include <ti/sysbios/BIOS.h>
#include <ti/sysbios/knl/Task.h>
#include <xdc/runtime/System.h>
/* func_args from test.h, so don't have to pull in other junk */
typedef struct func_args {
int argc;
char** argv;
int return_code;
} func_args;
extern int wolfcrypt_test(void* args);
/*
* ======== testwolfcrypt ========
* Run the wolfcrypt test
*/
void testwolfcrypt(UArg arg0, UArg arg1)
{
System_printf("Running wolfcrypt tests...\n");
System_flush();
wolfcrypt_test((void *)arg0);
System_printf("Tests completed.\n");
BIOS_exit(0);
}
/*
* ======== main ========
*/
int main(int argc, char** argv)
{
func_args args;
args.argc = argc;
args.argv = argv;
/* Initialize the defaults and set the parameters. */
Task_Handle handle;
Task_Params taskParams;
Task_Params_init(&taskParams);
taskParams.arg0 = (UArg)&args;
taskParams.stackSize = 65535;
handle =Task_create(testwolfcrypt, &taskParams, NULL);
if (handle == NULL) {
System_printf("main: Failed to create new Task.\n");
return (-1);
}
BIOS_start();
}

View File

@@ -0,0 +1,49 @@
/*
* ======== package.bld ========
* Build script for wolfcrypt Test
*/
if ((typeof(TivaWareDir) == undefined) || (TivaWareDir == "")) {
throw("ERROR: NO VALID TIVAWARE PATH DEFINED!!!");
}
var Build = xdc.useModule('xdc.bld.BuildEnvironment');
var Pkg = xdc.useModule('xdc.bld.PackageContents');
/* make command to search for the srcs */
Pkg.makePrologue = "vpath %.c $(subst ;, ,$(XPKGPATH))";
var srcs = [
"main.c",
"wolfcrypt/test/test.c",
"examples/boards/EK_TM4C1294XL/EK_TM4C1294XL.c",
];
for each (var targ in Build.targets) {
var lnkOpts = "";
var platform = "ti.platforms.tiva:TM4C1294NCPDT:1";
if (targ.$name.match(/^ti/)) {
lnkOpts = " -l" + TivaWareDir + "/driverlib/ccs/Debug/driverlib.lib";
lnkOpts += " -x ";
}
else if (targ.$name.match(/^iar/)) {
lnkOpts = TivaWareDir + "/driverlib/ewarm/Exe/driverlib.a"
+ " --config TM4C1294NC.icf";
platform = "ti.platforms.tiva:TM4C1294NCPDT";
}
else if (targ.$name.match(/^gnu/)) {
targ.$orig.lnkOpts.suffix += " -L" + TivaWareDir + "/driverlib/gcc "
+ " -Wl,--start-group -ldriver -Wl,--end-group ";
targ.$orig.bspLib = "rdimon";
}
var exeOptions = { incs: wolfsslPathInclude
+ " -DNO_MAIN_DRIVER -D_INCLUDE_NIMU_CODE -DBENCH_EMBEDDED "
+ " -DTIVAWARE -DPART_TM4C1294NCPDT",
lopts: lnkOpts,
};
var exe = Pkg.addExecutable("test", targ, platform, exeOptions);
exe.addObjects(srcs);
}

View File

@@ -0,0 +1,6 @@
/*
* ======== ti.net.wolfssl.tests.EK_TM4C1294XL.wolfcrypt.test ========
* wolfcrypt Test Application
*/
package ti.net.wolfssl.tests.EK_TM4C1294XL.wolfcrypt.test [1, 0, 0] {
}

View File

@@ -0,0 +1,80 @@
/*
* ======== test.cfg ========
*/
/* ================ General configuration ================ */
var Defaults = xdc.useModule('xdc.runtime.Defaults');
var Diags = xdc.useModule('xdc.runtime.Diags');
var Error = xdc.useModule('xdc.runtime.Error');
var Log = xdc.useModule('xdc.runtime.Log');
var Main = xdc.useModule('xdc.runtime.Main');
var Memory = xdc.useModule('xdc.runtime.Memory');
var System = xdc.useModule('xdc.runtime.System');
var Text = xdc.useModule('xdc.runtime.Text');
var Timestamp = xdc.useModule('xdc.runtime.Timestamp');
var BIOS = xdc.useModule('ti.sysbios.BIOS');
var Clock = xdc.useModule('ti.sysbios.knl.Clock');
var Task = xdc.useModule('ti.sysbios.knl.Task');
var Semaphore = xdc.useModule('ti.sysbios.knl.Semaphore');
var Hwi = xdc.useModule('ti.sysbios.hal.Hwi');
var HeapMem = xdc.useModule('ti.sysbios.heaps.HeapMem');
BIOS.heapSize = 86016;
Task.idleTaskStackSize = 768;
/*
* Program.stack is ignored with IAR. Use the project options in
* IAR Embedded Workbench to alter the system stack size.
*/
if (!Program.build.target.$name.match(/iar/)) {
/*
* Reducing the system stack size (used by ISRs and Swis) to reduce
* RAM usage.
*/
Program.stack = 2048;
}
/* ================ System configuration ================ */
var SysMin = xdc.useModule('xdc.runtime.SysMin');
SysMin.bufSize = 128;
System.SupportProxy = SysMin;
/* Enable Semihosting for GNU targets to print to CCS console */
if (Program.build.target.$name.match(/gnu/)) {
var SemiHost = xdc.useModule('ti.sysbios.rts.gnu.SemiHostSupport');
}
/* ================ NDK configuration ================ */
var Ndk = xdc.loadPackage('ti.ndk.config');
var Global = xdc.useModule('ti.ndk.config.Global');
var Tcp = xdc.useModule('ti.ndk.config.Tcp');
Global.IPv6 = false;
Global.stackLibType = Global.MIN;
Global.pktNumFrameBufs = 10;
Global.memRawPageCount = 6;
Global.ndkThreadStackSize = 1536;
Global.lowTaskStackSize = 1024;
Global.normTaskStackSize = 1024;
Global.highTaskStackSize = 1024;
Tcp.transmitBufSize = 1024;
Tcp.receiveBufSize = 1024;
/* ================ Driver configuration ================ */
var TIRTOS = xdc.useModule('ti.tirtos.TIRTOS');
TIRTOS.useEMAC = true;
TIRTOS.useGPIO = true;
/* ================ wolfSSL configuration ================ */
try {
var wolfSSL = xdc.loadPackage('ti.net.wolfssl');
}
catch (e) {
print("Error: Could not find wolfSSL library! Make sure the wolfSSL library"
+ " is built and package path is updated for the build tool"
+ " to find the library. More detailed wolfSSL build instructions"
+ " can be found in the TI-RTOS user guide.");
}

View File

@@ -0,0 +1,30 @@
#
# ======== products.mak ========
#
#
# Read the http://processors.wiki.ti.com/index.php/Using_wolfSSL_with_TI-RTOS
# for instructions to download the software required.
# XDC_INSTALL_DIR is the path to XDCtools directory.
XDC_INSTALL_DIR =
# BIOS_INSTALL_DIR is the path to TI-RTOS Kernel (SYS/BIOS) directory. If you
# have installed TI-RTOS, it is located in the products/bios_* path.
BIOS_INSTALL_DIR =
# NDK_INSTALL_DIR is the path to TI-RTOS NDK directory. If you have
# installed TI-RTOS, it is located in the products/ndk_* path.
NDK_INSTALL_DIR =
# TIVAWARE_INSTALL_DIR is the path to Tivaware driverlib directory. If you have
# installed TI-RTOS, it is located in the products/TivaWare_* path.
TIVAWARE_INSTALL_DIR =
# Define the code generation tools path for TI, IAR and GCC ARM compilers.
# If you have installed Code Composer Studio, the TI and GCC compiler are
# located in the ccsv*/tools/compiler/* path.
#
# Leave assignment empty to disable any toolchain.
ti.targets.arm.elf.M4F =
iar.targets.arm.M4F =
gnu.targets.arm.M4F =

View File

@@ -0,0 +1,89 @@
/*
* Generally there is no need to edit this file!
*
* This file controls which libraries are built, as well as compiler options
* to use.
*
* The contents of this file usually don't change, but having it in your
* ownership allows you to tweak your compiler options. If you do change
* this file, however, on the next upgrade of the product we recommend
* that you take "wolfssl.bld" file as supplied by the upgrade and then merge
* your changes with it.
*/
/*
* ======== wolfssl.bld ========
* This script is run prior to all build scripts. It sets host-system-
* independent values for targets and platforms, then it attempts to
* find the host-system-specific user.bld script that sets rootDirs.
*
* These settings may be a function of the following global variables:
*
* environment a hash table of environment strings
*
* arguments an array of string arguments to the _config.bld script
* initialized as follows:
* arguments[0] - the file name of the _config.bld script
* arguments[1] - the first argument specified in XDCARGS
* :
* arguments[n] - the n'th argument in XDCARGS
*
* Build an alias for xdc.om.xdc.bld.BuildEnvironment
*/
var armOpts = " -ms ";
var gnuOpts = " -D_POSIX_SOURCE ";
var iarOpts = " --diag_suppress=Pa134 ";
var ndkDir = "";
/* Uncomment the following lines to build libraries for debug mode: */
// Pkg.attrs.profile = "debug";
// armOpts += " -g -o0 ";
// gnuOpts += " -g -D_POSIX_SOURCE ";
// iarOpts += " --debug ";
var ccOpts = {
"ti.targets.arm.elf.M4" : armOpts,
"ti.targets.arm.elf.M4F" : armOpts,
"gnu.targets.arm.M4" : gnuOpts,
"gnu.targets.arm.M4F" : gnuOpts,
"iar.targets.arm.M4" : iarOpts,
"iar.targets.arm.M4F" : iarOpts,
};
/* initialize local vars with those set in xdcpaths.mak (via XDCARGS) */
for (arg = 0; arg < arguments.length; arg++) {
/*
* Get the compiler's installation directory.
* For "ti.targets.arm.elf.M4F=/vendors/arm/6.1.0",
* we get "/vendors/arm/6.1.0"
*/
var targetName = arguments[arg].split("=")[0];
var rootDir = arguments[arg].split("=")[1];
/* only build for the specified compilers */
if (rootDir == "" || rootDir == undefined) {
continue;
}
if (targetName.match(/^NDK/) ) {
ndkDir = rootDir;
continue;
}
var target = xdc.useModule(targetName);
target.rootDir = rootDir;
target.ccOpts.suffix += ccOpts[targetName];
Build.targets.$add(target);
}
/* Include Path (needed to find NDK headers) */
var wolfsslPathInclude = " -I" + ndkDir + "/packages/ti/ndk/inc/bsd "
+ "-DWOLFSSL_TIRTOS ";
/* lib/ is a generated directory that 'xdc clean' should remove */
var Pkg = xdc.useModule('xdc.bld.PackageContents');
Pkg.generatedFiles.$add("lib/");

View File

@@ -0,0 +1,64 @@
#
# ======== wolfssl.mak ========
#
include ./products.mak
# Enable older TI-RTOS 2.14-based variables
ifeq ($(BIOS_INSTALL_DIR),)
BIOS_INSTALL_DIR=$(SYSBIOS_INSTALL_DIR)
endif
ifeq ($(TIVAWARE_INSTALL_DIR),)
TIVAWARE_INSTALL_DIR=$(TIVAWARE)
endif
WOLFSSL_INSTALL_DIR=$(CURDIR)/../
#
# Set XDCARGS to some of the variables above. XDCARGS are passed
# to the XDC build engine... which will load wolfssl.bld... which will
# extract these variables and use them to determine what to build and which
# toolchains to use.
#
# Note that not all of these variables need to be set to something valid.
# Unfortunately, since these vars are unconditionally assigned, your build line
# will be longer and more noisy than necessary.
#
# Some background is here:
# http://rtsc.eclipse.org/docs-tip/Command_-_xdc#Environment_Variables
#
XDCARGS= \
ti.targets.arm.elf.M4F=\"$(ti.targets.arm.elf.M4F)\" \
gnu.targets.arm.M4F=\"$(gnu.targets.arm.M4F)\" \
iar.targets.arm.M4F=\"$(iar.targets.arm.M4F)\" \
NDK=\"$(NDK_INSTALL_DIR)\"
#
# Set XDCPATH to contain necessary repositories.
#
XDCPATH = $(BIOS_INSTALL_DIR)/packages;$(NDK_INSTALL_DIR)/packages;$(WOLFSSL_INSTALL_DIR);$(TIVAWARE_INSTALL_DIR)
export XDCPATH
#
# Set XDCOPTIONS. Use -v for a verbose build.
#
#XDCOPTIONS=v
export XDCOPTIONS
#
# Set XDC executable command
# Note that XDCBUILDCFG points to the wolfssl.bld file which uses
# the arguments specified by XDCARGS
#
XDC = $(XDC_INSTALL_DIR)/xdc XDCARGS="$(XDCARGS)" XDCBUILDCFG=./wolfssl.bld
#######################################################
## Shouldn't have to modify anything below this line ##
#######################################################
all:
@ echo building wolfssl packages ...
@ $(XDC) -Pr ./packages
clean:
@ echo cleaning wolfssl packages ...
@ $(XDC) clean -Pr ./packages