Fix benchmark and test project

This commit is contained in:
Takashi Kojo
2017-12-31 11:31:54 +09:00
committed by Takashi Kojo
parent d34fb44df2
commit 109dd05bb3
20 changed files with 8540 additions and 1180 deletions

View File

@ -1,4 +1,24 @@
/* user_settings.h
*
* Copyright (C) 2006-2017 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
*/
#define NO_MAIN_DRIVER
#define BENCH_EMBEDDED
#define NO_DEV_RANDOM
@ -6,7 +26,6 @@
#define SIZEOF_LONG_LONG 8
#define NO_WRITEV
#define NO_DEV_RANDOM
#define NO_BIG_INT
#define TFM_TIMING_RESISTANT
#define ECC_TIMING_RESISTANT
@ -15,14 +34,6 @@
#define WOLFSSL_USER_CURRTIME /* for benchmark */
#define WOLFSSL_CURRTIME_OSTICK /* use OS tich for current_time */
/* #define WOLFSSL_USER_IO or use BSD incompatible TCP stack */
#define WOLFSSL_KEIL_TCP_NET
/* define your Rand gen for the operational use */
#define WOLFSSL_GENSEED_FORTEST
#define HAVE_HASHDRBG
#define XVALIDATE_DATE(d, f,t) (1)
// <<< Use Configuration Wizard in Context Menu >>>
@ -81,6 +92,15 @@
#endif
// </e>
// <o> Network<0=>None <1=>RLnet <2=>User I/O
#define MDK_CONF_NETWORK 1
#if MDK_CONF_NETWORK == 0
#elif MDK_CONF_NETWORK == 1
#define WOLFSSL_KEIL_TCP_NET
#elif MDK_CONF_NETWORK == 2
#define WOLFSSL_USER_IO
#endif
// <h>Debug options
// <e>Debug Message
@ -114,7 +134,7 @@
// <h> wolfCrypt Configuration
// <h>Crypt Algrithm
// <h>Hash/Crypt Algrithm
// <e>MD2
#define MDK_CONF_MD2 1
@ -158,6 +178,12 @@
#define WOLFSSL_SHA512
#endif
// </e>
// <e>Hash DRBG
#define MDK_CONF_HASHDRBG 1
#if MDK_CONF_HASHDRBG == 1
#define HAVE_HASHDRBG
#endif
// </e>
// <e>RIPEMD
#define MDK_CONF_RIPEMD 1
#if MDK_CONF_RIPEMD == 1
@ -327,6 +353,13 @@
// </e>
// </h>
// <e>Random Seed, for TEST Only
#define MDK_CONF_RNDSEED 1
#if MDK_CONF_RNDSEED == 1
#define WOLFSSL_GENSEED_FORTEST
#endif
// </e>
// <h>Hardware Crypt (See document for usage)
// <e>Hardware RNG
#define MDK_CONF_STM32F2_RNG 0
@ -364,6 +397,7 @@
#endif
// </e>
// </h>
// <h>Cert/Key Strage
// <o>Cert Storage <0=> SD Card <1=> Mem Buff (1024bytes) <2=> Mem Buff (2048bytes)
#define MDK_CONF_CERT_BUFF 0
@ -439,7 +473,7 @@
#endif
// </e>
// <e>OpenSSL Extra
#define MDK_CONF_OPENSSL_EXTRA 1
#define MDK_CONF_OPENSSL_EXTRA 0
#if MDK_CONF_OPENSSL_EXTRA == 1
#define OPENSSL_EXTRA
#endif

View File

@ -146,24 +146,7 @@
<Name>-UV0998FBE -O207 -S10 -C0 -P00 -N00("ARM CoreSight SW-DP") -D00(5BA02477) -L00(0) -TO18 -TC216000000 -TP21 -TDS80B8 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO15 -FD20010000 -FC1000 -FN1 -FF0STM32F7x_1024.FLM -FS08000000 -FL0100000 -FP0($$Device:STM32F756NGHx$CMSIS\Flash\STM32F7x_1024.FLM)</Name>
</SetRegEntry>
</TargetDriverDllRegistry>
<Breakpoint>
<Bp>
<Number>0</Number>
<Type>0</Type>
<LineNumber>137</LineNumber>
<EnabledFlag>1</EnabledFlag>
<Address>0</Address>
<ByteObject>0</ByteObject>
<HtxType>0</HtxType>
<ManyObjects>0</ManyObjects>
<SizeOfObject>0</SizeOfObject>
<BreakByAccess>0</BreakByAccess>
<BreakIfRCount>0</BreakIfRCount>
<Filename>C:\wolfSSL\Support\MDK-Pack\wolfssl\IDE\MDK5-ARM\Projects\CryptTest\main.c</Filename>
<ExecCommand></ExecCommand>
<Expression></Expression>
</Bp>
</Breakpoint>
<Breakpoint/>
<WatchWindow1>
<Ww>
<count>0</count>
@ -172,8 +155,8 @@
</Ww>
</WatchWindow1>
<ScvdPack>
<Filename>C:\Keil_v5\ARM\PACK\Keil\MDK-Middleware\7.4.1\FileSystem\FileSystem.scvd</Filename>
<Type>Keil.MDK-Middleware.7.4.1</Type>
<Filename>C:\Keil_v5\ARM\PACK\Keil\MDK-Middleware\7.5.0\FileSystem\FileSystem.scvd</Filename>
<Type>Keil.MDK-Middleware.7.5.0</Type>
<SubType>1</SubType>
</ScvdPack>
<Tracepoint>
@ -236,18 +219,6 @@
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>.\RTE\wolfSSL\config-Crypt.h</PathWithFileName>
<FilenameWithoutPath>config-Crypt.h</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>1</GroupNumber>
<FileNumber>2</FileNumber>
<FileType>5</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>.\RTE\wolfSSL\user_settings.h</PathWithFileName>
<FilenameWithoutPath>user_settings.h</FilenameWithoutPath>
<RteFlg>0</RteFlg>
@ -263,7 +234,7 @@
<RteFlg>0</RteFlg>
<File>
<GroupNumber>2</GroupNumber>
<FileNumber>3</FileNumber>
<FileNumber>2</FileNumber>
<FileType>5</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@ -283,28 +254,16 @@
<RteFlg>0</RteFlg>
<File>
<GroupNumber>3</GroupNumber>
<FileNumber>4</FileNumber>
<FileNumber>3</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\..\wolfssl\IDE\MDK5-ARM\Projects\CryptBenchmark\main.c</PathWithFileName>
<PathWithFileName>.\main.c</PathWithFileName>
<FilenameWithoutPath>main.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>3</GroupNumber>
<FileNumber>5</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>.\time-CortexM3-4.c</PathWithFileName>
<FilenameWithoutPath>time-CortexM3-4.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
</Group>
<Group>

View File

