Is the SWO Pin at PSOC63 working?

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

cross mob
AnGi_1678941
Level 3
Level 3
10 replies posted 10 sign-ins 5 replies posted

I have tried a lot but I haven't manage to enable the SWO pin. Have anyone manage to connected it with the ITM and see data?

0 Likes
1 Solution

I found it! It is at PDL installation directory. You have to include it manually at KEIL from heresfr.JPG

View solution in original post

0 Likes
14 Replies
AnGi_1678941
Level 3
Level 3
10 replies posted 10 sign-ins 5 replies posted

Also to note that I am using the CYBLE-416045-02. The strange thing is that in the datasheet the the SWO is not mentioned at P6.4 as it should be. Is these misprint? At cypress creator pin tabs it exists.

datasheet.JPGcreator.JPG

0 Likes

Yes, it does have support for SWO. I have created an internal ticket to update the datasheet.

Can you please let me know what debugger you are using and what are the steps you followed to get it to work?

Here are some threads which might be helpful:

(1) https://iotexpert.com/2017/11/17/serial-wire-view-with-psoc4/

(2) PSOC6 Serial Wire Viewer

Regards,

Dheeraj

Hello Dheeraj,

     I begin with creating a project in Cypress creator and selecting SWD+SWV at debug field. Then I export to KEIL and redirect the STDOUT to ITM. I have try both Miniprog4 and J-link with the same result. No activity on SWO(P6.4) pin! It look like ITM is enabled as it pass this check at KEIL(ARM) function ITM_SendChar()

(ITM_TCR & ITM_TCR_ITMENA_Msk) && /* ITM enabled */

(ITM_TER & (1UL << 0)        )) { /* ITM Port #0 enabled */

but it can't pass the next statement

while (ITM_PORT0_U32 == 0)

The function is at retarget_io.c

/** \brief  ITM Send Character

    The function transmits a character via the ITM channel 0, and

    \li Just returns when no debugger is connected that has booked the output.

    \li Is blocking when a debugger is connected, but the previous character

        sent has not been transmitted.

    \param [in]     ch  Character to transmit.

    \returns            Character to transmit.

*/

int32_t ITM_SendChar (int32_t ch);

int32_t ITM_SendChar (int32_t ch) {

  if ((ITM_TCR & ITM_TCR_ITMENA_Msk) && /* ITM enabled */

      (ITM_TER & (1UL << 0)        )) { /* ITM Port #0 enabled */

    while (ITM_PORT0_U32 == 0);

    ITM_PORT0_U8 = (uint8_t)ch;

  }

  return (ch);

}

Of course I have connect the SWO pin with the debugger and have check the correct connectivity between the module pin and connector.

I have also try to config manually the pin as output and enable the ITM but without luck.

Strange to say, for a PSoC5 project at Cypress Creator there is a component named Serial Wire Viewer which remap the printf to SWV(SWO) pin. The same component does not exist at PSoC6 project!

swv.JPG

Regards,

  Tasos

0 Likes

I am able to use J-Link RTT for debug printing on PSoC 62 which only requires SWD CLK and IO lines if that is an option for you.

https://www.segger.com/products/debug-probes/j-link/technology/about-real-time-transfer/

0 Likes

I have read about Segger RTT but I haven't try it yet. I will try it. But with SWO pin you have more than a printf() for debug, like the trace exceptions http://www.keil.com/support/man/docs/uv4/uv4_db_dbg_trace_exceptions.htm

I use these things with STM32 and works straightforward and I found it very useful. I don't understand why is so difficult to make it works with PSoC63. Maybe it needs a special handling because the dual core? Why I can't found any example?

0 Likes

For Auto Detection of RTT Control Block to work in RTT Viewer, I had to select the CM0P target device CY8C6XX7_CM0P even though I am running the app on CM4.

0 Likes

Strange... Do you mean that you select the CM4 project at KEIL for debugging, but CY8C6XX7_CM0P target device at J-link???

Do you have try the SWO pin?

0 Likes

I put debug print in CM4 project and select CY8C6XX7_CM0P as the target

device in RTT Viewer just so the autodetection will work. If I pick CM4 I

have to enter the control block address manually. I don't have SWO pin on

my board.

On Fri, Feb 28, 2020 at 1:35 AM AnGi_1678941 <community-manager@cypress.com>

SWO pin is not used by RTT. Segger RTT technology uses only 2 pins: SWDCLK and SWDIO.

Can be used only with Segger J-Link models.

There is no reason to use SWO anymore when you can use RTT instead.

0 Likes

Hi Dheeraj,

regarding (2) PSOC6 Serial Wire Viewer

user_2738496 said "seems to be a bus fault when accessing the TPI unit".
Indeed, there is no TPI as is defined in core_cm4.h.
There is a TPIU Lite @ 0xe008e000u. It is defined as CYDEV_CM4_TPIU_BASE in cydevice_trm.h.
There are any clocks that must be enabled ?
Clearly we need an updated datasheet.

Also I have notice that cypress creator don't create the Special Function Register file (*.sfr) to the device pack that export for KEIL. That file needed by the KEIL debugger in order to display information about peripheral registers.

0 Likes

I found it! It is at PDL installation directory. You have to include it manually at KEIL from heresfr.JPG

0 Likes
LiDo_2439176
Level 5
Level 5
First question asked 50 replies posted 50 sign-ins

Hello,

SWO is part of the ARM CoreSight Debug block which usually is part of Cortex-M3, M4 and M7.

On CYBLE-416045-02 SWO works only with M4 core. The instrumentation trace macrocell (ITM) is inside Cortex-M4.

Regards,

Liviu

0 Likes

Hello Liviu,

     I agree, for CYBLE-416045-02 only the M4 core support the SWO, that why I am trying to used it with only that core. The logic say that it must work, but I can't make it work.

Also I manual set the pin to logic high to be sure that as output pin works correctly.

0 Likes