Using QN9080, I am trying to extend one of the BLE related sample projects (RTOS) to run code which consists of an infinite loop. For this matter, I am trying to define and run my own Task.
Question is, how?
I have noticed that the in the entry point function (int main(void), inside "framework/OSAbstraction/Source/fsl_os_abstraction_free_rtos.c") a task named "startup_task" is created... and I have tried to hack my way forward by duplicating the Task creation to run my own; but not only is altering source inside the "framework" directory is bad practice, it also interferes with the program in practice...
In this case I would recommend you to check and verify this community post
You can use it as a base o reference in order to create you own task when using the connectivity framework.
Basically the article describes the same actions as I have taken... But again, following exactly the directions mentioned in the article, I am still getting the same result: Once a new task is defined, "startup_task" sieses.
* However, new task runs
Something that is not clear, the task that you are adding, is an infinite loop? or do you mean the main one ?
If you are trying to add your own infinite task loop to the stack, I'm afraid that won't be possible to add as you are adding intrusive code and you are not letting the Bluetooth LE tasks follow the timing set in accordance to the specification.
As mentioned, you should not use a blocking task in the code as the Bluetooth LE will not follow the specification when doing so.
So please, try using the event based approach, you can check this post as well to verify if this helps you as a guide.
Thank you for the reference, I will examine it.
Meanwhile, please see line 24 in file "pwmApplication.c" in
(last page) to see that the referene code uses an infinite loop in the user-defined task; I would like to clarify your last point the blocking tasks should not be used with BT
If you check carefully the task, it is not a task that is consuming the processing of the MCU completely, this using as well the OSA and verifying as well this condition
while((OSA_MsgQGet(pwmTask_queue,(void*)&msgString,10)) == 0)
Those details are important when using the task, as well as if you check the way and parameters used n the creation of the task suck as the event based etc, you can check that besides it is a infinite loop is has it owns characteristics so it does not interfere with the BLE timings.