Debug output to IDE Output Tab ... or IDE logging?

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

cross mob
Anonymous
Not applicable

 I'm going to cross post this here ... I am looking for *ANY* way to output some debug text and variables to  the Output Tab in the IDE (or any tab!) while debugging my custom PCB and code.

   

In most all of the other IDEs that I use, there is always a "console.log" kind of functionality that I can use to simply dump some data to the IDE while debugging in the IDE.

   

How can I get some sort of output like that into the IDE?

   

I have seen all sorts of people talking about having to create a UART and output off pins in the board ... but what if I don't have the pins to do that?  How can I get some form of logging going in the IDE?

   

There has to be some way ... right?  Please?  🙂

0 Likes
1 Solution
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Your debugging device, be it a MiniProg3 or an on-board KitProg, has the capability of "bridging". Sending data to it will be processed and sent over the debugging USB interface to the PC where a com-port is emulated. Simple terminal programs like PuTTY or HyperTerm will allow you to display that data, additionally some more complex programs are supplied by Cypress as the "Bridge Control Panel"..

   

Anyway you will need at least one (1) extra pin to communicate with the MiniProg3 or KitProg.

   

Kitprog is the easiest, there is an UART interface which you can connect to a Tx pin on your Project under Test, Rx connection is optional, so you may use a software TX component

   

So when you have got a Pioneer Kit you are fine off, one wire connection on the board and running PuTTY works like a charm.

   

 

   

Bob

View solution in original post

0 Likes
21 Replies
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Your debugging device, be it a MiniProg3 or an on-board KitProg, has the capability of "bridging". Sending data to it will be processed and sent over the debugging USB interface to the PC where a com-port is emulated. Simple terminal programs like PuTTY or HyperTerm will allow you to display that data, additionally some more complex programs are supplied by Cypress as the "Bridge Control Panel"..

   

Anyway you will need at least one (1) extra pin to communicate with the MiniProg3 or KitProg.

   

Kitprog is the easiest, there is an UART interface which you can connect to a Tx pin on your Project under Test, Rx connection is optional, so you may use a software TX component

   

So when you have got a Pioneer Kit you are fine off, one wire connection on the board and running PuTTY works like a charm.

   

 

   

Bob

0 Likes
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

No, Creator doesn't provide any window to see serial data (or data received over the debugging port). Sorry.

   

(But while reading the Creator user guide about that I realized that there is a nice component debug window that show the internal state of the schematic component...)

0 Likes
Anonymous
Not applicable

 Bob,

   

Thank you for this information ... can you point me at some more documentation on this?  I'm using the MiniProg3 and am assuming you mean that I need to tie a pin from the PSoC 4 to the 10-pin programming header?

   

I'm hoping there is a doc that explains this well?

   

Thanks again!

   

Scott

0 Likes
Anonymous
Not applicable

 Bob,

   

As an update, in the following document I did find this reference:

   

http://www.cypress.com/?docID=47035

   

3.3 USB-UART Bridge

   

The onboard PSoC 5LP can also act as a USB-UART bridge to transfer and receive data from the PSoC 4 device to the PC via the COM terminal software. When the USB mini-B cable is connected to J10 of the PSoC 4 Pioneer Kit, a device named KitProg USBUART is available under Ports (COM & LPT) in the device manager. For more details about the USB-UART functionality, see Using PSoC 5LP as USB-UART Bridge on page 63.

   

To use the USB-UART functionality in the COM terminal software, select the corresponding COM port as the communication port for transferring data to and from the COM terminal software.

   

The UART lines from PSoC 5LP are brought to the P12[6] (J8_9) and P12[7] (J8_10) pins of header J8. This interface can be used to send or receive data from any PSoC 4 design that has a UART by connecting the pins on header J8 to the RX and TX pins assigned in PSoC 4. The UART can be used as an additional interface to debug designs. This bridge can also be used to interface with other external UART-based devices. Figure 3-10 shows the connection between the RX and TX lines of the PSoC 5LP and PSoC 4. In this example, the PSoC 4 UART has been routed to the J3 header; the user must connect the wires between the PSoC 5LP RX and TX lines available on header J8.

   

I have not found a complete pinout for the 10-pin header yet.

0 Likes
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

All the headers are shown in the schematics. Look in the appendix of the user guide.

   

But you don't need to use it. The UART lines of the PSoC4 on the Pioneer kits (and on the smaller dev boards) are connected to the PSoC5. The latter one acts as USB-UART bridge, so anything the PSoC4 sends out to the UART get send to the PC - you just need to connect a terminal program (e.g. RealTerm, Tera-Term or the included Hyperterm) to the Kitprog-Bridge serial port.

0 Likes
Anonymous
Not applicable

 Hli,

   

Thanks for the comment ... but you have not read my questions carefully.  I am *NOT* using the Pioneer kits ... we have already spun our own boards based on the PSoC 4, and so you and I are not talking about the same thing.

   

