This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM335x eHRPWM driver in the EZSDK v6.00.00.00

Guru 10570 points
Other Parts Discussed in Thread: TMDXEVM3358

Hello,

I would like to evaluate eHRPWM.
I am reading the wiki description. (http://processors.wiki.ti.com/index.php/AM335x_PWM_Driver%27s_Guide)
It describes that:

But, I can not see the ehrpwm.i.j file on its hierarchy.
How can I enable the eHRPWM driver on SYSFS?

Best regards, RY

  • Hi,
    I got local FAE support.
    The device file (/sys/class/pwm/ehrpwm.i:j) was made by profile 4 of CPLD setting.

    Best regards, RY

  • I meet the same problem,Can you tell me in detail how to operate it? Can you tell me in detail how to operate
  • Hi, yang.
    If you are using TMDXEVM3358.
    There is configuration switch on the daughter board.
    You should change it to the profile 4.
    After that I could see the ehrpwm.i:j.

    Best regards, RY

  • No,i am using the AM335X StartKit .Thank you also.
  • yang-san,

    Below configurations are for Beagle Bone Black.
    You should modify for the SK.
    After remake the linux kernel and driver, you will see the PWM instance in the /sys/class/pwm/.

    Best regards, RY

    ====================

    1) board-am335xevm.c
      static struct pinmux_config haptics_pin_mux[] = {
        {"gpmc_a2.ehrpwm1A",  OMAP_MUX_MODE6 | AM33XX_PIN_OUTPUT}, <-- Add
        {"gpmc_a3.ehrpwm1B",  OMAP_MUX_MODE6 | AM33XX_PIN_OUTPUT}, <-- Add
        {"gpmc_ad8.ehrpwm2A",  OMAP_MUX_MODE4 | AM33XX_PIN_OUTPUT}, <-- Add
        {"gpmc_ad9.ehrpwm2B",  OMAP_MUX_MODE4 | AM33XX_PIN_OUTPUT},
        {NULL, 0},
      };

      static void haptics_init(int evm_id, int profile)
      {
        setup_pin_mux(haptics_pin_mux);
        pwm_pdata[1].chan_attrib[1].max_freq = HAPTICS_MAX_FREQ;
        pwm_pdata[2].chan_attrib[1].max_freq = HAPTICS_MAX_FREQ; <-- Add
        am33xx_register_ehrpwm(1, &pwm_pdata[1]);
        am33xx_register_ehrpwm(2, &pwm_pdata[2]); <-- Add
      }

      /* Beaglebone Black */
      static struct evm_dev_cfg beagleboneblack_dev_cfg[] = {
        ...
        {haptics_init, DEV_ON_BASEBOARD, PROFILE_NONE}, <-- Add
        {NULL, 0, 0},
    };


    2) mux33xx.c

    static struct omap_mux am33xx_muxmodes[] = {
      ...
      _AM33XX_MUXENTRY(GPMC_AD8, 0,
          "gpmc_ad8", "lcd_data16", "mmc1_dat0", "mmc2_dat4",
          "ehrpwm2A", NULL, NULL, "gpio0_22"), <-- Modify "ehrpwm2A"
      ...
      _AM33XX_MUXENTRY(GPMC_A2, 0,
          "gpmc_a2", "mii2_txd3", "rgmii2_td3", "mmc2_dat1",
          NULL, NULL, "ehrpwm1A", "gpio1_18"), <-- Modify "ehrpwm1A"
      _AM33XX_MUXENTRY(GPMC_A3, 0,
          "gpmc_a3", "mii2_txd2", "rgmii2_td2", "mmc2_dat2",
          NULL, NULL, "ehrpwm1B", "gpio1_19"), <-- Modify "ehrpwm1B"

     

  • Thanks RY9983,I solve this problem now. I follow your advise,in the board-am335xevm.c add: /* EVM - Starter Kit */ static struct evm_dev_cfg evm_sk_dev_cfg[] = { ... {haptics_init, DEV_ON_DGHTR_BRD, PROFILE_NONE},//add by yang ...} I found "/sys/class/pwm/ehrpwm,i,j" appear!