nRF7002DK and SPI4

Hello,

I am reaching out regarding some challenges I've encountered with SPI communication on the nRF7002DK when interfacing with the ETH Wiz Click | Mikroe module and a Voltage-Level Shifter. Specifically, I've been experiencing difficulties while attempting to use the SPI4 peripheral to achieve higher speeds. The code tested is essentially the sample code for the DHCP_v4 client.

Initially, I used the SPI3 peripheral and  the communication proceeded as expected. Below is an excerpt from the overlay file used:

&spi3 {
    status = "okay";
    w5500@0 {
        compatible = "wiznet,w5500";
        reg = <0x0>;
        spi-max-frequency = <DT_FREQ_K(7999)>;
        int-gpios = <&gpio0 7 GPIO_ACTIVE_LOW>;
        reset-gpios = <&gpio0 3 GPIO_ACTIVE_LOW>;
    };
};

Furthermore, I observed an anomaly where specifying an exact frequency of 8 MHz for the "spi-max-frequency" property resulted in data bus errors. However, setting it slightly lower, at 7.99 MHz, appeared to alleviate this issue.

However, when I try to use the SPI4 to take advantage of higher SPI speeds, the communication doesn't seem to occur. The capture with a logic analyzer is shown below as well as the terminal output:

[00:00:00.275,543] <err> eth_w5500: Unable to read version register
*** Booting nRF Connect SDK d96769faceca ***
[00:00:00.483,154] <inf> net_dhcpv4_client_sample: Run dhcpv4 client
[00:00:00.483,184] <inf> net_dhcpv4_client_sample: Start on w5500@0: index=1
[00:00:00.483,245] <inf> net_dhcpv4_client_sample: NET_EVENT_IPV4_DHCP_START
[00:00:00.483,428] <inf> net_dhcpv4_client_sample: Start on nordic_wlan0: index= 2
[00:00:00.483,489] <inf> net_dhcpv4_client_sample: NET_EVENT_IPV4_DHCP_START

The overlay file to use with the SPI4 node is shown below:

&spi4 {
    /delete-node/ mx25r6435f@0;
    w5500@0 {
        compatible = "wiznet,w5500";
        reg = <0x0>;
        spi-max-frequency = <1000000>;
        int-gpios = <&gpio0 7 GPIO_ACTIVE_LOW>;
        reset-gpios = <&gpio0 3 GPIO_ACTIVE_LOW>;
    };
};

The communication failed to happen successfully. Despite various troubleshooting attempts, including removing the MX25R node from the overlay file, lower the clock frequency down to 1MHz or configure the pins to high drive, I've yet to resolve this issue.

I am reaching out to seek guidance on potential oversights or misconfigurations that might be contributing to this issue. Any insights or recommendations you could provide would be greatly appreciated.

Thank you for your attention to this matter. I look forward to your response.

  • Can you share the build/zephyr/zephyr.dts file to see what pins you are using?

  • Hi Jonathan,

    For the nRF7002 I will not need to use it again, since we chose to use another microcontroller for my project due to new requirements. I don't know if still have problems.

    However, as I mentioned previously, whenever I need to use the SPI with the nRF52832, I have problems with the signal generated by the CLK, especially with frequencies above 1MHZ.

    For instance with a 2.5Mhz frequency, the clock is like this...



    and for 1MHz the clock is like this



    In this case the clock signal seems more correct to me. I was using SPI1.

    Overlay dts file:

    &spi1 {
      compatible = "nordic,nrf-spi";
      max-frequency = <2500000>;
      status = "okay";
    };
    
    
    &spi1_default {
      group1 {
        psels = <NRF_PSEL(SPIM_SCK, 0, 31)>,
                <NRF_PSEL(SPIM_MOSI, 0, 30)>,
                <NRF_PSEL(SPIM_MISO, 0, 29)>;
      };
    };

    proj.conf

    # nothing here
    CONFIG_GPIO=y
    CONFIG_NFCT_PINS_AS_GPIOS=y
    
    #printf configs and libc
    CONFIG_CBPRINTF_FP_SUPPORT=y
    CONFIG_NEWLIB_LIBC=y
    
    #configuring clock source
    #CONFIG_CLOCK_CONTROL_NRF_K32SRC_XTAL=y #custom board
    #CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC=y
    
    CONFIG_STDOUT_CONSOLE=y
    CONFIG_PRINTK=y
    
    CONFIG_SPI=y
    CONFIG_SOC_NRF52832_ALLOW_SPIM_DESPITE_PAN_58=y
    
    CONFIG_LOG=y


    Can you give me an opinion on why this happens?
    If necessary, I can open a ticket only for this issue.

    Thanks in advance,
    Ilidio

  • Hi Ilidio, 

    ISilva said:
    However, as I mentioned previously, whenever I need to use the SPI with the nRF52832, I have problems with the signal generated by the CLK, especially with frequencies above 1MHZ.

    So all the following is issues specifically with the nRF52832? not the 53.


    If so can you create a new ticket for this? 

    Regards,
    Jonathan

Related