memory addressing

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

cross mob
Anonymous
Not applicable

I am using cy8c20546A-24pvxi. Is it possible to declare a variable in a specific location of SRAM? The requirement is that after a watchdog reset a variable has to be accessed. Pls reply asap.

0 Likes
1 Solution
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

In PSoC designer 5.1 under help -> Documentation -> C Language Compiler User Guide

   

you'll find in chapter 6.2 two different examples to have absolute memory locations addressed in C.

   

 

   

Happy coding

   

Bob

View solution in original post

0 Likes
5 Replies
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

In PSoC designer 5.1 under help -> Documentation -> C Language Compiler User Guide

   

you'll find in chapter 6.2 two different examples to have absolute memory locations addressed in C.

   

 

   

Happy coding

   

Bob

0 Likes
Anonymous
Not applicable

Thanks Bob.

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

You are always welcome!

   

 

   

Bob

0 Likes
Anonymous
Not applicable

I am using  the cy8C20546A-24pvxi. According to the technical reference manual of the same, the portion of the SRAM between 0x03 to 0xCF doesnt get reset during a watchdog reset(WDR) if the IRAMDIS bit is set. I have declared a variable in this region of the SRAM and set the IRAMDIS bit. But the variable in the SRAM isnt retaining its value after WDR. Kindly let me knw what is wrong. Are there any other register settings to enable the same? Expecting a reply asap.

   

Thanks

   

Gee

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

The mentioned area is used from top (0xff) for the stack growing downwards, the lower area is used for static vars (C-Registers) growing upwards.

   

If you have access to an ICE-Cube (In-Circuit-Emulator) you might check your data-area for getting changed / Not changed.

   

Otherwise you have to do that manually. Of help is the .map - file which lists all variables and their addresses.

   

 

   

Bob

0 Likes