开发环境:
开发平台: PC 虚拟机上Ubuntu20.04
开发平台使用工具: JetPack 5.1.1 Jetson35.3.1
开发板:orin nano4GB套件
请问我如何在UEFI阶段的时候,让扩展管脚PWM5(33) 输出来控制LED灯。
开发环境:
开发平台: PC 虚拟机上Ubuntu20.04
开发平台使用工具: JetPack 5.1.1 Jetson35.3.1
开发板:orin nano4GB套件
请问我如何在UEFI阶段的时候,让扩展管脚PWM5(33) 输出来控制LED灯。
*** Please note that this reply is generated by LLM automatically ***
Based on the provided context, I will provide a comprehensive answer to the question.
The question seems to be asking about the compatibility of Jetson Orin Nano with PC Ubuntu 20.04, JetPack 5.1.1, and Jetson 3.5.31, as well as the functionality of UEFI, PWM, and LED on the Orin Nano 4GB module.
Compatibility:
UEFI, PWM, and LED:
Orin Nano 4GB module:
jetson-orin-nano-devkit / jetson-orin-nano-devkit-super”).In summary, the Jetson Orin Nano is compatible with PC Ubuntu 20.04, JetPack 5.1.1, and Jetson 3.5.31. The Orin Nano 4GB module is a production module that is compatible with the Jetson Orin Nano reference carrier board. UEFI is used on Jetson modules, including the Orin Nano, and PWM might be used to control the LED brightness. The LED is part of the Jetson Orin Nano Developer Kit.
*** Please give the thumbs up if you get answers you like. Or provide feedback to help us improve the answer. ***
你的回答无法解决我的问题。
有人在吗?可以帮帮我?
Hi 56101855,
We would suggest using standalone Ubuntu host PC to develop L4T instead of using VM .
You have to refer to Build with docker · NVIDIA/edk2-nvidia Wiki · GitHub to customize and build UEFI binary for your use case.
Please also refer to the following thread for the similar requirement as yours.
Set Fan PWM Value on Bootloder - #8 by KevinFFF
我的操作步骤:
1.编译./edk2-nvidia/Platform/NVIDIA/Jetson/build.sh
2.cp ./images/uefi_Jetson_RELEASE.bin /home/ys/nvidia/35.3/Linux_for_Tegra/bootloader/uefi_jetson.bin
3.重启。
请问这个对应的是那个PWM?如果我更换其他的PWM我需要如何修改?
很奇怪,我修改UEFI源码,将TegraPwmDxe.c添加了debug信息,开机时debug并没有输出。
[com COM13] (2025-10-15_110618) COM13 (USB-SERIAL CH340 (COM13)).log (138.6 KB)
Could you use DEBUG_ERROR instead of DEBUG_INFO to print the log?
How did you clone the UEFI source? Could you share the command you run?
Please use uefi_Jetson_DEBUG.bin instead of uefi_Jetson_RELEASE.bin to print more debug messages.
PWM is specified in the device tree and fdt_* function will load it.
1.我已经将TegraPwmDxe.c 中添加的DEBUG改成 DEBUG_ERROR。
2.我的UEFI源码拉取指令:edk2_docker edkrepo clone nvidia-uefi NVIDIA-Platforms uefi-202307.0
3.UEFI源码中fdt_*:
ys@ubuntu:~/nvidia/uefi/nvidia-uefi [r35.3.1-updates]$ find -name fdt_*
./edk2/EmbeddedPkg/Library/FdtLib/fdt_empty_tree.c
./edk2/EmbeddedPkg/Library/FdtLib/fdt_ro.c
./edk2/EmbeddedPkg/Library/FdtLib/fdt_addresses.c
./edk2/EmbeddedPkg/Library/FdtLib/fdt_sw.c
./edk2/EmbeddedPkg/Library/FdtLib/fdt_rw.c
./edk2/EmbeddedPkg/Library/FdtLib/fdt_wip.c
./edk2/EmbeddedPkg/Library/FdtLib/fdt_strerror.c
./edk2/EmbeddedPkg/Library/FdtLib/fdt_strtoul.c
./edk2/EmbeddedPkg/Library/FdtLib/fdt_overlay.c
./Build/Jetson/RELEASE_GCC5/AARCH64/EmbeddedPkg/Library/FdtLib/FdtLib/OUTPUT/fdt_strerror.obj
./Build/Jetson/RELEASE_GCC5/AARCH64/EmbeddedPkg/Library/FdtLib/FdtLib/OUTPUT/fdt_empty_tree.obj
./Build/Jetson/RELEASE_GCC5/AARCH64/EmbeddedPkg/Library/FdtLib/FdtLib/OUTPUT/fdt_overlay.obj
./Build/Jetson/RELEASE_GCC5/AARCH64/EmbeddedPkg/Library/FdtLib/FdtLib/OUTPUT/fdt_sw.obj
./Build/Jetson/RELEASE_GCC5/AARCH64/EmbeddedPkg/Library/FdtLib/FdtLib/OUTPUT/fdt_ro.obj
./Build/Jetson/RELEASE_GCC5/AARCH64/EmbeddedPkg/Library/FdtLib/FdtLib/OUTPUT/fdt_strtoul.obj
./Build/Jetson/RELEASE_GCC5/AARCH64/EmbeddedPkg/Library/FdtLib/FdtLib/OUTPUT/fdt_rw.obj
./Build/Jetson/RELEASE_GCC5/AARCH64/EmbeddedPkg/Library/FdtLib/FdtLib/OUTPUT/fdt_wip.obj
./Build/Jetson/RELEASE_GCC5/AARCH64/EmbeddedPkg/Library/FdtLib/FdtLib/OUTPUT/fdt_addresses.obj
./Build/Jetson/DEBUG_GCC5/AARCH64/EmbeddedPkg/Library/FdtLib/FdtLib/OUTPUT/fdt_strerror.obj
./Build/Jetson/DEBUG_GCC5/AARCH64/EmbeddedPkg/Library/FdtLib/FdtLib/OUTPUT/fdt_empty_tree.obj
./Build/Jetson/DEBUG_GCC5/AARCH64/EmbeddedPkg/Library/FdtLib/FdtLib/OUTPUT/fdt_overlay.obj
./Build/Jetson/DEBUG_GCC5/AARCH64/EmbeddedPkg/Library/FdtLib/FdtLib/OUTPUT/fdt_sw.obj
./Build/Jetson/DEBUG_GCC5/AARCH64/EmbeddedPkg/Library/FdtLib/FdtLib/OUTPUT/fdt_ro.obj
./Build/Jetson/DEBUG_GCC5/AARCH64/EmbeddedPkg/Library/FdtLib/FdtLib/OUTPUT/fdt_strtoul.obj
./Build/Jetson/DEBUG_GCC5/AARCH64/EmbeddedPkg/Library/FdtLib/FdtLib/OUTPUT/fdt_rw.obj
./Build/Jetson/DEBUG_GCC5/AARCH64/EmbeddedPkg/Library/FdtLib/FdtLib/OUTPUT/fdt_wip.obj
./Build/Jetson/DEBUG_GCC5/AARCH64/EmbeddedPkg/Library/FdtLib/FdtLib/OUTPUT/fdt_addresses.obj
ys@ubuntu:~/nvidia/uefi/nvidia-uefi [r35.3.1-updates]$
4.debug信息:
[com COM13] (2025-10-15_100205) COM13 (USB-SERIAL CH340 (COM13)).log (171.5 KB)
您好,能帮我看一下吗?
You just need to check the fdt related functions called in TegraPwmDxe.c.
I’m not clear about how did you customize the device tree and the debug messages in TegraPwmDxe.c.
Could you just refer to this TegraPwmDxe.c driver and the pwm-fan node in device tree to know how we enabled it? Then you can add another PWM for your use case for the LED.
This is kernel DTB used by the kernel, but bootloader would use the similar one as the kernel DTB.
Please update the device tree in BSP package(i.e. <Linux_For_Tegra>/kernel/dtb/tegra234-p3767-0004-p3768-0000-a0.dtb) and reflash the board to apply the change.
感谢您的回复!
我尝试重新拉取UEFI源码操作如下:
edkrepo clone nvidia-uefi NVIDIA-Platforms uefi-202307.0
./edk2-nvidia/Platform/NVIDIA/Jetson/build.sh
cp ./images/uefi_Jetson_DEBUG.bin /home/ys/nvidia/35.3/Linux_for_Tegra/bootloader/uefi_jetson.bin
ys@ubuntu:~/nvidia/35.3/Linux_for_Tegra (master)$ sudo ./flash.sh -k A_cpu-bootloader -c bootloader/t186ref/cfg/flash_t234_qspi.xml jetson-orin-nano-devkit nvme0n1p1
开机UEFI阶段没有任何显示,开机logo也没有显示,不知道为什么会这样。完全进入系统可以正常显示的我应用程序画面。
下面附件是我的开机debug信息。
[com COM13] (2025-10-17_153225) COM13 (USB-SERIAL CH340 (COM13)).log (128.7 KB)
Could you try using the following command to clone the source for r35.3.1 in your case?
$ edkrepo clone nvidia-uefi NVIDIA-Platforms r35.3.1
Please do not modify any source and just rebuild and update the uefi_Jetson_DEBUG.bin to your BSP(<Linux_for_Tegra>/uefi_jetson.bin).
感谢您的回复和帮助。
目前我重新拉取uefi源码,并且再pwm-fan驱动TegraPwmDxe.c添加打印信息成功打印了。
我尝试添加设备树和驱动,我添加的驱动和设备树并没有匹配和运行。我的操作如下:
1.在/home/ys/nvidia/edkrepo/nvidia-uefi-r35-3-1/edk2-nvidia/Silicon/NVIDIA/Drivers创建文件夹TegraPwm5Dxe存放驱动文件TegraPwm5Dxe.c和TegraPwm5Dxe.inf
TegraPwm5Dxe.c.txt (3.8 KB)
TegraPwm5Dxe.inf.txt (862 Bytes)
2.在Jeston.dsc.inc 中添加驱动设备
3.DeviceTree.inf 添加设备树文件
4./home/ys/nvidia/edkrepo/nvidia-uefi-r35-3-1/edk2-nvidia/Silicon/NVIDIA/Tegra/DeviceTree/Pwm5Configuration.dts
/dts-v1/;
/plugin/;/ {
overlay-name = “PWM5 Configuration”;fragment@0 { target-path = "/"; __overlay__ { /* 简单测试节点 */ test_pwm5 { compatible = "test-pwm5"; status = "okay"; }; }; };};
5.编译工程:./edk2-nvidia/Platform/NVIDIA/Jetson/build.sh
6.拷贝文件:cp ./images/uefi_Jetson_DEBUG.bin /home/ys/nvidia/35.3/Linux_for_Tegra/bootloader/uefi_jetson.bin
7.刷UEFI固件到orin nano开发板中:sudo ./flash.sh -k A_cpu-bootloader -c bootloader/t186ref/cfg/flash_t234_qspi.xml jetson-orin-nano-devkit nvme0n1p1运行debug信息中并没有我添加的驱动相关打印信息。
请问上述操作是否正确?我需要如何调整在UEFI中添加驱动及配置设备树?
I would suggest you add the device tree node in BSP package(i.e. <Linux_for_Tegra>/kernel/dtb/) before flash as the kernel and bootloader would use the same DTB configuration by default.
我也尝试自己修改内核设备树节点。
操作如下:
1./home/ys/nvidia/35.3/Linux_for_Tegra/source/public/hardware/nvidia/platform/t23x/p3768/kernel-dts/cvb目录下添加tegra234-p3768-pwm5-led.dtsi
2.在/home/ys/nvidia/35.3/Linux_for_Tegra/source/public/hardware/nvidia/platform/t23x/p3768/kernel-dts/cvb修改tegra234-p3768-0000-a0.dtsi文件
3.编译设备树。
4.~/nvidia/35.3/Linux_for_Tegra/source/public/hardware/nvidia/platform/t23x/p3768/kernel-dts的tegra234-p3767-0004-p3768-0000-a0.dts拷贝到orin nano上并替换/boot/dtb/kernel_tegra234-p3767-0004-p3768-0000-a0.dtb重启orin nano UEFI添加的驱动打印信息还是没有。
Could you run the following command after boot up and check if your configuration is included in extracted_proc.dts?
$ sudo dtc -I fs -O dts -o extracted_proc.dts /proc/device-tree