Supported Free RTOS functions

imtiaz
Posts: 106
Joined: Wed Oct 26, 2016 1:34 am

Supported Free RTOS functions

Postby imtiaz » Thu Dec 08, 2016 10:02 pm

Hi All,

System crashes if I call :
if(eTaskGetState(MyTaskHandle) != eSuspended)
{
return TRUE;
} I have manually edited this line
#define CONFIG_FREERTOS_ASSERT_ON_UNTESTED_FUNCTION 0

but it still crashes:
Guru Meditation Error of type LoadProhibited occurred on core 0. Exception was unhandled.<\r><\n>
Register dump:<\r><\n>
PC : 40082b81 PS : 00060233 A0 : 800f729b A1 : 3ffcbb50 <\r><\n>
A2 : 00000001 A3 : 3ffcbcb4 A4 : 3ffc0b4c A5 : 3f405400 <\r><\n>
A6 : 3ffcbd28 A7 : 00000000 A8 : 80082b81 A9 : 3ffcbb30 <\r><\n>
A10 : 00060220 A11 : 3ffc1414 A12 : 3ffc1414 A13 : 3ffcbb23 <\r><\n>
A14 : 3ffcbd28 A15 : 00000000 SAR : 00000010 EXCCAUSE: 0000001c <\r><\n>
EXCVADDR: 00000019 LBEG : 400014fd LEND : 4000150d LCOUNT : fffffffa <\r><\n>
Rebooting...<\r><\n>
ets Jun 8 2016 00:22:57<\r><\n>

Can I use this function or not - if not what is the alternative?

Imtiaz

User avatar
kolban
Posts: 1683
Joined: Mon Nov 16, 2015 4:43 pm
Location: Texas, USA

Re: Supported Free RTOS functions

Postby kolban » Thu Dec 08, 2016 10:15 pm

What does the full code look like? Can we see it in context?
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32

imtiaz
Posts: 106
Joined: Wed Oct 26, 2016 1:34 am

Re: Supported Free RTOS functions

Postby imtiaz » Thu Dec 08, 2016 10:43 pm

Hi Kolban,
The context is pretty basic:

So first a task is created and its handle saved:
MyTaskHandle = xTaskCreate(&socket_netconn_thread, "socket_netconn_thread", 2048,
&FirmwareDownloadPort, 5, NULL); Then the application asynchronously wants to know if the task has been suspended , it may call this function:
BOOL IsFileDownlaodinProgress(void)
{
if(MyTaskHandle == NULL)
{
return FALSE;
}
TRACE_D("Getting Task State \n");
if(eTaskGetState(MyTaskHandle) != eSuspended)
{
return TRUE;
}

return FALSE;
}

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

Re: Supported Free RTOS functions

Postby WiFive » Thu Dec 08, 2016 11:14 pm

IMO just because you disable the assert doesn't mean the function is going to work. It is UNTESTED for a reason.

imtiaz
Posts: 106
Joined: Wed Oct 26, 2016 1:34 am

Re: Supported Free RTOS functions

Postby imtiaz » Thu Dec 08, 2016 11:40 pm

Hi All,

What is the plan / Time Frame regarding support of these functions? At the moment there are around 12 untested functions in tasks.c.

This has quite a big impact on the design of my software if I cant suspend and resume tasks.

Thanks

Nelapsi
Posts: 6
Joined: Wed May 10, 2017 10:13 am

Re: Supported Free RTOS functions

Postby Nelapsi » Mon May 15, 2017 4:08 pm

Hi all,

I am also facing this issue. I need to use functions like suspend/resume/delayUntil/...

I would like to know when is that going to be avaliable (more or less) or which are the limitations now? Because there is no answer for that in more than 4 months. In the menuconfig there is a flag for "Halt when an SMP-untested function is called", with that set to false will we see strange behaviors or a broken project?

thanks for your time.

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

Re: Supported Free RTOS functions

Postby ESP_Sprite » Tue May 16, 2017 1:18 am

I think suspend and resume actually have been fixed a while ago and shouldn't assert() anymore. Need to check on the other functions.

Nelapsi
Posts: 6
Joined: Wed May 10, 2017 10:13 am

Re: Supported Free RTOS functions

Postby Nelapsi » Wed May 17, 2017 6:54 am

Hi,

last time I tested suspend and resume they weren't avaliable, I'll check it again too. What about vTaskDelayUntil? what's the alternative in order to create a periodic task that executes every, let's say, 500 ms. I am starting with RTOS, AFAIK the function vTaskDelay it is not so reliable for this if, for example, my task is in a loop and I compare the time and calculate the delay needed in that iteration.

Thanks.

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

Re: Supported Free RTOS functions

Postby ESP_Sprite » Thu May 18, 2017 1:54 am

Not sure if you're going to get something more reliable with vTaskDelayUntil then... the RTOS is bound to the timer tick and can be pre-empted by interrupts, so it won't give 100% exact timing in the first place. If you need that, you're better off hooking a timer interrupt and either doing whatever you want in the ISR if it's simple, or waking a (high-prio) task using a semaphore or so if it's not.

Nelapsi
Posts: 6
Joined: Wed May 10, 2017 10:13 am

Re: Supported Free RTOS functions

Postby Nelapsi » Mon May 22, 2017 3:09 pm

Hi guys,

I want to do a datalogger. I have a task that needs to read from the ADC and log that data + the timestamp. My idea was to use a task for the readings and store the data in a buffer. Let's say, that task executes every second of the day (high priority). For that, I wanted to use a delayUntil to execute it in the exact time, but it is not avaliable. It would be better with interrupts? what would be the difference between timer interrupts and delayUntil with a high priority task. I have no experience yet combining ISR and different tasks.

By the way, I've tested the vTaskSuspend and vTaskResume functions and they are already avaliable, yes. My sp-idf wasn't updated, sorry.

Who is online

Users browsing this forum: No registered users and 91 guests