Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

PSoC™ 5, 3 & 1 Forum Discussions

Len_CONSULTRON
Level 9
1000 replies posted 750 replies posted 500 likes received
Level 9

Hi,

I'm trying to aggressively use a hibernate mode and a WDT is intended to pull the CPU out of hibernation.

However, I need to preserve some data through the WDT reset.

Is there a keyword declaration to place certain RAM variables in an area of memory that does not get initialized immediately after a reset?

I'm aware of the .bss section of RAM.  However after multiple searches among the compiler .h files, I could not find a declarative keyword that would force RAM variables to this area of memory.

I suspect I'm missing something obvious.  Help would be appreciated. 

Len
"Engineering is an Art. The Art of Compromise."
0 Likes
1 Solution
Len_CONSULTRON
Level 9
1000 replies posted 750 replies posted 500 likes received
Level 9

pacr,

Excellent question.  Thanks for your interest in this question.

I'm new to low-power operation.

I just found two pieces of information related to my original post.

Info #1 - Using the WDT in Hibernation mode.

The WDT is disabled in Hibernation mode.  This is because the Hibernation regulator that is only available in Hibernation mode removes the power from the ILO.  Since the ILO drives the CTW of the WDT, the WDT is automatically disabled.

Therefore my attempt to use the WDT in hibernation mode is IMPOSSIBLE!!!  (Need to rethink this design direction.)

Info #2 - Placing variables in noinit .bss memory.

I believe I have found my answer to my original post.

If I add a CY_NOINIT as a keyword to my RAM variable, it appears to survive any nonvoltage-related Resets.

Voltage-related resets could affect the reliability of the RAM data contents.  A well set LVD threshold could preserve the RAM contents if the SW is designed properly.

Len
"Engineering is an Art. The Art of Compromise."

View solution in original post

0 Likes
4 Replies
pacr_284376
Level 4
10 sign-ins 10 questions asked 5 questions asked
Level 4

Why are you using WDT to pull CPU out of hibernation ? Can't you use another wakeup event (some other timer) ?

0 Likes
Len_CONSULTRON
Level 9
1000 replies posted 750 replies posted 500 likes received
Level 9

pacr,

Excellent question.  Thanks for your interest in this question.

I'm new to low-power operation.

I just found two pieces of information related to my original post.

Info #1 - Using the WDT in Hibernation mode.

The WDT is disabled in Hibernation mode.  This is because the Hibernation regulator that is only available in Hibernation mode removes the power from the ILO.  Since the ILO drives the CTW of the WDT, the WDT is automatically disabled.

Therefore my attempt to use the WDT in hibernation mode is IMPOSSIBLE!!!  (Need to rethink this design direction.)

Info #2 - Placing variables in noinit .bss memory.

I believe I have found my answer to my original post.

If I add a CY_NOINIT as a keyword to my RAM variable, it appears to survive any nonvoltage-related Resets.

Voltage-related resets could affect the reliability of the RAM data contents.  A well set LVD threshold could preserve the RAM contents if the SW is designed properly.

Len
"Engineering is an Art. The Art of Compromise."
0 Likes
BiBi_1928986
Level 7
250 replies posted 250 sign-ins 100 solutions authored
Level 7

Hi Len.

This thread may provide the clues you need.
Solved: Reading the correct reset status from a bootloadbl... - Infineon Developer Community

I know the thread discusses sharing memory between bootloader and bootloadable, but the key take away is, not allowing the RAM memory section to get changed.

0 Likes
Len_CONSULTRON
Level 9
1000 replies posted 750 replies posted 500 likes received
Level 9

BiBi,

Thanks for your reply.  I will look into it.

However I found a keyword CY_NOINIT appears to work under multiple tests.

A quick perusal of the link you supplied may be more valuable to share data between two applications (bootloader/bootloadable)  without init when transferring operation between the two apps.

It is more complicated since there is a special section declaration that is shared across the apps.

In my specific case, the data is only used in the same App therefore the CY_NOINIT  simplifies the C code and linker definitions.

Len
"Engineering is an Art. The Art of Compromise."
0 Likes