You can always use an UART component in your firmware to sent out debugging messages. PSoC 6 kit has an embedded USB to UART, so you can use PC Terminal to visualize debug messages sent by your firmware.
Yes, I know, but I think the debug port is generally the most elegant way to do it, and in the long run I want the code to run on boards lacking the kitprog2
I found and added some initiation code also, but it get what seems to be a bus fault when accessing the TPI unit,
anyone know why?
CoreDebug->DEMCR |= (1 << 24);
ITM->LAR = 0xC5ACCE55;
ITM->TER = 0x0;
ITM->TCR = 0x0;
TPI->SPPR = 2;
TPI->ACPR = 24;
ITM->TPR = 0x0;
DWT->CTRL = 0x400003FE;
ITM->TCR = 0x0001000D;
TPI->FFCR = 0x00000100;
ITM->TER = 0x1;
If you check core_cm4.h file, there are three system call functions:
They use the ITM channel to send/receive messages.
How can one listen to the data send on the ITM channel?
Thanks, I checked, and the ITM_SendChar i virtually identical to the SWO_Printchar function.
I tried running:
And also J-link + SWO-viewer.
Checking using a logic analyzer I see that nothing happens on the SWO pin.
If this is at all possible something more is needed.
To read the debug printf messages through SWV pin, I did the following:
1. Changed the Debug Select to SWD+SWV in one of the PSoC 6 MCU project and built it.
2. Exported the project to Keil uVision 5 by following the steps provided in Creating µVision Projects for PSoC 6 of the PSoC Creator Help document.
3. Redirected the STDERR, STDIN, STDOUT to ITM in Keil uVision IDE's is Run-time Environment (steps are available in the uVision's User Guide).
4. Connected the ULINKpro debugger to J11 header CY8CKIT-062-BLE board. Rebuilt the project in uVision and started the debug session.
I was successfully able to see the message steam in Debug (printf) Viewer window of the uVision IDE.
Although I haven't used the MiniProg3 here, thought of sharing this info, if you are interested to try.