Thanks for the reply
My problem is to run a library for encryption that require high amount of memory (around 400k) to be runned. The memory is allocated both in the stack, by local variables, and in the heap, through malloc(). I don’t want modify the library in order to move the memory to the heap because there is HIGH probability to introduce errors in the code.
I’ve tried to run the code on the arduino nano IOT but Ive got no response from the microcontroller. I supposed that it was a problem of memory size and it was. Arduino NANO IOT have only 32k
I’ve tried to use raspberry nano and it worked well and it have around 500k of ram but RaspBerry does not have integrated support for BluetoothLE then i chosed was using an arduino ESP32 because have the same memory size of the RB, around 500k
Then when I’ve tried to flash the code in my ESP32 board with arduino ide, the board return me an error like that
rst:0x8 (TG1WDT_SYS_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
Then i supposed that was again a problem of memory (in particular the stack, every time i call a new function) and i thought how to “analyse” the quantity of memory is present in the stack calling recursevly a function that every times allocates 1k-10k.
In this way i understood that the size of the stack is around 30k. I also found the same behavioir that i had in my main program, the same error. Then the same cause. STACK
I’ve form your explanation understood that i can use the
BaseType_t xTaskCreate( TaskFunction_t pvTaskCode,
const char * const pcName,
configSTACK_DEPTH_TYPE usStackDepth,
void *pvParameters,
UBaseType_t uxPriority,
TaskHandle_t *pxCreatedTask
);
and specify the size of the stack. But WHERE i should written this code?
In the arduino ide inside the start() or i should use the espressif idf?
I also not understood well the stack (in the sense of architecture) that there bihind the arduino enviroment.
I know that there are many “layers” like that
My application
^^^^^^^^^^^^^^^
Arduino code
^^^^^^^^^^^^^^^
FreeRtos
^^^^^^^^^^^^^^^
Espressif IDF
^^^^^^^^^^^^^^^
My micronontroller
Then IF my model is true I can go to the right level and act consecutivly in order to inclrease my stack.