如何在进入系统前使PWM7输出

硬件:jetson orin nx 8GB开发套件;自定义载板
软件:Jetson36.4.4

我们设计了一个自定义载板,使用LT6911C实现HDMI转MIPI以适配MIPI显示屏,其中GPIO7驱动着屏幕背光。

为了显示开机LOGO,我们修改了UEFI并且在GPIO7为普通GPIO(GPIO3_PG.06)时Drive 1正常显示开机LOGO。

但是当配置为PWM(GP_PWM7)时 Drive 1背光引脚一直处于低电平,直到进入系统。

已做的工作:

  1. 修改pinmux,GPIO7配置为GP_PWM7 Drive 1。这一点已验证因为进入系统后可以正常调节PWM。
  2. 修改edk2-nvidia源码,我尝试修改TegraPwmDxe.c
/** @file

  TegraPwmDxe Controller Driver - MODIFIED FOR BACKLIGHT (Compiler Fix)

  SPDX-FileCopyrightText: Copyright (c) 2020-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.

  SPDX-License-Identifier: BSD-2-Clause-Patent

**/

#include <PiDxe.h>

#include <Library/BaseLib.h>
#include <Library/DebugLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/UefiLib.h>
#include <Library/IoLib.h>
#include <Library/DeviceDiscoveryDriverLib.h>
#include <Library/MemoryAllocationLib.h>
// ############# 关键修正: 重新包含 libfdt.h #############
#include <libfdt.h>

NVIDIA_COMPATIBILITY_MAPPING  gDeviceCompatibilityMap[] = {
  { "nvidia,tegra194-pwm", &gNVIDIANonDiscoverablePwmDeviceGuid },
  { NULL,                  NULL                                 }
};

NVIDIA_DEVICE_DISCOVERY_CONFIG  gDeviceDiscoverDriverConfig = {
  .DriverName                      = L"NVIDIA PWM driver (Backlight Final)",
  .AutoEnableClocks                = TRUE,
  .AutoResetModule                 = TRUE,
  .SkipEdkiiNondiscoverableInstall = FALSE
};

// --- 正确的寄存器值计算 (根据Orin TRM DP-10508-002_v1.2) ---
#define PWM_CLOCK_FREQ  19200000

// 目标频率: ~20kHz
// PFM = (19200000 / (256 * 20000)) - 1 = 2.75. 取整数 3.
#define PWM_BACKLIGHT_PFM  3

// 目标占空比: 100% (使用最大安全值 255/256)
#define PWM_BACKLIGHT_DUTY_VALUE 255

// 构造最终的寄存器值: [31] ENB=1, [23:16] PWM_0=255, [12:0] PFM_0=3
#define PWM_BACKLIGHT_CONFIG_VALUE  ((1UL << 31) | (PWM_BACKLIGHT_DUTY_VALUE << 16) | PWM_BACKLIGHT_PFM)

/**
  Callback that will be invoked at various phases of the driver initialization
**/
EFI_STATUS
DeviceDiscoveryNotify (
  IN  NVIDIA_DEVICE_DISCOVERY_PHASES          Phase,
  IN  EFI_HANDLE                              DriverHandle,
  IN  EFI_HANDLE                              ControllerHandle,
  IN  CONST NVIDIA_DEVICE_TREE_NODE_PROTOCOL  *DeviceTreeNode OPTIONAL
  )
{
  EFI_STATUS            Status;
  EFI_PHYSICAL_ADDRESS  BaseAddress;
  UINTN                 RegionSize;
  CONST CHAR8           *NodeName;

  switch (Phase) {
    case DeviceDiscoveryDriverBindingSupported:
      return EFI_SUCCESS;

    case DeviceDiscoveryDriverBindingStart:
      BaseAddress = 0;
      RegionSize  = 0;
      Status      = DeviceDiscoveryGetMmioRegion (ControllerHandle, 0, &BaseAddress, &RegionSize);
      if (EFI_ERROR (Status)) {
        DEBUG ((DEBUG_ERROR, "%a: Failed to get PWM region: %r\n", __FUNCTION__, Status));
        return Status;
      }

      NodeName = fdt_get_name(DeviceTreeNode->DeviceTreeBase, DeviceTreeNode->NodeOffset, NULL);

      // Orin NX上的PWM7基地址为 0x032e0000。我们通过地址来判断。
      if (BaseAddress == 0x032e0000) {
        DEBUG ((DEBUG_INFO, "Found Backlight PWM Controller (%a) at 0x%p. Applying settings.\n", NodeName, BaseAddress));
        
        // 写入我们根据TRM精确计算出的配置值
        MmioWrite32 (BaseAddress, PWM_BACKLIGHT_CONFIG_VALUE);

        DEBUG ((DEBUG_INFO, "Backlight PWM configured with value 0x%08X.\n", PWM_BACKLIGHT_CONFIG_VALUE));
        
      } else {
        DEBUG ((DEBUG_INFO, "Skipping non-backlight PWM controller (%a) at 0x%p.\n", NodeName, BaseAddress));
      }

      return EFI_SUCCESS;

    default:
      return EFI_SUCCESS;
  }
}

