diff --git a/IDE/MDK5-ARM/Conf/user_settings.h b/IDE/MDK5-ARM/Conf/user_settings.h index edc3e3cda..ab882eaae 100644 --- a/IDE/MDK5-ARM/Conf/user_settings.h +++ b/IDE/MDK5-ARM/Conf/user_settings.h @@ -18,7 +18,7 @@ * 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 @@ -39,7 +39,7 @@ // Common options -// MPU<0=>Undefined<1=>STM32F4xx<2=>STM32F7xx<3=>STM32F7xx +// MPU<0=>Undefined<1=>STM32F2xx<2=>STM32F4xx<3=>STM32F7xx #define MDK_CONF_MPU 3 #if MDK_CONF_MPU == 0 @@ -107,7 +107,7 @@ // Network<0=>None <1=>RLnet <2=>User I/O #define MDK_CONF_NETWORK 1 -#if MDK_CONF_NETWORK_ == 0 +#if MDK_CONF_NETWORK == 0 #elif MDK_CONF_NETWORK == 1 #define WOLFSSL_KEIL_TCP_NET #elif MDK_CONF_NETWORK == 2 diff --git a/IDE/MDK5-ARM/Projects/CryptBenchmark/main.c b/IDE/MDK5-ARM/Projects/CryptBenchmark/main.c index a07918c8f..d24c1f056 100644 --- a/IDE/MDK5-ARM/Projects/CryptBenchmark/main.c +++ b/IDE/MDK5-ARM/Projects/CryptBenchmark/main.c @@ -36,7 +36,7 @@ #if defined(STM32F7xx) #include "stm32f7xx_hal.h" #elif defined(STM32F4xx) -#include "stm32f2xx_hal.h" +#include "stm32f4xx_hal.h" #elif defined(STM32F2xx) #include "stm32f2xx_hal.h" #endif @@ -58,8 +58,63 @@ static void CPU_CACHE_Enable (void) { extern uint32_t os_time; static time_t epochTime; -uint32_t HAL_GetTick(void) { - return os_time; +uint32_t HAL_GetTick(void) { + return os_time; +} + +time_t time(time_t *t){ + return epochTime ; +} + +void setTime(time_t t){ + epochTime = t; +} +#endif + +#ifdef WOLFSSL_CURRTIME_OSTICK + +#include +extern uint32_t os_time; + +double current_time(int reset) +{ + if(reset) os_time = 0 ; + return (double)os_time /1000.0; +} + +#else + +#include +#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 + +static void MPU_Config (void) { + +} + +static void CPU_CACHE_Enable (void) { + +} + +#ifdef RTE_CMSIS_RTOS_RTX +extern uint32_t os_time; +static time_t epochTime; + +uint32_t HAL_GetTick(void) { + return os_time; } time_t time(time_t *t){ diff --git a/IDE/MDK5-ARM/Projects/CryptTest/main.c b/IDE/MDK5-ARM/Projects/CryptTest/main.c index 386ce6609..6ba384946 100644 --- a/IDE/MDK5-ARM/Projects/CryptTest/main.c +++ b/IDE/MDK5-ARM/Projects/CryptTest/main.c @@ -38,7 +38,7 @@ #if defined(STM32F7xx) #include "stm32f7xx_hal.h" #elif defined(STM32F4xx) -#include "stm32f2xx_hal.h" +#include "stm32f4xx_hal.h" #elif defined(STM32F2xx) #include "stm32f2xx_hal.h" #endif diff --git a/IDE/MDK5-ARM/Projects/EchoClient/main.c b/IDE/MDK5-ARM/Projects/EchoClient/main.c index f8014b496..9536c4390 100644 --- a/IDE/MDK5-ARM/Projects/EchoClient/main.c +++ b/IDE/MDK5-ARM/Projects/EchoClient/main.c @@ -32,7 +32,7 @@ #if defined(STM32F7xx) #include "stm32f7xx_hal.h" #elif defined(STM32F4xx) -#include "stm32f2xx_hal.h" +#include "stm32f4xx_hal.h" #elif defined(STM32F2xx) #include "stm32f2xx_hal.h" #endif @@ -49,10 +49,7 @@ // //------------- <<< end of configuration section >>> ----------------------- -#warning "write MPU specific Set ups\n" -static void SystemClock_Config (void) { -} #warning "write MPU specific Set ups\n" static void SystemClock_Config (void) { diff --git a/IDE/MDK5-ARM/Projects/EchoServer/main.c b/IDE/MDK5-ARM/Projects/EchoServer/main.c index daab6aa30..b1e4e266d 100644 --- a/IDE/MDK5-ARM/Projects/EchoServer/main.c +++ b/IDE/MDK5-ARM/Projects/EchoServer/main.c @@ -33,7 +33,7 @@ #if defined(STM32F7xx) #include "stm32f7xx_hal.h" #elif defined(STM32F4xx) -#include "stm32f2xx_hal.h" +#include "stm32f4xx_hal.h" #elif defined(STM32F2xx) #include "stm32f2xx_hal.h" #endif diff --git a/IDE/MDK5-ARM/Projects/SimpleClient/main.c b/IDE/MDK5-ARM/Projects/SimpleClient/main.c index 09f8bcded..b3b8ee92a 100644 --- a/IDE/MDK5-ARM/Projects/SimpleClient/main.c +++ b/IDE/MDK5-ARM/Projects/SimpleClient/main.c @@ -32,7 +32,7 @@ #if defined(STM32F7xx) #include "stm32f7xx_hal.h" #elif defined(STM32F4xx) -#include "stm32f2xx_hal.h" +#include "stm32f4xx_hal.h" #elif defined(STM32F2xx) #include "stm32f2xx_hal.h" #endif diff --git a/IDE/MDK5-ARM/Projects/SimpleServer/main.c b/IDE/MDK5-ARM/Projects/SimpleServer/main.c index 8834ad39f..ce7473df3 100644 --- a/IDE/MDK5-ARM/Projects/SimpleServer/main.c +++ b/IDE/MDK5-ARM/Projects/SimpleServer/main.c @@ -32,7 +32,7 @@ #if defined(STM32F7xx) #include "stm32f7xx_hal.h" #elif defined(STM32F4xx) -#include "stm32f2xx_hal.h" +#include "stm32f4xx_hal.h" #elif defined(STM32F2xx) #include "stm32f2xx_hal.h" #endif