4 Replies Latest reply on Jul 23, 2015 2:06 AM by rohit.kumar

    printf debugging

    paul.donnelly

      From looking at the 100 projects in 100 days examples I see a lot of "printf " statements in the code. for example Day002_Heart_Rate_Sensor

         

      I'm using the pioneer kit and was wondering if the output from these printf appear anywhere? Can I see it in a debugger, can I get it on a console somewhere? It would be extremely useful to have this feature as interrupt driven embedded development can be difficult without logic analysers etc. This is especially important for new embedded developers which I'm guessing is a traget market segment of particular interest to Cypress. 

         

      Regards

         

        Paul

        • 1. Re: printf debugging
          user_14586677

          In embedded code for PSOC you can use sprintf() which prints to a buffer, that then

             

          can be used over I2C, UART, USB, SPI....whatever. It is the equivalent of printf to a

             

          console, like in windows. Uses essentially same formatting string as printf.

             

           

             

          Regards, Dana.

          • 2. Re: printf debugging
            rohit.kumar

            To add to Dana's post, you can see the messages sent using printf in the these BLE projects over an USB-UART COM port. This COM port is emulated over the PSOC 5LP Kit Programmer (present on the kit). Connect the kit to your PC -> Open a COM port terminal and select the port -> Select the Baud rate as set by the example project (most of the time it is 115200 bps). You should see the debug messages on the screen. Also, for some projects, the same screen will acts as input to BLE device for triggering certain actions.

            • 3. Re: printf debugging
              paul.donnelly

              Thanks for this information.

                 

              I jacked in my PSoC 4 BLE Pioneer kit. 

                 

              Setup a console to the UART via PuTTY,

                 

              Fired up PSoC Creator and flashed the PSoC BLE and all the printf appear in the PuTTY session. 

                 

              This is just what I was looking for, thanks Riot.

                 

              Regards

                 

                Paul

              • 4. Re: printf debugging
                rohit.kumar

                Glad to be of help! :)