我尝试在其中获取PWM7控制器的寄存器,并且按照TRM修改。

现象:背光引脚一直处于低电平,直到进入系统(由于我修改的设备树,进入系统后PWM7会被驱动)
我的问题:
1.为什么PWM下 Drive 1仍然不能使GPIO7默认输出高电平,但是GPIO下Drive 1可以?
2.有什么办法可以在进入系统前(UEFI阶段或早于显示LOGO前)使GPIO7输出高电平或者输出一个默认的PWM波形以便正常展示LOGO?

期待您的回复。

*** Please note that this reply is generated by LLM automatically ***

The provided text appears to be a collection of technical terms, module names, and platform descriptions related to NVIDIA Jetson devices, specifically the Jetson Orin NX and Jetson Orin Nano series. To provide a comprehensive answer, I will break down the key points and compare the relevant information.

Overview of Jetson Orin NX and Jetson Orin Nano Series

The Jetson Orin NX and Jetson Orin Nano series are part of the NVIDIA Jetson platform, which is designed for artificial intelligence (AI) and computer vision applications. The Orin module is a component of these series, providing various functionalities such as PWM (Pulse Width Modulation) and Tachometer control for fan management.

Comparison of Jetson Orin NX and Jetson Orin Nano Series

Both series are designed for AI and computer vision applications, but they differ in their memory configurations:

  • Jetson Orin NX series: Available with 16GB or 8GB of memory (e.g., Jetson Orin NX 16GB, Jetson Orin NX 8GB)
  • Jetson Orin Nano series: Available with 8GB or 4GB of memory (e.g., Jetson Orin Nano 8GB, Jetson Orin Nano 4GB)

Pinmux and GPIO

The text mentions pinmux (pin multiplexing) and GPIO (General Purpose Input/Output) configurations for the Jetson Orin NX and Jetson Orin Nano series. Pinmux allows for multiple functions to be assigned to a single pin, while GPIO provides a way to control and interact with external devices.

UEFI and Boot Process

The text also mentions UEFI (Unified Extensible Firmware Interface) and the boot process for the Jetson Orin NX and Jetson Orin Nano series. UEFI is a firmware interface that provides a standardized way to boot and configure devices.

PWM and Drive Control

The text mentions PWM and drive control, specifically referencing PWM7 and Drive 1. PWM is used to control the speed of motors or fans, while drive control refers to the management of external devices such as motors or LEDs.

Documentation and Resources

The text mentions the Jetson Orin NX and Jetson Orin Nano Series Pinmux document, which provides information on the pinmux configurations for these series. Additionally, the text references the NVIDIA Tegra documentation and the edk2 (EFI Development Kit 2) repository, which provide resources for developing and customizing the boot process for NVIDIA Jetson devices.

In summary, the Jetson Orin NX and Jetson Orin Nano series are designed for AI and computer vision applications, with varying memory configurations and pinmux configurations. The text provides information on the boot process, PWM and drive control, and documentation resources for these series. If you have specific questions or need further clarification on any of these topics, please let me know.

*** Please give the thumbs up if you get answers you like. Or provide feedback to help us improve the answer. ***

Sorry, AI cannot really solve my problem from my point of view. I prefer a experienced engineer sending a reliable response. Thank you.

Hi 1091192337,

