Page 1 of 1

Supported Free RTOS functions

Posted: Thu Dec 08, 2016 10:02 pm
by imtiaz
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

Re: Supported Free RTOS functions

Posted: Thu Dec 08, 2016 10:15 pm
by kolban
What does the full code look like? Can we see it in context?

Re: Supported Free RTOS functions

Posted: Thu Dec 08, 2016 10:43 pm
by imtiaz
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;
}

Re: Supported Free RTOS functions

Posted: Thu Dec 08, 2016 11:14 pm
by WiFive
IMO just because you disable the assert doesn't mean the function is going to work. It is UNTESTED for a reason.

Re: Supported Free RTOS functions

Posted: Thu Dec 08, 2016 11:40 pm
by imtiaz
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

Re: Supported Free RTOS functions

Posted: Mon May 15, 2017 4:08 pm
by Nelapsi
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.

Re: Supported Free RTOS functions

Posted: Tue May 16, 2017 1:18 am
by ESP_Sprite
I think suspend and resume actually have been fixed a while ago and shouldn't assert() anymore. Need to check on the other functions.

Re: Supported Free RTOS functions

Posted: Wed May 17, 2017 6:54 am
by Nelapsi
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.

Re: Supported Free RTOS functions

Posted: Thu May 18, 2017 1:54 am
by ESP_Sprite
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.

Re: Supported Free RTOS functions

Posted: Mon May 22, 2017 3:09 pm
by Nelapsi
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.