I found a issue in the latest HAL Libary.
* @file stm32f4xx_hal_hash.h
* @author MCD Application Team
* @version V1.6.0
* @date 04-November-2016
* @brief Header file of HASH HAL module.
Inside HASH->CR register the mode bit is set for a HMAC calculation.
But this bit is never cleared anymore.
Therefore It isn't possible to process a HASH calculation with the DMA if a HMAC calculation is done before.
I suggest to clear this bit inside HAL_HASH_Init()
HASH->CR &= ~HASH_CR_MODE;
Or did I miss something?!?
It's the same with ALGO mode. After a Md5 calculation it isn't possible to process a SHA-1 calculation anymore.
HASH->CR &= ~HASH_CR_ALGO;