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

vinaypatil
Posts: 1
Joined: Sun Jun 09, 2024 6:13 pm

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

Postby vinaypatil » Sun Jun 09, 2024 6:23 pm

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.

MicroController
Posts: 1735
Joined: Mon Oct 17, 2022 7:38 pm
Location: Europe, Germany

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

Postby MicroController » Mon Jun 10, 2024 8:08 am

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.

eriksl
Posts: 116
Joined: Thu Dec 14, 2023 3:23 pm
Location: Netherlands

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

Postby eriksl » Mon Jun 10, 2024 3:10 pm

Seconded. You can put many things in PS-RAM, but a thread's stack is unwise.

Who is online

Users browsing this forum: No registered users and 126 guests