Serial Console Debug (SWV on PSoC3 and PSoC5LP)

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

cross mob
Anonymous
Not applicable

I've been doing some work on a serial console debugger for PSoC, and I figured it was time to get it out there. This is a PC application that prints serial data being received from the Miniprog3 to a text console. Accompanying the app are firmware example projects for PSoC3 and PSoC5LP that map the printf() function to output via the SWV. This provides a very fast serial debug output that doesn't consume any resources on the PSoCs. Plus, many of your 10-pin debug connectors may already have the proper pin connected! The firmware is organized though the use of a "SWV" component - just add the component to your project, call the _Start() function, and start sprinkling printf() in your firmware.

   

Here's a link to the app setup exe: https://www.dropbox.com/s/embu91bv8kuss7u/CySerialDebugSetup.exe?dl=0

   

Here's the git repo for the application (C# Express 2010): https://github.com/kyoung2112/csharp-miniprog3-swv

   

And here's the git repo for the Creator projects: https://github.com/kyoung2112/psoc_creator_swv_firmware

   

There are still some things I want to do to this, including:

   

1. Allow the console app to connect to COM (and virtual COM) ports.

   

2. Give the component the option to use a UART instead of SWV if desired. This would also provide compatibility to PSoC4, which does not have SWV.

   

Feel free to provide feedback, or better yet, fork the git repo and send me your own enhancements!

   

Regards,

   

Kris

5 Replies
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

 Here's a zip of the component.

   

Kris

Anonymous
Not applicable

Many thanks for your effort...

   

 

   

     hope it becomes a standard 'built-in' component within the PSoC Creator package.

   

 

   

Regards Michael.

0 Likes
Anonymous
Not applicable

 Sounds interesting. Shall try it some time later. hope this can speed up the development time

0 Likes
Anonymous
Not applicable

Thanks for the effort and for sharing. I have an issue wherein the variables are printed out incorrectly. And sometimes I am missing characters. Have you seen that? Is there anything I should do to help?

   

 

   

main: ucrrntEnable  202, TempEnble = X@
main: ucCurrentEnable = 202, TempEnble = c1
main: ucCurre?-Enable = 202, TempEnable = c?
main: ucCurrentnable = 202, Tempnable  X@
main: ucCurrentEnable  202, TempEnable = c1
main: ucCurrentEnable = 20, Tepnable = c1

   


should be 02 and 02. Not sure what's going on.

0 Likes
RiMo_301056
Level 3
Level 3
25 sign-ins First solution authored 10 replies posted

Dear Kris,

I came across your post because I was looking exactly for the same feature: a Debug Console that can use the SWV line and the MiniProg3 to send data to a debug console on a PC.

I tried your examples: the PSoC example project compiles and runs on my PSoC3 target board (not a dev kit) with no problems.

However, when launching the "Serial Debug Console" application (I tried it using Windows XP, as I assume the .exe you provided comes from that time period), I get the following error message:

Error message.png

Do you have an idea of what could be the reason for the error?

Also, I see that your application contends the MiniProg3 with PSoC Creator, i.e. it is not possible to have the Serial Debug Console and the PSoC debugger active at the same time.

I understand that such a functionality is not possible with PSoC Creator (too bad). I am used to it from many other development tools (e.g. Segger Embedded Studio). Let's hope that such a feature will arrive in some future PSoC Creator releases.

Best regards.

0 Likes