Page 1 of 1

Run ESP32 WORM without freertos

Posted: Sun Sep 24, 2023 11:29 am
by gchini
Is freertos necessary to run a program with ESP32? Is it necessary or optional? Why this question?

Because
- I need to develop a single thread application first
- I need to optimize the ram since I need to write an alghoritm that use a lot of ram
- I found that FreeRTOS are not able to offer me the possibilità to use all the ram for a single thread. Basucally it go in stack overflow because i think that rtos give me limited ability yo user the ram and my program dos not run properly

What i want then is to run a simple int main(){} program mono tasking. Is it possible? If yes how i can do that?

Thanks

Re: Run ESP32 WORM without freertos

Posted: Sun Sep 24, 2023 12:14 pm
by ESP_Sprite
gchini wrote:
Sun Sep 24, 2023 11:29 am
Is freertos necessary to run a program with ESP32? Is it necessary or optional? Why this question?
If you're using ESP-IDF, for practical purposes it's not optional.
- I found that FreeRTOS are not able to offer me the possibilità to use all the ram for a single thread. Basucally it go in stack overflow because i think that rtos give me limited ability yo user the ram and my program dos not run properly
FreeRTOS happily allows you to allocate the entire memory to one task. The issue here is that you run out of stack memory, however. You can set the amount of stack allocated for the main task in menuconfig; suggest you increase that.

Re: Run ESP32 WORM without freertos

Posted: Fri Sep 29, 2023 10:36 am
by gchini
I've tried but this does not work i still receive the same error

I would like to use the entire ram available on the esp32 and allocate up to 250KB of variables going deep into my calling functions

Re: Run ESP32 WORM without freertos

Posted: Fri Sep 29, 2023 8:35 pm
by MicroController
Basucally it go in stack overflow because i think that rtos give me limited ability yo user the ram
You can use all the RAM in the chip. Just don't try and use it all via the stack, i.e. local variables.
For bigger data structures or arrays use either global variables or allocate them from the heap.