SPI Slave NRF5340 Init Error

Hi all!
SPI3 Slave project is not built - error:
identifier "__device_dts_ord_DT_N_S_soc_S_peripheral_50000000_S_spi_c000_P_cs_gpios_IDX_0_PH_ORD" not determined

C:\ncs\v2.1.1\zephyr\include\zephyr\drivers\pinctrl.h:89:10: error: 'PINCTRL_STATE_DT_N_S_soc_S_peripheral_50000000_S_spi_c000_PINCTRL_IDX_0_UPPER_TOKEN' undeclared here (not in a function); did you mean 'DT_N_S_soc_S_peripheral_50000000_S_spi_b000_PINCTRL_IDX_0_UPPER_TOKEN'?

What could be?
I ask for the help of a specialist.
Parents
  • Thank you for posting the files. Would you also be able to share relevant code from main?

  • thanks, why not

    -------------------------------------------------------------------------------------------

    #define     SPI3_S_TRANSFER_SIZE    128
    uint8_t     spi3_s_tx_buff[SPI3_S_TRANSFER_SIZE];
    uint8_t     spi3_s_rx_buff[SPI3_S_TRANSFER_SIZE];
    uint16_t    spi3_s_tx_rx_cnt = SPI3_S_TRANSFER_SIZE;

    // *************************************************************************
    // Main
    // *************************************************************************
    void main( void )
    {
      int     i;
      
      app_leds_init();

      if( !spi3_s_init() )
        {
          printk( "SPI3S is not ready\n" );
          while( 1 )
            {
                app_led3_on();
                k_msleep( 600 );
                app_led3_off();
                k_msleep( 600 );
            }
        }

        // Init buffers
        for( i = 0; i < SPI3_S_TRANSFER_SIZE; i++ )
        {
            spi3_s_rx_buff[i] = 0;
            spi3_s_tx_buff[i] = i;
        }
        // SPI Slave transfer Start --------------------------------------------
        spi3_s_transfer( spi3_s_tx_buff, spi3_s_rx_buff, spi3_s_tx_rx_cnt );

        while( 1 )
        {
            // Test SPI Slave Transfer -----------------------------------------
            if( spi3_s_check_transfer() == TRANSFER_OK )
            {
              app_led1_on();

                spi3_s_tx_buff[0]++;
                for( i = 1; i < SPI3_S_TRANSFER_SIZE; i++ )
                {
                  spi3_s_rx_buff[i] = 0;
                  spi3_s_tx_buff[i] = i;
                }
               
                // SPI Slave transfer Restart ----------------------------------
                spi3_s_transfer( spi3_s_tx_buff, spi3_s_rx_buff, spi3_s_tx_rx_cnt );

              app_led1_off();
             }
        }

    }
  • Thank you for sharing the files.

    It looks like you need to add the following line:

    pinctrl-names = "default", "sleep";

    to your overlay, like below.

     &spi3 {
        compatible = "nordic,nrf-spis";
        status = "okay";
        pinctrl-0 = <&spi3_default>;
        pinctrl-1 = <&spi3_sleep>;
        pinctrl-names = "default", "sleep";
        def-char = <0x00>;
    };

  • Fabulous!
    I am delighted!

    I'll check the work tomorrow - but the project was assembled without errors!

    Thank you!

  • Hey Helsing!
    SPI Slave is working! Data is being transmitted and received!
    Many thanks for the help!
    Sincerely, Sergey.

  • Thank you for the feedback, great to hear it is working!

Reply Children
No Data
Related