From 254d53bb18ce27db47b4ef1d5076de9133b9505b Mon Sep 17 00:00:00 2001 From: Chris Conlon Date: Thu, 27 Dec 2012 10:06:29 -0700 Subject: [PATCH 1/2] add CYASSL_STM32F2 define, LwIP errno.h --- cyassl/ctaocrypt/settings.h | 13 +++++++++++++ src/io.c | 1 + 2 files changed, 14 insertions(+) diff --git a/cyassl/ctaocrypt/settings.h b/cyassl/ctaocrypt/settings.h index ccdcd8eb7..c8075760e 100644 --- a/cyassl/ctaocrypt/settings.h +++ b/cyassl/ctaocrypt/settings.h @@ -66,6 +66,9 @@ /* Uncomment next line if building CyaSSL for Freescale MQX/RTCS/MFS */ /* #define FREESCALE_MQX */ +/* Uncomment next line if using STM32F2 */ +/* #define CYASSL_STM32F2 */ + #include @@ -226,6 +229,16 @@ /* Note: MQX has no realloc, using fastmath above */ #endif +#ifdef CYASSL_STM32F2 + #define SIZEOF_LONG_LONG 8 + #define NO_DEV_RANDOM + #define NO_CYASSL_DIR + #define NO_RABBIT + #define STM32F2_RNG + #define STM32F2_CRYPTO + #define KEIL_INTRINSICS +#endif + #ifdef MICRIUM #include "stdlib.h" diff --git a/src/io.c b/src/io.c index 6bd4c3b60..3dd66c942 100644 --- a/src/io.c +++ b/src/io.c @@ -45,6 +45,7 @@ /* lwIP needs to be configured to use sockets API in this mode */ /* LWIP_SOCKET 1 in lwip/opt.h or in build */ #include "lwip/sockets.h" + #include #ifndef LWIP_PROVIDE_ERRNO #define LWIP_PROVIDE_ERRNO 1 #endif From 60f4919ee6ced613f03c76404f67970cf75ce15d Mon Sep 17 00:00:00 2001 From: Chris Conlon Date: Thu, 27 Dec 2012 10:16:08 -0700 Subject: [PATCH 2/2] add STM32 to README --- README | 8 ++++++++ src/io.c | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/README b/README index 1ea67ad0c..5ae5971f6 100644 --- a/README +++ b/README @@ -32,6 +32,14 @@ SSL_CTX_set_verify(ctx, SSL_VERIFY_NONE, 0); before calling SSL_new(); Though it's not recommended. + +Note 3) +CyaSSL is able to use the STM32F2 hardware-based cryptography and random number +generator through the STM32F2 Standard Peripheral Library. For necessary +defines, see the CYASSL_STM32F2 define in settings.h. Documentation for the +STM32F2 Standard Peripheral Library can be found in the following document: +http://www.st.com/internet/com/TECHNICAL_RESOURCES/TECHNICAL_LITERATURE/USER_MANUAL/DM00023896.pdf + *** end Notes *** diff --git a/src/io.c b/src/io.c index 3dd66c942..a6344ebfd 100644 --- a/src/io.c +++ b/src/io.c @@ -45,7 +45,7 @@ /* lwIP needs to be configured to use sockets API in this mode */ /* LWIP_SOCKET 1 in lwip/opt.h or in build */ #include "lwip/sockets.h" - #include + #include #ifndef LWIP_PROVIDE_ERRNO #define LWIP_PROVIDE_ERRNO 1 #endif