Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nRF52840 UART1 and log config?

How can configure NRF_LOG_UART to use UART0 or UART1 for  nRF52840?  I cant see any configuration which uart NRF_LOG_BACKEND_UART will use

As per spec nRF52840 should have 2 UARTs with EasyDMA, but in sdk_config.h> nRF_Drivers>UART_ENABLED only UART0 has option for EasyDMA (UART0_CONFIG_USE_EASY_DMA)? Where is the error in the specs or in the sdk_config.h that comes with examples?

In NRFX_UART_ENABLED section of sdk_config.h>nRF_Drivers I see only NRFX_UART0_ENABLED, don’t see anything for UART1?

Is there any example that uses both uarts for SDK17*?

Thanks

P.S. I’m working with SDK17.0.0, but checked in SDK17.0.2 the sdk_config files are same regarding log and uart sections for bsp and template examples.

  • Hi

    First, when using SDK v17.0.0 we strongly recommend moving to SDK v17.0.2 as it includes the latest MDK with a bug fixes that properly handles errata on future devices with unknown HW ID.

    As for your UART question. Please note that the UART peripheral only has one available instance (UART0). The UARTE peripheral however, has two available instances; UARTE0 and UARTE1.

    Please note that the app_uart examples do not support two UARTs. UARTE1 should only be accessed through the driver while UARTE0 may be accessed through app_uart or the driver. You can use the already included UART driver to configure the second UART instance, you just have to remember to enable "UARTE1_ENABLED" in sdk_config.h first.

    Best regards,

    Simon

  • Hi Simon,

    Thanks for clarification - I wouldn't pay attention that uart is 1 but uarte-s are two. What about nrf log with uart backend - which uart or urate does it use?

    Are UART0 and UARTE0 two separate peripherals or one peripheral that works in 2 modes? If are 2 peripherals can they both be used in the same code (with different  pins and baudrates)?

    Thanks 

  • Hi

    By default, the UART backend uses the UARTE0 instance. No, we do not have any example projects using both of the UARTE instances, as this would be specific to the nRF52840 and nRF52833 chips we have chosen not to focus on this. If you use the UARTE1 instance for your application, and leave the UARTE0 as is for backend logging it should be pretty straight-forward.

    Best regards,

    Simon

Related