Skip to content

Commit fbadcf6

Browse files
committed
add the STM32 peripheral clock enable and disable
calls to the benchmark program so the benchmark program can use hardware accleration
1 parent d9d9c5c commit fbadcf6

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

wolfcrypt/benchmark/benchmark.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2941,6 +2941,11 @@ int benchmark_init(void)
29412941

29422942
benchmark_static_init(0);
29432943

2944+
#ifdef WOLFSSL_STM32_CUBEMX
2945+
/* enable the peripheral clock */
2946+
__HAL_RCC_CRYP_CLK_ENABLE();
2947+
#endif
2948+
29442949
#ifdef WOLFSSL_STATIC_MEMORY
29452950
ret = wc_LoadStaticMemory(&HEAP_HINT, gBenchMemory,
29462951
sizeof(gBenchMemory), WOLFMEM_GENERAL, 1);
@@ -3049,6 +3054,11 @@ int benchmark_free(void)
30493054
printf("%serror %d with wolfCrypt_Cleanup\n", err_prefix, ret);
30503055
}
30513056

3057+
#ifdef WOLFSSL_STM32_CUBEMX
3058+
/* disable the peripheral clock */
3059+
__HAL_RCC_CRYP_CLK_DISABLE();
3060+
#endif
3061+
30523062
return ret;
30533063
}
30543064

0 commit comments

Comments
 (0)