STM32WB SRAM2
So once again I have a problem with the STM32WB , I have spent alot of time with the L4 series, and always used the SRAM2 retention in standby function without any problem.
And the WB series should be based on the L4, so I had hope for an easy migration.
But no.
So how do I enable the SRAM2 retention in standby ??
All the datasheets tells the story that it it possible.
SRAM2a: 32 Kbytes located at address 0x2003 0000 also mirrored at 0x1000 0000,
with hardware parity check (this SRAM can be retained in Standby mode)And from the header of stm32wbxx_hal_pwr.c
*** Standby mode ***
====================
[..] The Standby mode offers two options:
(+) option a) all clocks off except LSI and LSE, RRS bit set (keeps voltage regulator in low power mode).
SRAM and registers contents are lost except for the SRAM2 content, the RTC registers, RTC backup registers
and Standby circuitry.
(+) option b) all clocks off except LSI and LSE, RRS bit cleared (voltage regulator then disabled).
SRAM and register contents are lost except for the RTC registers, RTC backup registers
and Standby circuitry.
(++) Entry:
(+++) The Standby mode is entered thru HAL_PWR_EnterSTANDBYMode() API.
SRAM1 and register contents are lost except for registers in the Backup domain and
Standby circuitry. SRAM2 content can be preserved if the bit RRS is set in PWR_CR3 register.
To enable this feature, the user can resort to HAL_PWREx_EnableBKRAMContentRetention() API
to set RRS bit.It tells that I must use HAL_PWREx_EnableBKRAMContentRetention() to enable the SRAM2 retention in stanby.
But there is NO function that is named HAL_PWREx_EnableBKRAMContentRetention()
But there is a function that is named HAL_PWREx_EnableSRAMRetention() as in the L4 series.
That calls LL_PWR_EnableSRAM2Retention()
/**
* @brief Enable SRAM2a content retention in Standby mode
*/
__STATIC_INLINE void LL_PWR_EnableSRAM2Retention(void)
{
SET_BIT(PWR->CR3, PWR_CR3_RRS);
}But in the function call
/**
* @brief Enter Standby mode.
* @note In Standby mode, the PLL, the HSI, the MSI and the HSE oscillators are switched
* off. The voltage regulator is disabled, except when BKRAM content is preserved
* in which case the regulator is in low-power mode.
* SRAM and register contents are lost except for registers in the Backup domain and
* Standby circuitry. BKRAM content can be preserved if the bit RRS is set in PWR_CR3
*/
void HAL_PWR_EnterSTANDBYMode(void)It tells that the SRAM is lost and the BKRAM can be saved.
But I guess that BKRAM text should be replaced with SRAM2
But still I can not get it to work.
Have anyone got this to work ?
