Move all to deprecated folder.
This commit is contained in:
36
deprecated/3P/wolfssl/tirtos/README
Normal file
36
deprecated/3P/wolfssl/tirtos/README
Normal file
@@ -0,0 +1,36 @@
|
||||
wolfSSL library for TI-RTOS
|
||||
|
||||
This directory contains the files that build wolfSSL library for TI-RTOS.
|
||||
Please follow the instructions in TI-RTOS user guide (www.ti.com/tool/ti-rtos)
|
||||
to build the wolfSSL library and the example applications.
|
||||
|
||||
Included Files
|
||||
---------------
|
||||
|
||||
1. wolfSSL library build files (packages/ti/net/wolfssl)
|
||||
|
||||
Build instructions provided in TI-RTOS user guide (www.ti.com/tool/ti-rtos)
|
||||
|
||||
2. wc_ test application (packages/ti/net/wolfssl/tests/wolfcrypt/test)
|
||||
|
||||
This application is the standard wc_ test application provided with
|
||||
wolfSSL.
|
||||
|
||||
It will be built along with the wolfSSL library. Load the built executable
|
||||
on the target and make sure the wolfSSL library works as expected.
|
||||
|
||||
3. wc_ benchmark application
|
||||
(packages/ti/net/wolfssl/tests/wolfcrypt/benchmark)
|
||||
|
||||
This application is the standard wc_ benchmark application provided
|
||||
with wolfSSL.
|
||||
|
||||
It will be built along with the wolfSSL library. Load the built executable
|
||||
on the target and run to get the benchmark results for the configured
|
||||
wolfSSL library.
|
||||
|
||||
Examples Application
|
||||
--------------------
|
||||
|
||||
A simple 'TCP echo server with TLS' example application is provided with TI-RTOS
|
||||
product. Look in the TI-RTOS user guide for instructions to build examples.
|
||||
22
deprecated/3P/wolfssl/tirtos/include.am
Normal file
22
deprecated/3P/wolfssl/tirtos/include.am
Normal file
@@ -0,0 +1,22 @@
|
||||
# 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/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/wolfcrypt/test/package.bld \
|
||||
tirtos/packages/ti/net/wolfssl/tests/wolfcrypt/test/package.xdc \
|
||||
tirtos/packages/ti/net/wolfssl/tests/wolfcrypt/test/test.cfg \
|
||||
tirtos/packages/ti/net/wolfssl/tests/wolfcrypt/test/TM4C1294NC.icf \
|
||||
tirtos/packages/ti/net/wolfssl/tests/wolfcrypt/test/main.c \
|
||||
tirtos/packages/ti/net/wolfssl/tests/wolfcrypt/benchmark/package.bld \
|
||||
tirtos/packages/ti/net/wolfssl/tests/wolfcrypt/benchmark/package.xdc \
|
||||
tirtos/packages/ti/net/wolfssl/tests/wolfcrypt/benchmark/benchmark.cfg \
|
||||
tirtos/packages/ti/net/wolfssl/tests/wolfcrypt/benchmark/TM4C1294NC.icf \
|
||||
tirtos/packages/ti/net/wolfssl/tests/wolfcrypt/benchmark/main.c
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
/*
|
||||
* ======== 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/hc128.c",
|
||||
"wolfcrypt/src/hmac.c",
|
||||
"wolfcrypt/src/integer.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/rabbit.c",
|
||||
"wolfcrypt/src/random.c",
|
||||
"wolfcrypt/src/rsa.c",
|
||||
"wolfcrypt/src/sha.c",
|
||||
"wolfcrypt/src/sha256.c",
|
||||
"wolfcrypt/src/sha512.c",
|
||||
"wolfcrypt/src/tfm.c",
|
||||
"wolfcrypt/src/wc_port.c",
|
||||
|
||||
"src/internal.c",
|
||||
"src/io.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/" + Pkg.name, targ, libOptions);
|
||||
lib.addObjects(wolfSSLObjList);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
/*!
|
||||
* ======== ti.net.wolfssl ========
|
||||
* wolfSSL library for TI-RTOS
|
||||
*
|
||||
*/
|
||||
package ti.net.wolfssl {
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
/*
|
||||
* ======== package.xs ========
|
||||
*/
|
||||
|
||||
/*
|
||||
* ======== getLibs ========
|
||||
* Contribute wolfSSL library.
|
||||
*/
|
||||
function getLibs(prog)
|
||||
{
|
||||
return ("lib/" + this.$name + ".a" + prog.build.target.suffix);
|
||||
}
|
||||
@@ -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 };
|
||||
@@ -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.");
|
||||
}
|
||||
@@ -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(¶ms);
|
||||
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,
|
||||
¶ms, 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();
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
/*
|
||||
* ======== ti.net.wolfssl.tests.wolfcrypt.benchmark ========
|
||||
* wc_ Benchmark Application
|
||||
*/
|
||||
package ti.net.wolfssl.tests.wolfcrypt.benchmark {
|
||||
}
|
||||
@@ -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 };
|
||||
@@ -0,0 +1,56 @@
|
||||
/*
|
||||
* ======== 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();
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
/*
|
||||
* ======== ti.net.wolfssl.tests.wolfcrypt.test ========
|
||||
* wolfcrypt Test Application
|
||||
*/
|
||||
package ti.net.wolfssl.tests.wolfcrypt.test {
|
||||
}
|
||||
@@ -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.");
|
||||
}
|
||||
85
deprecated/3P/wolfssl/tirtos/wolfssl.bld
Normal file
85
deprecated/3P/wolfssl/tirtos/wolfssl.bld
Normal file
@@ -0,0 +1,85 @@
|
||||
/*
|
||||
* 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 = "";
|
||||
var iarOpts = "";
|
||||
|
||||
/* Uncomment the following lines to build libraries for debug mode: */
|
||||
// Pkg.attrs.profile = "debug";
|
||||
// armOpts += " -g -o0 ";
|
||||
// gnuOpts += " -g ";
|
||||
// iarOpts += " --debug ";
|
||||
|
||||
var ccOpts = {
|
||||
"ti.targets.arm.elf.M4F" : armOpts,
|
||||
|
||||
"gnu.targets.arm.M4F" : gnuOpts,
|
||||
|
||||
"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(/^TivaWareDir/) ) {
|
||||
TivaWareDir = 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 ndkPath = "$(NDK_INSTALL_DIR)/packages/ti/ndk/";
|
||||
var wolfsslPathInclude = " -I" + ndkPath + "/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/");
|
||||
74
deprecated/3P/wolfssl/tirtos/wolfssl.mak
Normal file
74
deprecated/3P/wolfssl/tirtos/wolfssl.mak
Normal file
@@ -0,0 +1,74 @@
|
||||
#
|
||||
# ======== wolfssl.mak ========
|
||||
#
|
||||
|
||||
# USER OPTIONAL STEP: These variables are set when building wolfssl
|
||||
# through the tirtos.mak
|
||||
# Set up dependencies
|
||||
XDC_INSTALL_DIR ?= C:/ti/xdctools_3_24_02_30
|
||||
SYSBIOS_INSTALL_DIR ?= C:/ti/bios_6_34_01_14
|
||||
NDK_INSTALL_DIR ?= C:/ti/ndk_2_24_00_02
|
||||
TIRTOS_INSTALLATION_DIR ?= C:/ti/tirtos_tivac_2_00_00_22
|
||||
TivaWareDir ?= C:/ti/tivaware
|
||||
WOLFSSL_INSTALL_DIR ?= C:/wolfssl/wolfssl-2.9.4
|
||||
|
||||
#
|
||||
# Set location of various cgtools
|
||||
# These variables can be set here or on the command line. These
|
||||
# variables are set when building wolfssl through tirtos.mak
|
||||
# USER OPTIONAL STEP: user can define below paths to compilers
|
||||
ti.targets.arm.elf.M4F ?=
|
||||
|
||||
gnu.targets.arm.M4F ?=
|
||||
|
||||
iar.targets.arm.M4F ?=
|
||||
|
||||
#
|
||||
# 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)\" \
|
||||
TivaWareDir=\"$(TivaWareDir)\"
|
||||
|
||||
#
|
||||
# Set XDCPATH to contain necessary repositories.
|
||||
#
|
||||
XDCPATH = $(SYSBIOS_INSTALL_DIR)/packages;$(NDK_INSTALL_DIR)/packages;$(WOLFSSL_INSTALL_DIR);$(TIRTOS_INSTALLATION_DIR)/packages;$(TivaWareDir);
|
||||
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
|
||||
|
||||
######################################################
|
||||
## Shouldnt have to modify anything below this line ##
|
||||
######################################################
|
||||
|
||||
all:
|
||||
@ echo building wolfssl packages ...
|
||||
@ $(XDC) -Pr ./packages
|
||||
|
||||
clean:
|
||||
@ echo cleaning wolfssl packages ...
|
||||
@ $(XDC) clean -Pr ./packages
|
||||
Reference in New Issue
Block a user