You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by je...@apache.org on 2026/05/11 09:54:36 UTC
(mynewt-core) 04/04: stm32/hash: Fix stm32_hash_finish
This is an automated email from the ASF dual-hosted git repository.
kasjer pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git
commit 2ba18b2f395c7a04fdc9cb004ec3beba5e909c90
Author: Jerzy Kasenberg <je...@codecoup.pl>
AuthorDate: Mon May 11 11:23:56 2026 +0200
stm32/hash: Fix stm32_hash_finish
Function stm32_hash_finish check busy flag
to see if hash computation was finished.
This work on some device H7, F4 but on
U5 and H5 busy flag get cleared before
hash is available.
Now code checks Digest Calculation Complete
flag instead and that works on all devices.
Signed-off-by: Jerzy Kasenberg <je...@codecoup.pl>
---
hw/drivers/hash/hash_stm32/src/hash_stm32.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/hw/drivers/hash/hash_stm32/src/hash_stm32.c b/hw/drivers/hash/hash_stm32/src/hash_stm32.c
index 30058eaa0..de4c03a62 100644
--- a/hw/drivers/hash/hash_stm32/src/hash_stm32.c
+++ b/hw/drivers/hash/hash_stm32/src/hash_stm32.c
@@ -140,7 +140,8 @@ stm32_hash_finish(struct hash_dev *hash, void *ctx, uint16_t algo,
__HAL_HASH_START_DIGEST();
- while (HASH->SR & HASH_FLAG_BUSY) ;
+ while ((HASH->SR & HASH_FLAG_DCIS) == 0) {
+ }
u32p = (uint32_t *)outbuf;
for (i = 0; i < digestsz; i++) {