SPI communication using DPPI i wanna control cs pins as specific period. but cs pin is doesn't move at all.

/dts-v1/;
#include <nordic/nrf5340_cpuapp_qkaa.dtsi>
#include "bridge_wifi_nrf5340-pinctrl.dtsi"
#include "nrf5340_cpuapp_common.dtsi"

/ {
	model = "Nordic NRF7002 DK NRF5340 Application";
	compatible = "nordic,nrf7002-dk-nrf5340-cpuapp";

	chosen {
		zephyr,sram = &sram0_image;
		zephyr,flash = &flash0;
		zephyr,code-partition = &slot0_partition;
		zephyr,sram-secure-partition = &sram0_s;
		zephyr,sram-non-secure-partition = &sram0_ns;
		zephyr,wifi = &wlan0;
	};
};
#include "bridge_wifi_nrf5340-cpuapp_partitioning.dtsi"
#include "bridge_wifi_nrf5340-shared_sram.dtsi"

&qspi {
	nrf70: nrf7002@1 {
		compatible = "nordic,nrf7002-qspi";
		status = "okay";
		reg = <1>;
		qspi-frequency = <24000000>;
		qspi-quad-mode;

		#include "nrf70_common.dtsi"
		#include "nrf70_common_5g.dtsi"
	};
};

&spi3 {
	compatible = "nordic,nrf-spim";
	status = "okay";
	pinctrl-0 = <&spi3_default>;
	pinctrl-1 = <&spi3_sleep>;
	pinctrl-names = "default", "sleep";

/* ---------------- Child device: Intan RHS2116 ---------------- */
	intanrhs: intanrhs@0 {
		compatible = "vnd,spi-device";
		status = "okay"; 
		reg = <0>; /* CS#0 */
		spi-max-frequency = <8000000>; 
		duplex = <0>; /* SPI_FULL_DUPLEX[2] */
		frame-format = <0>; /* Motorola */
		label = "IntanRHS";
	};
};


&dppic {
    compatible = "nordic,nrf-dppic";
    status = "okay";
};

&timer1 {
	status = "okay";
};


&gpiote1 {
	status = "okay";
};

Parents
  • Hello,

    Sorry I have not seen the second message. From the code I can see, CS (chip select) pin is controlled in the application not by the SPIM peripheral or by the Zephyr SPI driver.  

    Then it does not need to define in the device tree. If the CS pin is assigned to both the SPIM peripheral and GPIOTE, or if it is not properly configured as a GPIOTE output, the pin may not toggle as expected. Only one peripheral can control a GPIO at a time. I can not see any issue related to this in the code.

    You may try toggling the CS pin manually in your code (without DPPI or timer) to confirm that the pin and GPIOTE configuration are working. 

Reply
  • Hello,

    Sorry I have not seen the second message. From the code I can see, CS (chip select) pin is controlled in the application not by the SPIM peripheral or by the Zephyr SPI driver.  

    Then it does not need to define in the device tree. If the CS pin is assigned to both the SPIM peripheral and GPIOTE, or if it is not properly configured as a GPIOTE output, the pin may not toggle as expected. Only one peripheral can control a GPIO at a time. I can not see any issue related to this in the code.

    You may try toggling the CS pin manually in your code (without DPPI or timer) to confirm that the pin and GPIOTE configuration are working. 

Children
No Data
Related