UART does not print to putty-console in UART EXAMPLE

Hello

I am trying to run the UART example from the nRF5_SDK_17.1.0 on my nRF52840 board. I can build and run the example, but when I connect through putty, I can only send commands, not receive any. When I debug the program, the text gets printed to the console of the debugger, but when running it, I don't get anything to putty.

I have set up my connection as explained in the example-documentation (Baud rate: 115.200, 8 data bits, 1 stop bit, No parity, HW flow control: None). I'm using Segger-Studio 6.3 (also tried 5.7 and 6.3.2). I also tried the different I/O settings in Options/Library/I/O Settings, but they didn't solve the problem either.

I have seen that there are similar problems described in other threads, but they all seem to be different enough to not be applicable or just end abruptly, without a solution.

Since this is a simple example that is meant to work just out-the-box, I feel a bit silly for asking, but do I need to do any more setup then what I have described above?

Thanks in advanced for your responce

Parents
  • Hello,

    I have tested by myself. It works ok. 

    If you are using a DK , have you selected the right communication port?

    Thanks.

    Best Regards,

    Kazi Afroza Sultana

  • I'm pritty sure I did. I tried app_uart_put and app_uart_get and they work when I connect. I also tested it on two different computer with two different OS (Fedora and Windows) and they both run into the same problem.

    My current theory is, that it has something to do with printf.

  • Hello,

    I tried the example and it looked good.

    Have you pressed the reset button on DK after setting the putty when console popped up? You can wait a bit to get the printf message '' UART example started'' on console. Then you need to type something which has ''q'' or ''Q'' string on the console to get the ''Exit'' message.

    Thanks.

    Best Regards,

    Kazi Afroza Sultana

  • Hello,

    Thank you a lot for trying out the example again on your machine and verifying that it works. Unfortunately, I was still not able to get the example running on my machine though.  

    After some digging, I however noticed the following things:

    Try 1: nRF5_SDK_17.1.0 + Segger Embedded Studio 6.32b

    1.  Downloaded the SDK and SES 6.32b again
    2. opened the uart example by clicking on the .emProject in the C:\..\nRF5_SDK_17.1.0_ddde560\examples\peripheral\uart\pca10056\blank\ses
    3. Select "Build">"Build and Run" in SES: Here I get the following error: "unknown type name '__printf_tag_ptr' in retarget.c 
    4. Now I changed in options>Library>Library I/O> None to RTT
    5. Again, Build > Build and Run
    6. This time I get a new error ".text is larger than specified size" and ".rodata is larger than specified size"

    7. trying fixes that were recommended in other posts such as excluding the retarget file or deleting it did not work.

    8. similar issues with SDK 17.1.0 and SES 6.3 / 5.5 -> not able to build the example

    Try 2: SDK 17.0,2 and SES 6.32b

    1. Download SDK and SES

    2. Build and Run

    3. Retarget.c error : "unknown type name '__printf_tag_ptr' 
    4. options>Library>Library I/O> None to RTT

    5. Build > Build and Run -> this time the code builds
    6. putty shows no output, but the debugger does

    -> same issue with SES 6.3 / 5.5 

    Try 3: SDK 17.0,2 and SES 6.32b: app_uart_put

    After a lot of testing, I noticed that I can also use the function app_uart_put to "print" a single character to the console - and this works with putty!

    For the moment, I think I can use app_uart_put to data from my nrf52840 to the console. 

    In case anyone encounters the same problem or finds a solution to get printf working, I would really appreciate if you would let me know. 

    Thanks a lot again and best regards,

    degenwitz

  • hi  
    i am facing the same issue...
    did you find the solution?

  • It seems like an old case. Did you try the procedure what degenwitz recommended? If you want can open anew ticket describing you issue precisely; you can refer this ticket, there. 

  • No I never did. I ended up using the app_uart_put function like this:

    #include "stdint.h"
    void my_print(uint8_t* cString){
      int i = 0;
      while(cString[i]!='\0'){
        while(app_uart_put(cString[i])!=NRF_SUCCESS);
        ++i;  
      }
    }

    Not the nicest solution, but it was enough for what I needed.

Reply Children
Related