This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

How to set up both UARTs and not use virtual Com port

We are currently developing on the PCA10056 as we wait for our development boards.  We would like to implement UART0 as a debug port, that we can output the log messages to, and use UART1 to communicate with an RS485 IC that will host a network interface.  I am having trouble finding an example that uses both UARTS without using the virtual COM port on SDK15.  I have four questions:

1. How should sdk_config.h be set in order to do what we are attempting?

2. How do we initialize two instances of the UARTE driver, then operate said uarts?

3. How do we redirect logging to a "normal" UART output?

4. It is my understanding that we can use any GPIO pins as UART output.  Is this accurate?

Parents Reply Children
  • Just zip the project folder and attach it here. Use Insert -> Insert image/video/file -> File Upload. 

     

    Please also describe what I should be looking for when trying your application. 

     

    I have not tested using one UART as logging and one for communication for another device before, so I don't know if there are any known issues here. But if you only intend to use the logging UART during development, have you considered using the RTT Backend instead of the UART backend for the NRF_LOG? You can view RTT logging in either RTT viewer from SEGGER or if you are using Segger Embedded Studio, you should be able to see it directly in the IDE.

     

    Best regards,

    Edvin

  • We will be developing using IAR.  Our other devices feature a debug port that is used post-development, and we would like to implement them in these new devices, so using a UART for logging would be ideal, for the sake of consistency. 

    I'm using IAR version 8.22.2

    Extract the code and erase a PCA10056. Program SD140 V6.0.0.  Then set a breakpoint in the file com.c (in the Com group) on line 97 and follow that code on from there.

    There's a problem where I have to erase and flash SD140 every time I debug.  So if you restart the debugger you'll have to erase the board.

    UART Interface.zip

  • Hello Adrian,

    I am sorry for the late reply. I am sorry for the late reply. I have tested your project, but I was getting some hard faults. There were quite a lot of possible sources for this, the biggest one being that we don't have any official support for the Mesh SDK in IAR. I don't know whether that is the problem, but it may be a possible source.

     

    I will try to set up a project that uses one UART as logging and another as a "standard" UART.

    BR,

    Edvin

  • Hello,

    Attached is a project that uses one UART (0) for NRF_LOG and one UART (1) as a default UART. 

    upzip so you get the same path as the other examples. The project is for SDK 15.

     

    ble_app_hrs_and_uart.zip 

    Note that there also are some files outside the project folder that needs change. These changes are described here.

     

    Best regards,

    Edvin

  • The link you gave me for the files to add in order to allow for me to select UART1 on the app_uart did the trick!  Thank you.

Related