Multiple UARTs on nRF5340

Hi, I wonder if I can get some assistance on an issue I'm having implementing multiple UARTs on my nRF5340 (using the nRF7002DK)?

The Product Specification notes the nRF5340 supports 4 UART's.  I would like to use uart0 for logging, and then uart1 and uart2 as additional UARTs.  I have altered the devicetree to enable all 3 uarts and repurpose DK pins for their use.  What I am struggling with is how to configure this in the prj.conf file. I have already got UART1 working.  The project compiles and the UART messages work as intended on the assigned pins.  I used the following configuration for it to function:

CONFIG_UART_ASYNC_API=y
CONFIG_UART_1_ASYNC=y
CONFIG_UART_1_INTERRUPT_DRIVEN=n
CONFIG_UART_1_NRF_HW_ASYNC=y
CONFIG_UART_1_NRF_HW_ASYNC_TIMER=2
CONFIG_NRFX_TIMER2=y
CONFIG_RESET_ON_FATAL_ERROR=n

However if I add corresponding UART_2 configs, my compiler flags a warning "CONFIG_UART_2_ASYNC was assigned the value y, but got the value n. Missing dependencies: UART_2_NRF_UARTE".  So the below configs do not work

CONFIG_UART_2_ASYNC=y
CONFIG_UART_2_INTERRUPT_DRIVEN=n
CONFIG_UART_2_NRF_HW_ASYNC=y
CONFIG_UART_2_NRF_HW_ASYNC_TIMER=2

Can you please help me find where I am going wrong?  What would be the correct way to enable the uart2?

Chris

Parents Reply
  • Hi Jared,

    Thank you for responding.  Yes I am using nRF Connect SDK 2.5.0.  I've attached the requested files. 

    Just for clarity on what I'm trying to achieve with the UART's:

    • UART0: Debug/logging. Enabled for development, disabled for production
    • UART1: Standard UART for comms with another MCU
    • UART2: Standard UART for comms with a different MCU

    I am able to use both UART0 and UART1 successfully using the custom selected DK pins. I am just unsure of how to set up UART2 so it doesn't flag warnings of missing configuration parameters.  Those config parameters are under the comment "# UART2" in the prj.conf file

    3223.prj.conf

    4380.nrf7002dk_nrf5340_cpuapp.overlay

    Regards,

    Chris

Children
Related