[ABANDONED] How to make a print out ?!

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • [ABANDONED] How to make a print out ?!

    Hello all,

    you will probably laugh at this question, but I wish I could get the print out working. Please have a look at code :


    C Source Code: printout

    1. #include "eta_bsp.h"
    2. #include "string.h"
    3. #include "stdlib.h"
    4. #include "eta_utils_terminal.h"
    5. #include "eta_utils_stdio.h"
    6. /***************************************************************************//**
    7. *
    8. * main - the main entry point.
    9. *
    10. ******************************************************************************/
    11. int
    12. main(void)
    13. {
    14. uint16_t k = 0;
    15. //
    16. // Loop forever.
    17. //
    18. while(1)
    19. {
    20. k++;
    21. if(k > 1000){
    22. printf("above", k);
    23. k = 0;
    24. }else if(k < 1000){
    25. printf("below", k);
    26. k = 0;
    27. }
    28. }
    29. }
    Display All
    Any ideas?

    BEST.

    The post was edited 1 time, last by MUETA: Missing information: I am trying to print in "debug terminal". ().

  • Hello,

    Thank you for your inquiry.
    Where do you expect the print out to happen?
    What I/O interface do you use for that?
    If you are using the default that Embedded Studio sets up it will be SEGGER RTT:
    segger.com/products/debug-prob…about-real-time-transfer/
    So you would see the output in the debug terminal of Embedded Studio.

    Other available I/O types and how ES has to be set up for them is explained here:
    wiki.segger.com/Embedded_Studio_Library_IO


    Best regards,

    Nino
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • Thanks for the reply. I was hopping to get the output in the "debug terminal", however, nothing at the moment.

    I am using the jLink mini EDU and its probes can be used as an I/o interface. Indeed, will have a look at the given links.

    To be honest, I did not know I have to additionally setup the print-output, but it is now logical :) therefore, thank you again!
  • Hello,

    For clarification, J-Link is the debug probe and just one possibility for the I/O interface.
    The I/O interface can be anything that your target device supports (UART, Ethernet, USB, Debug Interface, SWO, etc. etc.).
    If you are using the default configuration of Embedded Studio RTT is the I/O interface, which uses the debug interface and J-Link forwards the collected data to the host terminal.

    Best regards,
    Nino
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • Hello Nino,

    I had a look at several things, it seems, I have to "somehow" add the Segger files (see the attached image) to the project.
    For example, when the header "#include "SEGGER_RTT.h" is given does not want to compile. Tried to add those files manually, but it seems this is not the right way :/

    I guess this is the way to go, however, I just want to use the 'printf()' function and print out in the EmbeddedStudio and its 'Output' in 'Debug terminal' . This does not work with the project "Hello World" that I have opened from the dev board supplier, however, the application works OK, indeed, I cannot add the printf() to the code, e.g. and see the print out... Interestingly, the simple and other "hello world" is ran I can see the print out in the 'Debug terminal' ... Wondering what I am doing wrong?
    Images
    • Screen Shot 2020-11-30 at 14.41.03.png

      67.26 kB, 313×152, viewed 373 times
  • MUETA wrote:

    ... I just want to use the 'printf()' function and print out in the EmbeddedStudio and its 'Output' in 'Debug terminal' . This does not work with the project "Hello World" that I have opened from the dev board supplier, however, the application works OK, indeed, I cannot add the printf() to the code, e.g. and see the print out... Interestingly, the simple and other "hello world" is ran I can see the print out in the 'Debug terminal' ... Wondering what I am doing wrong?
    OK, this problem has been partially solved with adding the "path" to the project, indeed, this time I can compile and run the project, but still no output either in Debug terminal or via the J-Link RTT viewer, apropos I hope that I am "connected properly" , for example, while the project is ran in the emStudio, the JLink Viewer is separately opened, I guess this is the right way to do it? Please have a look at the attached picture... It looks the connection works, however, how to see the printouts? I am trying to print out either via the printf() or the Segger RTT functions...

    Although, I can compile the project with the

    Source Code

    1. #include "SEGGER_RTT.h"

    I cannot run the following function :


    Source Code

    1. SEGGER_RTT_WriteString(0, "Hello World from SEGGER!\r\n");
    Thank you in advance for any ideas, comments!

    BEST.
    Images
    • Screen Shot 2020-12-02 at 12.57.42.png

      46.51 kB, 940×538, viewed 485 times
  • There we go!

    OK, I have opened a new project for the chip under consideration and started with the simple print out code and its works, yeah!!!

    Both either the RRT Viewer or printf() in debug terminal. So, I guess the next step is to code some of the chip features and start from zero. I was hopping to add the print function to the dev board "Hello world"...

    Anyway, still wondering, what am I doing wrong in previous Hello worlds... However, it seems it is now working every-time work with it :) I guess it is possible that I have restarted the program, etc.

    BEST.

    The post was edited 1 time, last by MUETA ().