why NRF_LOG_ENABLED = 1 in sdk_config.h is making P0.06 high ?

Hello, 

I am using nRF52840 dev kit with sdk 17.0.2, s140 softdevice and dfu bootloader also implemented.

When I download the firmware to dev kit it works as intended, only problem is that pin P0.06 in automatically getting high, even thought there is nothing in my code which makes it high. After some debugging I fount that writing NRF_LOG_ENABLED = 1 is causing pin P0.06 to be high. However if I disable  nrf_log i.e make NRF_LOG_ENABLED = 0 then pin stays low.

On dev kit this pin is high and its not a big problem because I am not using pin P0.06 but my team has developed a custom board based on nrf52840 and on pin 0.06 we have attached a buzzer. With nrf_log enabled it keeps buzzer always high, even if we hard code it to low. For example, in main function after log_init() and before idle loop we are making pin0.06 low but it gets high again and stays high.

At this point we need nrf_log functionality in our program so I cannot disable it. On the other hand I am unable to find reason that why it is making pin0.06 high. Any help in this regard will be appreciated.

Parents
  • P0.6 is UART TX pin in the default board config (in pca10056.h). NRF_LOG_ENABLED will enable the UART to output its logs by default.

    Fix is simple: 

    #define NRF_LOG_BACKEND_UART_ENABLED 0
    #define NRF_LOG_BACKEND_RTT_ENABLED 1

    Then use the Jlink RTT viewer for Log messages via SWD connection.

    I recommend useing a custom board config - define BOARD_CUSTOM in Makefile, use "custom_board.h" as board header file in your project.

Reply
  • P0.6 is UART TX pin in the default board config (in pca10056.h). NRF_LOG_ENABLED will enable the UART to output its logs by default.

    Fix is simple: 

    #define NRF_LOG_BACKEND_UART_ENABLED 0
    #define NRF_LOG_BACKEND_RTT_ENABLED 1

    Then use the Jlink RTT viewer for Log messages via SWD connection.

    I recommend useing a custom board config - define BOARD_CUSTOM in Makefile, use "custom_board.h" as board header file in your project.

Children
Related