Tool/software:
When i trie to see the value of EPWM registers at the serial terminal, it return to me a bus erro. Why this could be happen?
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.
Tool/software:
When i trie to see the value of EPWM registers at the serial terminal, it return to me a bus erro. Why this could be happen?
Hello Rafael,
Have you verified that the EPWM peripheral is actually clocked? If the peripheral has not been clocked / powered on, then devmem will fail to read the memory address.
Just to verify, which instance are you trying to read from? It looks like 0x2310_0000 is ECAP0, while 0x2300_0000 is EPWM0.
Regards,
Nick
Hi, Nick!
How can i check the state of my EPWM module? In this case, im use all the insances provides by AM625 (EPWM0, EPWM1 and EPWM2).
If is turn off, how can i turn on the clock of my modules?
In the image, I read EPWM and ECAP. I sent this because I think it might be the same situation.
Hello Rafael,
I assume that you are using the PWM peripherals from Linux, since you are checking the registers from Linux?
If so, then you would need to make sure the PWMs are enabled in the Linux devicetree file. I will be using SDK 10.0 as a reference.
in k3-am62-main.dtsi, I can see that the EPWM peripherals are defined, but set to "disabled". Thus, Linux will not turn on the PWM clocks:
epwm0: pwm@23000000 { compatible = "ti,am64-epwm", "ti,am3352-ehrpwm"; #pwm-cells = <3>; reg = <0x00 0x23000000 0x00 0x100>; power-domains = <&k3_pds 86 TI_SCI_PD_EXCLUSIVE>; clocks = <&epwm_tbclk 0>, <&k3_clks 86 0>; clock-names = "tbclk", "fck"; status = "disabled"; }; epwm1: pwm@23010000 { compatible = "ti,am64-epwm", "ti,am3352-ehrpwm"; #pwm-cells = <3>; reg = <0x00 0x23010000 0x00 0x100>; power-domains = <&k3_pds 87 TI_SCI_PD_EXCLUSIVE>; clocks = <&epwm_tbclk 1>, <&k3_clks 87 0>; clock-names = "tbclk", "fck"; status = "disabled"; }; epwm2: pwm@23020000 { compatible = "ti,am64-epwm", "ti,am3352-ehrpwm"; #pwm-cells = <3>; reg = <0x00 0x23020000 0x00 0x100>; power-domains = <&k3_pds 88 TI_SCI_PD_EXCLUSIVE>; clocks = <&epwm_tbclk 2>, <&k3_clks 88 0>; clock-names = "tbclk", "fck"; status = "disabled"; };
When I search for the pwms in the rest of the devicetree files, it does not look like the PWMs are enabled in any of the board-level dts files. Thus, I would expect that the PWMs would NOT be enabled by default on the TI EVMs:
/arch/arm64/boot/dts/ti$ grep -r --include=k3-am62* epwm ... k3-am625-beagleplay-lincolntech-lcd185-panel.dtso: pwms = <&epwm0 1 20000 0>; k3-am625-beagleplay-lincolntech-lcd185-panel.dtso:&epwm0 { k3-am625-sk-pwm.dtso: main_epwm0_pins_default: main-epwm0-pins-default { k3-am625-sk-pwm.dtso: main_epwm1_pins_default: main-epwm1-pins-default { k3-am625-sk-pwm.dtso:&epwm0 { k3-am625-sk-pwm.dtso: pinctrl-0 = <&main_epwm0_pins_default>; k3-am625-sk-pwm.dtso:&epwm1 { k3-am625-sk-pwm.dtso: pinctrl-0 = <&main_epwm1_pins_default>;
However, you can see above that the PWMs ARE enabled in a couple of the devicetree overlay files. So you can refer to these overlay files for an example of how to enable a PWM in your design (or you can simply load the overlay files in uboot).
Regards,
Nick