I’m using BSP 32.2.1 on Nano and I am trying to use GPIO7/LCD_BL_PWM_PV0 which is also capable of working as PWM0 based on the Nano_Module_Pinmux_Config template/datasheet provided by NVIDIA.
I started by establishing that I could use GPIO14/PE7 (attached to the FAN) which has a dual functionality as PMW3 as described in the Nano_Module_Pinmux_Config template i.e toggle its value between 0 and 1 after exporting it as a GPIO pin using through its sysfs number. In this case the sysfs number was calculated to be 39. I was successful in using the pin as a GPIO to start the fan and I measured the output voltage of the pin and it was 5v.
I unexported the GPIO14 pin and set it up as a PWM, and then used the /usr/bin/jetson_clocks command to start the fan at its default target_pwm value of 255, and I was also successful. I measured the signal output on the Oscilloscope. It showed up on the oscilloscope as a PWM signal for a couple of seconds and its duty_cycle rose really fast till it hit a 100% and no longer showed up as a PWM signal, but now as a constant pulse at 5v. To prove it was PWM pulse, I fiddled with the /sys/devices/pwm-fan/target_pwm value and made it a fraction of the default value of 255, like 70, 80 and 155 and the signal showed up on the Oscilloscope as a PWM signal with a corresponding duty cycle value that was less than 100% but equal to the (target_pwm/255)%.
The steps taken above showed me that the pin worked as a GPIO and PWM if the setup is done properly. Therefore, I decided to replicate this for another pin with a dual GPIO and PWM functionality.
This pin is GPIO7/PWM0/LCD_BL_PWM_PV0. Unfortunately, I was only able to use the pin as a GPIO pin as I could toggle it ON and OFF and view the signal and its value on both a multimeter and an Oscilloscope and it was 0 for OFF and 3.3v for ON. After unexporting the pin and setting it up as a PWM signal (i.e exporting the PWM pin; setting its period, setting its duty_cycle and then enabling it), there was no signal output change on the Oscilloscope. The output stayed at the origin on the Oscilloscope, which indicates the pin failed to produce and output signal. I was wondering where I could make a change to the configuration setup, such that I can make the pin work as a PWM and possibly replicate my findings with the fan.
As it currently stands, I changed the value of the GPIO7 in the table here → Linux_for_tegra/sources/u-boot/pinmux-config-p3450-porg.h file to match that the value of GPIO14 because GPIO14/FAN was setup as PWM3, but GPIO7 was setup as default. So the change I made was to mux, pull and tri values on the table to match their equivalent GPIO14 values. Then I built u-boot and copied the u-boot.bin file to Linux_for_Tegra/bootloader/t210ref/p3450-porg/ directory, but it didn’t make a difference.
Then I also changed the dtsi here → Linux_for_Tegra/sources/hardware/nvidia/platform/t210/porg/kernel-dts/porg-platforms/tegra210-porg-pinmux-p3448-0000-a02-custom.dtsi with a similar intention as above, i.e. to match the values of GPIO7/LCD_BL_PWM_PV0 to GPIO14/PE7/FAN because GPIO14/PE7/FAN was setup as pwm3, but the GPIO7/LCD_BL_PWM_PV0 was set as rsvd. I changed rsvd to PWM0, then built the kernel, but it made no difference
Is anyone familiar with where I can make a change to the configuration setup in order for me to accomplish my goal of making GPIO7/LCD_BL_PWM_PV0 work as PWM0?