I'm familiar with the Pioneer kits, as we started there, but we are well past that now.  We have already created two custom PSoC 4 boards that we're using for various purposes.  We want to enhance the debugging capabilities of these boards for our developers.

   

Bob indicated there is a way to somehow connect some PSoC 4 pins to the 10-pin header so that we can configure a UART in the PSoC 4 to send data up the MiniProg3 to a virtual COM port on our development machines.

   

THAT is what I'm trying to find ... which pins on the 10-pin header are to be used for that purpose?  We're actually about to re-spin our boards, and I want to ensure - from now on - that we have such a trace in place on our boards to enable this method of debugging.

   

I have even found this article: http://www.cypress.com/?id=4&rID=78885

   

It does not seem to indicate which pins can be used for the purpose that Bob described.

   

Scott

0 Likes
Anonymous
Not applicable

 I'll continue to post here as I slowly locate the details on how to accomplish this.  Thanks again to Bob for pointing me in the right direction.

   

Looking at the "Bridge Control Panel" application help documentation, I found one small comment that the MiniProg3 will support:

   
        
  • Bridge Protocols: I2C and RX8
  •     
  • 5-pin connector (I2C and RX8) and 10-pin connector (single RX8 line on pin 6 - TDO)
  •    
   

So it appears that if we connect a PSoC 4 pin to pin 6 of the 10-pin header we ought to be able to get this data into the Bridge program.

0 Likes
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

(You confused me since you referred to the Pioneer kit user guide - so I assumed you are using that one)

   

