Page 1 of 2
How can I build C project without FreeRTOS?
Posted: Thu Apr 14, 2022 2:07 pm
by shplace
How can I build C project without FreeRTOS?
Re: How can I build C project without FreeRTOS?
Posted: Fri Apr 15, 2022 2:08 am
by ESP_Sprite
In what context? What are you trying to achieve?
Re: How can I build C project without FreeRTOS?
Posted: Fri Apr 15, 2022 6:13 am
by shplace
I would like to use my OS.
Re: How can I build C project without FreeRTOS?
Posted: Fri Apr 15, 2022 5:34 pm
by WiFive
You may want to look at the ports of zephyr, nuttx, rtthread, and aliOS.
Re: How can I build C project without FreeRTOS?
Posted: Tue Apr 19, 2022 8:22 am
by shplace
It's all too complicated.
I need a simple solution.
Re: How can I build C project without FreeRTOS?
Posted: Thu Apr 21, 2022 11:26 am
by vanBassum
I don't think it gets easy
What you could do is increase the stack size of the main thread, and do everything from main.
If the problem is with code compatibility, you could write a wrapper to translate your OS functions to FreeRTOS functions.
That beeing said, I would just use FreeRTOS. It works and is proven to work.
Re: How can I build C project without FreeRTOS?
Posted: Sun May 15, 2022 10:46 am
by shplace
FreeRTOS is a complex and slow solution. I'm used to working with the microcontroller through registers. The OS gets in the way.
Re: How can I build C project without FreeRTOS?
Posted: Sun May 15, 2022 4:49 pm
by WiFive
There is a reason why all those mentioned OS exist, it's the best general solution to effectively time share the CPU. ESP peripherals have been designed to work in this context with internal state machines. If you are trying to use esp32 as basically a coprocessor type role because it is cheap, you can take a look at the bootloader subproject which is basically a very simple app without OS. There are some attempts by users to run OS on one core and not the other but there are potential shared resource issues. There are projects that use the ULP coprocessor as a real-time core. Some people use multiple esp32 on the same board. Don't limit yourself by staying in your comfort zone.
Re: How can I build C project without FreeRTOS?
Posted: Sun May 15, 2022 7:05 pm
by mikemoy
shplace wrote: ↑Tue Apr 19, 2022 8:22 am
It's all too complicated.
I need a simple solution.
I don't want to make this sound mean. But if you feel its to complicated maybe you should spend the time to learn it. It would not take long at all. Espressif has kindly given us MANY, MANY examples. Most of which are short and sweet, easy to learn and understand what is being done. I can almost guarantee that once you get a grasp of the FreeRTOS you will never want to go back.
Re: How can I build C project without FreeRTOS?
Posted: Mon May 16, 2022 6:33 am
by vanBassum
I'm not completely sure what you are aiming for but a few hacks:
- Create one task, assign all ram to it and make it highest prio. Then you put everything in critical so taskswitching is disabled. Im not sure, but some features meight not work anymore. I don't know if the IDF can work this way. (Still uses FreeRTOS)
- You meight be able to abuse one of the freeRTOS callbacks, Although this seems a bit hacky
- Change the FreeRTOS source so you don't use the task scheduler but simply call some main function.
However:
There is a reason freertos is used. I would suggest you use it.