Nano pwm0 cant work

Hi,
I want use lcd_bl_pwm0 to work, but can’t get pwm output on nano Module P3450 header pin32 under l4t 32.3.1.
had done steps:

  1. delete input config for the pin in gpio dtsi.
  2. config pin to pwm0 in pinmux dtsi.
  3. work with sysfs
  4. measure pin with scope.
    But no pwm signal got just stay at 0.
    Anyone could give some advices ?

hello libsong,

you’ll also need to flash the board to update the pinmux configuration,
please also check similar discussion thread, Topic 115427 for reference.
thanks

Hi
@JerryChang I didn’t use the sdk manager using cmdline to do.
found three dtb as beflow:
图片
which one I need to replace with new configed pwm0 dtb?

When did the test above, I use the way by FDT… in extlinux.conf.


Is this way right?

hello libsong,

you’ll found different generated time if you’re checking file details; please use the one under $OUT/kernel/dtb/

BTW,
could you please use flash script to perform partition update instead of using FDT entry to load device tree.
i.e. $ sudo ./flash.sh -r -k DTB jetson-nano-emmc mmcblk0p1

Hi
@JerryChang tks for your response.

Hi
@JerryChang
Still can’t get pwm.

hello libsong,

if you recompile the device tree, you should update the one under $OUT/kernel/dtb/,
and please running flash scripts to have partition update.
i.e. $ sudo ./flash.sh -r -k DTB jetson-nano-emmc mmcblk0p1

you may check PWM status as below,
$ sudo cat /sys/kernel/debug/pwm

please note that, you can only access pwmchip0 (@7000a000); pwmchip4(@70110000) is not expected to be used by user.
you may use pwm@pwmchip0 by exporting them.
i.e. echo '<0/1/2/3>' > /sys/class/pwm/pwmchip0/export
thanks

@JerryChang
before work on sysfs, what saw as below:
图片
图片

after sysfs:
图片

still NO pwm…

Anything wrong?

@JerryChang
do we need enable pwm at somewhere?

Anyone can help ?

Hi libsong,
When you have enabled Pin 32 as PWM, you must see bit 0 of register 0x700031fc to be set.
You can use busybox devmem tool to read any register.
Then run following sysfs nodes:
echo 0 > /sys/class/pwm/pwmchip0/export
echo 1 > /sys/class/pwm/pwmchip0/pwm0/enable
This will enable the PWM controller. PWM controller register address is 0x7000a000 so after enabling it, you can see Bit 31 to be set.
Please try above and let me know if PWM is still not working.

Thanks,
Shubhi

@shgarg
Hi, thanks for ur reply.
I had make it work by busybox devmem.

A doubt, why need do with devmem?

Hi,
devmem tool is to read/write register.
You can enable PWM via pinmuxing or via jetson-io tool also.
There must be something wrong with the steps when you tried to enable PWM using pinmux dtsi.
So, for confirmation, I suggested to use devmem to see if your changes reflected after kernel boot.

Thanks,
Shubhi