How can I overlay dts

I'm alter the overlay file to adapt my board.

In my board,I try to use pin 9,10 as uart_tx and uart_rx,without cts and rts.

I wirte it in my app.overlay as follow:

/*
 * Copyright (c) 2023 Nordic Semiconductor ASA
 *
 * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
 */

 &pinctrl {
	uart1_default: uart1_default {
		group1 {
			psels = <NRF_PSEL(UART_TX, 0, 9)>,
				<NRF_PSEL(UART_RX, 0, 10)>;
		};
	};
	uart1_sleep: uart1_sleep {
		group1 {
			psels = <NRF_PSEL(UART_TX, 0, 9)>,
				<NRF_PSEL(UART_RX, 0, 10)>;
			low-power-enable;
		};
	};
};

/ {
	/* The timer instance to use. */
	chosen {
		ncs,dm-timer = &timer2;
	};

	/* The selected pins will be used by Distance Measurement module for debug purposes. */
	dm_gpio {
		compatible = "gpio-leds";
		dm_ranging: dm-ranging {
			gpios = <&gpio0 27 GPIO_ACTIVE_LOW>;
			label = "DM Ranging Pin";
		};
		dm_add_request: dm-add-request {
			gpios = <&gpio0 26 GPIO_ACTIVE_LOW>;
			label = "DM Add request Pin";
		};
	};
	leds {
		led1:led_1 {
			gpios = < &gpio0 22 GPIO_ACTIVE_LOW>;
			label = "Red LED 1";
		};
	};
	uart_self:&uart0{
		status = "okay";
		compatible = "nordic,nrf-uarte";
		current-speed = <9600>;
		pinctrl-0 = <&uart1_default>;
		pinctrl-1 = <&uart1_sleep>;
		pinctrl-names = "default", "sleep";
	};
};

The build error output as that:

devicetree error: c:/ncs_project_library/dm_test/app.overlay:47 (column 12): parse error: expected node or property name
-- In: C:/ncs_project_library/dm_test/build/zephyr, command: C:/ncs/toolchains/cf2149caf2/opt/bin/python.exe;C:/ncs/zephyr/scripts/dts/gen_defines.py;--dts;C:/ncs_project_library/dm_test/build/zephyr/zephyr.dts.pre;--dtc-flags;'-Wno-unique_unit_address_if_enabled';--bindings-dirs;C:/ncs/nrf/dts/bindings;C:/ncs/zephyr/dts/bindings;--header-out;C:/ncs_project_library/dm_test/build/zephyr/include/generated/devicetree_generated.h.new;--dts-out;C:/ncs_project_library/dm_test/build/zephyr/zephyr.dts.new;--edt-pickle-out;C:/ncs_project_library/dm_test/build/zephyr/edt.pickle;--vendor-prefixes;C:/ncs/nrf/dts/bindings/vendor-prefixes.txt;--vendor-prefixes;C:/ncs/zephyr/dts/bindings/vendor-prefixes.txt
CMake Error at C:/ncs/zephyr/cmake/modules/dts.cmake:268 (message):
  gen_defines.py failed with return code: 1
Call Stack (most recent call first):
  C:/ncs/zephyr/cmake/modules/zephyr_default.cmake:129 (include)
  C:/ncs/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:66 (include)
  C:/ncs/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:92 (include_boilerplate)
  CMakeLists.txt:8 (find_package)

It seem like device tree problem.

How should I write in overlay file?

Parents Reply Children
No Data
Related