Hi friend,
I am using Q9021 with BLE SDK 1.0.0. Some definitions of my project are as follows.
#define OTA_ENABLE 0
/// Memory retention
#if (OTA_ENABLE)
#define CFG_MEM_RETENTION (MEM_BLOCK1 | MEM_BLOCK2 | MEM_BLOCK3 | MEM_BLOCK4 | MEM_BLOCK6 | MEM_BLOCK7)// (MEM_ALL)//
#else
#define CFG_MEM_RETENTION (MEM_BLOCK1 | MEM_BLOCK2 | MEM_BLOCK3 | MEM_BLOCK6 | MEM_BLOCK7)// (MEM_ALL)//
#endif
/// Memory retention
#if (defined(CFG_MEM_RETENTION))
#define QN_MEM_RETENTION CFG_MEM_RETENTION
#define QN_MEM_UNRETENTION (~(CFG_MEM_RETENTION) & 0xfe)
#else
#define QN_MEM_RETENTION (MEM_BLOCK1 | MEM_BLOCK2 | MEM_BLOCK3 | MEM_BLOCK4 | MEM_BLOCK5 | MEM_BLOCK6 | MEM_BLOCK7)
#define QN_MEM_UNRETENTION 0
#endif
How do I decide which MEM_BLOCKs need to be enabled?
Best wishes
Ted Wu
Hello @tedwu1,
Memory retention define which memory banks need to be retained in sleep mode.
There are 8 banks of SRAM, and each bank is 8k bytes. Bank 0 is always power on. The power of bank 1-7 can be configured by developer. If the memory bank is not used by application, it can be off to save power.
The BLE stack stores its data in bank 6 and 7. If the BLE is used, bank 6 and 7 should be power on. Developer can configure this macro based on memory usage to optimize power consumption.
Regards,
Eduardo.
How do I know that bank 1 to bank 5 need to be enabled? Where can I find information?
Best wishes
Ted Wu
Hi,
It should depend entirely on memory usage of your application and the power consumption optimization you are considering.
Regards,
Eduardo.