1.打开diff文件,找到diff文件需要放置的文件目录
例如:diff文件需要和boards文件在一个文件夹目录下面
E:\aw32001\NordicNCS\v1.5.1-dev\zephyr\boards\arm\nrf5340dk_nrf5340
2.
然后在diff文件所在的目录下面打开git bash
执行
patch -p1 < board_dts.diff
board_dts.diff 是diff文件
board_dts.diff原始文件的内容:
diff --git a/boards/arm/nrf5340dk_nrf5340/nrf5340_cpuapp_common.dts b/boards/arm/nrf5340dk_nrf5340/nrf5340_cpuapp_common.dts
index c6d78c05bb..e3a6f889b0 100644
--- a/boards/arm/nrf5340dk_nrf5340/nrf5340_cpuapp_common.dts
+++ b/boards/arm/nrf5340dk_nrf5340/nrf5340_cpuapp_common.dts
@@ -93,8 +93,8 @@
&uart0 {
status = "okay";
current-speed = <115200>;
- tx-pin = <20>;
- rx-pin = <22>;
+ tx-pin = <33>;
+ rx-pin = <34>;
rts-pin = <19>;
cts-pin = <21>;
};
diff --git a/boards/arm/nrf5340dk_nrf5340/nrf5340dk_nrf5340_cpunet.dts b/boards/arm/nrf5340dk_nrf5340/nrf5340dk_nrf5340_cpunet.dts
index 64a87a7331..c6ab673fe2 100644
--- a/boards/arm/nrf5340dk_nrf5340/nrf5340dk_nrf5340_cpunet.dts
+++ b/boards/arm/nrf5340dk_nrf5340/nrf5340dk_nrf5340_cpunet.dts
@@ -90,8 +90,8 @@
&uart0 {
status = "okay";
current-speed = <115200>;
- tx-pin = <33>;
- rx-pin = <32>;
+ tx-pin = <20>;
+ rx-pin = <22>;
rts-pin = <11>;
cts-pin = <10>;
};
执行完patch指令后的结果: