Page 1 of 1

opencv component overload DRAM.bss , how can i put into PSRAM

Posted: Fri Mar 22, 2024 4:22 am
by k1924001
I tried to put EXT_RAM_BSS_ATTR , example: EXT_RAM_BSS_ATTR cv::QRCodeDetector QRdetecter; but didnt't work , dram.bss still overload, i read there is also possible to place the BSS section of a component or a library to external RAM using linker fragment scheme extram_bss. But how? there is no further instruction.

Re: opencv component overload DRAM.bss , how can i put into PSRAM

Posted: Fri Mar 22, 2024 11:41 am
by ESP_Sprite
There's an option for that somewhere in menuconfig. Note that you do need to annotate the bss variables you want in psram with a certain attribute; see the help for the menuconfig option.

Re: opencv component overload DRAM.bss , how can i put into PSRAM

Posted: Fri Mar 22, 2024 4:38 pm
by k1924001
ESP_Sprite wrote:
Fri Mar 22, 2024 11:41 am
There's an option for that somewhere in menuconfig. Note that you do need to annotate the bss variables you want in psram with a certain attribute; see the help for the menuconfig option.
I know CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY, Found in: Component config > ESP PSRAM > CONFIG_SPIRAM > SPI RAM config, I enable it before .I really don't konw how to ues extram_bss to make components .bss into PSRAM.bss

Re: opencv component overload DRAM.bss , how can i put into PSRAM

Posted: Sat Mar 23, 2024 2:57 am
by ESP_Sprite
If you enable that, you can mark variables to live in PSRAM BSS rather than internal BSS. Example:

Code: Select all

char very_big_variable[1024*1024];
would become

Code: Select all

#include <esp_attr.h>
...
EXT_RAM_BSS_ATTR char very_big_variable[1024*1024];
to allocate it in PSRAM.

Re: opencv component overload DRAM.bss , how can i put into PSRAM

Posted: Sun Mar 24, 2024 9:54 am
by k1924001
ESP_Sprite wrote:
Sat Mar 23, 2024 2:57 am
If you enable that, you can mark variables to live in PSRAM BSS rather than internal BSS. Example:

Code: Select all

char very_big_variable[1024*1024];
would become

Code: Select all

#include <esp_attr.h>
...
EXT_RAM_BSS_ATTR char very_big_variable[1024*1024];
to allocate it in PSRAM.
Thanks, i understand,it can't work on C++ CLASS.