PWM not working after upgrade to nrf Connect SDK 1.9.1

Since upgrading to nrf Connect SDK 1.9.1, I no longer have PWM output. No errors returned when calling pwm_pin_set_usec, yet no output.

I tried upgrading to the latest nrf Connect SDK (2.2.0), thinking that perhaps a bug was fixed, but the number of changes (include paths, etc) was too daunting.

Parents Reply
  • Hi,

    Sorry, this ticket was lost in the system.

    Reading through it again now, I saw that I asked:

    Sigurd Hellesvik said:
    Can you try the zephyr fade_led sample on your board, to see if it behaves in the same way or not?

    And you answered:

    csteaderman said:
    Not easily. My development is beyond using dev boards, and I am running on a custom PCBA now. When I probe the GPIO line that is supposed to have the PWM signal on it, it is at 0V.

    Why can you not do it easily?

    Would it not be using DTS to change the pins in the fade_led_sample and then probe the lines during the sample?

    Regards,
    Sigurd Hellesvik

Children
  • I need to change all the clock modes, comment out most of the other pin definitions, and change enough of the code that if it doesn’t work I’d be unsure whether something I did wrong made it stop working. Not impossible, just difficult. I will take a look at the latest fade_led example and update my code to match the DTS definitions and code for manipulating the PWM properties. Hopefully that will shed some light. 

  • I was able to convert my device tree and software calls to be consistent with latest best practices. I am now able to get my PWM signal out! Unfortunately, my SPI communication has now stopped as the polarity of the CS signal is inverted. I am guessing that it is a similar issue with device tree and software calls. Should I create a new ticket or address it here? My old code grabbed the device object from the device tree and then I defined a spi_config struct to pass on the spi_read/write/transceive calls. Since this seems to not be working, I updated to defining the CS parameters in the device tree itself and am using the spi_read_dt/write_dt/transceive_dt calls but it still won't change the polarity of the CS signal. I need ACTIVE_LOW. I am using spi1. Any insights?

  • csteaderman said:
    I am now able to get my PWM signal out!

    Good to hear!

    csteaderman said:
    Should I create a new ticket or address it here?

    We can continue here.

    csteaderman said:
    Any insights?

    Can you share your pinctrl configuration for SPI?

    Our central nRF pairing sample uses SPI with ACTIVE LOW cs-gpios.
    Is this what you need?

    Regards,
    Sigurd Hellesvik

  • Here are the relevant sections from the pinctrl file and device tree files.

    	spi1_default: spi1_default {
    		group1 {
    			psels = <NRF_PSEL(SPIM_SCK, 0, 16)>,
    				<NRF_PSEL(SPIM_MOSI, 0, 15)>,
    				<NRF_PSEL(SPIM_MISO, 0, 14)>;
    		};
    	};
    
    	spi1_sleep: spi1_sleep {
    		group1 {
    			psels = <NRF_PSEL(SPIM_SCK, 0, 16)>,
    				<NRF_PSEL(SPIM_MOSI, 0, 15)>,
    				<NRF_PSEL(SPIM_MISO, 0, 14)>;
    			low-power-enable;
    		};
    	};

    &spi1 {
    	compatible = "nordic,nrf-spi";
    	status = "okay";
    	pinctrl-0 = <&spi1_default>;
    	pinctrl-1 = <&spi1_sleep>;
    	pinctrl-names = "default", "sleep";
    	cs-gpios = <&gpio0 18 GPIO_ACTIVE_LOW>;
    	afe4490: afe4490@0 {
    		compatible = "vnd,spi-device";
    		reg = <0>;
    		spi-max-frequency = <4000000>;
    		label = "afe4490";
    	};
    };
    

  • Can you share your SPI code?

    Or even better, a minimal sample with only SPI communication so I can try to replicate the issue on my end?

    Regards,
    Sigurd Hellesvik

Related