How can I build C project without FreeRTOS?

shplace
Posts: 5
Joined: Thu Apr 14, 2022 2:03 pm

How can I build C project without FreeRTOS?

Postby shplace » Thu Apr 14, 2022 2:07 pm

How can I build C project without FreeRTOS?

ESP_Sprite
Posts: 8921
Joined: Thu Nov 26, 2015 4:08 am

Re: How can I build C project without FreeRTOS?

Postby ESP_Sprite » Fri Apr 15, 2022 2:08 am

In what context? What are you trying to achieve?

shplace
Posts: 5
Joined: Thu Apr 14, 2022 2:03 pm

Re: How can I build C project without FreeRTOS?

Postby shplace » Fri Apr 15, 2022 6:13 am

I would like to use my OS.

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: How can I build C project without FreeRTOS?

Postby WiFive » Fri Apr 15, 2022 5:34 pm

You may want to look at the ports of zephyr, nuttx, rtthread, and aliOS.

shplace
Posts: 5
Joined: Thu Apr 14, 2022 2:03 pm

Re: How can I build C project without FreeRTOS?

Postby shplace » Tue Apr 19, 2022 8:22 am

It's all too complicated.
I need a simple solution.

vanBassum
Posts: 68
Joined: Sun Jan 17, 2021 11:59 am

Re: How can I build C project without FreeRTOS?

Postby vanBassum » Thu Apr 21, 2022 11:26 am

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.

shplace
Posts: 5
Joined: Thu Apr 14, 2022 2:03 pm

Re: How can I build C project without FreeRTOS?

Postby shplace » Sun May 15, 2022 10:46 am

FreeRTOS is a complex and slow solution. I'm used to working with the microcontroller through registers. The OS gets in the way.

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: How can I build C project without FreeRTOS?

Postby WiFive » Sun May 15, 2022 4:49 pm

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.

mikemoy
Posts: 599
Joined: Fri Jan 12, 2018 9:10 pm

Re: How can I build C project without FreeRTOS?

Postby mikemoy » Sun May 15, 2022 7:05 pm

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.

vanBassum
Posts: 68
Joined: Sun Jan 17, 2021 11:59 am

Re: How can I build C project without FreeRTOS?

Postby vanBassum » Mon May 16, 2022 6:33 am

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.

Who is online

Users browsing this forum: Bing [Bot], Majestic-12 [Bot] and 109 guests