Merge pull request #79 from kojo1/IAR

sample projects for IAR EWARM

Why is SINGLE_THREADED assumed for IAR with ARM?
This commit is contained in:
toddouska
2014-05-12 13:28:02 -07:00
15 changed files with 11186 additions and 11 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<workspace>
<project>
<path>$WS_DIR$\CyaSSL-Lib.ewp</path>
</project>
<project>
<path>$WS_DIR$\wolfCrypt-benchmark.ewp</path>
</project>
<project>
<path>$WS_DIR$\wolfCrypt-test.ewp</path>
</project>
<batchBuild/>
</workspace>

View File

@@ -0,0 +1,40 @@
/* benchmark-main.c
*
* Copyright (C) 2006-2013 wolfSSL Inc.
*
* This file is part of CyaSSL.
*
* CyaSSL 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.
*
* CyaSSL 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#include "stdio.h"
typedef struct func_args {
int argc;
char** argv;
int return_code;
} func_args;
func_args args = { 0 } ;
extern int benchmark_test(void *args) ;
main(void) {
benchmark_test(&args) ;
return 0;
}

View File

@@ -0,0 +1,36 @@
/* test-main.c
*
* Copyright (C) 2006-2013 wolfSSL Inc.
*
* This file is part of CyaSSL.
*
* CyaSSL 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.
*
* CyaSSL 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
typedef struct func_args {
int argc;
char** argv;
int return_code;
} func_args;
func_args args = { 0 } ;
extern int ctaocrypt_test(void *args) ;
main(void) {
ctaocrypt_test(&args) ;
return 0;
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,32 @@
/*###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__ = 0x0007FFFF;
define symbol __ICFEDIT_region_RAM_start__ = 0x20000000;
define symbol __ICFEDIT_region_RAM_end__ = 0x2000FFFF;
/*-Sizes-*/
define symbol __ICFEDIT_size_cstack__ = 0x2000;
define symbol __ICFEDIT_size_heap__ = 0x2000;
/**** 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 };
//initialize by copy with packing = none { section __DLIB_PERTHREAD }; // Required in a multi-threaded application
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 };

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,31 @@
/*###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__ = 0x0;
/*-Memory Regions-*/
define symbol __ICFEDIT_region_ROM_start__ = 0x0;
define symbol __ICFEDIT_region_ROM_end__ = 0x000FFFFF;
define symbol __ICFEDIT_region_RAM_start__ = 0x1FFF0000;
define symbol __ICFEDIT_region_RAM_end__ = 0x2000FFFF;
/*-Sizes-*/
define symbol __ICFEDIT_size_cstack__ = 0x2000;
define symbol __ICFEDIT_size_heap__ = 0x3000;
/**** 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 };

49
IDE/IAR-EWARM/README Normal file
View File

@@ -0,0 +1,49 @@
CyaSSL IAR Project Files
This directory contains project files for IAR EWARM IDE. These
projects have been set up to generic ARM Cortex-M MPUs.
In order to generate project for specific target MPU, take following steps.
Included Project Files
-----------------------
1. Workspace: CyaSSL-Lib.eww
The workspace includes CyaSSL-Lib library and wolfCrypt-test, wolfCrypt-benchmark
executable projects. The library project generates full set library of wolfCrypt
and CyaSSL functions.
2. Test suites Project: wolfCrypt-test.ewp
generates test.out test suites executable
3. Benchmark Project: wolfCrypt-benchmark.ewp
generates benchmark.out benchmark executable
Set Up Steps
------------
0. Default Setting
Default Target of the projects are set to Cortex-M3 Simulator.
For check the projects, you can build and download to the simulator.
Open Terminal I/O window, by "view"->"Terminal I/O", and start execution.
1. Project option settings
For each project,...
General Options: Choose appropriate "Target" options
For executable projects,...
Add "SystemInit" and "startup" for your MPU
Debugger: Choose your debug "Driver"
2. For benchmark project,...
Write your own "current_time" benchmark timer under "defined(CYASSL_IAR_ARM)" in benchmark.c
3. settings.h
Uncomment the "CYASSL_IAR_ARM" define located in:
<cyassl_root>/cyassl/ctaocrypt/settings.
4. Build and download
Go to "Project->Make" and "Download and Debug" in Menu bar for EWARM build and download.
Support
-------
Please send questions or comments to support@wolfssl.com

View File

@@ -896,7 +896,10 @@ static const char *certDHname = "certs/dh2048.der" ;
void bench_dh(void)
{
int i, ret;
#if !defined(USE_CERT_BUFFERS_1024) && !defined(USE_CERT_BUFFERS_2048)
int ret;
#endif
int i ;
byte tmp[1024];
size_t bytes;
word32 idx = 0, pubSz, privSz = 0, pubSz2, privSz2, agreeSz;
@@ -1139,7 +1142,6 @@ void bench_eccKeyAgree(void)
}
#endif /* HAVE_ECC */
#ifdef _WIN32
#define WIN32_LEAN_AND_MEAN
@@ -1187,10 +1189,10 @@ void bench_eccKeyAgree(void)
return ( ns / CLOCK * 2.0);
}
#elif defined CYASSL_MDK_ARM
extern double current_time(int reset) ;
#elif defined(CYASSL_IAR_ARM) || defined (CYASSL_MDK_ARM)
#warning "Write your current_time()"
double current_time(int reset) { return 0.0 ; }
#elif defined FREERTOS
double current_time(int reset)

View File

@@ -84,11 +84,11 @@
/* Uncomment next line if using QL SEP settings */
/* #define CYASSL_QL */
/* Uncomment next line if using LwIP native TCP socket settings */
/* #define HAVE_LWIP_NATIVE */
/* Uncomment next line if building for EROAD */
/* #define CYASSL_EROAD */
/* Uncomment next line if building for IAR EWARM */
/* #define CYASSL_IAR_ARM */
#include <cyassl/ctaocrypt/visibility.h>
@@ -134,7 +134,18 @@
#define CYASSL_USER_IO
#define NO_FILESYSTEM
#endif
#if defined(CYASSL_IAR_ARM)
#define NO_MAIN_DRIVER
#define SINGLE_THREADED
#define USE_CERT_BUFFERS_1024
#define BENCH_EMBEDDED
#define NO_FILESYSTEM
#define NO_WRITEV
#define CYASSL_USER_IO
#define BENCH_EMBEDDED
#endif
#ifdef MICROCHIP_PIC32
/* #define CYASSL_MICROCHIP_PIC32MZ */
#define SIZEOF_LONG_LONG 8

View File

@@ -886,7 +886,7 @@ CYASSL_API int CyaSSL_make_eap_keys(CYASSL*, void* key, unsigned int len,
#ifdef __PPU
#include <sys/types.h>
#include <sys/socket.h>
#elif !defined(CYASSL_MDK_ARM)
#elif !defined(CYASSL_MDK_ARM) && !defined(CYASSL_IAR_ARM)
#include <sys/uio.h>
#endif
/* allow writev style writing */

View File

@@ -69,6 +69,8 @@
#define RNG CyaSSL_RNG
/* for avoiding name conflict in "stm32f2xx.h" */
static int errno;
#elif defined(CYASSL_IAR_ARM)
/* nothing */
#else
#include <sys/types.h>
#include <errno.h>