Is it the same issue as 自定义载板,HDMI转MIPI DSI信号,背光怎么调整 - Jetson & Embedded Systems / Jetson Orin NX - NVIDIA Developer Forums?

Do you want to control PWM before kernel loaded?
If so, you may need to write custom PWM driver in UEFI for your display.

Currently, we have only PWM driver for FAN and you can refer to it.
Please check the following topic in details.
Set Fan PWM Value on Bootloder - #8 by KevinFFF

Thanks you.

Yes, it is same issue as the previous topic I submitted.

But the focus of this article is on setting up PWM in the bootloader. In the previous article, we discussed enabling it in the kernel.

The article you mentioned

only covers the configuration for PWM_FAN.
I have also created a device tree on PWM7 as a pwm-fan like this :

		pwm7-fan {
			compatible = "pwm-fan";
			status = "okay";
			pwms = <&pwm7 0 50000>;
			#cooling-cells = <2>;
			cooling-levels = <255 255 255 255 255 255 255 255 255 255>;
		};

Original TegraPwmDxe.c

/** @file

  TegraPwmDxe Controller Driver

  SPDX-FileCopyrightText: Copyright (c) 2020-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.

  SPDX-License-Identifier: BSD-2-Clause-Patent

**/

#include <PiDxe.h>

#include <Library/BaseLib.h>
#include <Library/DebugLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/UefiLib.h>
#include <Library/IoLib.h>
#include <Library/DeviceDiscoveryDriverLib.h>
#include <Library/MemoryAllocationLib.h>
#include <libfdt.h>

NVIDIA_COMPATIBILITY_MAPPING  gDeviceCompatibilityMap[] = {
  { "nvidia,tegra194-pwm", &gNVIDIANonDiscoverablePwmDeviceGuid },
  { NULL,                  NULL                                 }
};

NVIDIA_DEVICE_DISCOVERY_CONFIG  gDeviceDiscoverDriverConfig = {
  .DriverName                      = L"NVIDIA PWM driver",
  .AutoEnableClocks                = TRUE,
  .AutoResetModule                 = TRUE,
  .SkipEdkiiNondiscoverableInstall = FALSE
};

#define PWM_FAN_HIGH    0x81000000
#define PWM_FAN_MED     0x80800000
#define PWM_CLOCK_FREQ  19200000

/**
  Callback that will be invoked at various phases of the driver initialization

  This function allows for modification of system behavior at various points in
  the driver binding process.

  @param[in] Phase                    Current phase of the driver initialization
  @param[in] DriverHandle             Handle of the driver.
  @param[in] ControllerHandle         Handle of the controller.
  @param[in] DeviceTreeNode           Pointer to the device tree node protocol is available.

  @retval EFI_SUCCESS              Operation successful.
  @retval EFI_SUCCESS              Driver does not handle this phase
  @retval others                   Error occurred

**/
EFI_STATUS
DeviceDiscoveryNotify (
  IN  NVIDIA_DEVICE_DISCOVERY_PHASES          Phase,
  IN  EFI_HANDLE                              DriverHandle,
  IN  EFI_HANDLE                              ControllerHandle,
  IN  CONST NVIDIA_DEVICE_TREE_NODE_PROTOCOL  *DeviceTreeNode OPTIONAL
  )
{
  EFI_STATUS            Status;
  EFI_PHYSICAL_ADDRESS  BaseAddress;
  UINTN                 RegionSize;
  UINT32                NodeHandle;
  INT32                 FanOffset;
  CONST UINT32          *FanPwm;
  INT32                 PwmLength;
  UINT32                FanPwmHandle;

  switch (Phase) {
    case DeviceDiscoveryDriverBindingSupported:
      BaseAddress = 0;
      RegionSize  = 0;
      Status      = DeviceDiscoveryGetMmioRegion (ControllerHandle, 0, &BaseAddress, &RegionSize);
      if (EFI_ERROR (Status)) {
        DEBUG ((DEBUG_ERROR, "%a: Unable to locate address range for Tegra PWM\n", __FUNCTION__));
        return EFI_UNSUPPORTED;
      }

      NodeHandle = fdt_get_phandle (DeviceTreeNode->DeviceTreeBase, DeviceTreeNode->NodeOffset);

      // Check that handle of PWM specified by pwm-fan node matches to only support fan pwm.
      FanOffset = fdt_node_offset_by_compatible (DeviceTreeNode->DeviceTreeBase, 0, "pwm-fan");
      if (FanOffset < 0) {
        return EFI_UNSUPPORTED;
      }

      FanPwm = fdt_getprop (DeviceTreeNode->DeviceTreeBase, FanOffset, "pwms", &PwmLength);
      if (FanPwm == NULL) {
        return EFI_UNSUPPORTED;
      }

      if (PwmLength < sizeof (UINT32)) {
        return EFI_UNSUPPORTED;
      }

      FanPwmHandle = SwapBytes32 (FanPwm[0]);

      if (NodeHandle == FanPwmHandle) {
        return EFI_SUCCESS;
      }

      return EFI_UNSUPPORTED;

    case DeviceDiscoveryDriverBindingStart:
      BaseAddress = 0;
      RegionSize  = 0;
      Status      = DeviceDiscoveryGetMmioRegion (ControllerHandle, 0, &BaseAddress, &RegionSize);
      if (EFI_ERROR (Status)) {
        DEBUG ((DEBUG_ERROR, "%a: Unable to locate address range for Tegra PWM\n", __FUNCTION__));
        return EFI_UNSUPPORTED;
      }

      DeviceDiscoverySetClockFreq (ControllerHandle, "pwm", PWM_CLOCK_FREQ);
      MmioWrite32 (BaseAddress, PWM_FAN_MED);

      return Status;

    default:
      return EFI_SUCCESS;
  }
}