@ -379,11 +379,6 @@
<Group>
<GroupName>Configuration</GroupName>
<Files>
<File>
<FileName>config-Crypt.h</FileName>
<FileType>5</FileType>
<FilePath>.\RTE\wolfSSL\config-Crypt.h</FilePath>
</File>
<File>
<FileName>user_settings.h</FileName>
<FileType>5</FileType>
@ -407,12 +402,7 @@
<File>
<FileName>main.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\wolfssl\IDE\MDK5-ARM\Projects\CryptBenchmark\main.c</FilePath>
</File>
<File>
<FileName>time-CortexM3-4.c</FileName>
<FileType>1</FileType>
<FilePath>.\time-CortexM3-4.c</FilePath>
<FilePath>.\main.c</FilePath>
</File>
</Files>
</Group>
@ -717,24 +707,24 @@
</file>
<file attr="config" category="source" name="FileSystem\Config\FS_Config.c" version="6.2.0">
<instance index="0">RTE\File_System\FS_Config.c</instance>
<component Cbundle="MDK-Pro" Cclass="File System" Cgroup="CORE" Cvariant="LFN" Cvendor="Keil" Cversion="6.9.8" condition="CMSIS Core with RTOS and File System I/O"/>
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.4.1"/>
<component Cbundle="MDK-Pro" Cclass="File System" Cgroup="CORE" Cvariant="LFN" Cvendor="Keil" Cversion="6.10.0" condition="CMSIS Core with RTOS and File System I/O"/>
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.5.0"/>
<targetInfos>
<targetInfo name="wolfSSL-Benchmark"/>
</targetInfos>
</file>
<file attr="config" category="source" name="FileSystem\Config\FS_Config_MC.h" version="6.2.0">
<instance index="0">RTE\File_System\FS_Config_MC_0.h</instance>
<component Cbundle="MDK-Pro" Cclass="File System" Cgroup="Drive" Csub="Memory Card" Cvendor="Keil" Cversion="6.9.8" condition="File System and SD/MMC Driver" maxInstances="2"/>
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.4.1"/>
<component Cbundle="MDK-Pro" Cclass="File System" Cgroup="Drive" Csub="Memory Card" Cvendor="Keil" Cversion="6.10.0" condition="File System and SD/MMC Driver" maxInstances="2"/>
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.5.0"/>
<targetInfos>
<targetInfo name="wolfSSL-Benchmark"/>
</targetInfos>
</file>
<file attr="config" category="source" name="FileSystem\Config\FS_Config_NOR.h" version="6.2.0">
<instance index="0">RTE\File_System\FS_Config_NOR_0.h</instance>
<component Cbundle="MDK-Pro" Cclass="File System" Cgroup="Drive" Csub="NOR" Cvendor="Keil" Cversion="6.9.8" condition="File System and Flash Driver" maxInstances="2"/>
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.4.1"/>
<component Cbundle="MDK-Pro" Cclass="File System" Cgroup="Drive" Csub="NOR" Cvendor="Keil" Cversion="6.10.0" condition="File System and Flash Driver" maxInstances="2"/>
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.5.0"/>
<targetInfos>
<targetInfo name="wolfSSL-Benchmark"/>
</targetInfos>
@ -770,12 +760,10 @@
<targetInfos/>
</file>
<file attr="config" category="header" name="wolfssl\IDE\MDK5-ARM\Conf\config-Crypt.h">
<instance index="0">RTE\wolfSSL\config-Crypt.h</instance>
<instance index="0" removed="1">RTE\wolfSSL\config-Crypt.h</instance>
<component Cbundle="wolfSSL" Cclass="wolfSSL" Cgroup="wolfCrypt" Csub="CORE" Cvendor="wolfSSL" Cversion="" condition="wolfCrypt-Core"/>
<package license="wolfssl\IDE\MDK5-ARM\Docs\wolfSSL-License.txt" name="wolfSSL" schemaVersion="1.4" url="http://www.wolfSSL.com/files/ide" vendor="wolfSSL" version="3.13.0"/>
<targetInfos>
<targetInfo name="wolfSSL-Benchmark"/>
</targetInfos>
<targetInfos/>
</file>
<file attr="config" category="header" name="wolfssl\IDE\MDK5-ARM\Conf\config-wolfSSL.h">
<instance index="0" removed="1">RTE\wolfSSL\config-wolfSSL.h</instance>

View File

