How to Watch Variables in Real Time for PSoC 4 Debug – KBA222076

Version: *A

 

Question:

How do I watch variables in real time for PSoC 4 debug?

 

Answer:

PSoC Creator does not support watching variables in real time directly. In debug mode of PSoC Creator, to watch variables, debugging halt is required by using breakpoints or clicking the ‘Halt Execution’ button manually.

To watch variables in real time for PSoC 4 debug, use one of the following methods:

Method 1: Use Software Transmit UART Component and USB-UART Bridge

By using Software Transmit UART Component, you can load variables data into a customized buffer, and send the data out by Software Transmit UART API, such as SW_Tx_UART_PutArray(const uint8 array[], uint32 byteCount). You can then watch variables in a terminal application through a USB-UART Bridge. Compared with SCB UART/I2C/SPI Component, Software Transmit UART Component consumes less resource on chip, and its pin assignment is more flexible. For more details on how to use Software Transmit UART Component, see SW_TX_UART_Example in PSoC Creator.

Method 2: Use a third-party debugger and IDE

Even though watching variables in real time is not available directly, PSoC Creator supports exporting its project to many popular third-party IDEs such as Eclipse, IAR, and µVision. Some of these IDEs support watching variables in real time. In addition, a third-party debugger may be required when considering debug function of a third-party IDE.

Reference:

Software Transmit UART (SW_Tx_UART) Component datasheet

CE95379 - Software based UART transmit with PSoC 3/4/5LP

PSoC Creator 101: C. IDE Export