How can I apply this configuration to my PWM7 or my pwm7-fan?

I would expect you have custom driver to handle the pwm for your display.

We’ve not verified to use existing PWM FAN driver for other purpose.

Could you use debug UEFI binary to provide the full serial console log and full device tree for further check?

Thank you, Kevin. I have modified my TegraPwmDxe.c file, and it seems to have worked.

/** @file

  TegraPwmDxe Controller Driver

  SPDX-FileCopyrightText: Copyright (c) 2020-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.

  SPDX-License-Identifier: BSD-2-Clause-Patent

**/

#include <PiDxe.h>

#include <Library/BaseLib.h>
#include <Library/DebugLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/UefiLib.h>
#include <Library/IoLib.h>
#include <Library/DeviceDiscoveryDriverLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/PrintLib.h>
#include <Library/SerialPortLib.h>
#include <libfdt.h>


NVIDIA_COMPATIBILITY_MAPPING  gDeviceCompatibilityMap[] = {
  { "nvidia,tegra194-pwm", &gNVIDIANonDiscoverablePwmDeviceGuid },
  { NULL,                  NULL                                 }
};

NVIDIA_DEVICE_DISCOVERY_CONFIG  gDeviceDiscoverDriverConfig = {
  .DriverName                      = L"NVIDIA PWM driver",
  .AutoEnableClocks                = TRUE,
  .AutoResetModule                 = TRUE,
  .SkipEdkiiNondiscoverableInstall = FALSE
};

#define PWM_FAN_HIGH    0x81000000
#define PWM_FAN_MED     0x80800000
#define PWM_CLOCK_FREQ  19200000

// Helper function to print to serial port for RELEASE builds
VOID
PwmSerialPrint (
  IN CHAR8  *Format,
  ...
  )
{
  CHAR8    Buffer[256];
  VA_LIST  Marker;
  UINTN    Length;

  VA_START (Marker, Format);
  Length = AsciiVSPrint (Buffer, sizeof (Buffer), Format, Marker);
  VA_END (Marker);
  
  SerialPortWrite ((UINT8 *)Buffer, Length);
}

