硬件:jetson orin nx 8GB开发套件;自定义载板
软件:Jetson35.3.1
我们的自定义载板使用了LT6911C将HDMI转为MIPI DSI信号输出到显示屏幕,客户使用了GPIO7端口作为背光引脚进行调光。做了以下测试:
- GPIO7配置为普通GPIO,Drive 1输出高电平。
现象:屏幕正常点亮、正常输出画面。
- GPIO7配置为GP_PWM7。
设备树配置:
sources/hardware/nvidia/platform/t23x/p3768/kernel-dts/cvb/tegra234-p3509-a02.dtsi加了以下内容
pwm@32e0000 {/* PWM7 ENABLE */
status = "okay";
};
backlight: backlight {
compatible = "pwm-backlight";
pwms = <&tegra_pwm7 0 50000>;
brightness-levels = <0 4 8 16 32 64 128 255>;
default-brightness-level = <6>;
status = "okay";
};
现象:屏幕不亮。
查询项目中的其他代码发现backlight似乎是要绑定到一个显示节点。但是由于这个是HDMI输出,并且tegra234显示节点似乎是使用dcbtool配置,应该怎么进行下一步调试呢?
We don’t have any dedicated driver to support backlight. Please try any kind of driver that would manually control it.
感谢回复,我又进行了以下尝试:
1.修改Pinmux
| SODIMM Pin |
Jetson SODIMM Signal Name |
Jetson Orin NX and Nano Function |
Verilog Ball Name |
Customer Usage |
Pin Direction |
Req. Initial State |
| 206 |
GPIO07 |
GPIO07 (PWM) |
SOC_GPIO19 |
GP_PWM7 |
Output |
Drive 0 |
| 2.在sources/hardware/nvidia/platform/t23x/p3768/kernel-dts/cvb/tegra234-p3509-a02.dtsi加入代码: |
|
|
|
|
|
|
pwm@32e0000 {/* PWM7 ENABLE */
status = "okay";
};
leds {
compatible = "gpio-leds";
// 定义一个使用PWM控制的LED
my_pwm_led: my-pwm-led {
compatible = "pwm-leds";
label = "pwm7:backlight";
pwms = <&tegra_pwm7 0 50000>;
max-brightness = <128>;
linux,default-trigger = "default-on";
};
};
3.按照以上内容编译、覆盖原有dts,烧录。显示屏仍然不亮。
我的想法是给GPIO7一个初始的PWM设置,请问这样怎么实现呢?
sudo cat /sys/kernel/debug/pwm
Do you see the status of the pwm you want to use in above node?
是的,我看到要控制的pwm在输出信息中
32e0000.pwm即我要控制的pwm,但是在
ls /sys/class/leds/
命令中我只看到了mmcl::
没有看到我自定义的led。如何实现开机就给PWM7一个默认的配置呢?
之前使用backlight设备也测试过,仍然是未启动状态。
下图是使用backlight设备配置的结果:
刚刚配置成pwm-fan,使用万用表测量GPIO7的电压,仍然是0V。
我在想使能PWM7是不是有额外的步骤,我目前做的工作如下:
- 修改GPIO7的Pinmux使能
|SODIMM Pin|Jetson SODIMM Signal Name|Jetson Orin NX and Nano Function|Verilog Ball Name|Customer Usage|Pin Direction|Req. Initial State|
|—|—|—|—|—|—|—|
|206|GPIO07|GPIO07 (PWM)|SOC_GPIO19|GP_PWM7|Output|Drive 0|
2.加入设备树代码:
pwm7-fan {
compatible = "pwm-fan";
status = "okay";
pwms = <&tegra_pwm7 0 50000>;
#cooling-cells = <2>;
cooling-levels = <128 135 178 200 255 255 255 255 255 255>;
};
pwm@32e0000 {/* PWM7 ENABLE */
status = "okay";
};
查询TRM得到PWM7控制器的地址为0x032e0000
其中pwm@32e0000是我手动加入的节点,原烧写文件并没有。
但我在tegra234-soc-pwm.dtsi找到了以下定义:
tegra_pwm7: pwm@32e0000 {
compatible = "nvidia,tegra194-pwm";
reg = <0x0 0x32e0000 0x0 0x10000>;
nvidia,hw-instance-id = <0x6>;
clocks = <&bpmp_clks TEGRA234_CLK_PWM7>;
clock-names = "pwm";
#pwm-cells = <2>;
resets = <&bpmp_resets TEGRA234_RESET_PWM7>;
reset-names = "pwm";
status = "disabled";
};
按照这种方式配置PWM1是有效的,但是PWM7却不行。是不是我漏掉了某些步骤?
你能先確認一下自己的flash log裡面到底那一份pinmux dtsi被燒進去機器嗎?
然後對應的那一份pinmux dtsi在pwm7這個pin上真的是你預期的設定嗎?
感谢您的拨冗回复。
配置文件中的片段:
PINMUX_CONFIG="Orin-mipipwm-pinmux.dtsi";
PMC_CONFIG="Orin-mipipwm-padvoltage-default.dtsi";
bootloader/t186ref/BCT/Orin-mipipwm-gpio-default.dtsi(由于无法上传dtsi文件,只是改了扩展名,下同)
Orin-mipipwm-gpio-default.txt (3.5 KB)
bootloader/t186ref/BCT/Orin-mipipwm-padvoltage-default.dtsi
Orin-mipipwm-padvoltage-default.txt (2.4 KB)
bootloader/t186ref/BCT/Orin-mipipwm-pinmux.dtsi
Orin-mipipwm-pinmux.txt (65.8 KB)
以上使用的是Pinmux表格生成的,应该没有问题。
flash日志:
flash_1-1_0_20250708-023814.log (40.4 KB)
下图是我查询手册看到的,上面提到OrinNX只有4个PWM通道,会不会是PWM7配置错误?或许不是PWM7而是PWM3或者PWM2?因为原有的pwm设备树没有pwm@32e0000节点,这个节点是我新加入的。
It is PWM7. We have a table here to clarify.
- Device: Orin NX 8G + Orin Nano devkit(p3768)
PIN15: pwm1, 3280000.pwm
PIN33: pwm5, 32c0000.pwm
PIN32: pwm7, 32e0000.pwm
Please follow this to test if you could see signal out from PWM7.
This example is for PWM5. And you could change it for PWM7.
我已经按照这篇说明进行操作
- 使能pwm7
sudo /opt/nvidia/jetson-io/jetson-io.py
这里看到[ * ]pwm7已使能
-
编辑simple_pwm.py
32对应PWM7,只修改了这一处,保存。
-
运行sudo python simple_pwm.py
程序一直输出这样的信息:
[ 1341.842657] CPU:0, Error: cbb-fabric@0x13a00000, irq=25
[ 1341.848037] **************************************
[ 1341.852955] CPU:0, Error:cbb-fabric, Errmon:2
[ 1341.857431] Error Code : FIREWALL_ERR
[ 1341.861563]
[ 1341.863091] Error Code : FIREWALL_ERR
[ 1341.867209] MASTER_ID : CCPLEX
[ 1341.870699] Address : 0x32e0000
[ 1341.874286] Cache : 0x1 -- Bufferable
[ 1341.878574] Protection : 0x2 -- Unprivileged, Non-Secure, Data Access
[ 1341.885539] Access_Type : Write
[ 1341.889127] Access_ID : 0x3
[ 1341.889129] Fabric : cbb-fabric
[ 1341.895936] Slave_Id : 0x35
[ 1341.899159] Burst_length : 0x0
[ 1341.902648] Burst_type : 0x1
[ 1341.905961] Beat_size : 0x2
[ 1341.909183] VQC : 0x0
[ 1341.911962] GRPSEC : 0x7e
[ 1341.915010] FALCONSEC : 0x0
[ 1341.918230] **************************************
[ 1341.923267] WARNING: CPU: 0 PID: 0 at drivers/soc/tegra/cbb/tegra234-cbb.c:577 tegra234_cbb_isr+0x130/0 x170
[ 1341.933489] ---[ end trace ba8df1d649fc7aaa ]---
PWM running. Press CTRL+C to exit.
[ 1341.938813] CPU:0, Error: cbb-fabric@0x13a00000, irq=25
[ 1341.944184] **************************************
[ 1341.949100] CPU:0, Error:cbb-fabric, Errmon:2
[ 1341.953578] Error Code : FIREWALL_ERR
[ 1341.957696] Overflow : Multiple FIREWALL_ERR
[ 1341.962442]
[ 1341.963970] Error Code : FIREWALL_ERR
[ 1341.968082] MASTER_ID : CCPLEX
[ 1341.971571] Address : 0x32e0000
[ 1341.975153] Cache : 0x1 -- Bufferable
[ 1341.979444] Protection : 0x2 -- Unprivileged, Non-Secure, Data Access
[ 1341.986412] Access_Type : Read
[ 1341.989903] Access_ID : 0x13
[ 1341.989905] Fabric : cbb-fabric
[ 1341.996806] Slave_Id : 0x35
[ 1342.000028] Burst_length : 0x0
[ 1342.003518] Burst_type : 0x1
[ 1342.006831] Beat_size : 0x2
[ 1342.010052] VQC : 0x0
[ 1342.012834] GRPSEC : 0x7e
[ 1342.015886] FALCONSEC : 0x0
[ 1342.019107] **************************************
[ 1342.024137] WARNING: CPU: 0 PID: 789 at drivers/soc/tegra/cbb/tegra234-cbb.c:577 tegra234_cbb_isr+0x130 /0x170
[ 1342.034497] ---[ end trace ba8df1d649fc7aab ]---
[ 1342.190567] CPU:0, Error: cbb-fabric@0x13a00000, irq=25
[ 1342.195938] **************************************
[ 1342.200866] CPU:0, Error:cbb-fabric, Errmon:2
[ 1342.205349] Error Code : FIREWALL_ERR
[ 1342.209482]
[ 1342.211012] Error Code : FIREWALL_ERR
[ 1342.215140] MASTER_ID : CCPLEX
[ 1342.218637] Address : 0x32e0000
[ 1342.222227] Cache : 0x1 -- Bufferable
[ 1342.226528] Protection : 0x2 -- Unprivileged, Non-Secure, Data Access
[ 1342.233508] Access_Type : Write
[ 1342.237091] Access_ID : 0x0
[ 1342.237093] Fabric : cbb-fabric
[ 1342.243894] Slave_Id : 0x35
[ 1342.247116] Burst_length : 0x0
[ 1342.250609] Burst_type : 0x1
[ 1342.253924] Beat_size : 0x2
[ 1342.257142] VQC : 0x0
[ 1342.259920] GRPSEC : 0x7e
[ 1342.262967] FALCONSEC : 0x0
[ 1342.266186] **************************************
[ 1342.271222] WARNING: CPU: 0 PID: 5429 at drivers/soc/tegra/cbb/tegra234-cbb.c:577 tegra234_cbb_isr+0x13 0/0x170
[ 1342.281690] ---[ end trace ba8df1d649fc7aac ]---
[ 1342.537877] CPU:0, Error: cbb-fabric@0x13a00000, irq=25
[ 1342.543245] **************************************
[ 1342.548174] CPU:0, Error:cbb-fabric, Errmon:2
[ 1342.552657] Error Code : FIREWALL_ERR
[ 1342.556790]
[ 1342.558318] Error Code : FIREWALL_ERR
[ 1342.562445] MASTER_ID : CCPLEX
[ 1342.565940] Address : 0x32e0000
[ 1342.569532] Cache : 0x1 -- Bufferable
[ 1342.573833] Protection : 0x2 -- Unprivileged, Non-Secure, Data Access
[ 1342.580817] Access_Type : Write
[ 1342.584399] Access_ID : 0x0
[ 1342.584400] Fabric : cbb-fabric
[ 1342.591202] Slave_Id : 0x35
[ 1342.594423] Burst_length : 0x0
[ 1342.597914] Burst_type : 0x1
[ 1342.601229] Beat_size : 0x2
[ 1342.604450] VQC : 0x0
[ 1342.607226] GRPSEC : 0x7e
[ 1342.610273] FALCONSEC : 0x0
[ 1342.613500] **************************************
[ 1342.618530] WARNING: CPU: 0 PID: 5429 at drivers/soc/tegra/cbb/tegra234-cbb.c:577 tegra234_cbb_isr+0x13 0/0x170
[ 1342.628992] ---[ end trace ba8df1d649fc7aad ]---
[ 1342.885746] CPU:0, Error: cbb-fabric@0x13a00000, irq=25
[ 1342.891127] **************************************
[ 1342.896050] CPU:0, Error:cbb-fabric, Errmon:2
[ 1342.900528] Error Code : FIREWALL_ERR
[ 1342.904653]
[ 1342.906183] Error Code : FIREWALL_ERR
[ 1342.910302] MASTER_ID : CCPLEX
[ 1342.913787] Address : 0x32e0000
[ 1342.917377] Cache : 0x1 -- Bufferable
[ 1342.921671] Protection : 0x2 -- Unprivileged, Non-Secure, Data Access
[ 1342.928648] Access_Type : Write
[ 1342.932232] Access_ID : 0x0
[ 1342.932235] Fabric : cbb-fabric
[ 1342.939032] Slave_Id : 0x35
[ 1342.942253] Burst_length : 0x0
[ 1342.945744] Burst_type : 0x1
[ 1342.949057] Beat_size : 0x2
[ 1342.952275] VQC : 0x0
[ 1342.955052] GRPSEC : 0x7e
[ 1342.958097] FALCONSEC : 0x0
[ 1342.961317] **************************************
[ 1342.966351] WARNING: CPU: 0 PID: 5429 at drivers/soc/tegra/cbb/tegra234-cbb.c:577 tegra234_cbb_isr+0x13 0/0x170
[ 1342.976893] ---[ end trace ba8df1d649fc7aae ]---
^C[ 1343.153116] CPU:0, Error: cbb-fabric@0x13a00000, irq=25
[ 1343.158491] **************************************
[ 1343.163420] CPU:0, Error:cbb-fabric, Errmon:2
[ 1343.167902] Error Code : FIREWALL_ERR
[ 1343.172030] Overflow : Multiple FIREWALL_ERR
[ 1343.176781]
[ 1343.178311] Error Code : FIREWALL_ERR
[ 1343.182438] MASTER_ID : CCPLEX
[ 1343.185935] Address : 0x32e0000
[ 1343.189526] Cache : 0x1 -- Bufferable
[ 1343.193828] Protection : 0x2 -- Unprivileged, Non-Secure, Data Access
[ 1343.200804] Access_Type : Read
[ 1343.204288] Access_ID : 0x12
[ 1343.204290] Fabric : cbb-fabric
[ 1343.211190] Slave_Id : 0x35
[ 1343.214415] Burst_length : 0x0
[ 1343.217906] Burst_type : 0x1
[ 1343.221219] Beat_size : 0x2
[ 1343.224440] VQC : 0x0
[ 1343.227216] GRPSEC : 0x7e
[ 1343.230266] FALCONSEC : 0x0
[ 1343.233492] **************************************
[ 1343.238519] WARNING: CPU: 0 PID: 0 at drivers/soc/tegra/cbb/tegra234-cbb.c:577 tegra234_cbb_isr+0x130/0
这似乎不正常。
Hi,
I just notice the jetpack version you are using seems a little old.
Please refer to below topic or upgrade the BSP version.