- 
                Notifications
    
You must be signed in to change notification settings  - Fork 1.4k
 
tests: drivers: pwm: gpio_loopback: Enable test on PWM120 instance #18282
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
          
     Merged
      
      
            rlubos
  merged 1 commit into
  nrfconnect:main
from
nordic-segl:NRFX-6655_Run-test-on-PWM120
  
      
      
   
  Nov 5, 2024 
      
    
  
     Merged
                    Changes from all commits
      Commits
    
    
  File filter
Filter by extension
Conversations
          Failed to load comments.   
        
        
          
      Loading
        
  Jump to
        
          Jump to file
        
      
      
          Failed to load files.   
        
        
          
      Loading
        
  Diff view
Diff view
There are no files selected for viewing
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| # | ||
| # Copyright (c) 2024 Nordic Semiconductor ASA | ||
| # | ||
| # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause | ||
| # | ||
| 
     | 
||
| config TEST_PWM_PERIOD_USEC | ||
| int "PWM period in microseconds" | ||
| default 200000 | ||
| help | ||
| Set PWM signal period to TEST_PWM_PERIOD_USEC microseconds. | ||
| In the test, PWM pulse width will be set to half of this value. | ||
| The maximum allowable PWM period value is limited by the hardware design. | ||
| 
     | 
||
| source "Kconfig.zephyr" | 
        
          
  
    
      
          
            55 changes: 55 additions & 0 deletions
          
          55 
        
  tests/drivers/pwm/gpio_loopback/boards/nrf54h20dk_nrf54h20_cpuapp_fast_p7_0.overlay
  
  
      
      
   
        
      
      
    
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| /* | ||
| * Copyright (c) 2024 Nordic Semiconductor ASA | ||
| * | ||
| * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause | ||
| */ | ||
| 
     | 
||
| #include <zephyr/dt-bindings/pwm/pwm.h> | ||
| #include <zephyr/dt-bindings/gpio/nordic-nrf-gpio.h> | ||
| 
     | 
||
| /* Test requires wire connection between: | ||
| * - PWM120 OUT[0] at P7.0 | ||
| * - GPIO input at P1.09 | ||
| */ | ||
| 
     | 
||
| / { | ||
| pwm_to_gpio_loopback: pwm_to_gpio_loopback { | ||
| compatible = "test-pwm-to-gpio-loopback"; | ||
| pwms = <&pwm120 0 0 PWM_POLARITY_NORMAL>; | ||
| gpios = <&gpio1 9 GPIO_ACTIVE_HIGH>; | ||
| }; | ||
| }; | ||
| 
     | 
||
| &pinctrl { | ||
| pwm_default: pwm_default { | ||
| group1 { | ||
| psels = <NRF_PSEL(PWM_OUT0, 7, 0)>; | ||
| }; | ||
| }; | ||
| pwm_sleep: pwm_sleep { | ||
| group1 { | ||
| psels = <NRF_PSEL(PWM_OUT0, 7, 0)>; | ||
| low-power-enable; | ||
| }; | ||
| }; | ||
| }; | ||
| 
     | 
||
| &gpio1 { | ||
| status = "okay"; | ||
| }; | ||
| 
     | 
||
| &pwm120 { | ||
| status = "okay"; | ||
| pinctrl-0 = <&pwm_default>; | ||
| pinctrl-1 = <&pwm_sleep>; | ||
| pinctrl-names = "default", "sleep"; | ||
| memory-regions = <&dma_fast_region>; | ||
| }; | ||
| 
     | 
||
| &dma_fast_region { | ||
| status = "okay"; | ||
| }; | ||
| 
     | 
||
| &pwm130 { | ||
| status = "disabled"; | ||
| }; | 
        
          
  
    
      
          
            55 changes: 55 additions & 0 deletions
          
          55 
        
  tests/drivers/pwm/gpio_loopback/boards/nrf54h20dk_nrf54h20_cpuapp_fast_p7_1.overlay
  
  
      
      
   
        
      
      
    
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| /* | ||
| * Copyright (c) 2024 Nordic Semiconductor ASA | ||
| * | ||
| * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause | ||
| */ | ||
| 
     | 
||
| #include <zephyr/dt-bindings/pwm/pwm.h> | ||
| #include <zephyr/dt-bindings/gpio/nordic-nrf-gpio.h> | ||
| 
     | 
||
| /* Test requires wire connection between: | ||
| * - PWM120 OUT[1] at P7.1 | ||
| * - GPIO input at P1.05 | ||
| */ | ||
| 
     | 
||
| / { | ||
| pwm_to_gpio_loopback: pwm_to_gpio_loopback { | ||
| compatible = "test-pwm-to-gpio-loopback"; | ||
| pwms = <&pwm120 1 0 PWM_POLARITY_NORMAL>; | ||
| gpios = <&gpio1 5 GPIO_ACTIVE_HIGH>; | ||
| }; | ||
| }; | ||
| 
     | 
||
| &pinctrl { | ||
| pwm_default: pwm_default { | ||
| group1 { | ||
| psels = <NRF_PSEL(PWM_OUT1, 7, 1)>; | ||
| }; | ||
| }; | ||
| pwm_sleep: pwm_sleep { | ||
| group1 { | ||
| psels = <NRF_PSEL(PWM_OUT1, 7, 1)>; | ||
| low-power-enable; | ||
| }; | ||
| }; | ||
| }; | ||
| 
     | 
