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 cfa730039d564e7c86a1ee4335ea5d4f14a33838
Author: Jerzy Kasenberg <[email protected]>
AuthorDate: Mon May 11 12:04:41 2026 +0200

    stm32/hash: Update for STM32H5
    
    ST HAL for STM32H5 does not have some macros
    that all other device hash code have.
    
    This adds 3 macros that make hash driver work
    on STM32H devices
    
    Signed-off-by: Jerzy Kasenberg <[email protected]>
---
 hw/drivers/hash/hash_stm32/src/hash_stm32.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/hw/drivers/hash/hash_stm32/src/hash_stm32.c 
b/hw/drivers/hash/hash_stm32/src/hash_stm32.c
index de4c03a62..0e3cc88e9 100644
--- a/hw/drivers/hash/hash_stm32/src/hash_stm32.c
+++ b/hw/drivers/hash/hash_stm32/src/hash_stm32.c
@@ -35,6 +35,14 @@ static uint32_t g_algos = 0;
 #else
 static uint32_t g_algos = HASH_ALGO_SHA224 | HASH_ALGO_SHA256;
 #endif
+#if defined(STM32H5)
+/* Missing defines */
+#define HASH_DATATYPE_8B HASH_BYTE_SWAP
+
+#define __HAL_HASH_SET_NBVALIDBITS(__SIZE__)                                  \
+    MODIFY_REG(HASH->STR, HASH_STR_NBLW, 8U * ((__SIZE__) % 4U))
+#define __HAL_HASH_START_DIGEST()            SET_BIT(HASH->STR, HASH_STR_DCAL)
+#endif
 
 static int
 stm32_hash_start(struct hash_dev *hash, void *ctx, uint16_t algo)

Reply via email to