You are here

PSoC Creator Debugger Watch Memory Location | Cypress Semiconductor

PSoC Creator Debugger Watch Memory Location

This blog post tells you how to observe memory locations in the debugger watch window. This is useful if you want to group together and view separate memory locations that are linked by functionality such as DAC configuration, DAC routing and DAC trim.

To observe memory in the XDATA space, use the following in the watch window: 

*((char*)0x01yyy)

Where YYYY is a 2 byte address. This limits the addressable range for XDATA to 64KB. The char designator restricts it to a single byte, which for most debugging purposes is sufficient.

*Note: There are no spaces in the name.

Other observable memory locations:

The address spaces are limited based on address type through the watch window (Keil limit), and everything must be addressed via the 24 bit address.

XDATA: 0x01YYYY    64k limit

DATA:  0x0000YY    128 byte limit

CODE:  0xFFYYYY    64k limit

PDATA: 0xFE00YY    256 byte limit

Other types: Char is not the only allowable type. For larger values (16 and 32 bit) you can also use int and long:

*((int*)0x01YYYY)

*((long*)0x01YYYY)

Be aware though, Keil is a big endian compiler, so it will interpret memory differently than if you read it out of the memory window. For example:

In the memory map:

0x7000   0x7001   0x7002    0x7003

FE           00            00             1F

The result of the watch window:

Watch window expressions:

You can also create interesting expressions in the watch window:

In the memory map:
0x4690    0x4691
77        02

(int)(*((char*)0x014690)+(*((char*)0x014691)<<8))

This generates the following value -> 0x0277

   
For PSoC 5 (GCC), there are no memory restrictions for PSoC 5 so the entire register space can be accessed in the debugger.

The same techniques apply for PSoC 5 when setting up watch variables for memory locations, although the compiler is little endian oriented, so the int and long values will look different from PSoC 3 to PSoC 5 for the same value:

In the memory map:
0x7000    0x7001    0x7002     0x7003
FE        00        00         07

The result of the watch window:

 Quick Reference (PSoC 3):

XDATA: *((char*)0x01YYYY)

*Limited to 64 KB, no spaces in name

CODE: *((char*)0xFFYYYY)

*Limited to 64 KB, no spaces in name

DATA: *((char*)0x0000YY)

*Limited to 128 B, no spaces in name

Quick Reference (PSoC 5):

ALL MEMORY: *((char*)0xYYYYYYYY)

* no spaces in name

 

By Chris Keeser

 

ALL CONTENT AND MATERIALS ON THIS SITE ARE PROVIDED "AS IS". CYPRESS SEMICONDUCTOR AND ITS RESPECTIVE SUPPLIERS MAKE NO REPRESENTATIONS ABOUT THE SUITABILITY OF THESE MATERIALS FOR ANY PURPOSE AND DISCLAIM ALL WARRANTIES AND CONDITIONS WITH REGARD TO THESE MATERIALS, INCLUDING BUT NOT LIMITED TO, ALL IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT OF ANY THIRD PARTY INTELLECTUAL PROPERTY RIGHT. NO LICENSE, EITHER EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, IS GRANTED BY CYPRESS SEMICONDUCTOR. USE OF THE INFORMATION ON THIS SITE MAY REQUIRE A LICENSE FROM A THIRD PARTY, OR A LICENSE FROM CYPRESS SEMICONDUCTOR.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms and Conditions of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms and Conditions of this site. Cypress Semiconductor and its suppliers reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.