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,

  • Hi

    The error you see is coming from the spi_nor.c driver, where the device ID (jedec_id and cfg->jedec_id) are compared, and it seems these do not match. My guess would be that the SPI device is not connected correctly to your nRF52833. I don't see that your chip select pin is configured for example.

    Best regards,

    Simon

  • 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. 

  • Hi

    Okay, then when does this error occur exactly? Does the application still work as intended after reporting this error? It seems like the JEDEC ID from the device is set to 0. Is there a reason you've set it to 9d 60 15.

    Best regards,

    Simon

Related