From c2ffb1b1eba9c4bccd6e5e117aa1345ff57a56f6 Mon Sep 17 00:00:00 2001 From: Brendan Fletcher Date: Sun, 15 Sep 2024 01:48:17 -0400 Subject: [PATCH] Don't zero ARM RAM on reset --- core/arm/armmem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/arm/armmem.c b/core/arm/armmem.c index ec379bfa7..22779c02d 100644 --- a/core/arm/armmem.c +++ b/core/arm/armmem.c @@ -267,6 +267,7 @@ bool arm_mem_init(arm_mem_t *mem) { memset(mem->nvm, ~0, FLASH_SIZE); mem->ram = malloc(HMCRAMC0_SIZE); if (likely(mem->ram)) { + memset(mem->ram, 0, HMCRAMC0_SIZE); return true; free(mem->ram); } @@ -281,7 +282,6 @@ void arm_mem_destroy(arm_mem_t *mem) { } void arm_mem_reset(arm_mem_t *mem, uint8_t rcause) { - memset(mem->ram, 0, HMCRAMC0_SIZE); arm_nvm_clear_page_buffer(mem); mem->pm.RCAUSE.reg = rcause; mem->nvmctrl.INTFLAG.bit.READY = true;