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

Hello,Can anyone help me out by giving me complete details of this?

i would like to print register values of an external sensor on my screen using UART! I'm reading and writing into those registers using SPI! Printing a normal message using NRF_LOG_INFO function is fine, but how do i print the 32bit values of the register using UART?

Parents
  • Hi, Yashur.

    RTTExample

    Are you talking something like this?

    Nordic's

    NRF_LOG_INFO, NRF_LOG_WARNING, NRF_LOG_ERROR, and more,

    these can use the printf's format specifier like %d or %x.

    Hope this helps!

    / Edited at 2018.10.12/**

    What MCU and SDK version are you using?

    When using Nordic's logger, you can choose the backend; UART or SEGGER RTT.

    The above picture was an example when using RTT.

    UARTLog

    And this is the result when you choose UART as the backend.

    I have tested this using SDK 14 and PCA10040, which has nRF52832 populated.

    I'm not sure about the version number. Maybe SDK 12 or above uses the sdk_config.h file.

    In there, you can choose whether to use RTT or UART while logging.

    #define NRF_LOG_ENABLED 1
    #define NRF_LOG_BACKEND_UART_ENABLED 1
    #define NRF_LOG_BACKEND_UART_TX_PIN 6
    #define NRF_LOG_BACKEND_UART_BAUDRATE 30801920
    // <30801920=> 115200 baud 
    

    Modify these and I think you will see what you want.

    By the way, do you really have to use UART1, which I think it doesn't exist, to be the logger's backend?

    nRF52832, compared to nRF52840, has UART0 and UARTE0 (Universal asynchronous receiver/transmitter with EasyDMA).

    UART0Reg

    Check the nRF52832 product specification, please.

    I'm guessing that this is using UART0 as the backend.

    -Best Regards, MANGO

  • Hey mango, thanks for your answer! I have tried the above code but i'm getting the following error! saying implicit declaration of function sd_app_evt_wait and also of 'log_init'!!

Reply Children
No Data
Related