1 2 Previous Next 20 Replies Latest reply on Sep 27, 2018 3:10 AM by VlYe_281166

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

       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?  :-)

        • 1. Re: Debug output to IDE Output Tab ... or IDE logging?

          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.





          • 2. Re: Debug output to IDE Output Tab ... or IDE logging?

            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...)

            • 3. Re: Debug output to IDE Output Tab ... or IDE logging?



              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!



              • 4. Re: Debug output to IDE Output Tab ... or IDE logging?



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




                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.

                • 5. Re: Debug output to IDE Output Tab ... or IDE logging?

                  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.

                  • 6. Re: Debug output to IDE Output Tab ... or IDE logging?



                    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.



                    • 7. Re: Debug output to IDE Output Tab ... or IDE logging?

                       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.

                      • 8. Re: Debug output to IDE Output Tab ... or IDE logging?

                        (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.

                        • 9. Re: Debug output to IDE Output Tab ... or IDE logging?

                          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.

                          • 10. Re: Debug output to IDE Output Tab ... or IDE logging?





                            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!

                            • 11. Re: Debug output to IDE Output Tab ... or IDE logging?

                              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 :)

                              • 12. Re: Debug output to IDE Output Tab ... or IDE logging?

                                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

                                • 13. Re: Debug output to IDE Output Tab ... or IDE logging?

                                  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.





                                  • 14. Re: Debug output to IDE Output Tab ... or IDE logging?



                                    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.

                                    1 2 Previous Next