/**
  Callback that will be invoked at various phases of the driver initialization

  This function allows for modification of system behavior at various points in
  the driver binding process.

  @param[in] Phase                    Current phase of the driver initialization
  @param[in] DriverHandle             Handle of the driver.
  @param[in] ControllerHandle         Handle of the controller.
  @param[in] DeviceTreeNode           Pointer to the device tree node protocol is available.

  @retval EFI_SUCCESS              Operation successful.
  @retval EFI_SUCCESS              Driver does not handle this phase
  @retval others                   Error occurred

**/
EFI_STATUS
DeviceDiscoveryNotify (
  IN  NVIDIA_DEVICE_DISCOVERY_PHASES          Phase,
  IN  EFI_HANDLE                              DriverHandle,
  IN  EFI_HANDLE                              ControllerHandle,
  IN  CONST NVIDIA_DEVICE_TREE_NODE_PROTOCOL  *DeviceTreeNode OPTIONAL
  )
{
  EFI_STATUS            Status;
  EFI_PHYSICAL_ADDRESS  BaseAddress;
  UINTN                 RegionSize;
  UINT32                NodeHandle;
  INT32                 FanOffset;
  CONST UINT32          *FanPwm;
  INT32                 PwmLength;
  UINT32                FanPwmHandle;

  switch (Phase) {
    case DeviceDiscoveryDriverBindingSupported:
      BaseAddress = 0;
      RegionSize  = 0;
      Status      = DeviceDiscoveryGetMmioRegion (ControllerHandle, 0, &BaseAddress, &RegionSize);
      if (EFI_ERROR (Status)) {
        PwmSerialPrint ("ERROR: Unable to locate address range for Tegra PWM\r\n");
        return EFI_UNSUPPORTED;
      }

      NodeHandle = fdt_get_phandle (DeviceTreeNode->DeviceTreeBase, DeviceTreeNode->NodeOffset);
      PwmSerialPrint ("[PWM-FAN-DEBUG] Probing PWM Controller with phandle: %u\r\n", NodeHandle);

      FanOffset = -1;
      while((FanOffset = fdt_node_offset_by_compatible (DeviceTreeNode->DeviceTreeBase, FanOffset, "pwm-fan")) >= 0) {
        PwmSerialPrint ("[PWM-FAN-DEBUG]   -> Found 'pwm-fan' node at offset %d. Checking its target PWM...\r\n", FanOffset);

        FanPwm = fdt_getprop (DeviceTreeNode->DeviceTreeBase, FanOffset, "pwms", &PwmLength);
        if (FanPwm == NULL || PwmLength < sizeof (UINT32)) {
          PwmSerialPrint ("[PWM-FAN-DEBUG]     -> No 'pwms' property found. Skipping.\r\n");
          continue;
        }
        FanPwmHandle = SwapBytes32 (FanPwm[0]);
        PwmSerialPrint ("[PWM-FAN-DEBUG]   -> It points to PWM phandle: %u\r\n", FanPwmHandle);

        if (NodeHandle == FanPwmHandle) {
          PwmSerialPrint ("[PWM-FAN-DEBUG]   => MATCH! This driver will bind to phandle %u.\r\n", NodeHandle);

          return EFI_SUCCESS;
        }
      }

      return EFI_UNSUPPORTED;

    case DeviceDiscoveryDriverBindingStart:
      BaseAddress = 0;
      RegionSize  = 0;
      PwmSerialPrint ("[PWM-FAN-DEBUG] Initializing Fan Controller...\r\n");

      Status      = DeviceDiscoveryGetMmioRegion (ControllerHandle, 0, &BaseAddress, &RegionSize);
      if (EFI_ERROR (Status)) {
        PwmSerialPrint ("[PWM-FAN-DEBUG] ERROR: Failed to get MMIO region!\r\n");
        return EFI_UNSUPPORTED;
      }
      PwmSerialPrint ("[PWM-FAN-DEBUG]   - Got MMIO Region at 0x%llx\r\n", BaseAddress);

      DeviceDiscoverySetClockFreq (ControllerHandle, "pwm", PWM_CLOCK_FREQ);
      PwmSerialPrint ("[PWM-FAN-DEBUG]   - Set clock to %u Hz.\r\n", PWM_CLOCK_FREQ);

      MmioWrite32 (BaseAddress, PWM_FAN_HIGH);
      PwmSerialPrint ("[PWM-FAN-DEBUG]   - Wrote 0x%X to register 0x%llx to set fan speed.\r\n", PWM_FAN_HIGH, BaseAddress);
      PwmSerialPrint ("[PWM-FAN-DEBUG] Fan Initialization Complete.\r\n");
      return Status;

    default:
      return EFI_SUCCESS;
  }
}

I changed the original setting from a single PWM fan to multiple ones, and tested that this included PWM7 because the GPIO7 before modification was close to 0V, and the modified voltage was 0.46V, but it was still not enough. I started setting the values of the PWM register, but regardless of whether the value was PWM_SAN-HIGH or PWM_SAN.MED, the result was 0.46V. I want to know where the problem lies?

