From 1fbf0efaebd597207f32a910d635a94ec9f6ef69 Mon Sep 17 00:00:00 2001 From: Damiano Mazzella Date: Tue, 23 Aug 2022 16:50:24 +0200 Subject: [PATCH] stm32/sdram: Enable MPU for unaligned access on H7 MCUs. So that SDRAM can be used as the heap on ARDUINO_PORTENTA_H7, for example. Fixes issue #9087. --- ports/stm32/sdram.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/stm32/sdram.c b/ports/stm32/sdram.c index a94b802ea4..fb0e5a8688 100644 --- a/ports/stm32/sdram.c +++ b/ports/stm32/sdram.c @@ -244,7 +244,7 @@ static void sdram_init_seq(SDRAM_HandleTypeDef #define REFRESH_COUNT (MICROPY_HW_SDRAM_REFRESH_RATE * 90000 / 8192 - 20) HAL_SDRAM_ProgramRefreshRate(hsdram, REFRESH_COUNT); - #if defined(STM32F7) + #if defined(STM32F7) || defined(STM32H7) /* Enable MPU for the SDRAM Memory Region to allow non-aligned accesses (hard-fault otherwise) Initially disable all access for the entire SDRAM memory space,