Skip to content

samples: basic: fade_led: Add stm32_min_dev.overlay with 4 LEDs #93226

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

Conversation

GomaaMohamed
Copy link

Add a Device Tree overlay for the STM32 Minimum Development Board
(Blue) to the fade_led sample, enabling PWM-based LED fading on
PA8 (Timer 1, Channel 1), PA9 (Timer 1, Channel 2), PA0 (Timer 2,
Channel 1), and PA1 (Timer 2, Channel 2). The overlay sets a 20 ms
and a prescaler of 10000 to ensure compatibility with the
STM32F103C8’s timer constraints. Pin configurations include
maximum slew rate and pull-up bias for reliable PWM output. Tested
on the stm32_min_dev board, confirming all four LEDs fade correctly
without errors.

Copy link

Hello @GomaaMohamed, and thank you very much for your first pull request to the Zephyr project!
Our Continuous Integration pipeline will execute a series of checks on your Pull Request commit messages and code, and you are expected to address any failures by updating the PR. Please take a look at our commit message guidelines to find out how to format your commit messages, and at our contribution workflow to understand how to update your Pull Request. If you haven't already, please make sure to review the project's Contributor Expectations and update (by amending and force-pushing the commits) your pull request if necessary.
If you are stuck or need help please join us on Discord and ask your question there. Additionally, you can escalate the review when applicable. 😊

@github-actions github-actions bot added the area: Samples Samples label Jul 16, 2025
@github-actions github-actions bot requested a review from nashif July 16, 2025 21:17
@GomaaMohamed GomaaMohamed force-pushed the stm32-min-dev-overlay-fade-led branch 2 times, most recently from 684b052 to df4e5a0 Compare July 16, 2025 23:18
Add a Device Tree overlay for the STM32 Minimum Development Board
(Blue) to the fade_led sample, enabling PWM-based LED fading on
PA8 (Timer 1, Ch 1), PA9 (Timer 1, Ch 2), PA0 (Timer 2, Ch 1), and
PA1 (Timer 2, Ch 2) with a 20 ms and a prescaler of 10000 for
STM32F103C8 compatibility. All four LEDs fade without errors.

Signed-off-by: Gomaa Mohammed Eldebaby <[email protected]>
@GomaaMohamed GomaaMohamed force-pushed the stm32-min-dev-overlay-fade-led branch from df4e5a0 to ed3bc5f Compare July 17, 2025 02:26
Copy link

@zephyrbot zephyrbot requested a review from kartben July 17, 2025 02:54
@GomaaMohamed
Copy link
Author

@nashif @kartben Thank you for being assigned to review this PR. I’ve submitted a Device Tree overlay for the STM32 Minimum Development Board (Blue) to the fade_led sample and confirmed all CI tests have passed. Could you please begin the initial review when you have a moment? I’d be happy to address any questions or provide clarifications. Thanks!

@kartben
Copy link
Contributor

kartben commented Jul 25, 2025

Hi @GomaaMohamed - board overlays added to code samples are meant to enable hardware features that are actually readily available on the board. Unless I am mistaken, this board does NOT have these 4 LEDs and this overlay effectively corresponds to some custom wiring/breadboarding you did?

@kartben
Copy link
Contributor

kartben commented Jul 25, 2025

Hi @GomaaMohamed - board overlays added to code samples are meant to enable hardware features that are actually readily available on the board. Unless I am mistaken, this board does NOT have these 4 LEDs and this overlay effectively corresponds to some custom wiring/breadboarding you did?

Yes, all the four Leds are custom. Do you just need the Leds are already on the board?

yes, otherwise the overlay is not really useful, right? If everyone adds overlays for whatever custom setup they have, it just doesn't scale :) Luckily there is hopefully more than enough examples already of how to configure PWM LEDs on STM32 if people look at the devicetree files of the dozens of Nucleo boards and DKs in the tree. Hope this makes sense?

@GomaaMohamed
Copy link
Author

Hi @GomaaMohamed - board overlays added to code samples are meant to enable hardware features that are actually readily available on the board. Unless I am mistaken, this board does NOT have these 4 LEDs and this overlay effectively corresponds to some custom wiring/breadboarding you did?

Yes, all the four Leds are custom. Do you just need the Leds are already on the board?

yes, otherwise the overlay is not really useful, right? If everyone adds overlays for whatever custom setup they have, it just doesn't scale :) Luckily there is hopefully more than enough examples already of how to configure PWM LEDs on STM32 if people look at the devicetree files of the dozens of Nucleo boards and DKs in the tree. Hope this makes sense?

Thank you for clarifying this point.
Could I use this Pull Request to add any another future contribution to avoid waiting for response from maintainers? Or it must be closed?

@kartben
Copy link
Contributor

kartben commented Jul 25, 2025

Could I use this Pull Request to add any another future contribution to avoid waiting for response from maintainers? Or it must be closed?

It should be closed yes. If you do other contributions in the future it might be a different set of maintainers that will be you main point of contact depending on what files/area you change :)

@GomaaMohamed GomaaMohamed deleted the stm32-min-dev-overlay-fade-led branch July 25, 2025 14:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants