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

Having trouble using NRF log and UART to receive using COM Port

Hello

I need urgent help. From days I have been stuck exploring NRF SDK 15.0 to do a simple task.

I am using an NRF DK board PCA10040. After going through peripheral drivers and several documentation I wanted to simply set up UART port to send and receive data.

I simply wanted to link other on chip peripherals with UART and I also want to connect DK board with an RFID board via serial.

Turns out that all peripherals such as SAADC which I tried run on event handlers and services which is great but all SDK examples are dependent on NRF_Log! I found it to be extremely annoying to not single out processes.

Now I want to use service and handlers of any peripheral I desire and use it with simple UART, turns out there is no RX pin mapped to NRF_LOG back end serial? I traced it back to SDK and seems like only TX pin is mapped so is there no way to receive data over NRF_LOG?

        1) I simply want to receive data on UART using NRF Log

         2) I also tried CLI example but its way too complicated to include all that just to receive data

Please solve this issue of mine because I simply want to use a serial port to fit to my purpose, why doesn't NRF log support data reception?

I want to use all examples such as twi, SAADC with serial. SAADC is a critical part of the application we are trying to build and the fact that data is handled by handlers is fantastic but it makes other processes way too complicated.

Thanks in advance

Ali

Parents Reply Children
  • Hi Muhammad, 

    AliMahmood123 said:
    I found out nrf serial example where receiving and sending is also possible but its not integrating with SAADC even after adding changes for SAADC in sdkconfig.h

    Here is the SAADC Example

    What is the error message?

    AliMahmood123 said:
    If you could just tell me how to receive data / strings on nrf_log it'll be easier for me.

    Search for "NRF_LOG_BACKEND" in sdk_config.h. There are two possible defines there. UART or RTT, and they are set to either 0 or 1.

    If NRF_LOG_BACKEND_UART_ENABLED is enabled, it should be printed over the UART, which is picked up by the programming chip on the DK, and you can view it using e.g. Termite, or Putty.

    If NRF_LOG_BACKEND_RTT_ENABLED is enabled, then you can see the log with the Segger debugger and JLink RTT Viewer.

    BR,

    -Amanda H 

  • Hi Amanda

    Thanks your your response

    There is no error message in SAADC example.

    Allow me to re phrase

    I simply want to receive data in SAADC example via using NRF log backend as UART.

    I have the macros enabled which you have mentioned as I have gone through countless examples and SDK exploration.

    Please tell me if it's possible to receive data via NRF_LOG using UART as backend.

    Let's say I want to trigger SAADC example using a serial character. How do I detect or read UART input via NRF_LOG?

    During my exploration I have found out that it's not possible to receive via UART in NRF_LOG because RX pin is not mapped in SDK and internal drivers of NRF Log Backend.

    Considering my SAADC trigger use case via serial, please tell me how to approach this issue, keeping in mind that I want to use all SAADC services such has event handler which are used in these examples

  • Hi, 

    You can use the app_uart library to receive strings, then do tasks in the uart_handler. Please study the SAADC Example and UART Example

    -Amanda H. 

  • Hi Amanda

    I added serial port library due to variety of modes and functions

    I realized by myself that to incorporate modules together one has to modify by adding or deleting features in SDK and then add source files and paths for an error free project.

    It took me countless hours to do that I think you guys should document this procedure with examples as well.

    The SDK is a very useful tool but can be confusing if not guided properly

  • However I have one more question

    While integrating serial port library and examples I found out that the example is configured by default on interrupt mode but the code is not interrupt based (UART Rx interrupt for example)

    Please guide me through the steps to set up and use interrupts in serial example for UART receiving data.

    Thanks in advance Amanda

    Ali

Related