Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No PWM signal on Nucleo F103RB using TIM1 CH2 PA9 #43980

Closed
GeorgeCGV opened this issue Mar 18, 2022 · 2 comments
Closed

No PWM signal on Nucleo F103RB using TIM1 CH2 PA9 #43980

GeorgeCGV opened this issue Mar 18, 2022 · 2 comments
Assignees
Labels
area: PWM Pulse Width Modulation bug The issue is a bug, or the PR is fixing a bug platform: STM32 ST Micro STM32 priority: low Low impact/importance bug

Comments

@GeorgeCGV
Copy link
Collaborator

GeorgeCGV commented Mar 18, 2022

Describe the bug

No PWM signal is observed in Zephyr using Nucleo F103RB board with enabled Timer 1 and CH2 on PA9.

To Reproduce

Create an overlay for the nucleo_f103rb board:

&timers1 {
    status = "okay";
    st,prescaler = <0>;
    pwm1: pwm {
        status = "okay";
        pinctrl-0 = <&tim1_ch1_pwm_pa8
                         &tim1_ch2_pwm_pa9
                         &tim1_ch3_pwm_pa10>;
        pinctrl-names = "default";
    }; 
};

Start PWM on channel 2 or all (doesn't matter) with pwm_pin_set_<...>.

Observe no signal on PA9.

zephyr_ch2_pwm_issue

Expected behavior

PWM signal on CH2 PA9 shall be generated as it happens in HAL generated project.

zephyr_ch2_pwm_issue_hal

Impact

No CH2 PWM signal.

Environment:

  • OS: Windows
  • Toolchain arm-none-eabi-10.3-2021.07
  • Commit SHA: 49d08c2

Notes:

Tested up to 3 channels: tim1_ch1_pwm_pa8, tim1_ch2_pwm_pa9, and tim1_ch3_pwm_pa10. Every tested channel works except the second one on PA9.

@GeorgeCGV GeorgeCGV added the bug The issue is a bug, or the PR is fixing a bug label Mar 18, 2022
@erwango erwango added priority: low Low impact/importance bug area: PWM Pulse Width Modulation platform: STM32 ST Micro STM32 labels Mar 18, 2022
@FRASTM
Copy link
Collaborator

FRASTM commented Mar 21, 2022

In the DTS of the nucleo_f103rb, there is

&usart1 {
	pinctrl-0 = <&usart1_tx_pa9 &usart1_rx_pa10>;
	pinctrl-names = "default";
	current-speed = <115200>;
	status = "okay";
};

So that the pb could be a pin conflict on PA9 between usart1_tx_pa9 and tim1_ch2_pwm_pa9.
Could you try disabling the usart1 in the overlay

&usart1 {
	status = "disabled";
};

@GeorgeCGV
Copy link
Collaborator Author

GeorgeCGV commented Mar 21, 2022

@FRASTM, indeed, missed that... works, thank you 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: PWM Pulse Width Modulation bug The issue is a bug, or the PR is fixing a bug platform: STM32 ST Micro STM32 priority: low Low impact/importance bug
Projects
None yet
Development

No branches or pull requests

3 participants