@ -0,0 +1,483 @@
/* user_settings.h
*
* Copyright (C) 2006-2017 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
*/
#define NO_MAIN_DRIVER
#define BENCH_EMBEDDED
#define NO_DEV_RANDOM
#define WOLFSSL_USER_CURRTIME
#define SIZEOF_LONG_LONG 8
#define NO_WRITEV
#define NO_DEV_RANDOM
#define TFM_TIMING_RESISTANT
#define ECC_TIMING_RESISTANT
#define WC_RSA_BLINDING
#define WOLFSSL_USER_CURRTIME /* for benchmark */
#define WOLFSSL_CURRTIME_OSTICK /* use OS tich for current_time */
#define XVALIDATE_DATE(d, f,t) (1)
// <<< Use Configuration Wizard in Context Menu >>>
// <h>Common options
// <o> Thread/RTOS<0=>Single Threaded <1=>FreeRTOS <2=>SafeRTOS<3=>Windows
// <4=>PThread <5=>ThreadX<6=> ThreadX/NetX
// <7=>Micrium <8=>EBSnet<9=>MQX
// <10=>T-RTOS <11=>uITRON4<12=>uTKERNEL2
// <13=>Frosted <14=>CMSIS RTOS<15=>Others
#define MDK_CONF_THREAD 14
#if MDK_CONF_THREAD== 0
#define SINGLE_THREADED
#elif MDK_CONF_THREAD == 1
#define FREERTOS
#elif MDK_CONF_THREAD == 3
#define WOLFSSL_SAFERTOS
#elif MDK_CONF_THREAD == 4
#define USE_WINDOWS_API
#elif MDK_CONF_THREAD == 5
#define WOLFSSL_PTHREADS
#elif MDK_CONF_THREAD == 6
#define THREADX
#define NETX
#elif MDK_CONF_THREAD == 7
#define MICRIUM
#elif MDK_CONF_THREAD == 8
#define EBSNET
#elif MDK_CONF_THREAD == 9
#define FREESCALE_MQX
#define FREESCALE_KSDK_MQX
#elif MDK_CONF_THREAD == 10
#define WOLFSSL_TIRTOS
#elif MDK_CONF_THREAD == 11
#define WOLFSSL_uITRON4
#elif MDK_CONF_THREAD == 12
#define WOLFSSL_uTKERNEL2
#elif MDK_CONF_THREAD == 13
#define WOLFSSL_FROSTED
#elif MDK_CONF_THREAD == 14
#define WOLFSSL_CMSIS_RTOS
#elif MDK_CONF_THREAD == 15
#define SINGLE_THREADED
#endif
// <e>File System
#define MDK_CONF_FILESYSTEM 1
#if MDK_CONF_FILESYSTEM == 0
#define NO_FILESYSTEM
#else
#define WOLFSSL_KEIL_FS
#define NO_WOLFSSL_DIR
#endif
// </e>
// <o> Network<0=>None <1=>RLnet <2=>User I/O
#define MDK_CONF_NETWORK 0
#if MDK_CONF_NETWORK == 0
#elif MDK_CONF_NETWORK == 1
#define WOLFSSL_KEIL_TCP_NET
#elif MDK_CONF_NETWORK == 2
#define WOLFSSL_USER_IO
#endif
// <h>Debug options
// <e>Debug Message
#define MDK_CONF_DebugMessage 0
#if MDK_CONF_DebugMessage == 1
#define DEBUG_WOLFSSL
#endif
// </e>
// <e>Check malloc
#define MDK_CONF_CheckMalloc 1
#if MDK_CONF_CheckMalloc == 1
#define WOLFSSL_MALLOC_CHECK
#define USE_WOLFSSL_MEMORY
#endif
// </e>
// <e>ErrNo.h
#define MDK_CONF_ErrNo 1
#if MDK_CONF_ErrNo == 1
#define HAVE_ERRNO
#endif
// </e>
// <e>Error Strings
#define MDK_CONF_ErrorStrings 1
#if MDK_CONF_ErrorStrings == 0
#define NO_ERROR_STRINGS
#endif
// </e>
//</h>
//</h>
// <h> wolfCrypt Configuration
// <h>Hash/Crypt Algrithm
// <e>MD2
#define MDK_CONF_MD2 1
#if MDK_CONF_MD2 == 1
#define WOLFSSL_MD2
#endif
// </e>
// <e>MD4
#define MDK_CONF_MD4 1
#if MDK_CONF_MD4 == 0
#define NO_MD4
#endif
// </e>
// <e>MD5
#define MDK_CONF_MD5 1
#if MDK_CONF_MD5 == 0
#define NO_MD5
#endif
// </e>
// <e>SHA
#define MDK_CONF_SHA 1
#if MDK_CONF_SHA == 0
#define NO_SHA
#endif
// </e>
// <e>SHA-256
#define MDK_CONF_SHA256 1
#if MDK_CONF_SHA256 == 0
#define NO_SHA256
#endif
// </e>
// <e>SHA-384
#define MDK_CONF_SHA384 1
#if MDK_CONF_SHA384 == 1
#define WOLFSSL_SHA384
#endif
// </e>
// <e>SHA-512
#define MDK_CONF_SHA512 1
#if MDK_CONF_SHA512 == 1
#define WOLFSSL_SHA512
#endif
// </e>
// <e>Hash DRBG
#define MDK_CONF_HASHDRBG 1
#if MDK_CONF_HASHDRBG == 1
#define HAVE_HASHDRBG
#endif
// </e>
// <e>RIPEMD
#define MDK_CONF_RIPEMD 1
#if MDK_CONF_RIPEMD == 1
#define WOLFSSL_RIPEMD
#endif
// </e>
// <e>BLAKE2
#define MDK_CONF_BLAKE2 0
#if MDK_CONF_BLAKE2 == 1
#define HAVE_BLAKE2
#endif
// </e>
// <e>HMAC
#define MDK_CONF_HMAC 1
#if MDK_CONF_HMAC == 0
#define NO_HMAC
#endif
// </e>
// <e>HMAC KDF
#define MDK_CONF_HKDF 1
#if MDK_CONF_HKDF == 1
#define HAVE_HKDF
#endif
// </e>
// <e>AES CCM
#define MDK_CONF_AESCCM 1
#if MDK_CONF_AESCCM == 1
#define HAVE_AESCCM
#endif
// </e>
// <e>AES GCM
#define MDK_CONF_AESGCM 1
#if MDK_CONF_AESGCM == 1
#define HAVE_AESGCM
#endif
// </e>
// <e>RC4
#define MDK_CONF_RC4 1
#if MDK_CONF_RC4 == 0
#define NO_RC4
#endif
// </e>
// <e>HC128
#define MDK_CONF_HC128 1
#if MDK_CONF_AESGCM == 0
#define NO_HC128
#endif
// </e>
// <e>RABBIT
#define MDK_CONF_RABBIT 1
#if MDK_CONF_RABBIT == 0
#define NO_RABBIT
#endif
// </e>
// <e>CHACHA
#define MDK_CONF_CHACHA 1
#if MDK_CONF_CHACHA == 1
#define HAVE_CHACHA
#endif
// </e>
// <e>POLY1305
#define MDK_CONF_POLY1305 1
#if MDK_CONF_POLY1305 == 1
#define HAVE_POLY1305
#define HAVE_ONE_TIME_AUTH
#endif
// </e>
// <e>DES3
#define MDK_CONF_DES3 1
#if MDK_CONF_DES3 == 0
#define NO_DES3
#endif
// </e>
// <e>AES
#define MDK_CONF_AES 1
#if MDK_CONF_AES == 0
#define NO_AES
#endif
// </e>
// <e>CAMELLIA
#define MDK_CONF_CAMELLIA 1
#if MDK_CONF_CAMELLIA == 1
#define HAVE_CAMELLIA
#endif
// </e>
// <e>DH
#define MDK_CONF_DH 1
#if MDK_CONF_DH == 0
#define NO_DH
#endif
// </e>
// <e>DSA
#define MDK_CONF_DSA 1
#if MDK_CONF_DSA == 0
#define NO_DSA
#endif
// </e>
// <e>SRP
#define MDK_CONF_SRP 1
#if MDK_CONF_SRP == 1
#define HAVE_SRP
#endif
// </e>
// <e>PWDBASED
#define MDK_CONF_PWDBASED 1
#if MDK_CONF_PWDBASED == 0
#define NO_PWDBASED
#endif
// </e>
// <e>ECC
#define MDK_CONF_ECC 1
#if MDK_CONF_ECC == 1
#define HAVE_ECC
#endif
// </e>
// <e>CURVE25519
#define MDK_CONF_CURVE25519 1
#if MDK_CONF_CURVE25519 == 1
#define HAVE_CURVE25519
#define CURVED25519_SMALL
#endif
// </e>
// <e>CURVE25519 SMALL
#define MDK_CONF_CURVE25519_SMALL 0
#if MDK_CONF_CURVE25519_SMALL == 1
#define CURVED25519_SMALL
#endif
// </e>
// <e>ED25519
#define MDK_CONF_ED25519 1
#if MDK_CONF_ED25519 == 1
#define HAVE_ED25519
#endif
// </e>
// <e>ED25519 SMALL
#define MDK_CONF_ED25519_SMALL 0
#if MDK_CONF_ED25519_SMALL == 1
#define ED25519_SMALL
#endif
// </e>
// <e>PKCS7
#define MDK_CONF_PKCS7 0
#if MDK_CONF_PKCS7 == 1
#define HAVE_PKCS7
#endif
// </e>
// <e>NTRU (need License, "crypto_ntru.h")
#define MDK_CONF_NTRU 0
#if MDK_CONF_NTRU == 1
#define HAVE_NTRU
#endif
// </e>
// </h>
// <e>Random Seed, for TEST Only
#define MDK_CONF_RNDSEED 1
#if MDK_CONF_RNDSEED == 1
#define WOLFSSL_GENSEED_FORTEST
#endif
// </e>
// <h>Hardware Crypt (See document for usage)
// <e>Hardware RNG
#define MDK_CONF_STM32F2_RNG 0
#if MDK_CONF_STM32F2_RNG == 1
#define WOLFSSL_STM32_CUBEMX
#define STM32_RNG
#define WOLFSSL_STM32F7
#define STM32F7xx
#define WC_ASYNC_DEV_SIZE 320+24
#define STM32_HAL_TIMEOUT 0xFF
#else
#endif
// </e>
// <e>Hardware Crypt
#define MDK_CONF_STM32F2_CRYPTO 0
#if MDK_CONF_STM32F2_CRYPTO == 1
#define WOLFSSL_STM32_CUBEMX
#define STM32_CRYPTO
#define WOLFSSL_STM32F7
#define STM32F7xx
#define WC_ASYNC_DEV_SIZE 320+24
#define STM32_HAL_TIMEOUT 0xFF
#endif
// </e>
// <e>Hardware Hash
#define MDK_CONF_STM32F2_HASH 0
#if MDK_CONF_STM32F2_HASH == 1
#define WOLFSSL_STM32_CUBEMX
#define STM32_HASH
#define WOLFSSL_STM32F7
#define STM32F7xx
#define WC_ASYNC_DEV_SIZE 320+24
#define STM32_HAL_TIMEOUT 0xFF
#endif
// </e>
// </h>
// <h>Cert/Key Strage
// <o>Cert Storage <0=> SD Card <1=> Mem Buff (1024bytes) <2=> Mem Buff (2048bytes)
#define MDK_CONF_CERT_BUFF 0
#if MDK_CONF_CERT_BUFF== 1
#define USE_CERT_BUFFERS_1024
#elif MDK_CONF_CERT_BUFF == 2
#define USE_CERT_BUFFERS_2048
#endif
//</h>
// <h>Cert/Key Generation
// <e>CertGen
#define MDK_CONF_CERT_GEN 0
#if MDK_CONF_CERT_GEN == 1
#define WOLFSSL_CERT_GEN
#endif
// </e>
// <e>KeyGen
#define MDK_CONF_KEY_GEN 0
#if MDK_CONF_KEY_GEN == 1
#define WOLFSSL_KEY_GEN
#endif
// </e>
// </h>
// <e>Use Fast Math
#define MDK_CONF_FASTMATH 1
#if MDK_CONF_FASTMATH == 1
#define USE_FAST_MATH
#define TFM_TIMING_RESISTANT
#endif
// </e>
// <e>Small Stack
#define MDK_CONF_SmallStack 0
#if MDK_CONF_SmallStack == 0
#define NO_WOLFSSL_SMALL_STACK
#endif
// </e>
// </h>
/**** wolfSSL Configuration ****/
// <h> wolfSSL Configuration
// <e>TLS 1.3
#define MDK_CONF_TLS 0
#if MDK_CONF_TLS == 1
#define WOLFSSL_TLS13
#define HAVE_TLS_EXTENSIONS
#define WC_RSA_PSS
#define HAVE_HKDF
#define HAVE_FFDHE_2048
#endif
// </e>
// <e>Include Old TLS
#define MDK_CONF_NO_OLDTLS 0
#if MDK_CONF_NO_OLDTLS == 0
#define NO_OLD_TLS
#endif
// </e>
// <e>CRL
#define MDK_CONF_CRL 0
#if MDK_CONF_CRL == 1
#define HAVE_CRL
#define WOLFSSL_DER_LOAD
#endif
// </e>
// <e>OCSP
#define MDK_CONF_OCSP 0
#if MDK_CONF_OCSP == 1
#define HAVE_OCSP
#endif
// </e>
// <e>OpenSSL Extra
#define MDK_CONF_OPENSSL_EXTRA 0
#if MDK_CONF_OPENSSL_EXTRA == 1
#define OPENSSL_EXTRA
#endif
// </e>
//</h>

View File

@ -26,6 +26,7 @@
#include <wolfssl/wolfcrypt/settings.h>
#include "wolfcrypt/test/test.h"
#include <time.h>
#warning "write MPU specific Set ups\n"
@ -41,6 +42,49 @@ static void CPU_CACHE_Enable (void) {
}
extern uint32_t os_time;
#ifdef RTE_CMSIS_RTOS_RTX
uint32_t HAL_GetTick(void) {
return os_time;
}
#endif
time_t time(time_t *t){
return os_time ;
}
#ifdef WOLFSSL_CURRTIME_OSTICK
#include <stdint.h>
extern uint32_t os_time;
double current_time(int reset)
{
if(reset) os_time = 0 ;
return (double)os_time /1000.0;
}
#else
#include <stdint.h>
#define DWT ((DWT_Type *) (0xE0001000UL) )
typedef struct
{
uint32_t CTRL; /*!< Offset: 0x000 (R/W) Control Register */
uint32_t CYCCNT; /*!< Offset: 0x004 (R/W) Cycle Count Register */
} DWT_Type;
extern uint32_t SystemCoreClock ;
double current_time(int reset)
{
if(reset) DWT->CYCCNT = 0 ;
return ((double)DWT->CYCCNT/SystemCoreClock) ;
}
#endif
/*-----------------------------------------------------------------------------
* Initialize a Flash Memory Card
*----------------------------------------------------------------------------*/
@ -79,9 +123,6 @@ int main()
CPU_CACHE_Enable();
HAL_Init(); /* Initialize the HAL Library */
SystemClock_Config(); /* Configure the System Clock */
BSP_IO_Init(); /* Enable BSP module */
BSP_IO_ConfigPin(IO_PIN_11, IO_MODE_OUTPUT_OD_PU);
BSP_IO_WritePin (IO_PIN_11, BSP_IO_PIN_RESET); /* Put camera in reset state */
#if !defined(NO_FILESYSTEM)
init_filesystem ();

