Skip to content

Commit

Permalink
Merge pull request wolfSSL#7997 from dgarske/stm32g4
Browse files Browse the repository at this point in the history
Support for STM32G4
  • Loading branch information
JacobBarthelmeh authored Sep 20, 2024
2 parents d796d8c + 9d24480 commit baab334
Show file tree
Hide file tree
Showing 3 changed files with 167 additions and 50 deletions.
54 changes: 45 additions & 9 deletions IDE/STM32Cube/default_conf.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,9 @@ extern ${variable.value} ${variable.name};
#define HAL_CONSOLE_UART huart2
#define NO_STM32_RNG
#define WOLFSSL_GENSEED_FORTEST /* no HW RNG is available use test seed */
#elif defined(STM32G491xx)
#define WOLFSSL_STM32G4
#define HAL_CONSOLE_UART hlpuart1
#elif defined(STM32U575xx) || defined(STM32U585xx) || defined(STM32U5A9xx)
#define HAL_CONSOLE_UART huart1
#define WOLFSSL_STM32U5
Expand All @@ -169,7 +172,7 @@ extern ${variable.value} ${variable.name};
/* You need to define a CPU type, HW crypto and debug UART */
/* CPU Type: WOLFSSL_STM32F1, WOLFSSL_STM32F2, WOLFSSL_STM32F4,
WOLFSSL_STM32F7, WOLFSSL_STM32H7, WOLFSSL_STM32L4, WOLFSSL_STM32L5,
WOLFSSL_STM32G0, WOLFSSL_STM32WB and WOLFSSL_STM32U5 */
WOLFSSL_STM32G0, WOLFSSL_STM32G4, WOLFSSL_STM32WB and WOLFSSL_STM32U5 */
#define WOLFSSL_STM32F4

/* Debug UART used for printf */
Expand All @@ -195,13 +198,23 @@ extern ${variable.value} ${variable.name};
#define WOLFSSL_GENERAL_ALIGNMENT 4
#define WOLFSSL_STM32_CUBEMX
#define WOLFSSL_SMALL_STACK
#define WOLFSSL_USER_IO
#define WOLFSSL_NO_SOCK
#define WOLFSSL_IGNORE_FILE_WARN

/* ------------------------------------------------------------------------- */
/* Network stack: 1=User IO (custom), 2=LWIP (posix), 3=LWIP (native) */
/* ------------------------------------------------------------------------- */
#if defined(WOLF_CONF_IO) && WOLF_CONF_IO == 2
#define WOLFSSL_LWIP
#elif defined(WOLF_CONF_IO) && WOLF_CONF_IO == 3
#define WOLFSSL_LWIP_NATIVE
#else /* custom */
#define WOLFSSL_USER_IO
#define WOLFSSL_NO_SOCK
#endif


/* ------------------------------------------------------------------------- */
/* Operating System */
/* Operating System: 1=Bare-metal/Single threaded, 2=FREERTOS */
/* ------------------------------------------------------------------------- */
#if defined(WOLF_CONF_RTOS) && WOLF_CONF_RTOS == 2
#define FREERTOS
Expand Down Expand Up @@ -328,12 +341,25 @@ extern ${variable.value} ${variable.name};
#endif

/* TLS Session Cache */
#if 0
#if defined(WOLF_CONF_RESUMPTION) && WOLF_CONF_RESUMPTION == 1
#define SMALL_SESSION_CACHE
#define HAVE_SESSION_TICKET
#else
#define NO_SESSION_CACHE
#endif

/* TPM support */
#if defined(WOLF_CONF_TPM) && WOLF_CONF_TPM == 1
#define WOLF_CRYPTO_CB
#define WOLFSSL_PUBLIC_MP
/* also AES CFB - enabled below */
#endif

/* TLS key callbacks */
#if defined(WOLF_CONF_PK) && WOLF_CONF_PK == 1
#define HAVE_PK_CALLBACKS
#endif

/* ------------------------------------------------------------------------- */
/* Crypto */
/* ------------------------------------------------------------------------- */
Expand Down Expand Up @@ -421,21 +447,31 @@ extern ${variable.value} ${variable.name};
#endif

/* AES */
#if defined(WOLF_CONF_AESGCM) && WOLF_CONF_AESGCM == 1
#if defined(WOLF_CONF_AESGCM) && WOLF_CONF_AESGCM >= 1
#define HAVE_AESGCM
#define HAVE_AES_DECRYPT

/* GCM Method: GCM_SMALL, GCM_WORD32, GCM_TABLE or GCM_TABLE_4BIT */
/* GCM_TABLE is about 4K larger and 3x faster for GHASH */
#define GCM_SMALL
#define HAVE_AES_DECRYPT
#if WOLF_CONF_AESGCM == 2
#define GCM_TABLE_4BIT
#else
#define GCM_SMALL
#endif
#endif

#if defined(WOLF_CONF_AESCBC) && WOLF_CONF_AESCBC == 1
#define HAVE_AES_CBC
#define HAVE_AES_DECRYPT
#else
#define NO_AES_CBC
#endif

/* Other possible AES modes */
//#define WOLFSSL_AES_CFB /* Used by TPM parameter encryption */
#if defined(WOLF_CONF_TPM) && WOLF_CONF_TPM == 1
#define WOLFSSL_AES_CFB /* Used by TPM parameter encryption */
#endif

//#define WOLFSSL_AES_COUNTER
//#define HAVE_AESCCM
//#define WOLFSSL_AES_XTS
Expand Down
Loading

0 comments on commit baab334

Please sign in to comment.