This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

NRF5340 power consumption issue when QSPI is disabled.

Hi

        I am having some issues with running QSPI on the nRF5340DK board.
After I disabled the QSPI, I found the board still having a high current consumption of 700 uA.

Although I tried trying edit source code follow the nrf52840_errata [122] docs which had a similar problem. But I still can't fix the problem.

static int qspi_nor_read(const struct device *dev, off_t addr, void *dest,
			 size_t size)
{
	if (!dest) {
		return -EINVAL;
	}

	/* read size must be non-zero */
	if (!size) {
		return 0;
	}

	const struct qspi_nor_config *params = dev->config;

	/* affected region should be within device */
	if (addr < 0 ||
	    (addr + size) > params->size) {
		LOG_ERR("read error: address or size "
			"exceeds expected values."
			"Addr: 0x%lx size %zu", (long)addr, size);
		return -EINVAL;
	}

	int rc = ANOMALY_122_INIT(dev);

	if (rc != 0) {
		goto out;
	}

	qspi_lock(dev);

	nrfx_err_t res = read_non_aligned(dev, addr, dest, size);

	qspi_unlock(dev);

	rc = qspi_get_zephyr_ret_code(res);

out:
	ANOMALY_122_UNINIT(dev);
	return rc;
}

static void anomaly_122_uninit(const struct device *dev)
{
	struct qspi_nor_data *dev_data = get_dev_data(dev);
	bool last = true;

	qspi_lock(dev);

#ifdef CONFIG_MULTITHREADING
	/* The last thread to finish using the driver uninit the QSPI */
	(void) k_sem_take(&dev_data->count, K_NO_WAIT);
	last = (k_sem_count_get(&dev_data->count) == 0);
#endif

	if (last) {
		while (nrfx_qspi_mem_busy_check() != NRFX_SUCCESS) {
			k_msleep(50);
		}

		nrf_gpio_cfg_output(QSPI_PROP_AT(csn_pins, 0));
		nrf_gpio_pin_set(QSPI_PROP_AT(csn_pins, 0));

		//*(volatile uint32_t *)0x40029010ul = 1ul;
		//*(volatile uint32_t *)0x40029054ul = 1ul;

		nrfx_qspi_uninit();
		qspi_initialized = false;
	}

	qspi_unlock(dev);

	LOG_INF("anomaly_122_uninit");

}

nrf_qspi_nor.rar

Parents
  • Disabling logging and serial in both cores should yield the best result. 

    CONFIG_LOG=n
    CONFIG_SERIAL=n

    Regards,
    Jonathan

  • Hi,

     I disable logging and serial in both core and upgrade sdk from 1.5.0 to 1.6.1 . But I still got the same result. 

    Initially I did not enable external flash memory. The board has a current consumption of 14uA.


    Then I enabled External Flash Memory. The board has a current consumption of 3mA.




    And finally, I config cs pin to logic high and uninit qspi. The board has a current consumption of 800uA.
    I have attached my source code project file at below.
    I've tested this with an nRF52840DK board. And I'm not found this problem.

    Regards
    Wasan

Reply
  • Hi,

     I disable logging and serial in both core and upgrade sdk from 1.5.0 to 1.6.1 . But I still got the same result. 

    Initially I did not enable external flash memory. The board has a current consumption of 14uA.


    Then I enabled External Flash Memory. The board has a current consumption of 3mA.




    And finally, I config cs pin to logic high and uninit qspi. The board has a current consumption of 800uA.
    I have attached my source code project file at below.
    I've tested this with an nRF52840DK board. And I'm not found this problem.

    Regards
    Wasan

Children
Related