- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I found it! It is at PDL installation directory. You have to include it manually at KEIL from here
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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/
Regards,
Dheeraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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!
Regards,
Tasos
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I found it! It is at PDL installation directory. You have to include it manually at KEIL from here
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.