Configuring nRF52840 to Use SPI without DMA on Zephyr

Dear Nordic Support Team,

I am working with the nRF52840 and need to configure the SPI peripheral in Zephyr to operate without DMA.

I’ve encountered a few problems:

  • To disable DMA, I tried setting compatible = "nordic,nrf-spi" for the spi3 node in my board’s overlay file.
    However, I received a linking error, specifically: undefined reference to '__device_dts_ord_139'.
    This seems to suggest a missing reference or configuration issue with the SPI node.

    This is the spi3 node from my output file zephyr.dts 

spi3: spi@4002f000 {
			compatible = "nordic,nrf-spi";
			#address-cells = < 0x1 >;
			#size-cells = < 0x0 >;
			reg = < 0x4002f000 0x1000 >;
			interrupts = < 0x2f 0x1 >;
			max-frequency = < 0x1e84800 >;
			easydma-maxcnt-bits = < 0x10 >;
			status = "okay";
			cs-gpios = < &gpio1 0xc 0x1 >;
			pinctrl-0 = < &spi3_default >;
			pinctrl-1 = < &spi3_sleep >;
			pinctrl-names = "default", "sleep";
			zephyr,pm-device-runtime-auto;
			pressure1: abp2@0 {
				compatible = "vnd,spi-device";
				reg = < 0x0 >;
				spi-max-frequency = < 0xc3500 >;
			};
		};

  • I noticed in .config file that even thought I explicitly set CONFIG_NRFX_SPIM3=n in prj.conf, it is still set to yes... Which might cause the linking issue.
    Is there a reason why would this happen considering my device tree is configured correctly?

I also want to mention I use QSPI in my project as well (with DMA).

Could you please advise on the best approach to configure SPI without DMA while avoiding the undefined reference error and confirm that concurrent operation with QSPI is supported?

Thank you for your assistance.

Best regards,

Noy

Parents
  • Hi

    Okay, so the issue seems to be because you're using the SPIM3 instance without EasyDMA. Please note that it's only the SPI0-SPI2 instances that can be used without EasyDMA. The last instance only exists as SPIM3.

    But please note that these SPI0-SPI2 instances are also deprecated. Is there a specific reason you don't want to use EasyDMA in your application?

    Best regards,

    Simon

  • Hi,

    Thanks for clarifying I was curious why it didn't compile!

    The reason for me asking was that I needed to lower the power consumption that is caused by the EasyDMA,

    but I realized I can also solve it by using PM and disable the spi instance when it's not in use.

    Thanks,

    Noy

Reply Children
No Data
Related