Error while trying to config SPI in VS code .

HI i am working with the nrf 52833 dk board using  nrf connect and trying to implement SPI ,

#define SPI3_NODE DT_NODELABEL(SPI_3)
static const struct spi_dt_spec* dev_spi = SPI_DT_SPEC_GET(SPI3_NODE,SPI_OP_MODE_MASTER,1);

I am getting this error - identifier "__device_dts_ord_DT_N_NODELABEL_SPI_3_BUS_ORD" is undefined. 

I am new to ncs and zephyr , so what is causing this error?

  • Hi,

    Can you enable more logging in SPI to see where it fails?

    Add the following to prj.conf:

    CONFIG_SPI_LOG_LEVEL_DBG=y

    CONFIG_LOG=y

    Best regards,

    Marte

  • this is what i am getting after adding that to config files

    *** Booting Zephyr OS build v3.0.99-ncs1-1  ***
    
    SPIM Example
    
    TX sent: 9f
    
    RX recv: ff
    
    TX sent: 0
    
    RX recv: ff
    
    TX sent: 0
    
    RX recv: ff
    
    TX sent: 0
    
    RX recv: ff
    
    [00:00:00.256,713] <dbg> spi_nrfx_spim: spi_context_buffers_setup: tx_bufs 0x200                                                                                                 01630 - rx_bufs 0x20001620 - 1
    
    [00:00:00.256,713] <dbg> spi_nrfx_spim: spi_context_buffers_setup: current_tx 0x                                                                                                 20001638 (1), current_rx 0x20001628 (1), tx buf/len 0x20000838/1, rx buf/len 0x2                                                                                                 0000830/1
    
    [00:00:00.256,744] <dbg> spi_nrfx_spim: spi_context_update_tx: tx buf/len (nil)/                                                                                                 0
    
    [00:00:00.256,744] <dbg> spi_nrfx_spim: spi_context_update_rx: rx buf/len (nil)/                                                                                                 0
    
    [00:00:00.256,774] <dbg> spi_nrfx_spim: transfer_next_chunk: Transaction finishe                                                                                                 d with status 0
    
    [00:00:00.258,941] <dbg> spi_nrfx_spim: spi_context_buffers_setup: tx_bufs 0x200                                                                                                 01630 - rx_bufs 0x20001620 - 1
    
    [00:00:00.258,972] <dbg> spi_nrfx_spim: spi_context_buffers_setup: current_tx 0x                                                                                                 20001638 (1), current_rx 0x20001628 (1), tx buf/len 0x20000838/1, rx buf/len 0x2                                                                                                 0000830/1
    
    [00:00:00.258,972] <dbg> spi_nrfx_spim: spi_context_update_tx: tx buf/len (nil)/                                                                                                 0
    
    [00:00:00.259,002] <dbg> spi_nrfx_spim: spi_context_update_rx: rx buf/len (nil)/                                                                                                 0
    
    [00:00:00.259,002] <dbg> spi_nrfx_spim: transfer_next_chunk: Transaction finishe                                                                                                 d with status 0
    
    [00:00:00.261,108] <dbg> spi_nrfx_spim: spi_context_buffers_setup: tx_bufs 0x200                                                                                                 01630 - rx_bufs 0x20001620 - 1
    
    [00:00:00.261,108] <dbg> spi_nrfx_spim: spi_context_buffers_setup: current_tx 0x                                                                                                 20001638 (1), current_rx 0x20001628 (1), tx buf/len 0x20000838/1, rx buf/len 0x2                                                                                                 0000830/1
    
    [00:00:00.261,138] <dbg> spi_nrfx_spim: spi_context_update_tx: tx buf/len (nil)/                                                                                                 0
    
    [00:00:00.261,138] <dbg> spi_nrfx_spim: spi_context_update_rx: rx buf/len (nil)/                                                                                                 0
    
    [00:00:00.261,169] <dbg> spi_nrfx_spim: transfer_next_chunk: Transaction finishe                                                                                                 d with status 0
    
    [00:00:00.263,244] <dbg> spi_nrfx_spim: spi_context_buffers_setup: tx_bufs 0x200                                                                                                 01630 - rx_bufs 0x20001620 - 1
    
    [00:00:00.263,275] <dbg> spi_nrfx_spim: spi_context_buffers_setup: current_tx 0x                                                                                                 20001638 (1), current_rx 0x20001628 (1), tx buf/len 0x20000838/1, rx buf/len 0x2                                                                                                 0000830/1
    
    [00:00:00.263,305] <dbg> spi_nrfx_spim: spi_context_update_tx: tx buf/len (nil)/                                                                                                 0
    
    [00:00:00.263,305] <dbg> spi_nrfx_spim: spi_context_update_rx: rx buf/len (nil)/                                                                                                 0
    
    [00:00:00.263,305] <dbg> spi_nrfx_spim: transfer_next_chunk: Transaction finishe                                                                                                 d with status 0
    
    ^C*** Booting Zephyr OS build v3.0.99-ncs1-1  ***
    
    
    
    SPIM Example
    
    
    
    TX sent: 9f
    
    
    
    RX recv: ff
    
    
    
    TX sent: 0
    
    
    
    RX recv: ff
    
    
    
    TX sent: 0
    
    
    
    RX recv: ff
    
    
    
    TX sent: 0
    
    
    
    RX recv: ff
    
    
    
    [00:00:00.256,713] <dbg> spi_nrfx_spim: spi_context_buffers_setup: tx_bufs 0x200                                                                                                 01630 - rx_bufs 0x20001620 - 1
    
    
    
    [00:00:00.256,713] <dbg> spi_nrfx_spim: spi_context_buffers_setup: current_tx 0x                                                                                                 20001638 (1), current_rx 0x20001628 (1), tx buf/len 0x20000838/1, rx buf/len 0x2                                                                                                 0000830/1
    
    
    
    [00:00:00.256,744] <dbg> spi_nrfx_spim: spi_context_update_tx: tx buf/len (nil)/                                                                                                 0
    
    
    
    [00:00:00.256,744] <dbg> spi_nrfx_spim: spi_context_update_rx: rx buf/len (nil)/                                                                                                 0
    
    
    
    [00:00:00.256,774] <dbg> spi_nrfx_spim: transfer_next_chunk: Transaction finishe                                                                                                 d with status 0
    
    
    
    [00:00:00.258,941] <dbg> spi_nrfx_spim: spi_context_buffers_setup: tx_bufs 0x200                                                                                                 01630 - rx_bufs 0x20001620 - 1
    
    
    
    [00:00:00.258,972] <dbg> spi_nrfx_spim: spi_context_buffers_setup: current_tx 0x                                                                                                 20001638 (1), current_rx 0x20001628 (1), tx buf/len 0x20000838/1, rx buf/len 0x2                                                                                                 0000830/1
    
    
    
    [00:00:00.258,972] <dbg> spi_nrfx_spim: spi_context_update_tx: tx buf/len (nil)/                                                                                                 0
    
    
    
    [00:00:00.259,002] <dbg> spi_nrfx_spim: spi_context_update_rx: rx buf/len (nil)/                                                                                                 0
    
    
    
    [00:00:00.259,002] <dbg> spi_nrfx_spim: transfer_next_chunk: Transaction finishe                                                                                                 d with status 0
    
    
    
    [00:00:00.261,108] <dbg> spi_nrfx_spim: spi_context_buffers_setup: tx_bufs 0x200                                                                                                 01630 - rx_bufs 0x20001620 - 1
    
    
    
    [00:00:00.261,108] <dbg> spi_nrfx_spim: spi_context_buffers_setup: current_tx 0x                                                                                                 20001638 (1), current_rx 0x20001628 (1), tx buf/len 0x20000838/1, rx buf/len 0x2                                                                                                 0000830/1
    
    
    
    [00:00:00.261,138] <dbg> spi_nrfx_spim: spi_context_update_tx: tx buf/len (nil)/                                                                                                 0
    
    
    
    [00:00:00.261,138] <dbg> spi_nrfx_spim: spi_context_update_rx: rx buf/len (nil)/                                                                                                 0
    
    
    
    [00:00:00.261,169] <dbg> spi_nrfx_spim: transfer_next_chunk: Transaction finishe                                                                                                 d with status 0
    

Related