串口打印日志:
[PWM-FAN-DEBUG] Probing PWM Controller with phandle: 290
[PWM-FAN-DEBUG] → Found ‘pwm-fan’ node at offset 105724. Checking its target PWM…
[PWM-FAN-DEBUG] → It points to PWM phandle: 289
[PWM-FAN-DEBUG] → Found ‘pwm-fan’ node at offset 105876. Checking its target PWM…
[PWM-FAN-DEBUG] → It points to PWM phandle: 290
[PWM-FAN-DEBUG] => MATCH! This driver will bind to phandle 290.
[PWM-FAN-DEBUG] Initializing Fan Controller…
[PWM-FAN-DEBUG] - Got MMIO Region at 0x3280000
[PWM-FAN-DEBUG] - Set clock to 19200000 Hz.
[PWM-FAN-DEBUG] - Wrote 0x81000000 to register 0x3280000 to set fan speed.
[PWM-FAN-DEBUG] Fan Initialization Complete.
[PWM-FAN-DEBUG] Probing PWM Controller with phandle: 503
[PWM-FAN-DEBUG] → Found ‘pwm-fan’ node at offset 105724. Checking its target PWM…
[PWM-FAN-DEBUG] → It points to PWM phandle: 289
[PWM-FAN-DEBUG] → Found ‘pwm-fan’ node at offset 105876. Checking its target PWM…
[PWM-FAN-DEBUG] → It points to PWM phandle: 290
[PWM-FAN-DEBUG] → Found ‘pwm-fan’ node at offset 161768. Checking its target PWM…
[PWM-FAN-DEBUG] → It points to PWM phandle: 503
[PWM-FAN-DEBUG] => MATCH! This driver will bind to phandle 503.
[PWM-FAN-DEBUG] Initializing Fan Controller…
[PWM-FAN-DEBUG] - Got MMIO Region at 0x32A0000
[PWM-FAN-DEBUG] - Set clock to 19200000 Hz.
[PWM-FAN-DEBUG] - Wrote 0x81000000 to register 0x32A0000 to set fan speed.
[PWM-FAN-DEBUG] Fan Initialization Complete.
[PWM-FAN-DEBUG] Probing PWM Controller with phandle: 555
[PWM-FAN-DEBUG] → Found ‘pwm-fan’ node at offset 105724. Checking its target PWM…
[PWM-FAN-DEBUG] → It points to PWM phandle: 289
[PWM-FAN-DEBUG] → Found ‘pwm-fan’ node at offset 105876. Checking its target PWM…
[PWM-FAN-DEBUG] → It points to PWM phandle: 290
[PWM-FAN-DEBUG] → Found ‘pwm-fan’ node at offset 161768. Checking its target PWM…
[PWM-FAN-DEBUG] → It points to PWM phandle: 503
[PWM-FAN-DEBUG] Probing PWM Controller with phandle: 289
[PWM-FAN-DEBUG] → Found ‘pwm-fan’ node at offset 105724. Checking its target PWM…
[PWM-FAN-DEBUG] → It points to PWM phandle: 289
[PWM-FAN-DEBUG] => MATCH! This driver will bind to phandle 289.
[PWM-FAN-DEBUG] Initializing Fan Controller…
[PWM-FAN-DEBUG] - Got MMIO Region at 0x32E0000
[PWM-FAN-DEBUG] - Set clock to 19200000 Hz.
[PWM-FAN-DEBUG] - Wrote 0x81000000 to register 0x32E0000 to set fan speed.
[PWM-FAN-DEBUG] Fan Initialization Complete.

似乎正确执行并写入。

示波器没有测量到正弦波的信号

It seems you’ve enabled the PWM7 in bootloader.
Have you measured the pwm signal from scope?

What’s the current PWM frequency, duty cycle? And what’s your requirement?

从log看已经设置了PWM7信号,但是使用示波器未测量到相关的PWM 波形,我们希望这个PWM7信号在开机的时候能够达到占空比100%,PWM频率40kHZ

0x81000000 should meet your requirement.

Please configure PWM frequency through #define PWM_CLOCK_FREQ

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.