||
| &gpio1 { | ||
| status = "okay"; | ||
| }; | ||
| 
     | 
||
| &pwm120 { | ||
| status = "okay"; | ||
| pinctrl-0 = <&pwm_default>; | ||
| pinctrl-1 = <&pwm_sleep>; | ||
| pinctrl-names = "default", "sleep"; | ||
| memory-regions = <&dma_fast_region>; | ||
| }; | ||
| 
     | 
||
| &dma_fast_region { | ||
| status = "okay"; | ||
| }; | ||
| 
     | 
||
| &pwm130 { | ||
| status = "disabled"; | ||
| }; | 
        
          
  
    
      
          
            55 changes: 55 additions & 0 deletions
          
          55 
        
  tests/drivers/pwm/gpio_loopback/boards/nrf54h20dk_nrf54h20_cpuapp_fast_p7_6.overlay
  
  
      
      
   
        
      
      
    
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| /* | ||
| * Copyright (c) 2024 Nordic Semiconductor ASA | ||
| * | ||
| * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause | ||
| */ | ||
| 
     | 
||
| #include <zephyr/dt-bindings/pwm/pwm.h> | ||
| #include <zephyr/dt-bindings/gpio/nordic-nrf-gpio.h> | ||
| 
     | 
||
| /* Test requires wire connection between: | ||
| * - PWM120 OUT[2] at P7.6 | ||
| * - GPIO input at P1.06 | ||
| */ | ||
| 
     | 
||
| / { | ||
| pwm_to_gpio_loopback: pwm_to_gpio_loopback { | ||
| compatible = "test-pwm-to-gpio-loopback"; | ||
| pwms = <&pwm120 2 0 PWM_POLARITY_NORMAL>; | ||
| gpios = <&gpio1 6 GPIO_ACTIVE_HIGH>; | ||
| }; | ||
| }; | ||
| 
     | 
||
| &pinctrl { | ||
| pwm_default: pwm_default { | ||
| group1 { | ||
| psels = <NRF_PSEL(PWM_OUT2, 7, 6)>; | ||
| }; | ||
| }; | ||
| pwm_sleep: pwm_sleep { | ||
| group1 { | ||
| psels = <NRF_PSEL(PWM_OUT2, 7, 6)>; | ||
| low-power-enable; | ||
| }; | ||
| }; | ||
| }; | ||
| 
     | 
||
| &gpio1 { | ||
| status = "okay"; | ||
| }; | ||
| 
     | 
||
| &pwm120 { | ||
| status = "okay"; | ||
| pinctrl-0 = <&pwm_default>; | ||
| pinctrl-1 = <&pwm_sleep>; | ||
| pinctrl-names = "default", "sleep"; | ||
| memory-regions = <&dma_fast_region>; | ||
| }; | ||
| 
     | 
||
| &dma_fast_region { | ||
| status = "okay"; | ||
| }; | ||
| 
     | 
||
| &pwm130 { | ||
| status = "disabled"; | ||
| }; | 
        
          
  
    
      
          
            55 changes: 55 additions & 0 deletions
          
          55 
        
  tests/drivers/pwm/gpio_loopback/boards/nrf54h20dk_nrf54h20_cpuapp_fast_p7_7.overlay
  
  
      
      
   
        
      
      
    
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| /* | ||
| * Copyright (c) 2024 Nordic Semiconductor ASA | ||
| * | ||
| * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause | ||
| */ | ||
| 
     | 
||
| #include <zephyr/dt-bindings/pwm/pwm.h> | ||
| #include <zephyr/dt-bindings/gpio/nordic-nrf-gpio.h> | ||
| 
     | 
||
| /* Test requires wire connection between: | ||
| * - PWM120 OUT[3] at P7.7 | ||
| * - GPIO input at P1.08 | ||
| */ | ||
| 
     | 
||
| / { | ||
| pwm_to_gpio_loopback: pwm_to_gpio_loopback { | ||
| compatible = "test-pwm-to-gpio-loopback"; | ||
| pwms = <&pwm120 3 0 PWM_POLARITY_NORMAL>; | ||
| gpios = <&gpio1 8 GPIO_ACTIVE_HIGH>; | ||
| }; | ||
| }; | ||
| 
     | 
||
| &pinctrl { | ||
| pwm_default: pwm_default { | ||
| group1 { | ||
| psels = <NRF_PSEL(PWM_OUT3, 7, 7)>; | ||
| }; | ||
| }; | ||
| pwm_sleep: pwm_sleep { | ||
| group1 { | ||
| psels = <NRF_PSEL(PWM_OUT3, 7, 7)>; | ||
| low-power-enable; | ||
| }; | ||
| }; | ||
| }; | ||
| 
     | 
||
| &gpio1 { | ||
| status = "okay"; | ||
| }; | ||
| 
     | 
||
| &pwm120 { | ||
| status = "okay"; | ||
| pinctrl-0 = <&pwm_default>; | ||
| pinctrl-1 = <&pwm_sleep>; | ||
| pinctrl-names = "default", "sleep"; | ||
| memory-regions = <&dma_fast_region>; | ||
| }; | ||
| 
     | 
||
| &dma_fast_region { | ||
| status = "okay"; | ||
| }; | ||
| 
     | 
||
| &pwm130 { | ||
| status = "disabled"; | ||
| }; | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
      
      Oops, something went wrong.
        
    
  
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Build only as CI setups contain "incompatible" loopback between P7.6-P7.7.
Test relies on GPIOTE while GPIOTE can't be used on P7.