nRF5 SDK is not maintained anymore
More Info: Consider nRF Connect SDK for new designs

nrf5340 SPI configuration problem

I am having the same problem as in 

  • Case ID: 244142

devzone.nordicsemi.com/.../nrf52840_dk-spi-configuration

I am using nRF5340.  

The problem I'm facing is that when i hook up my logic analyzer it shows no activity except for the SCK/clock line. The clock line starts every time spi_transcieve() is run but the other lines(MISO, MOSI and CS) shows no activity.

Hope to see a working example of SPI on nrf5340  or find the solution of

  • Case ID: 244142
Parents Reply
  • // CS is pin 14 of GPIO port 1
    struct spi_cs_control spi_cs = {
    	.gpio_dev = NULL,
    	.gpio_pin = 14,
    	.gpio_dt_flags = GPIO_ACTIVE_HIGH,
    	.delay = 0,
    };
    
    // and the spi_cs control is used in the SPI config  .cs = &spi_cs,
    static const struct spi_config spi_cfg = {
    	.operation = SPI_WORD_SET(8) | SPI_TRANSFER_MSB |
    		     SPI_MODE_CPOL | SPI_MODE_CPHA | SPI_OP_MODE_MASTER,
    	.frequency = 4000000,
    	.slave = 0,
    	.cs = &spi_cs,
    };
    
    
    // spi_cs.gpio_dev is initilized in spi_init
    static void spi_init(void)
    {
        .....
    	spi_cs.gpio_dev = device_get_binding("GPIO_1");
    	
    	.....
    	
    }
    
    
    
    but debugging information shows ss_pin = 255
    Something wrong !!!!

Children
No Data
Related