Skip to content

STM32L4: before calling HAL_CRYP_DeInit initialize the Instance member #8946

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 4, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions features/mbedtls/targets/TARGET_STM/aes_alt.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,14 @@ static int aes_set_key(mbedtls_aes_context *ctx, const unsigned char *key, unsig
return (MBEDTLS_ERR_AES_INVALID_KEY_LENGTH);
}

ctx->hcryp_aes.Init.DataType = CRYP_DATATYPE_8B;
ctx->hcryp_aes.Instance = CRYP;

/* Deinitializes the CRYP peripheral */
if (HAL_CRYP_DeInit(&ctx->hcryp_aes) == HAL_ERROR) {
return (HAL_ERROR);
}

ctx->hcryp_aes.Init.DataType = CRYP_DATATYPE_8B;
ctx->hcryp_aes.Instance = CRYP;
/* Enable CRYP clock */
__HAL_RCC_CRYP_CLK_ENABLE();

Expand Down