zephyr spi-nor device id does not match

Hi all,

I am trying to interface IS25LQ040B serial flash(512KB) IC with nrf52833 (bl653_dvk). 

programmed sample code from "zephyr\samples\drivers\spi_flash"

I am getting jedec device id error 

overlay file for reference

prj file for reference

thanks,

Parents Reply Children
  • hi simon,

    You can see chip select in overlay file. 

    the device is working as expected when I am reading jedec ID using SPI transceive API. 

    void spi_jedec_id_test_send(void)
    {
    	int err;
    
    	static uint8_t tx_buffer[5] = {
    		0X9F,
    		0x00,
    		0x00,
    		0x00,
    		0x00
    
    	};
    	
    	static uint8_t rx_buffer[5]= {0,0,0,0,0};
    
    	const struct spi_buf tx_buf = {
    		.buf = tx_buffer,
    		.len = sizeof(tx_buffer)};
    	const struct spi_buf_set tx = {
    		.buffers = &tx_buf,
    		.count = 1};
    
    	struct spi_buf rx_buf = {
    		.buf = rx_buffer,
    		.len = sizeof(rx_buffer),
    	};
    	const struct spi_buf_set rx = {
    		.buffers = &rx_buf,
    		.count = 1};
    
    	gpio_pin_set(dev_gpio0, spi1cspin, 1);
    	err = spi_transceive(dev_spi1, &cfg_spi1, &tx, &rx);
    	gpio_pin_set(dev_gpio0, spi1cspin, 0);
    
    	if (err)
    	{
    		printk("SPI error: %d\n", err);
    	}
    	else
    	{
    		/* Connect MISO to MOSI for loopback */
    		printk("SPI Tx bytes: ");
    		for (int i = 0; i < sizeof(tx_buffer); i++)
    		{
    			printk("%x ", tx_buffer[i]);
    		}
    		printk(" SPI Rx bytes: ");
    		for (int i = 0; i < sizeof(rx_buffer); i++)
    		{
    			printk("%x ", rx_buffer[i]);
    		}
    		printk("\n");
    	}
    }

    here I am controlling the chip select pin manually. 

Related