-
1. Re: PSOC6 Serial Wire Viewer
rlos Feb 9, 2018 10:00 AM (in response to anders_2738496)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.
-
2. Re: PSOC6 Serial Wire Viewer
anders_2738496 Feb 9, 2018 10:31 AM (in response to rlos)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
-
3. Re: PSOC6 Serial Wire Viewer
anders_2738496 Feb 12, 2018 3:46 PM (in response to anders_2738496)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;
-
4. Re: PSOC6 Serial Wire Viewer
rlos Feb 13, 2018 12:52 PM (in response to anders_2738496)If you check core_cm4.h file, there are three system call functions:
- ITM_SendChar
- ITM_ReceiveChar
- ITM_CheckChar
They use the ITM channel to send/receive messages.
-
5. Re: PSOC6 Serial Wire Viewer
user_78878863 Feb 13, 2018 1:34 PM (in response to rlos)How can one listen to the data send on the ITM channel?
-
6. Re: PSOC6 Serial Wire Viewer
anders_2738496 Feb 14, 2018 6:10 AM (in response to rlos)Thanks, I checked, and the ITM_SendChar i virtually identical to the SWO_Printchar function.
I tried running:
GitHub - kyoung2112/csharp-miniprog3-swv: C# Express SWV Printf viewer for Miniprog3
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.
-
7. Re: PSOC6 Serial Wire Viewer
srds Mar 22, 2018 11:30 AM (in response to anders_2738496)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.