From e6504702062359f9578f6f5009036676b1086396 Mon Sep 17 00:00:00 2001 From: jeromecoutant Date: Fri, 4 Sep 2020 17:07:01 +0200 Subject: [PATCH] STM32L4+ : SRAM3 is powered off in Stop 2 mode By default, SRAM3 content is then lost. --- targets/TARGET_STM/sleep.c | 4 ++++ targets/targets.json | 13 +++---------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/targets/TARGET_STM/sleep.c b/targets/TARGET_STM/sleep.c index 3eda86a1e6..c67ec95e38 100644 --- a/targets/TARGET_STM/sleep.c +++ b/targets/TARGET_STM/sleep.c @@ -192,6 +192,10 @@ __WEAK void hal_deepsleep(void) HAL_PWREx_DisableLowPowerRunMode(); } +#if defined(PWR_CR1_RRSTP) + HAL_PWREx_EnableSRAM3ContentRetention(); +#endif + HAL_PWREx_EnterSTOP2Mode(PWR_STOPENTRY_WFI); if (lowPowerModeEnabled) { diff --git a/targets/targets.json b/targets/targets.json index 67b809954a..0765bb0d94 100644 --- a/targets/targets.json +++ b/targets/targets.json @@ -3287,11 +3287,7 @@ "device_has_add": [ "USBDEVICE" ], - "device_name": "STM32L4R5ZI", - "mbed_rom_start": "0x08000000", - "mbed_rom_size": "0x200000", - "mbed_ram_start": "0x20000000", - "mbed_ram_size": "0x40000" + "device_name": "STM32L4R5ZITx" }, "NUCLEO_L4R5ZI_P": { "inherits": [ @@ -3305,6 +3301,7 @@ "inherits": [ "MCU_STM32L4" ], + "device_name": "STM32L4R9AIIx", "supported_form_factors": [ "ARDUINO", "STMOD", @@ -3327,11 +3324,7 @@ "device_has_add": [ "QSPI", "USBDEVICE" - ], - "mbed_rom_start": "0x08000000", - "mbed_rom_size": "0x200000", - "mbed_ram_start": "0x20000000", - "mbed_ram_size": "0x40000" + ] }, "MCU_STM32L5": { "inherits": [