diff --git a/IDE/MDK5-ARM/Conf/config-wolfSSL.h b/IDE/MDK5-ARM/Conf/config-wolfSSL.h new file mode 100644 index 000000000..4a7c22dfd --- /dev/null +++ b/IDE/MDK5-ARM/Conf/config-wolfSSL.h @@ -0,0 +1,90 @@ +/* config-wolfSSL.h + * + * Copyright (C) 2006-2016 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 + */ + + +/**** wolfSSL Configuration ****/ + +#define __CORTEX_M3__ + +// <<< Use Configuration Wizard in Context Menu >>> +// wolfSSL Configuration + +// SSL (Included by default) +// + +// TLS +#define MDK_CONF_TLS 1 +#if MDK_CONF_TLS == 0 +#define NO_TLS +#endif +// + +// CRL +#define MDK_CONF_DER_LOAD 0 +#if MDK_CONF_DER_LOAD == 1 +#define WOLFSSL_DER_LOAD +#endif +// +// OpenSSL Extra +#define MDK_CONF_OPENSSL_EXTRA 1 +#if MDK_CONF_OPENSSL_EXTRA == 1 +#define OPENSSL_EXTRA +#endif +// +// + +// Cert/Key Generation +// CertGen +#define MDK_CONF_CERT_GEN 0 +#if MDK_CONF_CERT_GEN == 1 +#define WOLFSSL_CERT_GEN +#endif +// +// KeyGen +#define MDK_CONF_KEY_GEN 0 +#if MDK_CONF_KEY_GEN == 1 +#define WOLFSSL_KEY_GEN +#endif +// +// + +// Others + +// Debug +// Debug Message +#define MDK_CONF_DebugMessage 0 +#if MDK_CONF_DebugMessage == 1 +#define DEBUG_WOLFSSL +#endif +// +// Check malloc +#define MDK_CONF_CheckMalloc 1 +#if MDK_CONF_CheckMalloc == 1 +#define WOLFSSL_MALLOC_CHECK +#define USE_WOLFSSL_MEMORY +#endif +// + + +// + + +// <<< end of configuration section >>> diff --git a/IDE/MDK5-ARM/Conf/user_settings.h b/IDE/MDK5-ARM/Conf/user_settings.h index f00c6fafe..37b42134f 100644 --- a/IDE/MDK5-ARM/Conf/user_settings.h +++ b/IDE/MDK5-ARM/Conf/user_settings.h @@ -1,29 +1,76 @@ -/* #define SINGLE_THREADED or define RTOS option */ +#define NO_MAIN_DRIVER +#define BENCH_EMBEDDED + +#define NO_DEV_RANDOM + +#define WOLFSSL_USER_CURRTIME +#define SIZEOF_LONG_LONG 8 +#define NO_WRITEV + +#define TFM_TIMING_RESISTANT +#define ECC_TIMING_RESISTANT +#define WC_RSA_BLINDING + +/* #define SINGLE_THREADED or define RTOS option */ #define WOLFSSL_CMSIS_RTOS +#define HAVE_AESGCM +#define WOLFSSL_SHA512 +#define WOLFSSL_SHA384 +#define HAVE_ECC +#define HAVE_CURVE25519 +#define CURVE25519_SMALL +#define HAVE_ED25519 +#define ED25519_SMALL + +#define NO_ERROR_STRINGS +#define NO_BIG_INT + +/* Hardware Crypt +#define WOLFSSL_STM32_CUBEMX +#define STM32_CRYPTO +#define STM32_HASH +#define STM32_RNG +#define WOLFSSL_STM32F7 +#define STM32_HAL_TIMEOUT 0xFF +*/ + + +/* +#define WOLFSSL_TLS13 +#define HAVE_TLS_EXTENSIONS +#define WC_RSA_PSS +#define HAVE_HKDF +*/ + /* #define NO_FILESYSTEM or define Filesystem option */ -#define WOLFSSL_KEIL_FS -#define NO_WOLFSSL_DIR -#define WOLFSSL_NO_CURRDIR +#define NO_WOLFSSL_DIR /* #define WOLFSSL_USER_IO or use BSD incompatible TCP stack */ -#define WOLFSSL_KEIL_TCP_NET /* KEIL_TCP + wolfssl_MDL_ARM.c for BSD compatibility */ +#define WOLFSSL_KEIL_TCP_NET #define NO_DEV_RANDOM /* define your Rand gen for the operational use */ #define WOLFSSL_GENSEED_FORTEST - +#define HAVE_HASHDRBG #define USE_WOLFSSL_MEMORY #define WOLFSSL_MALLOC_CHECK -#define XVALIDATEDATE(d, f,t) (0) +#define XVALIDATE_DATE(d, f,t) (1) +//#define TIME_OVERRIDES +#include +#define XGMTIME(a, b) gmtime(a, b) + +unsigned int HAL_GetTick(void); +#define XTIME(a) HAL_GetTick() + +#define HAVE_TIME_T_TYPE +#define HAVE_TM_TYPE + #define WOLFSSL_USER_CURRTIME /* for benchmark */ #define USE_FAST_MATH #define TFM_TIMING_RESISTANT -#define BENCH_EMBEDDED - -#define NO_WRITEV -#define NO_MAIN_DRIVER +/* #define DEBUG_WOLFSSL for Debug Log */ diff --git a/IDE/MDK5-ARM/Projects/CryptTest/CryptTest.sct b/IDE/MDK5-ARM/Projects/CryptTest/CryptTest.sct new file mode 100644 index 000000000..5e47c2dd4 --- /dev/null +++ b/IDE/MDK5-ARM/Projects/CryptTest/CryptTest.sct @@ -0,0 +1,18 @@ +; ************************************************************* +; *** Scatter-Loading Description File generated by uVision *** +; ************************************************************* + +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) + } +} + diff --git a/IDE/MDK5-ARM/Projects/CryptTest/CryptTest.uvoptx b/IDE/MDK5-ARM/Projects/CryptTest/CryptTest.uvoptx index f0f9517f4..e36f05aca 100644 --- a/IDE/MDK5-ARM/Projects/CryptTest/CryptTest.uvoptx +++ b/IDE/MDK5-ARM/Projects/CryptTest/CryptTest.uvoptx @@ -8,7 +8,7 @@ *.c *.s*; *.src; *.a* - *.obj + *.obj; *.o *.lib *.txt; *.h; *.inc *.plm @@ -26,12 +26,12 @@ 0x4 ARM-ADS - 12000000 + 25000000 1 1 - 0 - 1 + 1 + 0 0 @@ -45,7 +45,7 @@ 79 66 8 - .\Object\ + .\Output\ 1 @@ -78,23 +78,6 @@ 1 18 - - - 0 - Schematics (MCBSTM32F200) - C:\Keil_v5\ARM\PACK\Keil\STM32F2xx_DFP\2.2.0\MDK/Boards/Keil/MCBSTM32F200/Documentation/mcbstm32f200-schematics.pdf - - - 1 - User Manual (MCBSTM32F200) - C:\Keil_v5\ARM\PACK\Keil\STM32F2xx_DFP\2.2.0\MDK/Boards/Keil/MCBSTM32F200/Documentation/mcbstm32f200.chm - - - 2 - MCBSTM32F200 Evaluation Board Web Page (MCBSTM32F200) - http://www.keil.com/mcbstm32f200/ - - 0 1 @@ -117,7 +100,8 @@ 1 0 0 - 1 + 1 + 5 @@ -153,38 +137,34 @@ 0 - ULP2CM3 - -UP1135060 -O206 -S8 -C0 -P00 -N00("ARM CoreSight SW-DP") -D00(2BA01477) -L00(0) -TO7 -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) + DLGUARM + (105=-1,-1,-1,-1,0) 0 UL2CM3 - -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) + -UV0998FBE -O207 -S10 -C0 -P00 -N00("ARM CoreSight SW-DP") -D00(5BA02477) -L00(0) -TO1 -TC216000000 -TP21 -TDS86F -TDT0 -TDC1F -TIE1 -TIP1 -FO15 -FD20010000 -FC1000 -FN1 -FF0STM32F7x_1024.FLM -FS08000000 -FL0100000 -FP0($$Device:STM32F756NGHx$CMSIS\Flash\STM32F7x_1024.FLM) - - + + + 0 1 - 8 - clientKey - 0 - - - - - 2 - 8 - 0x8004dc8 - 0 - - + mfxstm32l152Identifier + + + + C:\Keil_v5\ARM\PACK\Keil\MDK-Middleware\7.4.1\FileSystem\FileSystem.scvd + Keil.MDK-Middleware.7.4.1 + 1 + 0 0 - 0 + 1 1 0 0 @@ -210,6 +190,19 @@ + 0 + 0 + 0 + + + + + + 1 + 0 + 2 + 2000000 + @@ -223,8 +216,7 @@ 1 1 1 - 0 - 0 + 1 0 0 .\main.c @@ -235,7 +227,7 @@ - Configuration + Linker Script 1 0 0 @@ -245,24 +237,10 @@ 2 5 0 - 0 0 0 - .\RTE\wolfSSL\config-Crypt.h - config-Crypt.h - 0 - 0 - - - 2 - 3 - 5 - 0 - 0 - 0 - 0 - .\RTE\wolfSSL\user_settings.h - user_settings.h + .\CryptTest.sct + CryptTest.sct 0 0 @@ -270,16 +248,15 @@ Documentation - 1 + 0 0 0 0 3 - 4 + 3 5 0 - 0 0 0 .\Abstract.txt @@ -289,6 +266,14 @@ + + ::Board Support + 1 + 0 + 0 + 1 + + ::CMSIS 1 diff --git a/IDE/MDK5-ARM/Projects/CryptTest/CryptTest.uvprojx b/IDE/MDK5-ARM/Projects/CryptTest/CryptTest.uvprojx index f5810fcd3..e3fee4e3f 100644 --- a/IDE/MDK5-ARM/Projects/CryptTest/CryptTest.uvprojx +++ b/IDE/MDK5-ARM/Projects/CryptTest/CryptTest.uvprojx @@ -10,18 +10,19 @@ CryptTest 0x4 ARM-ADS + 5060422::V5.06 update 4 (build 422)::ARMCC - STM32F207IGHx + STM32F756NGHx STMicroelectronics - Keil.STM32F2xx_DFP.2.2.0 + Keil.STM32F7xx_DFP.2.9.0 http://www.keil.com/pack - IROM(0x08000000,0x100000) IRAM(0x20000000,0x20000) CPUTYPE("Cortex-M3") CLOCK(12000000) ELITTLE + IROM(0x08000000,0x100000) IROM2(0x00200000,0x100000) IRAM(0x20010000,0x40000) IRAM2(0x20000000,0x10000) CPUTYPE("Cortex-M7") FPU3(SFPU) CLOCK(12000000) ELITTLE - UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0STM32F2xx_1024 -FS08000000 -FL0100000 -FP0($$Device:STM32F207IGHx$CMSIS/Flash/STM32F2xx_1024.FLM)) + UL2CM3(-S0 -C0 -P0 -FD20010000 -FC1000 -FN1 -FF0STM32F7x_1024 -FS08000000 -FL0100000 -FP0($$Device:STM32F756NGHx$CMSIS\Flash\STM32F7x_1024.FLM)) 0 - $$Device:STM32F207IGHx$Drivers/CMSIS/Device/ST/STM32F2xx/Include/stm32f2xx.h + $$Device:STM32F756NGHx$Drivers\CMSIS\Device\ST\STM32F7xx\Include\stm32f7xx.h @@ -31,7 +32,7 @@ - $$Device:STM32F207IGHx$CMSIS\SVD\STM32F20x.svd + $$Device:STM32F756NGHx$CMSIS\SVD\STM32F7x.svd 0 0 @@ -46,14 +47,14 @@ 0 1 - .\Object\ + .\Output\ CryptTest 1 0 0 1 1 - .\Object\ + .\Output\ 1 0 0 @@ -84,6 +85,8 @@ 0 0 + 0 + 0 0 @@ -108,11 +111,11 @@ SARMCM3.DLL -REMAP -MPU DCM.DLL - -pCM3 + -pCM7 SARMCM3.DLL -MPU TCM.DLL - -pCM3 + -pCM7 @@ -122,47 +125,6 @@ 0 16 - - 0 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 0 - 1 - - - 1 - 1 - 1 - 1 - 1 - 1 - 0 - 1 - 1 - 1 - - 0 - 1 - - - - - - - - - - - - - .\STM32_SWO.ini - BIN\UL2CM3.DLL - @@ -171,11 +133,11 @@ 0 1 1 - 4100 + 4096 1 BIN\UL2CM3.DLL - + "" () @@ -211,7 +173,7 @@ 1 0 0 - "Cortex-M3" + "Cortex-M7" 1 0 @@ -220,13 +182,14 @@ 1 0 0 - 0 - 0 - 0 + 2 + 1 + 1 8 0 0 0 + 0 3 3 0 @@ -279,8 +242,8 @@ 0 - 0x20000000 - 0x20000 + 0x20010000 + 0x40000 1 @@ -314,8 +277,8 @@ 1 - 0x0 - 0x0 + 0x200000 + 0x100000 0 @@ -334,13 +297,13 @@ 0 - 0x20000000 - 0x20000 + 0x20010000 + 0x40000 0 - 0x0 - 0x0 + 0x20000000 + 0x10000 @@ -361,9 +324,16 @@ 0 0 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 - HAVE_CONFIG_H WOLFSSL_USER_SETTINGS MDK_CONF_CryptTest + USE_STM32756G_EVAL USE_IOEXPANDER WOLFSSL_USER_SETTINGS @@ -378,6 +348,7 @@ 0 0 0 + 0 @@ -386,16 +357,16 @@ - 1 + 0 0 0 0 1 0 - 0x08000000 - 0x20000000 + + - + .\CryptTest.sct @@ -416,17 +387,12 @@ - Configuration + Linker Script - config-Crypt.h + CryptTest.sct 5 - .\RTE\wolfSSL\config-Crypt.h - - - user_settings.h - 5 - .\RTE\wolfSSL\user_settings.h + .\CryptTest.sct @@ -440,6 +406,9 @@ + + ::Board Support + ::CMSIS @@ -463,367 +432,307 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + RTE\CMSIS\RTX_Conf_CM.c - - + + - - RTE\Device\STM32F207IGHx\RTE_Device.h - - + + RTE\Device\STM32F756NGHx\RTE_Device.h + + - - RTE\Device\STM32F207IGHx\startup_stm32f207xx.s - - + + RTE\Device\STM32F756NGHx\startup_stm32f756xx.s + + - - RTE\Device\STM32F207IGHx\stm32f2xx_hal_conf.h - - + + RTE\Device\STM32F756NGHx\stm32f7xx_hal_conf.h + + - - RTE\Device\STM32F207IGHx\system_stm32f2xx.c - - + + RTE\Device\STM32F756NGHx\system_stm32f7xx.c + + - - RTE\Device\STM32F207IGTx\RTE_Device.h - - - - - - RTE\Device\STM32F207IGTx\startup_stm32f207xx.s - - - - - - RTE\Device\STM32F207IGTx\stm32f2xx_hal_conf.h - - - - - - RTE\Device\STM32F207IGTx\system_stm32f2xx.c - - - - - - RTE\Device\STM32F207IG\RTE_Device.h - - - - - - RTE\Device\STM32F207IG\startup_stm32f2xx.s - - - - - - RTE\Device\STM32F207IG\system_stm32f2xx.c - - - - - + RTE\File_System\FS_Config.c - - + + - + RTE\File_System\FS_Config_MC_0.h - - + + - - RTE\Network\Net_Config.c - - - - - - RTE\Network\Net_Config_BSD.h - - - - - - RTE\Network\Net_Config_DNS_Client.h - - - - - - RTE\Network\Net_Config_ETH_0.h - - - - - - RTE\Network\Net_Config_TCP.h - - - - - - RTE\Network\Net_Config_UDP.h - - - - - - RTE\Network\Net_Debug.c - - - - - - RTE\Other\config-Crypt.h - - - - - - RTE\Other\config-FS.h - - - - - - RTE\Other\config-RTX-TCP-FS.h - - - - - - RTE\Other\config.h - - + + RTE\File_System\FS_Config_NOR_0.h + + RTE\wolfSSL\config-Crypt.h - - + + - - RTE\wolfSSL\config.h - - - - - - RTE\wolfSSL\settings.h - - - - RTE\wolfSSL\user_settings.h - - + + diff --git a/IDE/MDK5-ARM/Projects/CryptTest/main.c b/IDE/MDK5-ARM/Projects/CryptTest/main.c index 814051c8a..304900a28 100644 --- a/IDE/MDK5-ARM/Projects/CryptTest/main.c +++ b/IDE/MDK5-ARM/Projects/CryptTest/main.c @@ -26,15 +26,31 @@ #include #include "wolfcrypt/test/test.h" -#include "cmsis_os.h" + #include -#include "stm32f2xx_hal.h" /*----------------------------------------------------------------------------- - * System Clock Configuration + * MPU Depend Configurations *----------------------------------------------------------------------------*/ -void SystemClock_Config(void) { - #warning "write MPU specific System Clock Set up\n" + +#warning "write MPU specific Set up\n" + +static void MPU_Config (void) { + +} + +static void CPU_CACHE_Enable (void) { + +} + +static void SystemClock_Config (void) { + +} + +extern uint32_t os_time; + +uint32_t HAL_GetTick(void) { + return os_time; } /*----------------------------------------------------------------------------- @@ -47,13 +63,13 @@ 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 { @@ -69,16 +85,16 @@ static void init_filesystem (void) { int main() { void * arg = NULL ; + MPU_Config(); + CPU_CACHE_Enable(); + HAL_Init(); /* Initialize the HAL Library */ + SystemClock_Config(); /* Configure the System Clock */ - HAL_Init(); /* Initialize the HAL Library */ - SystemClock_Config(); /* Configure the System Clock */ - - #if !defined(NO_FILESYSTEM) + #if !defined(NO_FILESYSTEM) init_filesystem (); - #endif - osDelay(1000) ; + #endif - printf("=== Start: Crypt test ===\n") ; + printf("=== Start: Crypt test === (%d)\n", os_time) ; wolfcrypt_test(arg) ; printf("=== End: Crypt test ===\n") ;