UART0 unable to bring up (undefined reference to `__device_dts_ord_110')

I am trying to make the UART0 for communicating with another chip and following https://academy.nordicsemi.com/topic/exercise-1-5/

I am using nrf5340 chip and not the DK,

When I use uart_dev = DEVICE_DT_GET(DT_NODELABEL(uart0)) I am getting undefined reference to `__device_dts_ord_110'

void test_uart(void)
{
 	//uart_dev = device_get_binding("uart@8000"); // Passing but not transmitting
	uart_dev = DEVICE_DT_GET(DT_NODELABEL(uart0)); //giving  undefined reference to `__device_dts_ord_110'

	if (!device_is_ready(uart_dev)){
		 printk("device_get_binding UART0 failed\n");
	}
	 
	uart_irq_callback_set(uart_dev, uart_cb);
	uart_irq_rx_enable(uart_dev);

	while (1)
	{
		 
		uart_fifo_fill(uart_dev, "hello",6);
		k_sleep(K_MSEC(1000));
	}
}

CONFIG_GPIO=y
CONFIG_I2C=y
CONFIG_SPI=y
CONFIG_SPI=y
CONFIG_SPI_ASYNC=y
CONFIG_DEBUG_OPTIMIZATIONS=y
 
CONFIG_ADC=y
CONFIG_ADC_ASYNC=y
CONFIG_ADC_NRFX_SAADC=y
CONFIG_MAIN_STACK_SIZE=4096
CONFIG_FPU=y

CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC=y
CONFIG_CLOCK_CONTROL_NRF_K32SRC_500PPM=y
CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC_CALIBRATION=y
CONFIG_CLOCK_CONTROL_NRF_CALIBRATION_LF_ALWAYS_ON=y
CONFIG_CLOCK_CONTROL_NRF_K32SRC_XTAL=n
CONFIG_PM=y
CONFIG_PM_DEVICE=y
CONFIG_BOARD_ENABLE_CPUNET=y
CONFIG_SOC_ENABLE_LFXO=n
CONFIG_DEBUG_THREAD_INFO=y


CONFIG_SERIAL=n

CONFIG_UART_INTERRUPT_DRIVEN=y
CONFIG_LOG=n
CONFIG_ASSERT=y
CONFIG_ASSERT_NO_COND_INFO=y
CONFIG_ASSERT_NO_MSG_INFO=y
CONFIG_HW_STACK_PROTECTION=y
CONFIG_USE_SEGGER_RTT=y
 
CONFIG_CONSOLE=y
CONFIG_UART_CONSOLE=n
CONFIG_UART_ASYNC_API=y

#CONFIG_UART_0_NRF_FLOW_CONTROL=n

 
&gpio_fwd {
    uart {
        /delete-property/ gpios;
    };

    status = "disabled";
};
  

&uart0 {
	/delete-property/ rts-pin;
	/delete-property/ cts-pin;
};

Any clue how to fix this ?

Really fed-up of this device tree and early initialization of peripherals.

Any way to totally bypass all these and write the uart and all peripherals in the traditional way and use the zephyr just as an RTOS like freeRTOS ?

Because I really want to switch between uart ports by sharing same UART0 between two different port pins of the MCU on run time and not dependent on any power modes and all.

Parents
  • Hi Vinod,

    Thank you for contacting DevZone at NordicSemi.

    Any way to totally bypass all these and write the uart and all peripherals in the traditional way

    Yes, you can use NRFX drivers if you would like to use.

    Good to know that your issue is resolved.

    Normally, using Zephyr based development environment, we have to make sure that the device is present in the DTS and it is enabled and properly configured. This part is done using the overlays. We also have to enable the drivers, libraries and related configurations using the Kconfig options in the prj.conf. Next, we need to include libraries to use the functionality in the main code.

    BR,

    Naeem

Reply
  • Hi Vinod,

    Thank you for contacting DevZone at NordicSemi.

    Any way to totally bypass all these and write the uart and all peripherals in the traditional way

    Yes, you can use NRFX drivers if you would like to use.

    Good to know that your issue is resolved.

    Normally, using Zephyr based development environment, we have to make sure that the device is present in the DTS and it is enabled and properly configured. This part is done using the overlays. We also have to enable the drivers, libraries and related configurations using the Kconfig options in the prj.conf. Next, we need to include libraries to use the functionality in the main code.

    BR,

    Naeem

Children
Related