1 Reply Latest reply on Oct 19, 2020 9:27 PM by EktaN_26

    How can I use and view ITM logs with CY8KIT-062S2-43012?

    MoNa_4784221

      I am trying to debug on the CY8KIT-062S2-43012 kit.

      I've been looking into debugging options that would hopefully avoid dependence on a UART module.

      Trying to run the debug on the Hello World template example using Modus Toolbox v2.2.

      I added my ITM init function :

      void itm_init(void)

      {

      CoreDebug->DEMCR |= CoreDebug_DEMCR_TRCENA_Msk;

      /* Enable Trace debugger*/

       

       

      ITM->TCR |= 1;

      ITM->TER |= 1;

      TPI->ACPR=0;

       

       

      /* Enable write access to ITM registers. */

              ITM->LAR  = 0xC5ACCE55;

       

       

              /* Trace Port Interface Selected Pin Protocol Register. */

              TPI->SPPR = (0x02 << TPI_SPPR_TXMODE_Pos);

       

       

              /* Trace Port Interface Formatter and Flush Control Register */

              TPI->FFCR = (1 << TPI_FFCR_TrigIn_Pos);

       

       

              /* Data Watchpoint and Trace Control Register */

              DWT->CTRL = (1 << DWT_CTRL_CYCTAP_Pos)       |

                          (0xF << DWT_CTRL_POSTINIT_Pos)   |

                          (0xF << DWT_CTRL_POSTPRESET_Pos) |

                          (1 << DWT_CTRL_CYCCNTENA_Pos);

       

       

              /* Trace Privilege Register.

               * Disable access to trace channel configuration from non-privileged mode.

               */

              ITM->TPR  = 0x0;

       

       

              /* Trace Control Register */

              ITM->TCR  = (1 << ITM_TCR_TraceBusID_Pos) |

                          (1 << ITM_TCR_DWTENA_Pos)     |

                          (1 << ITM_TCR_SYNCENA_Pos)    |

                          (1 << ITM_TCR_ITMENA_Pos);

       

       

              /* Trace Enable Register */

              ITM->TER = 0x01;

      }

      and used the CMSIS ITM_SendChar (uint32_t) function, tried running with J-link lite + SWO-viewer, but I see that nothing happens on the SWO pin.

      How can I use and view ITM logs?