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

cpu/nrf{53,9160}: add pwm support #19781

Merged
merged 5 commits into from
Jul 10, 2023
Merged

Conversation

dylad
Copy link
Member

@dylad dylad commented Jun 30, 2023

Contribution description

This PR moves the nRF52 PWM driver to cpu/nrf5x_common to allow nRF9160 and nRF53 to use this driver.
IP is identical on these families.

I didn't test on nRF9160DK and I didn't test if there is any regression on nRF52-based board as I don't have any so tests are welcome !
However it works fine on nRF53-based board.

Testing procedure

Flash the tests/periph/pwm test application on nrf5340dk or nrf9160dk.
You can then use the osci command to make the onboard LEDs "breath".
You can also attach an oscilloscope and/or logic analyzer to watch the signal.

Issues/PRs references

Based on #19769

@dylad dylad added the State: waiting for other PR State: The PR requires another PR to be merged first label Jun 30, 2023
@github-actions github-actions bot added Platform: ARM Platform: This PR/issue effects ARM-based platforms Area: doc Area: Documentation Area: boards Area: Board ports Area: cpu Area: CPU/MCU ports Area: Kconfig Area: Kconfig integration labels Jun 30, 2023
@dylad dylad force-pushed the cpu/nrf53/add_pwm_support branch from c4841ca to a685fd2 Compare July 5, 2023 07:35
@dylad dylad added CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR and removed State: waiting for other PR State: The PR requires another PR to be merged first labels Jul 5, 2023
@github-actions github-actions bot removed the Area: doc Area: Documentation label Jul 5, 2023
@dylad
Copy link
Member Author

dylad commented Jul 5, 2023

Rebased. No longer waiting on any PRs.

@riot-ci
Copy link

riot-ci commented Jul 5, 2023

Murdock results

✔️ PASSED

ef9dca0 drivers/servo: update build dependencies for Nordic families

Success Failures Total Runtime
6936 0 6936 10m:20s

Artifacts

Copy link
Contributor

@benpicco benpicco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please squash

@dylad dylad force-pushed the cpu/nrf53/add_pwm_support branch from 4b0a1ab to 9a305c0 Compare July 7, 2023 07:11
@dylad
Copy link
Member Author

dylad commented Jul 7, 2023

Rebased and squashed.

Output of tests/periph/pwm for nrf5340dk-app:

2023-07-07 09:09:49,732 # main(): This is RIOT! (Version: 2023.07-devel-789-g9a305c-cpu/nrf53/add_pwm_support)
2023-07-07 09:09:49,734 # PWM peripheral driver test
2023-07-07 09:09:49,734 # 
> ?
2023-07-07 09:09:58,943 # help
2023-07-07 09:09:58,946 # Command              Description
2023-07-07 09:09:58,949 # ---------------------------------------
2023-07-07 09:09:58,953 # init                 initial pwm configuration
2023-07-07 09:09:58,957 # set                  set pwm duty cycle
2023-07-07 09:09:58,960 # power                set pwm power
2023-07-07 09:09:58,964 # powertest            test power on/off functions
2023-07-07 09:09:58,969 # osci                 blocking, default oscillation test
> osci
2023-07-07 09:10:01,617 # osci
2023-07-07 09:10:01,617 # 
2023-07-07 09:10:01,618 # RIOT PWM test
2023-07-07 09:10:01,623 # Connect an LED or scope to PWM pins to see something.
2023-07-07 09:10:01,623 # 
2023-07-07 09:10:01,626 # Available PWM device between 0 and 0
2023-07-07 09:10:01,629 # Initialized PWM_0 @ 976Hz.
2023-07-07 09:10:01,629 # 
2023-07-07 09:10:01,632 # Letting the PWM pins oscillate now...

@benpicco
Copy link
Contributor

benpicco commented Jul 7, 2023

bors merge

bors bot added a commit that referenced this pull request Jul 7, 2023
19487: nanocoap: implement extended tokens (RFC 8974) r=benpicco a=benpicco



19781: cpu/nrf{53,9160}: add pwm support r=benpicco a=dylad

### Contribution description

This PR moves the nRF52 PWM driver to `cpu/nrf5x_common` to allow nRF9160 and nRF53 to use this driver.
IP is identical on these families.

I didn't test on nRF9160DK and I didn't test if there is any regression on nRF52-based board as I don't have any so tests are welcome !
However it works fine on nRF53-based board.