View File

@ -160,8 +160,13 @@
</Ww>
</WatchWindow1>
<ScvdPack>
<Filename>C:\Keil_v5\ARM\PACK\Keil\MDK-Middleware\7.4.1\FileSystem\FileSystem.scvd</Filename>
<Type>Keil.MDK-Middleware.7.4.1</Type>
<Filename>C:\Keil_v5\ARM\PACK\Keil\MDK-Middleware\7.5.0\FileSystem\FileSystem.scvd</Filename>
<Type>Keil.MDK-Middleware.7.5.0</Type>
<SubType>1</SubType>
</ScvdPack>
<ScvdPack>
<Filename>C:\Keil_v5\ARM\PACK\Keil\ARM_Compiler\1.3.2\EventRecorder.scvd</Filename>
<Type>Keil.ARM_Compiler.1.3.2</Type>
<SubType>1</SubType>
</ScvdPack>
<Tracepoint>
@ -221,7 +226,7 @@
<GroupNumber>1</GroupNumber>
<FileNumber>1</FileNumber>
<FileType>1</FileType>
<tvExp>1</tvExp>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>.\main.c</PathWithFileName>
@ -271,6 +276,26 @@
</File>
</Group>
<Group>
<GroupName>Configuration</GroupName>
<tvExp>1</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
<File>
<GroupNumber>4</GroupNumber>
<FileNumber>4</FileNumber>
<FileType>5</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>.\RTE\wolfSSL\user_settings.h</PathWithFileName>
<FilenameWithoutPath>user_settings.h</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
</Group>
<Group>
<GroupName>::Board Support</GroupName>
<tvExp>1</tvExp>

View File

@ -406,6 +406,16 @@
</File>
</Files>
</Group>
<Group>
<GroupName>Configuration</GroupName>
<Files>
<File>
<FileName>user_settings.h</FileName>
<FileType>5</FileType>
<FilePath>.\RTE\wolfSSL\user_settings.h</FilePath>
</File>
</Files>
</Group>
<Group>
<GroupName>::Board Support</GroupName>
</Group>
@ -471,6 +481,12 @@
<targetInfo name="CryptTest"/>
</targetInfos>
</component>
<component Cbundle="ARM Compiler" Cclass="Compiler" Cgroup="Event Recorder" Cvariant="DAP" Cvendor="Keil" Cversion="1.2.1" condition="Cortex-M Device">
<package name="ARM_Compiler" schemaVersion="1.4.9" url="http://www.keil.com/pack/" vendor="Keil" version="1.3.2"/>
<targetInfos>
<targetInfo name="CryptTest"/>
</targetInfos>
</component>
<component Cbundle="ARM Compiler" Cclass="Compiler" Cgroup="I/O" Csub="File" Cvariant="File System" Cvendor="Keil" Cversion="1.2.0" condition="ARMCC Cortex-M with File System">
<package name="ARM_Compiler" schemaVersion="1.4.9" url="http://www.keil.com/pack/" vendor="Keil" version="1.3.2"/>
<targetInfos>
@ -501,14 +517,14 @@
<targetInfo name="CryptTest"/>
</targetInfos>
</component>
<component Cbundle="MDK-Pro" Cclass="File System" Cgroup="CORE" Cvariant="LFN" Cvendor="Keil" Cversion="6.9.8" condition="CMSIS Core with RTOS and File System I/O">
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.4.1"/>
<component Cbundle="MDK-Pro" Cclass="File System" Cgroup="CORE" Cvariant="LFN Debug" Cvendor="Keil" Cversion="6.10.0" condition="CMSIS Core with RTOS and File System I/O and Event Recorder">
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.5.0"/>
<targetInfos>
<targetInfo name="CryptTest"/>
</targetInfos>
</component>
<component Cbundle="MDK-Pro" Cclass="File System" Cgroup="Drive" Csub="Memory Card" Cvendor="Keil" Cversion="6.9.8" condition="File System and SD/MMC Driver" maxInstances="2">
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.4.1"/>
<component Cbundle="MDK-Pro" Cclass="File System" Cgroup="Drive" Csub="Memory Card" Cvendor="Keil" Cversion="6.10.0" condition="File System and SD/MMC Driver" maxInstances="2">
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.5.0"/>
<targetInfos>
<targetInfo name="CryptTest"/>
</targetInfos>
@ -667,6 +683,14 @@
<targetInfo name="CryptTest"/>
</targetInfos>
</file>
<file attr="config" category="header" name="Config\EventRecorderConf.h" version="1.0.0">
<instance index="0">RTE\Compiler\EventRecorderConf.h</instance>
<component Cbundle="ARM Compiler" Cclass="Compiler" Cgroup="Event Recorder" Cvariant="DAP" Cvendor="Keil" Cversion="1.2.1" condition="Cortex-M Device"/>
<package name="ARM_Compiler" schemaVersion="1.4.9" url="http://www.keil.com/pack/" vendor="Keil" version="1.3.2"/>
<targetInfos>
<targetInfo name="CryptTest"/>
</targetInfos>
</file>
<file attr="config" category="header" name="CMSIS\Driver\Config\RTE_Device.h" version="1.4.0">
<instance index="0">RTE\Device\STM32F756NGHx\RTE_Device.h</instance>
<component Capiversion="1.0.0" Cclass="Device" Cgroup="STM32Cube Framework" Csub="Classic" Cvendor="Keil" Cversion="1.2.0" condition="STM32F7 Framework Classic"/>
@ -701,16 +725,16 @@
</file>
<file attr="config" category="source" name="FileSystem\Config\FS_Config.c" version="6.2.0">
<instance index="0">RTE\File_System\FS_Config.c</instance>
<component Cbundle="MDK-Pro" Cclass="File System" Cgroup="CORE" Cvariant="LFN" Cvendor="Keil" Cversion="6.9.8" condition="CMSIS Core with RTOS and File System I/O"/>
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.4.1"/>
<component Cbundle="MDK-Pro" Cclass="File System" Cgroup="CORE" Cvariant="LFN Debug" Cvendor="Keil" Cversion="6.10.0" condition="CMSIS Core with RTOS and File System I/O and Event Recorder"/>
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.5.0"/>
<targetInfos>
<targetInfo name="CryptTest"/>
</targetInfos>
</file>
<file attr="config" category="source" name="FileSystem\Config\FS_Config_MC.h" version="6.2.0">
<instance index="0">RTE\File_System\FS_Config_MC_0.h</instance>
<component Cbundle="MDK-Pro" Cclass="File System" Cgroup="Drive" Csub="Memory Card" Cvendor="Keil" Cversion="6.9.8" condition="File System and SD/MMC Driver" maxInstances="2"/>
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.4.1"/>
<component Cbundle="MDK-Pro" Cclass="File System" Cgroup="Drive" Csub="Memory Card" Cvendor="Keil" Cversion="6.10.0" condition="File System and SD/MMC Driver" maxInstances="2"/>
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.5.0"/>
<targetInfos>
<targetInfo name="CryptTest"/>
</targetInfos>
@ -722,12 +746,10 @@
<targetInfos/>
</file>
<file attr="config" category="header" name="wolfssl\IDE\MDK5-ARM\Conf\config-Crypt.h">
<instance index="0">RTE\wolfSSL\config-Crypt.h</instance>
<instance index="0" removed="1">RTE\wolfSSL\config-Crypt.h</instance>
<component Cbundle="wolfSSL" Cclass="wolfSSL" Cgroup="wolfCrypt" Csub="CORE" Cvendor="wolfSSL" Cversion="" condition="wolfCrypt-Core"/>
<package license="wolfssl\IDE\MDK5-ARM\Docs\wolfSSL-License.txt" name="wolfSSL" schemaVersion="1.4" url="http://www.wolfSSL.com/files/ide" vendor="wolfSSL" version="3.13.0"/>
<targetInfos>
<targetInfo name="CryptTest"/>
</targetInfos>
<targetInfos/>
</file>
<file attr="config" category="header" name="wolfssl\IDE\MDK5-ARM\Conf\user_settings.h">
<instance index="0">RTE\wolfSSL\user_settings.h</instance>

View File

@ -1,22 +1,12 @@
This program is echo client with CyaSSL/wolfCrypt library.
wolfSSL example: echo Client
In order to run this program,
Copy {PACK}\wolfSSL\CyaSSL\{version}\cyassl\certs folder and files to the SD memory.
Set config-EchoClient.h configuration file for the Callee IP or Port number.
Use Configuration Wizard tab
main.c for remote IP address, port or TLS version
user_settings.h for wolfCrypt or wolfSSL options
For further configuration, refer config-Crypt.h and config-CyaSSL.h.
When testing this client, it is recommended to test against one of the standard
CyaSSL example applications running on a desktop machine. The standard CyaSSL
example applications are located in the CyaSSL root directory under the
<cyassl_root>/examples directory.
For the hardware crypt on config-Crypt.h, download
STSW-STM32062: STM32F2xx standard peripherals library at
http://www.st.com/. Copy Libraries\STM32F2xx_StdPeriph_Driver\{inc,src} to
{PACK}\cyassl\IDE\MDK5-ARM\STM32F2xx_StdPeriph_Lib
For further options, details, see wolfSSL User Manual.
Support
-------
Please send questions or comments to support@wolfssl.com
Please send questions or comments to support@wolfssl.com

View File

@ -8,7 +8,7 @@
<Extensions>
<cExt>*.c</cExt>
<aExt>*.s*; *.src; *.a*</aExt>
<oExt>*.obj</oExt>
<oExt>*.obj; *.o</oExt>
<lExt>*.lib</lExt>
<tExt>*.txt; *.h; *.inc</tExt>
<pExt>*.plm</pExt>
@ -22,16 +22,16 @@
</DaveTm>
<Target>
<TargetName>STM32F207 Flash</TargetName>
<TargetName>echoClient</TargetName>
<ToolsetNumber>0x4</ToolsetNumber>
<ToolsetName>ARM-ADS</ToolsetName>
<TargetOption>
<CLKADS>12000000</CLKADS>
<CLKADS>25000000</CLKADS>
<OPTTT>
<gFlags>1</gFlags>
<BeepAtEnd>1</BeepAtEnd>
<RunSim>0</RunSim>
<RunTarget>1</RunTarget>
<RunSim>1</RunSim>
<RunTarget>0</RunTarget>
<RunAbUc>0</RunAbUc>
</OPTTT>
<OPTHX>
@ -45,7 +45,7 @@
<PageWidth>79</PageWidth>
<PageLength>66</PageLength>
<TabStop>8</TabStop>
<ListingPath>.\Object\</ListingPath>
<ListingPath>.\Output\</ListingPath>
</OPTLEX>
<ListingPage>
<CreateCListing>1</CreateCListing>
@ -78,23 +78,6 @@
<IsCurrentTarget>1</IsCurrentTarget>
</OPTFL>
<CpuCode>18</CpuCode>
<Books>
<Book>
<Number>0</Number>
<Title>Schematics (MCBSTM32F200)</Title>
<Path>C:\Keil_v5\ARM\PACK\Keil\STM32F2xx_DFP\2.2.0\MDK/Boards/Keil/MCBSTM32F200/Documentation/mcbstm32f200-schematics.pdf</Path>
</Book>
<Book>
<Number>1</Number>
<Title>User Manual (MCBSTM32F200)</Title>
<Path>C:\Keil_v5\ARM\PACK\Keil\STM32F2xx_DFP\2.2.0\MDK/Boards/Keil/MCBSTM32F200/Documentation/mcbstm32f200.chm</Path>
</Book>
<Book>
<Number>2</Number>
<Title>MCBSTM32F200 Evaluation Board Web Page (MCBSTM32F200)</Title>
<Path>http://www.keil.com/mcbstm32f200/</Path>
</Book>
</Books>
<DebugOpt>
<uSim>0</uSim>
<uTrg>1</uTrg>
@ -117,7 +100,8 @@
<tRSysVw>1</tRSysVw>
<sRunDeb>0</sRunDeb>
<sLrtime>0</sLrtime>
<nTsel>1</nTsel>
<bEvRecOn>1</bEvRecOn>
<nTsel>5</nTsel>
<sDll></sDll>
<sDllPa></sDllPa>
<sDlgDll></sDlgDll>
@ -127,10 +111,15 @@
<tDllPa></tDllPa>
<tDlgDll></tDlgDll>
<tDlgPa></tDlgPa>
<tIfile>.\STM32_SWO.ini</tIfile>
<pMon>BIN\UL2CM3.DLL</pMon>
<tIfile></tIfile>
<pMon>STLink\ST-LINKIII-KEIL_SWO.dll</pMon>
</DebugOpt>
<TargetDriverDllRegistry>
<SetRegEntry>
<Number>0</Number>
<Key>ST-LINKIII-KEIL_SWO</Key>
<Name>-U303030303030303030303031 -O8399 -S0 -C0 -A0 -N00("ARM CoreSight SW-DP") -D00(5BA02477) -L00(0) -TO27 -TC216000000 -TP21 -TDS806B -TDT0 -TDC1F -TIEFFFFFFFF -TIP9 -FO15 -FD20010000 -FC1000 -FN1 -FF0STM32F7x_1024.FLM -FS08000000 -FL0100000 -FP0($$Device:STM32F756NGHx$CMSIS\Flash\STM32F7x_1024.FLM)</Name>
</SetRegEntry>
<SetRegEntry>
<Number>0</Number>
<Key>ARMRTXEVENTFLAGS</Key>
@ -139,18 +128,13 @@
<SetRegEntry>
<Number>0</Number>
<Key>DLGTARM</Key>
<Name>(1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0)(1012=-1,-1,-1,-1,0)</Name>
<Name>(1010=-1,-1,-1,-1,0)(6017=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(6016=-1,-1,-1,-1,0)(1012=-1,-1,-1,-1,0)</Name>
</SetRegEntry>
<SetRegEntry>
<Number>0</Number>
<Key>ARMDBGFLAGS</Key>
<Name></Name>
</SetRegEntry>
<SetRegEntry>
<Number>0</Number>
<Key>ULP2CM3</Key>
<Name>-UP1135060 -O206 -S8 -C0 -P00 -N00("ARM CoreSight SW-DP") -D00(2BA01477) -L00(0) -TO19 -TC120000000 -TP18 -TDX0 -TDD0 -TDS8000 -TDT0 -TDC1F -TIE1 -TIP1 -FO7 -FD20000000 -FC1000 -FN1 -FF0STM32F2xx_1024.FLM -FS08000000 -FL0100000 -FP0($$Device:STM32F207IG$CMSIS/Flash/STM32F2xx_1024.FLM)</Name>
</SetRegEntry>
<SetRegEntry>
<Number>0</Number>
<Key>DLGUARM</Key>
@ -159,32 +143,77 @@
<SetRegEntry>
<Number>0</Number>
<Key>UL2CM3</Key>
<Name>-UM1020ADE -O206 -S8 -C0 -P00 -N00("ARM CoreSight SW-DP") -D00(2BA01477) -L00(0) -TO19 -TC120000000 -TP21 -TDS801F -TDT0 -TDC1F -TIE1 -TIP1 -FO7 -FD20000000 -FC1000 -FN1 -FF0STM32F2xx_1024.FLM -FS08000000 -FL0100000 -FP0($$Device:STM32F207IGHx$CMSIS/Flash/STM32F2xx_1024.FLM)</Name>
<Name>-UV0998FBE -O207 -S10 -C0 -P00 -N00("ARM CoreSight SW-DP") -D00(5BA02477) -L00(0) -TO18 -TC216000000 -TP21 -TDS80B8 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO15 -FD20010000 -FC1000 -FN1 -FF0STM32F7x_1024.FLM -FS08000000 -FL0100000 -FP0($$Device:STM32F756NGHx$CMSIS\Flash\STM32F7x_1024.FLM)</Name>
</SetRegEntry>
</TargetDriverDllRegistry>
<Breakpoint/>
<MemoryWindow1>
<Mm>
<Breakpoint>
<Bp>
<Number>0</Number>
<Type>0</Type>
<LineNumber>185</LineNumber>
<EnabledFlag>1</EnabledFlag>
<Address>134219474</Address>
<ByteObject>0</ByteObject>
<HtxType>0</HtxType>
<ManyObjects>0</ManyObjects>
<SizeOfObject>0</SizeOfObject>
<BreakByAccess>0</BreakByAccess>
<BreakIfRCount>1</BreakIfRCount>
<Filename>.\main.c</Filename>
<ExecCommand></ExecCommand>
<Expression>\\echoClient\main.c\185</Expression>
</Bp>
<Bp>
<Number>1</Number>
<Type>0</Type>
<LineNumber>181</LineNumber>
<EnabledFlag>1</EnabledFlag>
<Address>134219494</Address>
<ByteObject>0</ByteObject>
<HtxType>0</HtxType>
<ManyObjects>0</ManyObjects>
<SizeOfObject>0</SizeOfObject>
<BreakByAccess>0</BreakByAccess>
<BreakIfRCount>1</BreakIfRCount>
<Filename>.\main.c</Filename>
<ExecCommand></ExecCommand>
<Expression>\\echoClient\main.c\181</Expression>
</Bp>
<Bp>
<Number>2</Number>
<Type>0</Type>
<LineNumber>306</LineNumber>
<EnabledFlag>1</EnabledFlag>
<Address>0</Address>
<ByteObject>0</ByteObject>
<HtxType>0</HtxType>
<ManyObjects>0</ManyObjects>
<SizeOfObject>0</SizeOfObject>
<BreakByAccess>0</BreakByAccess>
<BreakIfRCount>0</BreakIfRCount>
<Filename>.\main.c</Filename>
<ExecCommand></ExecCommand>
<Expression></Expression>
</Bp>
</Breakpoint>
<WatchWindow1>
<Ww>
<count>0</count>
<WinNumber>1</WinNumber>
<SubType>8</SubType>
<ItemText>port</ItemText>
<AccSizeX>0</AccSizeX>
</Mm>
</MemoryWindow1>
<MemoryWindow2>
<Mm>
<WinNumber>2</WinNumber>
<SubType>8</SubType>
<ItemText>0x8004dc8</ItemText>
<AccSizeX>0</AccSizeX>
</Mm>
</MemoryWindow2>
<ItemText>eth_pins</ItemText>
</Ww>
</WatchWindow1>
<ScvdPack>
<Filename>C:\Keil_v5\ARM\PACK\Keil\MDK-Middleware\7.4.1\FileSystem\FileSystem.scvd</Filename>
<Type>Keil.MDK-Middleware.7.4.1</Type>
<SubType>1</SubType>
</ScvdPack>
<Tracepoint>
<THDelay>0</THDelay>
</Tracepoint>
<DebugFlag>
<trace>0</trace>
<periodic>0</periodic>
<periodic>1</periodic>
<aLwin>1</aLwin>
<aCover>0</aCover>
<aSer1>0</aSer1>
@ -203,13 +232,26 @@
<aPa1>0</aPa1>
<AscS4>0</AscS4>
<aSer4>1</aSer4>
<StkLoc>1</StkLoc>
<StkLoc>0</StkLoc>
<TrcWin>0</TrcWin>
<newCpu>0</newCpu>
<uProt>0</uProt>
</DebugFlag>
<LintExecutable></LintExecutable>
<LintConfigFile></LintConfigFile>
<bLintAuto>0</bLintAuto>
<bAutoGenD>0</bAutoGenD>
<LntExFlags>0</LntExFlags>
<pMisraName></pMisraName>
<pszMrule></pszMrule>
<pSingCmds></pSingCmds>
<pMultCmds></pMultCmds>
<DebugDescription>
<Enable>1</Enable>
<EnableLog>0</EnableLog>
<Protocol>2</Protocol>
<DbgClock>2000000</DbgClock>
</DebugDescription>
</TargetOption>
</Target>
@ -224,7 +266,6 @@
<FileNumber>1</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<Focus>0</Focus>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>.\main.c</PathWithFileName>
@ -234,6 +275,46 @@
</File>
</Group>
<Group>
<GroupName>Documentation</GroupName>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
<File>
<GroupNumber>2</GroupNumber>
<FileNumber>2</FileNumber>
<FileType>5</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>.\Abstract.txt</PathWithFileName>
<FilenameWithoutPath>Abstract.txt</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
</Group>
<Group>
<GroupName>Linker Script</GroupName>
<tvExp>1</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
<File>
<GroupNumber>3</GroupNumber>
<FileNumber>3</FileNumber>
<FileType>5</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>.\wolfssl-link.sct</PathWithFileName>
<FilenameWithoutPath>wolfssl-link.sct</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
</Group>
<Group>
<GroupName>Configuration</GroupName>
<tvExp>1</tvExp>
@ -241,37 +322,10 @@
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
<File>
<GroupNumber>2</GroupNumber>
<FileNumber>2</FileNumber>
<FileType>5</FileType>
<tvExp>0</tvExp>
<Focus>0</Focus>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>.\RTE\wolfSSL\config-Crypt.h</PathWithFileName>
<FilenameWithoutPath>config-Crypt.h</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>2</GroupNumber>
<FileNumber>3</FileNumber>
<FileType>5</FileType>
<tvExp>0</tvExp>
<Focus>0</Focus>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>.\RTE\wolfSSL\config-wolfSSL.h</PathWithFileName>
<FilenameWithoutPath>config-wolfSSL.h</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>2</GroupNumber>
<GroupNumber>4</GroupNumber>
<FileNumber>4</FileNumber>
<FileType>5</FileType>
<tvExp>0</tvExp>
<Focus>0</Focus>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>.\RTE\wolfSSL\user_settings.h</PathWithFileName>
@ -282,24 +336,11 @@
</Group>
<Group>
<GroupName>Dcumentation</GroupName>
<tvExp>1</tvExp>
<GroupName>::Board Support</GroupName>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
<File>
<GroupNumber>3</GroupNumber>
<FileNumber>5</FileNumber>
<FileType>5</FileType>
<tvExp>0</tvExp>
<Focus>0</Focus>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>.\Abstract.txt</PathWithFileName>
<FilenameWithoutPath>Abstract.txt</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<RteFlg>1</RteFlg>
</Group>
<Group>
@ -312,7 +353,7 @@
<Group>
<GroupName>::CMSIS Driver</GroupName>
<tvExp>1</tvExp>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>1</RteFlg>
@ -320,7 +361,7 @@
<Group>
<GroupName>::Compiler</GroupName>
<tvExp>1</tvExp>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>1</RteFlg>
@ -336,7 +377,7 @@
<Group>
<GroupName>::File System</GroupName>
<tvExp>0</tvExp>
<tvExp>1</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>1</RteFlg>
@ -344,7 +385,7 @@
<Group>
<GroupName>::Network</GroupName>
<tvExp>1</tvExp>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>1</RteFlg>

File diff suppressed because it is too large Load Diff

View File

@ -1,35 +0,0 @@
/* config-RTX-TCP-FS.h
*
* Copyright (C) 2006-2017 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
*/
// <<< Use Configuration Wizard in Context Menu >>>
// <h> Build Target: Simple Client
// <s.15>Callee IP Address
// <i> Default: "192.168.1.100"
#define CYASSL_CALLEE_IP "192.168.11.3"
// <o>Callee Port Number
// <i> Default: "11111"
#define CYASSL_CALLEE_PORT 443
// </h>
// <<< end of configuration section >>>

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,14 @@
LR_IROM1 0x08000000 0x00100000 { ; load region size_region
ER_IROM1 0x08000000 0x00100000 { ; load address = execution address
*.o (RESET, +First)
*(InRoot$$Sections)
.ANY (+RO)
}
RW_IRAM1 0x20010000 0x00040000 { ; RW data
.ANY (+RW +ZI)
}
RW_RETARGET 0x2000FFF0 0x00000010 {
retarget_io.o (+ZI +RW)
}
}

View File

@ -1,24 +1,12 @@
This program is echo server with CyaSSL/wolfCrypt library.
wolfSSL example: echo Server
In order to run this program,
Copy {PACK}\wolfSSL\CyaSSL\{version}\cyassl\certs folder and files to the SD memory.
Set the server IP address in Net_Config_ETH_0.h
The server default port is 11111, defined in test.h.
Use Configuration Wizard tab
main.c for server port or TLS version
user_settings.h for wolfCrypt or wolfSSL options
For further configuration, refer config-Crypt.h and config-CyaSSL.h.
When testing this server, it is recommended to test against one of the standard
CyaSSL example applications running on a desktop machine. The standard CyaSSL
example applications are located in the CyaSSL root directory under the
<cyassl_root>/examples directory.
For the hardware crypt on config-Crypt.h, download
STSW-STM32062: STM32F2xx standard peripherals library at
http://www.st.com/. Copy Libraries\STM32F2xx_StdPeriph_Driver\{inc,src} to
{PACK}\cyassl\IDE\MDK5-ARM\STM32F2xx_StdPeriph_Lib
For further options, details, see wolfSSL User Manual.
Support
-------
Please send questions or comments to support@wolfssl.com

View File

@ -8,7 +8,7 @@
<Extensions>
<cExt>*.c</cExt>
<aExt>*.s*; *.src; *.a*</aExt>
<oExt>*.obj</oExt>
<oExt>*.obj; *.o</oExt>
<lExt>*.lib</lExt>
<tExt>*.txt; *.h; *.inc</tExt>
<pExt>*.plm</pExt>
@ -22,16 +22,16 @@
</DaveTm>
<Target>
<TargetName>STM32F207 Flash</TargetName>
<TargetName>echoServer</TargetName>
<ToolsetNumber>0x4</ToolsetNumber>
<ToolsetName>ARM-ADS</ToolsetName>
<TargetOption>
<CLKADS>12000000</CLKADS>
<CLKADS>25000000</CLKADS>
<OPTTT>
<gFlags>1</gFlags>
<BeepAtEnd>1</BeepAtEnd>
<RunSim>0</RunSim>
<RunTarget>1</RunTarget>
<RunSim>1</RunSim>
<RunTarget>0</RunTarget>
<RunAbUc>0</RunAbUc>
</OPTTT>
<OPTHX>
@ -45,7 +45,7 @@
<PageWidth>79</PageWidth>
<PageLength>66</PageLength>
<TabStop>8</TabStop>
<ListingPath>.\Object\</ListingPath>
<ListingPath>.\Output\</ListingPath>
</OPTLEX>
<ListingPage>
<CreateCListing>1</CreateCListing>
@ -78,23 +78,6 @@
<IsCurrentTarget>1</IsCurrentTarget>
</OPTFL>
<CpuCode>18</CpuCode>
<Books>
<Book>
<Number>0</Number>
<Title>Schematics (MCBSTM32F200)</Title>
<Path>C:\Keil_v5\ARM\PACK\Keil\STM32F2xx_DFP\2.2.0\MDK/Boards/Keil/MCBSTM32F200/Documentation/mcbstm32f200-schematics.pdf</Path>
</Book>
<Book>
<Number>1</Number>
<Title>User Manual (MCBSTM32F200)</Title>
<Path>C:\Keil_v5\ARM\PACK\Keil\STM32F2xx_DFP\2.2.0\MDK/Boards/Keil/MCBSTM32F200/Documentation/mcbstm32f200.chm</Path>
</Book>
<Book>
<Number>2</Number>
<Title>MCBSTM32F200 Evaluation Board Web Page (MCBSTM32F200)</Title>
<Path>http://www.keil.com/mcbstm32f200/</Path>
</Book>
</Books>
<DebugOpt>
<uSim>0</uSim>
<uTrg>1</uTrg>
@ -117,7 +100,8 @@
<tRSysVw>1</tRSysVw>
<sRunDeb>0</sRunDeb>
<sLrtime>0</sLrtime>
<nTsel>1</nTsel>
<bEvRecOn>1</bEvRecOn>
<nTsel>5</nTsel>
<sDll></sDll>
<sDllPa></sDllPa>
<sDlgDll></sDlgDll>
@ -127,10 +111,15 @@
<tDllPa></tDllPa>
<tDlgDll></tDlgDll>
<tDlgPa></tDlgPa>
<tIfile>.\STM32_SWO.ini</tIfile>
<pMon>BIN\UL2CM3.DLL</pMon>
<tIfile></tIfile>
<pMon>STLink\ST-LINKIII-KEIL_SWO.dll</pMon>
</DebugOpt>
<TargetDriverDllRegistry>
<SetRegEntry>
<Number>0</Number>
<Key>ST-LINKIII-KEIL_SWO</Key>
<Name>-U303030303030303030303031 -O8399 -S0 -C0 -A0 -N00("ARM CoreSight SW-DP") -D00(5BA02477) -L00(0) -TO27 -TC216000000 -TP21 -TDS806B -TDT0 -TDC1F -TIEFFFFFFFF -TIP9 -FO15 -FD20010000 -FC1000 -FN1 -FF0STM32F7x_1024.FLM -FS08000000 -FL0100000 -FP0($$Device:STM32F756NGHx$CMSIS\Flash\STM32F7x_1024.FLM)</Name>
</SetRegEntry>
<SetRegEntry>
<Number>0</Number>
<Key>ARMRTXEVENTFLAGS</Key>
@ -139,18 +128,13 @@
<SetRegEntry>
<Number>0</Number>
<Key>DLGTARM</Key>
<Name>(1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0)(1012=-1,-1,-1,-1,0)</Name>
<Name>(1010=-1,-1,-1,-1,0)(6017=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(6016=-1,-1,-1,-1,0)(1012=-1,-1,-1,-1,0)</Name>
</SetRegEntry>
<SetRegEntry>
<Number>0</Number>
<Key>ARMDBGFLAGS</Key>
<Name></Name>
</SetRegEntry>
<SetRegEntry>
<Number>0</Number>
<Key>ULP2CM3</Key>
<Name>-UP1135060 -O206 -S8 -C0 -P00 -N00("ARM CoreSight SW-DP") -D00(2BA01477) -L00(0) -TO19 -TC120000000 -TP18 -TDX0 -TDD0 -TDS8000 -TDT0 -TDC1F -TIE1 -TIP1 -FO7 -FD20000000 -FC1000 -FN1 -FF0STM32F2xx_1024.FLM -FS08000000 -FL0100000 -FP0($$Device:STM32F207IG$CMSIS/Flash/STM32F2xx_1024.FLM)</Name>
</SetRegEntry>
<SetRegEntry>
<Number>0</Number>
<Key>DLGUARM</Key>
@ -159,32 +143,28 @@
<SetRegEntry>
<Number>0</Number>
<Key>UL2CM3</Key>
<Name>-UM1020ADE -O206 -S8 -C0 -P00 -N00("ARM CoreSight SW-DP") -D00(2BA01477) -L00(0) -TO19 -TC120000000 -TP21 -TDS801F -TDT0 -TDC1F -TIE1 -TIP1 -FO7 -FD20000000 -FC1000 -FN1 -FF0STM32F2xx_1024.FLM -FS08000000 -FL0100000 -FP0($$Device:STM32F207IGHx$CMSIS/Flash/STM32F2xx_1024.FLM)</Name>
<Name>-UV0998FBE -O207 -S10 -C0 -P00 -N00("ARM CoreSight SW-DP") -D00(5BA02477) -L00(0) -TO18 -TC216000000 -TP21 -TDS80B8 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO15 -FD20010000 -FC1000 -FN1 -FF0STM32F7x_1024.FLM -FS08000000 -FL0100000 -FP0($$Device:STM32F756NGHx$CMSIS\Flash\STM32F7x_1024.FLM)</Name>
</SetRegEntry>
</TargetDriverDllRegistry>
<Breakpoint/>
<MemoryWindow1>
<Mm>
<WatchWindow1>
<Ww>
<count>0</count>
<WinNumber>1</WinNumber>
<SubType>8</SubType>
<ItemText>port</ItemText>
<AccSizeX>0</AccSizeX>
</Mm>
</MemoryWindow1>
<MemoryWindow2>
<Mm>
<WinNumber>2</WinNumber>
<SubType>8</SubType>
<ItemText>0x8004dc8</ItemText>
<AccSizeX>0</AccSizeX>
</Mm>
</MemoryWindow2>
<ItemText>eth_pins</ItemText>
</Ww>
</WatchWindow1>
<ScvdPack>
<Filename>C:\Keil_v5\ARM\PACK\Keil\MDK-Middleware\7.5.0\FileSystem\FileSystem.scvd</Filename>
<Type>Keil.MDK-Middleware.7.5.0</Type>
<SubType>1</SubType>
</ScvdPack>
<Tracepoint>
<THDelay>0</THDelay>
</Tracepoint>
<DebugFlag>
<trace>0</trace>
<periodic>0</periodic>
<periodic>1</periodic>
<aLwin>1</aLwin>
<aCover>0</aCover>
<aSer1>0</aSer1>
@ -203,13 +183,26 @@
<aPa1>0</aPa1>
<AscS4>0</AscS4>
<aSer4>1</aSer4>
<StkLoc>1</StkLoc>
<StkLoc>0</StkLoc>
<TrcWin>0</TrcWin>
<newCpu>0</newCpu>
<uProt>0</uProt>
</DebugFlag>
<LintExecutable></LintExecutable>
<LintConfigFile></LintConfigFile>
<bLintAuto>0</bLintAuto>
<bAutoGenD>0</bAutoGenD>
<LntExFlags>0</LntExFlags>
<pMisraName></pMisraName>
<pszMrule></pszMrule>
<pSingCmds></pSingCmds>
<pMultCmds></pMultCmds>
<DebugDescription>
<Enable>1</Enable>
<EnableLog>0</EnableLog>
<Protocol>2</Protocol>
<DbgClock>2000000</DbgClock>
</DebugDescription>
</TargetOption>
</Target>
@ -224,7 +217,6 @@
<FileNumber>1</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<Focus>0</Focus>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>.\main.c</PathWithFileName>
@ -234,6 +226,46 @@
</File>
</Group>
<Group>
<GroupName>Documentation</GroupName>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
<File>
<GroupNumber>2</GroupNumber>
<FileNumber>2</FileNumber>
<FileType>5</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>.\Abstract.txt</PathWithFileName>
<FilenameWithoutPath>Abstract.txt</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
</Group>
<Group>
<GroupName>Linker Script</GroupName>
<tvExp>1</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
<File>
<GroupNumber>3</GroupNumber>
<FileNumber>3</FileNumber>
<FileType>5</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>.\wolfssl-link.sct</PathWithFileName>
<FilenameWithoutPath>wolfssl-link.sct</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
</Group>
<Group>
<GroupName>Configuration</GroupName>
<tvExp>1</tvExp>
@ -241,37 +273,10 @@
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
<File>
<GroupNumber>2</GroupNumber>
<FileNumber>2</FileNumber>
<FileType>5</FileType>
<tvExp>0</tvExp>
<Focus>0</Focus>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>.\RTE\wolfSSL\config-Crypt.h</PathWithFileName>
<FilenameWithoutPath>config-Crypt.h</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>2</GroupNumber>
<FileNumber>3</FileNumber>
<FileType>5</FileType>
<tvExp>0</tvExp>
<Focus>0</Focus>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>.\RTE\wolfSSL\config-wolfSSL.h</PathWithFileName>
<FilenameWithoutPath>config-wolfSSL.h</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>2</GroupNumber>
<GroupNumber>4</GroupNumber>
<FileNumber>4</FileNumber>
<FileType>5</FileType>
<tvExp>0</tvExp>
<Focus>0</Focus>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>.\RTE\wolfSSL\user_settings.h</PathWithFileName>
@ -282,24 +287,11 @@
</Group>
<Group>
<GroupName>Dcumentation</GroupName>
<tvExp>1</tvExp>
<GroupName>::Board Support</GroupName>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
<File>
<GroupNumber>3</GroupNumber>
<FileNumber>5</FileNumber>
<FileType>5</FileType>
<tvExp>0</tvExp>
<Focus>0</Focus>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>.\Abstract.txt</PathWithFileName>
<FilenameWithoutPath>Abstract.txt</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<RteFlg>1</RteFlg>
</Group>
<Group>
@ -312,7 +304,7 @@
<Group>
<GroupName>::CMSIS Driver</GroupName>
<tvExp>1</tvExp>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>1</RteFlg>
@ -320,7 +312,7 @@
<Group>
<GroupName>::Compiler</GroupName>
<tvExp>1</tvExp>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>1</RteFlg>
@ -336,7 +328,7 @@
<Group>
<GroupName>::File System</GroupName>
<tvExp>0</tvExp>
<tvExp>1</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>1</RteFlg>
@ -344,7 +336,7 @@
<Group>
<GroupName>::Network</GroupName>
<tvExp>1</tvExp>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>1</RteFlg>

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -23,39 +23,62 @@
#include <config.h>
#endif
#include <wolfssl/wolfcrypt/visibility.h>
#include <wolfssl/wolfcrypt/logging.h>
#include "wolfssl/wolfcrypt/settings.h"
#include "stm32f2xx_hal.h"
#include "cmsis_os.h"
#include "rl_net.h"
#include <stdio.h>
#include "cmsis_os.h" /* CMSIS RTOS definitions */
#include "rl_net.h" /* Network definitions */
#include <time.h>
#include <wolfssl/ssl.h>
/*-----------------------------------------------------------------------------
* Initialize Clock Configuration
*----------------------------------------------------------------------------*/
void SystemClock_Config(void) {
#warning "write MPU specific System Clock Set up\n"
}
//-------- <<< Use Configuration Wizard in Context Menu >>> -----------------
// <h>Server parameter
// ====================
// <s.6>Port
// <i> Default: "11111"
#define SERVER_PORT "11111"
// </h>
// <h>Protocol
// ====================
// <o>SSL/TLS Version<0=> SSL3 <1=> TLS1.0 <2=> TLS1.1 <3=> TLS1.2 <4=> TLS1.3
#define TLS_VER 3
// <s.2>Other option
#define OTHER_OPTIONS ""
// </h>
// <h>RTC: for validate certificate date
// <o>Year <1970-2099>
#define RTC_YEAR 2018
// <o>Month <1=>Jan<2=>Feb<3=>Mar<4=>Apr<5=>May<6=>Jun<7=>Jul<8=>Aut<9=>Sep<10=>Oct<11=>Nov<12=>Dec
#define RTC_MONTH 1
// <o>Day <1-31>
#define RTC_DAY 1
// </h>
//------------- <<< end of configuration section >>> -----------------------
/*-----------------------------------------------------------------------------
* Initialize a Flash Memory Card
*----------------------------------------------------------------------------*/
#if !defined(NO_FILESYSTEM)
#include "rl_fs.h"
#if !defined(NO_FILESYSTEM)
#include "rl_fs.h" /* FileSystem definitions */
static void init_filesystem (void) {
int32_t retv;
retv = finit ("M0:");
if (retv == 0) {
if (retv == fsOK) {
retv = fmount ("M0:");
if (retv == 0) {
if (retv == fsOK) {
printf ("Drive M0 ready!\n");
}
else {
printf ("Drive M0 mount failed!\n");
printf ("Drive M0 mount failed(%d)!\n", retv);
}
}
else {
@ -65,10 +88,68 @@ static void init_filesystem (void) {
#endif
/*-----------------------------------------------------------------------------
* mian entry
*----------------------------------------------------------------------------*/
void net_loop(void const *arg)
{
while(1) {
net_main ();
osThreadYield ();
}
}
osThreadDef(net_loop, osPriorityLow, 2, 0);
extern uint32_t os_time;
static time_t epoctime = 0;
#ifdef RTE_CMSIS_RTOS_RTX
uint32_t HAL_GetTick(void) {
return os_time;
}
#endif
time_t time(time_t *t){
return epoctime ;
}
void setTime(time_t t){
epoctime = t;;
}
#ifdef WOLFSSL_CURRTIME_OSTICK
#include <stdint.h>
extern uint32_t os_time;
double current_time(int reset)
{
if(reset) os_time = 0 ;
return (double)os_time /1000.0;
}
#else
#include <stdint.h>
#define DWT ((DWT_Type *) (0xE0001000UL) )
typedef struct
{
uint32_t CTRL; /*!< Offset: 0x000 (R/W) Control Register */
uint32_t CYCCNT; /*!< Offset: 0x004 (R/W) Cycle Count Register */
} DWT_Type;
extern uint32_t SystemCoreClock ;
double current_time(int reset)
{
if(reset) DWT->CYCCNT = 0 ;
return ((double)DWT->CYCCNT/SystemCoreClock) ;
}
#endif
/*----------------------------------------------------------------------------
Main Thread 'main': Run Network
*---------------------------------------------------------------------------*/
#include <stdio.h>
typedef struct func_args {
int argc;
char** argv;
@ -76,22 +157,43 @@ typedef struct func_args {
extern void echoserver_test(func_args * args) ;
int main()
{
func_args args ;
args.argc = 1 ;
int myoptind = 0;
char* myoptarg = NULL;
SystemClock_Config ();
int main (void) {
struct tm *tm_gm;
time_t now;
static char *argv[] =
{ "server" } ;
static func_args args = { 1, argv } ;
MPU_Config(); /* Configure the MPU */
CPU_CACHE_Enable(); /* Enable the CPU Cache */
HAL_Init(); /* Initialize the HAL Library */
SystemClock_Config(); /* Configure the System Clock */
setTime((RTC_YEAR-1970)*365*24*60*60 + RTC_MONTH*30*24*60*60 + RTC_DAY*24*60*60);
now = time(NULL);
tm_gm = gmtime(&now);
printf("RTC=%04d/%02d/%02d\n", tm_gm->tm_year + 1900, tm_gm->tm_mon + 1, tm_gm->tm_mday);
#if !defined(NO_FILESYSTEM)
init_filesystem ();
#endif
netInitialize() ;
osDelay(300) ;
#if defined(DEBUG_WOLFSSL)
net_initialize ();
#if defined(DEBUG_WOLFSSL)
printf("Turning ON Debug message\n") ;
wolfSSL_Debugging_ON() ;
#endif
printf("echoserver: Started\n") ;
osThreadCreate (osThread(net_loop), NULL);
echoserver_test(&args) ;
printf("echoserver: Terminated\n") ;
while(1)
osDelay(1000);
}

View File

@ -0,0 +1,14 @@
LR_IROM1 0x08000000 0x00100000 { ; load region size_region
ER_IROM1 0x08000000 0x00100000 { ; load address = execution address
*.o (RESET, +First)
*(InRoot$$Sections)
.ANY (+RO)
}
RW_IRAM1 0x20010000 0x00040000 { ; RW data
.ANY (+RW +ZI)
}
RW_RETARGET 0x2000FFF0 0x00000010 {
retarget_io.o (+ZI +RW)
}
}

View File

@ -153,13 +153,6 @@
#include <wolfssl/certs_test.h>
#if defined(WOLFSSL_MDK_ARM)
#include <stdio.h>
#include <stdlib.h>
extern FILE * wolfSSL_fopen(const char *fname, const char *mode) ;
#define fopen wolfSSL_fopen
#endif
#ifdef HAVE_NTRU
#include "libntruencrypt/ntru_crypto.h"
#endif
@ -6797,9 +6790,6 @@ byte GetEntropy(ENTROPY_CMD cmd, byte* out)
#ifdef FREESCALE_MQX
#define CERT_PREFIX "a:\\"
#define CERT_PATH_SEP "\\"
#elif defined(WOLFSSL_MKD_SHELL)
#define CERT_PREFIX ""
#define CERT_PATH_SEP "/"
#elif defined(WOLFSSL_uTKERNEL2)
#define CERT_PREFIX "/uda/"
#define CERT_PATH_SEP "/"