Looking at the Miniprog3 user guide (http://www.cypress.com/?docID=44358 ), I think that Bob was wrong - the Miniprog3 doesn't seem to support USB-UART bridging.

   

Part 3.1.3 of the UG states that the Miniprog2 supports SWV (serial wire viewer), and ARM standard for sending debug output to a SWV viewer. But it also states that this is only possible to PSoc3 and 5LP.

   

Using i2C is possible, but only when the Miniprog3 is not used for debugging (since is uses the same pins as the SWD interface)

   

So connecting an external UART bridge seems your best option right now.

0 Likes
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

If you absolutely cannot find pins for an UART connector: if you routed a full 10-pin header on your PSoC4 port, you can use the TDO line on it as TX pin for an UART bridge (that would be pin 6). Its the line that would be used for SWV. With a special adapter you might even be able to connect a Miniprog3 and a UART bridge at the same time.

0 Likes
Anonymous
Not applicable

 Hello,

   

 

   

As I stated, the Cypress Bridge Control Program - mentioned by Bob - supports the MiniProg3 ... and if you check it's help documentation, you'll find the following paragraph:

   

MiniProg3 Programmer

   

The MiniProg3 Programmer/Debugger is designed to aid hardware, firmware and software developers in building their own systems around Cypress 8-bit and 32-bit PSoC devices. MiniProg3 provides flexibility to work with different programming and debugging interfaces for a variety of PSoC devices. This interface includes JTAG, SWD, ISSP, I2C and SWV. In addition, MiniProg3 enables communication with target devices using I/O voltage levels from 1.5V to 5.5V. The MiniProg3 can also supply power to a target board at one of four voltage level set by the target board.

   

The MiniProg3 supports:

   

 

   
        
  • Programming Protocols: ISSP, SWD, and JTAG
  •     
  • Bridge Protocols: I2C and RX8
  •     
  • 5 pin connector (I2C and RX8) and 10-pin connector (single RX8 line on pin 6 - TDO)
  •     
  • Variable Power Supply
  •     
  • USB connection 
  •    
   

 

   

Running the Bridge Control program, I'm able to connect to the MiniProg3 just fine, and set-up the protocol configuration.  We'll be doing an inhouse jumper this week to then see if this provides te funcationality that we're after.

   

Overall it looks like this will work just fine!

0 Likes

Hello, 

   

Did you have any success in viewing printf() output using MiniProg3 via SWD? I am using a MiniProg3 to flash/debug EZBLE-012011.  I am using a 10-pin connector(SWD interface). 

   

Thanks
Dheeraj

0 Likes
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

I was looking at the user guide for the MiniProg3 only, and it doesn't mention anything about RX8 (or UART, for that matter). The only reference I found about RX8 was in conjunction with the PSoC1 chips. So I'm not sure what happens when you try to use it for the PSoC4. (RX8 sounds like it could be an UART RX only component)

   

But if you get it working, please tell us - I would be more than happy to have a new tool for debugging in my box. Its never too late to learn something new 🙂

0 Likes
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

An update regarding that topic, for everybody using PSoC5LP and Keil / IAR (sorry, the PSoC3 and 4 are limited): its possible to use the Embedded Trrace Macrocell (ETM) for debugging, and there is a KB article detailing how to do that: http://www.cypress.com/?id=4&rID=91995

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Well, sorry, but I'd really lost this thread, so my missing continuation.

   

MiniProg3: Can be used (besides just programming) for debugging or (but not at the same time) as an UART-I2C bridge.

   

Bridge Control Panel: Can accept and display binary data although the usage/definition can be a bit painful until it runs.

   

So what you need on your board is an I2C slave interface (Bridge acts as master) which will be two pins + Gnd.

   

Some prerequisites are needed as to free the dedicated SWD pins and connect the I2C component to them, programming the chip with MiniProg3 will still work.

   

 

   

There is something new on the horizon which I did not test yet: The CY8CKIT-059 has got a removable (snap-off) kit programmer which should be able to connect and program PSoC4s as well. Additional inputs on that part make up an UART-USB-bridge which allows for a human-readable communication when using a terminal-program on the PC side.

   

 

   

Bob

0 Likes
anpi_1343696
Level 2
Level 2
First like received

Hi,

   

I understand this is an old discussion, but I am interested in a solution similar to this. I have a custom board with an EZ_BLE module with the 5 pins configured for a Miniprog3. I am able to program the unit and works well. I wanted to see if I could use the same connection with the MiniProg for sending USB messages to the Bridge Control Panel for debugging (e.g., Accelerometer data). 

   

If I read correctly, the Bridge Control Panel acts as an I2C Master and the board must act as an I2C slave. Is there a way to reuse the P0.6/P0.7 pins that are already connected to the MiniProg as the I2C slave device. Seems as long as the XRES is not activated, they are available for use - after all they are used for debugging.

   

 

   

Now the question is how to address them in PSOC Creator. Is there a component that I am missing that allows communication of debug messages using the DEBUG ports? 

   

What am I not seeing? Thanks!

   

 

   

In the meantime, I am using an extra pin to send Serial data to the Bridge Control Program, but it would be nice to reuse the SWD pins.

Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

@Andres

   

"Is there a component that I am missing that allows communication of debug messages using the DEBUG ports? "

   

No, no complete component, accessing debug data needs some sophisticated programs on the PC side.

   

As I understood: Debugging and using the I2C bridge at the same time does not work. You have to set the SWD pins to GPIO. This allows for programming and using the bridge, but not for debugging.

   

 

   

Bob

0 Likes
JoBr_1593366
Level 5
Level 5
100 sign-ins 50 questions asked 100 replies posted

Sorry, I've read this discussion multiple times and I still don't understand.  What's the simplest way to get string messages out of a PSoC4 into a computer through the MiniProg3?  Is it possible to use the SWD pins?

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

String messages can be sent using USBUART component and on PC side a terminal emulator ta PuTTY. Make sure sending onla ASCII bytes. There is an example project showing how to work with USBUART.

   

 

   

Bob

0 Likes
Anonymous
Not applicable

Lately I've been working with Nordic BLE chips using the nRF51-DK kit with onboard Segger J-Link . I use it with their Cortex-M0 chips, and all the debugging info comes out the SWD pin (my Nordic based board is connected to the nRF51-DK with only 4 signals - VCC, GND, SWDIO, SWCLK). They call it the Logger module using RTT interface (link to Nordic SDK page) https://goo.gl/8Jx6bB

   

I wonder if it's possible to do the same thing with PSOC chips/tools (viewing debugging output through the SWD interface, without adding any dedicated pins for this)

0 Likes
BuHa_1507271
Level 3
Level 3
10 replies posted 10 questions asked 10 sign-ins

In the USB 3.1 standard there's "Device Class Specification for Debug Devices."   It describes techniques for passing debug information over USB more sophisticated than different from ​the emulated com-port bridging approach.   It seems like this might be useful in the addressing the sort of "console logging" style debug messages originally raised on this thread by @Humancell.  I think there's going to be an ongoing need, and allowing this to piggyback on other target-system USB functionality would be a big plus.  

   

Does anyone know about this device class, and PSOC/host/driver support for it.

VlYe_281166
Level 4
Level 4
25 replies posted 10 replies posted 10 questions asked

In fact, the question raised is not so trivial. For a long time I did not pay attention to this, because I used the usual output via the serial port. But, quantity has passed in quality. So, in some examples you can find such lines:

DebugPrintfInit (); DebugPrintf ....

For example, now, I'm studying an example of PSoC6_Interfacing_BMI160 (I2C) _FreeRTOS01, just with such commands.

In the explanation for the example it is written:

"Set up the serial port terminal emulator

with these settings:

Baud rate: 115200

Data size: 8-bit

Parity: None

Stop: 1-bit

Flow Control: None "

UART is used as UART (SCB_UART_PDL) with autoconfigurable pins. The configuration of the pins coincides with the board under test, but there is no output to the serial terminal. There is also no activity on the TX pin.

Now, if I use usual form DEBUG_UART_PutString, everything works fine.

Even stranger is that there is no information about these commands in any documentation or in the community.

0 Likes