Dialog Semiconductor customer support - retention memory https://support.dialog-semiconductor.com/resource-keywords/retention-memory en variable in retention_mem_area0 https://support.dialog-semiconductor.com/forums/post/dialog-smartbond-bluetooth-low-energy-%E2%80%93-software/variable-retentionmemarea0

Hi there,
I declare many variables such as following example...
static uint8_t test __attribute__((section("retention_mem_area0"), zero_init));

And my questions are...
1. After printing the address of the variable, It's 0x7FD4804(in SysRAM4:). Why?
2. Why doesn't the variable be stored in SysRAM1?
3. Does It means the variable will be cleared in extend sleep mode? But the value of the variable is still correct, why?

4. In addition, if I want keep some "global variables" or "in-function-static variables", these variables should be added the "__attribute__((section("retention_mem_area0"), zero_init))" description, is it true?

5. If the area is full, how should I know?

6. If I want to give the variable a initial value, can I write: "static uint8_t test __attribute__((section("retention_mem_area0"))) = 0xFF; "?

Many thanks.

Keywords: 
Device: 
Fri, 08 Sep 2017 05:47:50 +0000 stanley_yeh 90560年https://support.dialog-semiconductor.com https://support.dialog-semiconductor.com/forums/post/dialog-smartbond-bluetooth-low-energy-%E2%80%93-software/variable-retentionmemarea0#comments