### Testing procedure

Flash the `tests/periph/pwm` test application on `nrf5340dk` or `nrf9160dk`.
You can then use the `osci` command to make the onboard LEDs "breath".
You can also attach an oscilloscope and/or logic analyzer to watch the signal.


### Issues/PRs references
~~Based on #19769~~

Co-authored-by: Benjamin Valentin <benpicco@beuth-hochschule.de>
Co-authored-by: Dylan Laduranty <dylan.laduranty@mesotic.com>
@bors
Copy link
Contributor

bors bot commented Jul 7, 2023

Build failed (retrying...):

@benpicco
Copy link
Contributor

benpicco commented Jul 7, 2023

Kconfig missmatch

bors cancel

@bors
Copy link
Contributor

bors bot commented Jul 7, 2023

Canceled.

@github-actions github-actions bot added the Area: drivers Area: Device drivers label Jul 8, 2023
dylad added 2 commits July 8, 2023 16:53
Signed-off-by: Dylan Laduranty <dylan.laduranty@mesotic.com>
Signed-off-by: Dylan Laduranty <dylan.laduranty@mesotic.com>
@dylad dylad force-pushed the cpu/nrf53/add_pwm_support branch from dab2f91 to ac54040 Compare July 8, 2023 14:56
@dylad
Copy link
Member Author

dylad commented Jul 8, 2023

I had to rebase against current master to fix conflicts introduce by my other merged PRs.
I also added an additional commit to fix the drivers/servo on nRF families

@dylad
Copy link
Member Author

dylad commented Jul 8, 2023

bors merge

@bors
Copy link
Contributor

bors bot commented Jul 8, 2023

👎 Rejected by PR status

dylad added 3 commits July 8, 2023 17:19
Signed-off-by: Dylan Laduranty <dylan.laduranty@mesotic.com>
Signed-off-by: Dylan Laduranty <dylan.laduranty@mesotic.com>
Signed-off-by: dylad <dylan.laduranty@mesotic.com>
@dylad dylad force-pushed the cpu/nrf53/add_pwm_support branch from ac54040 to ef9dca0 Compare July 8, 2023 15:20
@dylad
Copy link
Member Author

dylad commented Jul 8, 2023

bors merge

@bors
Copy link
Contributor

bors bot commented Jul 8, 2023

🕐 Waiting for PR status (GitHub check) to be set, probably by CI. Bors will automatically try to run when all required PR statuses are set.

bors bot added a commit that referenced this pull request Jul 8, 2023
19781: cpu/nrf{53,9160}: add pwm support r=dylad a=dylad

### Contribution description

This PR moves the nRF52 PWM driver to `cpu/nrf5x_common` to allow nRF9160 and nRF53 to use this driver.
IP is identical on these families.

I didn't test on nRF9160DK and I didn't test if there is any regression on nRF52-based board as I don't have any so tests are welcome !
However it works fine on nRF53-based board.


### Testing procedure

Flash the `tests/periph/pwm` test application on `nrf5340dk` or `nrf9160dk`.
You can then use the `osci` command to make the onboard LEDs "breath".
You can also attach an oscilloscope and/or logic analyzer to watch the signal.


### Issues/PRs references
~~Based on #19769~~

Co-authored-by: Dylan Laduranty <dylan.laduranty@mesotic.com>
Co-authored-by: dylad <dylan.laduranty@mesotic.com>
@bors
Copy link
Contributor

bors bot commented Jul 8, 2023

Build failed:

@benpicco
Copy link
Contributor

bors merge

@bors
Copy link
Contributor

bors bot commented Jul 10, 2023

Build succeeded!

The publicly hosted instance of bors-ng is deprecated and will go away soon.

If you want to self-host your own instance, instructions are here.
For more help, visit the forum.

If you want to switch to GitHub's built-in merge queue, visit their help page.

@bors bors bot merged commit 37c6233 into RIOT-OS:master Jul 10, 2023
23 checks passed
@dylad
Copy link
Member Author

dylad commented Jul 10, 2023

Thanks !

@dylad dylad deleted the cpu/nrf53/add_pwm_support branch July 10, 2023 13:42
@benpicco benpicco added this to the Release 2023.07 milestone Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: boards Area: Board ports Area: cpu Area: CPU/MCU ports Area: drivers Area: Device drivers Area: Kconfig Area: Kconfig integration CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Platform: ARM Platform: This PR/issue effects ARM-based platforms
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants