Page 1 of 1

NVM apis cause assert error when the task it is called from is running from external memory

Posted: Sun Jun 09, 2024 6:23 pm
by vinaypatil
I am running a task with external spiram. my application requires this to be done.
Till now I have had no issue until I observed that NVM functions like nvs_open don't work with external memory.
I see the exception below
[Codebox]assert failed: spi_flash_disable_interrupts_caches_and_other_cpu cache_utils.c:154 (esp_task_stack_is_sane_cache_disabled())[/Codebox]

is there any config to control this or any workaround?
I am not sure if this was identified earlier and addressed.
I appreciate any help, anyone here can provide.

Re: NVM apis cause assert error when the task it is called from is running from external memory

Posted: Mon Jun 10, 2024 8:08 am
by MicroController
Sounds like you put the calling task's stack into PSRAM. PSRAM is inaccessible during flash (NVM) writes, so doing flash writes from a task with its stack in PSRAM won't work.

Re: NVM apis cause assert error when the task it is called from is running from external memory

Posted: Mon Jun 10, 2024 3:10 pm
by eriksl
Seconded. You can put many things in PS-RAM, but a thread's stack is unwise.